Browse Source

Build on Linux

kiwec 2 months ago
parent
commit
a2e746f8c6
51 changed files with 227 additions and 392 deletions
  1. 12 10
      src/App/Osu/Beatmap.cpp
  2. 2 0
      src/App/Osu/DatabaseBeatmap.h
  3. 49 70
      src/App/Osu/DifficultyCalculator.cpp
  4. 3 7
      src/App/Osu/GameRules.cpp
  5. 6 6
      src/App/Osu/GameRules.h
  6. 4 2
      src/App/Osu/HUD.cpp
  7. 7 12
      src/App/Osu/HitObject.cpp
  8. 5 5
      src/App/Osu/MainMenu.cpp
  9. 3 2
      src/App/Osu/OptionsMenu.cpp
  10. 11 10
      src/App/Osu/Osu.cpp
  11. 2 0
      src/App/Osu/Skin.cpp
  12. 5 10
      src/App/Osu/SkinImage.cpp
  13. 2 13
      src/App/Osu/SkinImage.h
  14. 8 6
      src/App/Osu/Slider.cpp
  15. 2 8
      src/App/Osu/SliderCurves.cpp
  16. 2 0
      src/App/Osu/SliderRenderer.cpp
  17. 2 0
      src/App/Osu/SongBrowser/Button.cpp
  18. 2 0
      src/App/Osu/SongBrowser/CollectionButton.cpp
  19. 2 0
      src/App/Osu/SongBrowser/SongDifficultyButton.cpp
  20. 2 7
      src/App/Osu/Spinner.cpp
  21. 2 0
      src/App/Osu/UIBackButton.cpp
  22. 2 0
      src/App/Osu/UIButton.cpp
  23. 2 0
      src/App/Osu/UIPauseMenuButton.cpp
  24. 6 7
      src/App/Osu/UpdateHandler.cpp
  25. 2 0
      src/App/Osu/UserCard.cpp
  26. 5 5
      src/App/Osu/score.cpp
  27. 3 9
      src/Engine/AnimationHandler.cpp
  28. 2 8
      src/Engine/Engine.cpp
  29. 3 9
      src/Engine/Input/Mouse.cpp
  30. 3 28
      src/Engine/Main/main_Windows.cpp
  31. 2 7
      src/Engine/Platform/LinuxEnvironment.cpp
  32. 6 5
      src/Engine/Platform/WinEnvironment.cpp
  33. 2 7
      src/Engine/Renderer/OpenGL3Interface.cpp
  34. 2 7
      src/Engine/Renderer/OpenGL3VertexArrayObject.cpp
  35. 2 7
      src/Engine/Renderer/OpenGLVertexArrayObject.cpp
  36. 6 3
      src/Engine/ResourceManager.cpp
  37. 9 11
      src/Engine/Sound.cpp
  38. 2 7
      src/Engine/TextureAtlas.cpp
  39. 2 7
      src/Engine/VertexArrayObject.cpp
  40. 2 7
      src/GUI/CBaseUIContainer.cpp
  41. 2 7
      src/GUI/CBaseUIContainerBase.cpp
  42. 7 16
      src/GUI/CBaseUIScrollView.cpp
  43. 2 7
      src/GUI/CBaseUISlider.cpp
  44. 2 7
      src/GUI/CBaseUITextbox.cpp
  45. 2 7
      src/GUI/CBaseUIWindow.cpp
  46. 6 11
      src/GUI/Windows/ConsoleBox.cpp
  47. 2 7
      src/GUI/Windows/VinylScratcher/VSTitleBar.cpp
  48. 2 7
      src/GUI/Windows/VinylScratcher/VinylScratcher.cpp
  49. 2 7
      src/GUI/Windows/VisualProfiler.cpp
  50. 2 0
      src/Util/Rect.cpp
  51. 2 14
      src/Util/cbase.h

+ 12 - 10
src/App/Osu/Beatmap.cpp

@@ -51,6 +51,8 @@
 #include "Spinner.h"
 #include "UIModSelectorModButton.h"
 
+using namespace std;
+
 ConVar osu_pvs("osu_pvs", true, FCVAR_DEFAULT,
                "optimizes all loops over all hitobjects by clamping the range to the Potentially Visible Set");
 ConVar osu_draw_hitobjects("osu_draw_hitobjects", true, FCVAR_DEFAULT);
@@ -708,7 +710,6 @@ void Beatmap::selectDifficulty2(DatabaseBeatmap *difficulty2) {
                            osu->getScore()->getModsLegacy(), getAR(), getCS(), getOD(), osu->getSpeedMultiplier());
         }
     }
-
 }
 
 void Beatmap::deselect() {
@@ -1813,8 +1814,8 @@ void Beatmap::loadMusic(bool stream) {
         // if it's not a stream then we are loading the entire song into memory for playing
         if(!stream) engine->getResourceManager()->requestNextLoadAsync();
 
-        m_music = engine->getResourceManager()->loadSoundAbs(
-            m_selectedDifficulty2->getFullSoundFilePath(), "OSU_BEATMAP_MUSIC", stream, false, false);
+        m_music = engine->getResourceManager()->loadSoundAbs(m_selectedDifficulty2->getFullSoundFilePath(),
+                                                             "OSU_BEATMAP_MUSIC", stream, false, false);
         m_music->setVolume(getIdealVolume());
         m_fMusicFrequencyBackup = m_music->getFrequency();
         m_music->setSpeed(osu->getSpeedMultiplier());
@@ -2043,10 +2044,9 @@ void Beatmap::drawFollowPoints(Graphics *g) {
     // 0.7x means animation lasts only 0.7 of it's time
     const double animationMutiplier = osu->getSpeedMultiplier() / osu->getAnimationSpeedMultiplier();
     const long followPointApproachTime =
-        animationMutiplier *
-        (osu_followpoints_clamp.getBool()
-             ? min((long)GameRules::getApproachTime(this), (long)osu_followpoints_approachtime.getFloat())
-             : (long)osu_followpoints_approachtime.getFloat());
+        animationMutiplier * (osu_followpoints_clamp.getBool() ? min((long)GameRules::getApproachTime(this),
+                                                                     (long)osu_followpoints_approachtime.getFloat())
+                                                               : (long)osu_followpoints_approachtime.getFloat());
     const bool followPointsConnectCombos = osu_followpoints_connect_combos.getBool();
     const bool followPointsConnectSpinners = osu_followpoints_connect_spinners.getBool();
     const float followPointSeparationMultiplier = max(osu_followpoints_separation_multiplier.getFloat(), 0.1f);
@@ -2568,7 +2568,7 @@ void Beatmap::update2() {
                        m_hitobjects[0]->getTime() > (long)osu_quick_retry_time.getInt())
                         m_music->setPositionMS(
                             max((long)0, m_hitobjects[0]->getTime() - (long)osu_quick_retry_time.getInt()));
-                        m_bWasSeekFrame = true;
+                    m_bWasSeekFrame = true;
 
                     m_bIsRestartScheduledQuick = false;
 
@@ -3451,7 +3451,9 @@ bool Beatmap::isLoading() {
             (bancho.is_playing_a_multi_map() && !bancho.room.all_players_loaded));
 }
 
-bool Beatmap::isActuallyLoading() { return (!engine->getSound()->isReady() || !m_music->isAsyncReady() || m_bIsPreLoading); }
+bool Beatmap::isActuallyLoading() {
+    return (!engine->getSound()->isReady() || !m_music->isAsyncReady() || m_bIsPreLoading);
+}
 
 Vector2 Beatmap::pixels2OsuCoords(Vector2 pixelCoords) const {
     // un-first-person
@@ -3735,7 +3737,7 @@ void Beatmap::saveAndSubmitScore(bool quit) {
     bool isComplete = (num300s + num100s + num50s + numMisses >= numHitObjects);
     bool isZero = (osu->getScore()->getScore() < 1);
     bool isCheated = (osu->getModAuto() || (osu->getModAutopilot() && osu->getModRelax())) ||
-                           osu->getScore()->isUnranked() || is_watching || is_spectating;
+                     osu->getScore()->isUnranked() || is_watching || is_spectating;
 
     FinishedScore score;
     score.isLegacyScore = false;

+ 2 - 0
src/App/Osu/DatabaseBeatmap.h

@@ -6,6 +6,8 @@
 #include "Resource.h"
 #include "pp.h"
 
+using namespace std;
+
 class Beatmap;
 class HitObject;
 

+ 49 - 70
src/App/Osu/DifficultyCalculator.cpp

@@ -1,10 +1,3 @@
-//================ Copyright (c) 2019, PG & Francesco149, All rights reserved. =================//
-//
-// Purpose:		star rating + pp calculation, based on https://github.com/Francesco149/oppai/
-//
-// $NoKeywords: $tomstarspp
-//==============================================================================================//
-
 #include "DifficultyCalculator.h"
 
 #include "Beatmap.h"
@@ -15,6 +8,8 @@
 #include "Replay.h"
 #include "SliderCurves.h"
 
+using namespace std;
+
 ConVar osu_stars_xexxar_angles_sliders("osu_stars_xexxar_angles_sliders", true, FCVAR_DEFAULT,
                                        "completely enables/disables the new star/pp calc algorithm");
 ConVar osu_stars_slider_curve_points_separation(
@@ -646,12 +641,10 @@ double DifficultyCalculator::calculateStarDiffForHitObjects(std::vector<OsuDiffi
 
                     double speed_bonus = 1.0;
                     if(strain_time < min_speed_bonus)
-                        speed_bonus =
-                            1.0 + 0.75 * pow((min_speed_bonus - strain_time) / speed_balancing_factor, 2.0);
+                        speed_bonus = 1.0 + 0.75 * pow((min_speed_bonus - strain_time) / speed_balancing_factor, 2.0);
 
-                    raw_speed_strain =
-                        (speed_bonus + speed_bonus * pow(distance / single_spacing_threshold, 3.5)) *
-                        doubletapness / strain_time;
+                    raw_speed_strain = (speed_bonus + speed_bonus * pow(distance / single_spacing_threshold, 3.5)) *
+                                       doubletapness / strain_time;
 
                     // https://github.com/ppy/osu/blob/master/osu.Game.Rulesets.Osu/Difficulty/Evaluators/RhythmEvaluator.cs
                     int previousIslandSize = 0;
@@ -682,19 +675,18 @@ double DifficultyCalculator::calculateStarDiffForHitObjects(std::vector<OsuDiffi
 
                         currHistoricalDecay =
                             min((double)(historicalNoteCount - i) / historicalNoteCount,
-                                     currHistoricalDecay);  // either we're limited by time or limited by object count.
+                                currHistoricalDecay);  // either we're limited by time or limited by object count.
 
                         double currDelta = currObj->strain_time;
                         double prevDelta = prevObj->strain_time;
                         double lastDelta = lastObj->strain_time;
                         double currRatio =
-                            1.0 + 6.0 * min(0.5, pow(std::sin(PI / (min(prevDelta, currDelta) /
-                                                                              max(prevDelta, currDelta))),
-                                                               2.0));  // fancy function to calculate rhythmbonuses.
+                            1.0 +
+                            6.0 * min(0.5, pow(std::sin(PI / (min(prevDelta, currDelta) / max(prevDelta, currDelta))),
+                                               2.0));  // fancy function to calculate rhythmbonuses.
 
-                        double windowPenalty =
-                            min(1.0, max(0.0, std::abs(prevDelta - currDelta) - hitWindow300 * 0.3) /
-                                              (hitWindow300 * 0.3));
+                        double windowPenalty = min(
+                            1.0, max(0.0, std::abs(prevDelta - currDelta) - hitWindow300 * 0.3) / (hitWindow300 * 0.3));
 
                         windowPenalty = min(1.0, windowPenalty);
 
@@ -769,9 +761,7 @@ double DifficultyCalculator::calculateStarDiffForHitObjects(std::vector<OsuDiffi
                         return 0.0;
 
                     auto calcWideAngleBonus = [](double angle) {
-                        return pow(
-                            std::sin(3.0 / 4.0 * (min(5.0 / 6.0 * PI, max(PI / 6.0, angle)) - PI / 6.0)),
-                            2.0);
+                        return pow(std::sin(3.0 / 4.0 * (min(5.0 / 6.0 * PI, max(PI / 6.0, angle)) - PI / 6.0)), 2.0);
                     };
                     auto calcAcuteAngleBonus = [=](double angle) { return 1.0 - calcWideAngleBonus(angle); };
 
@@ -809,15 +799,13 @@ double DifficultyCalculator::calculateStarDiffForHitObjects(std::vector<OsuDiffi
                                        min(angleBonus, 125.0 / strain_time) *
                                        pow(std::sin(PI / 2.0 * min(1.0, (100.0 - strain_time) / 25.0)), 2.0) *
                                        pow(std::sin(PI / 2.0 * (clamp<double>(jumpDistance, 50.0, 100.0) - 50.0) /
-                                                         50.0),
-                                                2.0));
+                                                    50.0),
+                                           2.0));
 
                             wideAngleBonus *=
-                                angleBonus *
-                                (1.0 - min(wideAngleBonus, pow(calcWideAngleBonus(prev.angle), 3.0)));
-                            acuteAngleBonus *=
-                                0.5 + 0.5 * (1.0 - min(acuteAngleBonus,
-                                                            pow(calcAcuteAngleBonus(prevPrev->angle), 3.0)));
+                                angleBonus * (1.0 - min(wideAngleBonus, pow(calcWideAngleBonus(prev.angle), 3.0)));
+                            acuteAngleBonus *= 0.5 + 0.5 * (1.0 - min(acuteAngleBonus,
+                                                                      pow(calcAcuteAngleBonus(prevPrev->angle), 3.0)));
                         }
                     }
 
@@ -826,22 +814,21 @@ double DifficultyCalculator::calculateStarDiffForHitObjects(std::vector<OsuDiffi
                         currVelocity = (jumpDistance + prev.travelDistance) / strain_time;
 
                         double distRatio = pow(std::sin(PI / 2.0 * std::abs(prevVelocity - currVelocity) /
-                                                             max(prevVelocity, currVelocity)),
-                                                    2.0);
-                        double overlapVelocityBuff = min(125.0 / min(strain_time, prev.strain_time),
-                                                              std::abs(prevVelocity - currVelocity));
+                                                        max(prevVelocity, currVelocity)),
+                                               2.0);
+                        double overlapVelocityBuff =
+                            min(125.0 / min(strain_time, prev.strain_time), std::abs(prevVelocity - currVelocity));
                         velocityChangeBonus =
                             overlapVelocityBuff * distRatio *
-                            pow(min(strain_time, prev.strain_time) / max(strain_time, prev.strain_time),
-                                     2.0);
+                            pow(min(strain_time, prev.strain_time) / max(strain_time, prev.strain_time), 2.0);
                     }
 
                     if(prev.ho->type == OsuDifficultyHitObject::TYPE::SLIDER)
                         sliderBonus = prev.travelDistance / prev.travelTime;
 
-                    aimStrain += max(
-                        acuteAngleBonus * acute_angle_multiplier,
-                        wideAngleBonus * wide_angle_multiplier + velocityChangeBonus * velocity_change_multiplier);
+                    aimStrain +=
+                        max(acuteAngleBonus * acute_angle_multiplier,
+                            wideAngleBonus * wide_angle_multiplier + velocityChangeBonus * velocity_change_multiplier);
                     if(withSliders) aimStrain += sliderBonus * slider_multiplier;
 
                     return aimStrain;
@@ -1012,9 +999,9 @@ double DifficultyCalculator::calculateStarDiffForHitObjects(std::vector<OsuDiffi
                         (prev1.ho->curve ? prev1.ho->curve->pointAt(prev1.ho->repeats % 2 ? 1.0 : 0.0) : prev1.ho->pos)
                             .distance(cur.ho->pos) *
                         radius_scaling_factor;
-                    cur.minJumpDistance = max(
-                        0.0f, min((float)cur.minJumpDistance - (maximum_slider_radius - assumed_slider_radius),
-                                       tail_jump_dist - maximum_slider_radius));
+                    cur.minJumpDistance =
+                        max(0.0f, min((float)cur.minJumpDistance - (maximum_slider_radius - assumed_slider_radius),
+                                      tail_jump_dist - maximum_slider_radius));
                 }
 
                 // calculate angles
@@ -1168,12 +1155,12 @@ double DifficultyCalculator::calculatePPv2(int modsLegacy, double timescale, dou
     double multiplier = 1.14;  // keep final pp normalized across changes
     {
         if(modsLegacy & ModFlags::NoFail)
-            multiplier *= max(
-                0.9, 1.0 - 0.02 * effectiveMissCount);  // see https://github.com/ppy/osu-performance/pull/127/files
+            multiplier *=
+                max(0.9, 1.0 - 0.02 * effectiveMissCount);  // see https://github.com/ppy/osu-performance/pull/127/files
 
         if((modsLegacy & ModFlags::SpunOut) && score.totalHits > 0)
             multiplier *= 1.0 - pow((double)numSpinners / (double)score.totalHits,
-                                         0.85);  // see https://github.com/ppy/osu-performance/pull/110/
+                                    0.85);  // see https://github.com/ppy/osu-performance/pull/110/
 
         if((modsLegacy & ModFlags::Relax) && !osu_stars_and_pp_lazer_relax_autopilot_nerf_disabled.getBool()) {
             double okMultiplier = max(0.0, od > 0.0 ? 1.0 - pow(od / 13.33, 1.8) : 1.0);   // 100
@@ -1188,8 +1175,7 @@ double DifficultyCalculator::calculatePPv2(int modsLegacy, double timescale, dou
     const double accuracyValue = computeAccuracyValue(score, attributes);
 
     const double totalValue =
-        pow(pow(aimValue, 1.1) + pow(speedValue, 1.1) + pow(accuracyValue, 1.1), 1.0 / 1.1) *
-        multiplier;
+        pow(pow(aimValue, 1.1) + pow(speedValue, 1.1) + pow(accuracyValue, 1.1), 1.0 / 1.1) * multiplier;
 
     return totalValue;
 }
@@ -1197,8 +1183,7 @@ double DifficultyCalculator::calculatePPv2(int modsLegacy, double timescale, dou
 double DifficultyCalculator::calculateTotalStarsFromSkills(double aim, double speed) {
     double baseAimPerformance = pow(5.0 * max(1.0, aim / 0.0675) - 4.0, 3.0) / 100000.0;
     double baseSpeedPerformance = pow(5.0 * max(1.0, speed / 0.0675) - 4.0, 3.0) / 100000.0;
-    double basePerformance =
-        pow(pow(baseAimPerformance, 1.1) + pow(baseSpeedPerformance, 1.1), 1.0 / 1.1);
+    double basePerformance = pow(pow(baseAimPerformance, 1.1) + pow(baseSpeedPerformance, 1.1), 1.0 / 1.1);
     return basePerformance > 0.00001
                ? 1.04464392682 /* Math.Cbrt(OsuPerformanceCalculator.PERFORMANCE_BASE_MULTIPLIER) */ * 0.027 *
                      (std::cbrt(100000.0 / pow(2.0, 1 / 1.1) * basePerformance) + 4.0)
@@ -1223,13 +1208,11 @@ double DifficultyCalculator::computeAimValue(const ScoreData &score, const Diffi
     // Penalize misses by assessing # of misses relative to the total # of objects. Default a 3% reduction for any # of
     // misses.
     if(effectiveMissCount > 0 && score.totalHits > 0)
-        aimValue *=
-            0.97 * pow(1.0 - pow(effectiveMissCount / (double)score.totalHits, 0.775), effectiveMissCount);
+        aimValue *= 0.97 * pow(1.0 - pow(effectiveMissCount / (double)score.totalHits, 0.775), effectiveMissCount);
 
     // combo scaling
     if(score.beatmapMaxCombo > 0)
-        aimValue *=
-            min(pow((double)score.scoreMaxCombo, 0.8) / pow((double)score.beatmapMaxCombo, 0.8), 1.0);
+        aimValue *= min(pow((double)score.scoreMaxCombo, 0.8) / pow((double)score.beatmapMaxCombo, 0.8), 1.0);
 
     // ar bonus
     double approachRateFactor = 0.0;  // see https://github.com/ppy/osu-performance/pull/125/
@@ -1254,18 +1237,17 @@ double DifficultyCalculator::computeAimValue(const ScoreData &score, const Diffi
     // hidden
     if(score.modsLegacy & ModFlags::Hidden)
         aimValue *= 1.0 + 0.04 * (max(12.0 - attributes.ApproachRate,
-                                           0.0));  // NOTE: clamped to 0 because neosu allows AR > 12
+                                      0.0));  // NOTE: clamped to 0 because neosu allows AR > 12
 
     // "We assume 15% of sliders in a map are difficult since there's no way to tell from the performance calculator."
     double estimateDifficultSliders = attributes.SliderCount * 0.15;
     if(attributes.SliderCount > 0) {
-        double estimateSliderEndsDropped =
-            clamp<double>((double)min(score.countGood + score.countMeh + score.countMiss,
-                                           score.beatmapMaxCombo - score.scoreMaxCombo),
-                          0.0, estimateDifficultSliders);
-        double sliderNerfFactor = (1.0 - attributes.SliderFactor) *
-                                      pow(1.0 - estimateSliderEndsDropped / estimateDifficultSliders, 3.0) +
-                                  attributes.SliderFactor;
+        double estimateSliderEndsDropped = clamp<double>((double)min(score.countGood + score.countMeh + score.countMiss,
+                                                                     score.beatmapMaxCombo - score.scoreMaxCombo),
+                                                         0.0, estimateDifficultSliders);
+        double sliderNerfFactor =
+            (1.0 - attributes.SliderFactor) * pow(1.0 - estimateSliderEndsDropped / estimateDifficultSliders, 3.0) +
+            attributes.SliderFactor;
         aimValue *= sliderNerfFactor;
     }
 
@@ -1293,13 +1275,12 @@ double DifficultyCalculator::computeSpeedValue(const ScoreData &score, const Att
     // Penalize misses by assessing # of misses relative to the total # of objects. Default a 3% reduction for any # of
     // misses.
     if(effectiveMissCount > 0 && score.totalHits > 0)
-        speedValue *= 0.97 * pow(1.0 - pow(effectiveMissCount / (double)score.totalHits, 0.775),
-                                      pow(effectiveMissCount, 0.875));
+        speedValue *=
+            0.97 * pow(1.0 - pow(effectiveMissCount / (double)score.totalHits, 0.775), pow(effectiveMissCount, 0.875));
 
     // combo scaling
     if(score.beatmapMaxCombo > 0)
-        speedValue *=
-            min(pow((double)score.scoreMaxCombo, 0.8) / pow((double)score.beatmapMaxCombo, 0.8), 1.0);
+        speedValue *= min(pow((double)score.scoreMaxCombo, 0.8) / pow((double)score.beatmapMaxCombo, 0.8), 1.0);
 
     // ar bonus
     double approachRateFactor = 0.0;  // see https://github.com/ppy/osu-performance/pull/125/
@@ -1314,7 +1295,7 @@ double DifficultyCalculator::computeSpeedValue(const ScoreData &score, const Att
     // hidden
     if(score.modsLegacy & ModFlags::Hidden)
         speedValue *= 1.0 + 0.04 * (max(12.0 - attributes.ApproachRate,
-                                             0.0));  // NOTE: clamped to 0 because neosu allows AR > 12
+                                        0.0));  // NOTE: clamped to 0 because neosu allows AR > 12
 
     // "Calculate accuracy assuming the worst case scenario"
     double relevantTotalDiff = score.totalHits - attributes.SpeedNoteCount;
@@ -1329,9 +1310,8 @@ double DifficultyCalculator::computeSpeedValue(const ScoreData &score, const Att
 
     // see https://github.com/ppy/osu-performance/pull/128/
     // Scale the speed value with accuracy and OD
-    speedValue *=
-        (0.95 + pow(attributes.OverallDifficulty, 2.0) / 750.0) *
-        pow((score.accuracy + relevantAccuracy) / 2.0, (14.5 - max(attributes.OverallDifficulty, 8.0)) / 2.0);
+    speedValue *= (0.95 + pow(attributes.OverallDifficulty, 2.0) / 750.0) *
+                  pow((score.accuracy + relevantAccuracy) / 2.0, (14.5 - max(attributes.OverallDifficulty, 8.0)) / 2.0);
     // Scale the speed value with # of 50s to punish doubletapping.
     speedValue *=
         pow(0.99, score.countMeh < (score.totalHits / 500.0) ? 0.0 : score.countMeh - (score.totalHits / 500.0));
@@ -1353,8 +1333,7 @@ double DifficultyCalculator::computeAccuracyValue(const ScoreData &score, const
     if(betterAccuracyPercentage < 0.0) betterAccuracyPercentage = 0.0;
 
     // arbitrary values tom crafted out of trial and error
-    double accuracyValue =
-        pow(1.52163, attributes.OverallDifficulty) * pow(betterAccuracyPercentage, 24.0) * 2.83;
+    double accuracyValue = pow(1.52163, attributes.OverallDifficulty) * pow(betterAccuracyPercentage, 24.0) * 2.83;
 
     // length bonus
     accuracyValue *= min(1.15, pow(score.amountHitObjectsWithAccuracy / 1000.0, 0.3));

+ 3 - 7
src/App/Osu/GameRules.cpp

@@ -1,12 +1,8 @@
-//================ Copyright (c) 2016, PG, All rights reserved. =================//
-//
-// Purpose:		difficulty & playfield behaviour
-//
-// $NoKeywords: $osugr
-//===============================================================================//
-
 #include "GameRules.h"
 
+const int GameRules::OSU_COORD_WIDTH = 512;
+const int GameRules::OSU_COORD_HEIGHT = 384;
+
 ConVar GameRules::osu_playfield_border_top_percent("osu_playfield_border_top_percent", 0.117f, FCVAR_DEFAULT);
 ConVar GameRules::osu_playfield_border_bottom_percent("osu_playfield_border_bottom_percent", 0.0834f, FCVAR_DEFAULT);
 

+ 6 - 6
src/App/Osu/GameRules.h

@@ -335,10 +335,10 @@ class GameRules {
 
     static float getRawHitCircleDiameter(float CS, bool applyBrokenGamefieldRoundingAllowance = true) {
         return max(0.0f,
-                        ((1.0f - 0.7f * (CS - 5.0f) / 5.0f) / 2.0f) * 128.0f *
-                            (applyBrokenGamefieldRoundingAllowance
-                                 ? broken_gamefield_rounding_allowance
-                                 : 1.0f));  // gives the circle diameter in osu!pixels, goes negative above CS 12.1429
+                   ((1.0f - 0.7f * (CS - 5.0f) / 5.0f) / 2.0f) * 128.0f *
+                       (applyBrokenGamefieldRoundingAllowance
+                            ? broken_gamefield_rounding_allowance
+                            : 1.0f));  // gives the circle diameter in osu!pixels, goes negative above CS 12.1429
     }
 
     static float getHitCircleXMultiplier() {
@@ -356,8 +356,8 @@ class GameRules {
     static ConVar osu_playfield_border_top_percent;
     static ConVar osu_playfield_border_bottom_percent;
 
-    static const int OSU_COORD_WIDTH = 512;
-    static const int OSU_COORD_HEIGHT = 384;
+    static const int OSU_COORD_WIDTH;
+    static const int OSU_COORD_HEIGHT;
 
     static float getPlayfieldScaleFactor() {
         const int engineScreenWidth = osu->getScreenWidth();

+ 4 - 2
src/App/Osu/HUD.cpp

@@ -29,6 +29,8 @@
 #include "VertexArrayObject.h"
 #include "score.h"
 
+using namespace std;
+
 ConVar osu_automatic_cursor_size("osu_automatic_cursor_size", false, FCVAR_DEFAULT);
 
 ConVar osu_cursor_alpha("osu_cursor_alpha", 1.0f, FCVAR_DEFAULT);
@@ -752,8 +754,8 @@ void HUD::drawCursorRipples(Graphics *g) {
     const float normalizedHeight = osu->getSkin()->getCursorRipple()->getHeight() * normalized2xScale * imageScale;
 
     const float duration = max(osu_cursor_ripple_duration.getFloat(), 0.0001f);
-    const float fadeDuration = max(
-        osu_cursor_ripple_duration.getFloat() - osu_cursor_ripple_anim_start_fadeout_delay.getFloat(), 0.0001f);
+    const float fadeDuration =
+        max(osu_cursor_ripple_duration.getFloat() - osu_cursor_ripple_anim_start_fadeout_delay.getFloat(), 0.0001f);
 
     if(osu_cursor_ripple_additive.getBool()) g->setBlendMode(Graphics::BLEND_MODE::BLEND_MODE_ADDITIVE);
 

+ 7 - 12
src/App/Osu/HitObject.cpp

@@ -1,10 +1,3 @@
-//================ Copyright (c) 2015, PG, All rights reserved. =================//
-//
-// Purpose:		base class for all gameplay objects
-//
-// $NoKeywords: $hitobj
-//===============================================================================//
-
 #include "HitObject.h"
 
 #include "AnimationHandler.h"
@@ -18,6 +11,8 @@
 #include "Skin.h"
 #include "SkinImage.h"
 
+using namespace std;
+
 ConVar osu_hitresult_draw_300s("osu_hitresult_draw_300s", false, FCVAR_DEFAULT);
 
 ConVar osu_hitresult_scale("osu_hitresult_scale", 1.0f, FCVAR_DEFAULT);
@@ -458,9 +453,9 @@ void HitObject::update(long curPos) {
         // hitobject body fadein
         const long fadeInStart = m_iTime - m_iApproachTime;
         const long fadeInEnd =
-            min(m_iTime, m_iTime - m_iApproachTime +
-                                  m_iFadeInTime);  // min() ensures that the fade always finishes at m_iTime (even if
-                                                   // the fadeintime is longer than the approachtime)
+            min(m_iTime,
+                m_iTime - m_iApproachTime + m_iFadeInTime);  // min() ensures that the fade always finishes at m_iTime
+                                                             // (even if the fadeintime is longer than the approachtime)
         m_fAlpha = clamp<float>(1.0f - ((float)(fadeInEnd - curPos) / (float)(fadeInEnd - fadeInStart)), 0.0f, 1.0f);
         m_fAlphaWithoutHidden = m_fAlpha;
 
@@ -487,8 +482,8 @@ void HitObject::update(long curPos) {
         const long approachCircleFadeStart = m_iTime - m_iApproachTime;
         const long approachCircleFadeEnd =
             min(m_iTime, m_iTime - m_iApproachTime +
-                                  2 * m_iFadeInTime);  // min() ensures that the fade always finishes at m_iTime (even
-                                                       // if the fadeintime is longer than the approachtime)
+                             2 * m_iFadeInTime);  // min() ensures that the fade always finishes at m_iTime (even
+                                                  // if the fadeintime is longer than the approachtime)
         m_fAlphaForApproachCircle = clamp<float>(
             1.0f - ((float)(approachCircleFadeEnd - curPos) / (float)(approachCircleFadeEnd - approachCircleFadeStart)),
             0.0f, 1.0f);

+ 5 - 5
src/App/Osu/MainMenu.cpp

@@ -29,6 +29,8 @@
 #include "UpdateHandler.h"
 #include "VertexArrayObject.h"
 
+using namespace std;
+
 UString MainMenu::NEOSU_MAIN_BUTTON_TEXT = UString("neosu");
 UString MainMenu::NEOSU_MAIN_BUTTON_SUBTEXT = UString("Multiplayer Client");
 
@@ -376,9 +378,8 @@ void MainMenu::draw(Graphics *g) {
         if(t.beatLengthBase == 0.0f)  // bah
             t.beatLengthBase = 1.0f;
 
-        m_iMainMenuAnimBeatCounter =
-            (curMusicPos - t.offset - (long)(max((long)t.beatLengthBase, (long)1) * 0.5f)) /
-            max((long)t.beatLengthBase, (long)1);
+        m_iMainMenuAnimBeatCounter = (curMusicPos - t.offset - (long)(max((long)t.beatLengthBase, (long)1) * 0.5f)) /
+                                     max((long)t.beatLengthBase, (long)1);
         pulse = (float)((curMusicPos - t.offset) % max((long)t.beatLengthBase, (long)1)) /
                 t.beatLengthBase;  // modulo must be >= 1
         pulse = clamp<float>(pulse, -1.0f, 1.0f);
@@ -1213,8 +1214,7 @@ void MainMenu::animMainButton() {
         const float randomDuration2 = (static_cast<float>(rand()) / static_cast<float>(RAND_MAX)) * 3.5f;
         const float randomDuration3 = (static_cast<float>(rand()) / static_cast<float>(RAND_MAX)) * 3.5f;
 
-        anim->moveQuadOut(&m_fMainMenuAnim, 1.0f,
-                          1.5f + max(randomDuration1, max(randomDuration2, randomDuration3)));
+        anim->moveQuadOut(&m_fMainMenuAnim, 1.0f, 1.5f + max(randomDuration1, max(randomDuration2, randomDuration3)));
         anim->moveQuadOut(&m_fMainMenuAnim1, m_fMainMenuAnim1Target, 1.5f + randomDuration1);
         anim->moveQuadOut(&m_fMainMenuAnim2, m_fMainMenuAnim2Target, 1.5f + randomDuration2);
         anim->moveQuadOut(&m_fMainMenuAnim3, m_fMainMenuAnim3Target, 1.5f + randomDuration3);

+ 3 - 2
src/App/Osu/OptionsMenu.cpp

@@ -40,6 +40,8 @@
 #include "UISearchOverlay.h"
 #include "UISlider.h"
 
+using namespace std;
+
 ConVar osu_options_save_on_back("osu_options_save_on_back", true, FCVAR_DEFAULT);
 ConVar osu_options_high_quality_sliders("osu_options_high_quality_sliders", false, FCVAR_DEFAULT);
 ConVar osu_options_slider_preview_use_legacy_renderer(
@@ -1851,8 +1853,7 @@ void OptionsMenu::updateLayout() {
     const float categoriesOptionsPercent = 0.135f;
 
     int optionsWidth = (int)(osu->getScreenWidth() * optionsScreenWidthPercent);
-    if(!m_bFullscreen)
-        optionsWidth = min((int)(725.0f * (1.0f - categoriesOptionsPercent)), optionsWidth) * dpiScale;
+    if(!m_bFullscreen) optionsWidth = min((int)(725.0f * (1.0f - categoriesOptionsPercent)), optionsWidth) * dpiScale;
 
     const int categoriesWidth = optionsWidth * categoriesOptionsPercent;
 

+ 11 - 10
src/App/Osu/Osu.cpp

@@ -53,6 +53,8 @@
 #include "VolumeOverlay.h"
 #include "score.h"
 
+using namespace std;
+
 Osu *osu = NULL;
 
 // release configuration
@@ -141,7 +143,8 @@ ConVar scoreboard_animations("scoreboard_animations", true, FCVAR_DEFAULT, "anim
 ConVar instant_replay_duration("instant_replay_duration", 15.f, FCVAR_DEFAULT,
                                "instant replay (F2) duration, in seconds");
 ConVar normalize_loudness("normalize_loudness", false, FCVAR_DEFAULT, "normalize loudness across songs");
-ConVar restart_sound_engine_before_playing("restart_sound_engine_before_playing", false, FCVAR_DEFAULT, "jank fix for users who experience sound issues after playing for a while");
+ConVar restart_sound_engine_before_playing("restart_sound_engine_before_playing", false, FCVAR_DEFAULT,
+                                           "jank fix for users who experience sound issues after playing for a while");
 
 ConVar use_https("use_https", true, FCVAR_DEFAULT);
 ConVar mp_server("mp_server", "ez-pp.farm", FCVAR_DEFAULT);
@@ -695,13 +698,12 @@ void Osu::draw(Graphics *g) {
                     getImageScaleToFitResolution(m_backBuffer->getSize(), engine->getGraphics()->getResolution());
                 const float scaledWidth = m_backBuffer->getWidth() * scale;
                 const float scaledHeight = m_backBuffer->getHeight() * scale;
-                m_backBuffer->draw(
-                    g,
-                    max(0.0f, engine->getGraphics()->getResolution().x / 2.0f - scaledWidth / 2.0f) *
-                        (1.0f + osu_letterboxing_offset_x.getFloat()),
-                    max(0.0f, engine->getGraphics()->getResolution().y / 2.0f - scaledHeight / 2.0f) *
-                        (1.0f + osu_letterboxing_offset_y.getFloat()),
-                    scaledWidth, scaledHeight);
+                m_backBuffer->draw(g,
+                                   max(0.0f, engine->getGraphics()->getResolution().x / 2.0f - scaledWidth / 2.0f) *
+                                       (1.0f + osu_letterboxing_offset_x.getFloat()),
+                                   max(0.0f, engine->getGraphics()->getResolution().y / 2.0f - scaledHeight / 2.0f) *
+                                       (1.0f + osu_letterboxing_offset_y.getFloat()),
+                                   scaledWidth, scaledHeight);
             } else {
                 m_backBuffer->draw(g, 0, 0, engine->getGraphics()->getResolution().x,
                                    engine->getGraphics()->getResolution().y);
@@ -1789,8 +1791,7 @@ void Osu::onResolutionChanged(Vector2 newResolution) {
 
         // disable internal resolution on specific conditions
         bool windowsBorderlessHackCondition =
-            (env->getOS() == Environment::OS::WINDOWS && env->isFullscreen() &&
-             env->isFullscreenWindowedBorderless() &&
+            (env->getOS() == Environment::OS::WINDOWS && env->isFullscreen() && env->isFullscreenWindowedBorderless() &&
              (int)g_vInternalResolution.y == (int)env->getNativeScreenSize().y);  // HACKHACK
         if(((int)g_vInternalResolution.x == engine->getScreenWidth() &&
             (int)g_vInternalResolution.y == engine->getScreenHeight()) ||

+ 2 - 0
src/App/Osu/Skin.cpp

@@ -15,6 +15,8 @@
 #include "SoundEngine.h"
 #include "VolumeOverlay.h"
 
+using namespace std;
+
 #define OSU_BITMASK_HITWHISTLE 0x2
 #define OSU_BITMASK_HITFINISH 0x4
 #define OSU_BITMASK_HITCLAP 0x8

+ 5 - 10
src/App/Osu/SkinImage.cpp

@@ -1,10 +1,3 @@
-//================ Copyright (c) 2017, PG, All rights reserved. =================//
-//
-// Purpose:		skin images/drawables
-//
-// $NoKeywords: $osuskimg
-//===============================================================================//
-
 #include "SkinImage.h"
 
 #include "ConVar.h"
@@ -14,6 +7,8 @@
 #include "ResourceManager.h"
 #include "Skin.h"
 
+using namespace std;
+
 ConVar osu_skin_animation_fps_override("osu_skin_animation_fps_override", -1.0f, FCVAR_DEFAULT);
 
 ConVar *SkinImage::m_osu_skin_mipmaps_ref = NULL;
@@ -350,9 +345,9 @@ void SkinImage::update(float speedMultiplier, bool useEngineTimeForAnimations, l
         // the beatmap (m_iBeatmapTimeAnimationStartOffset), and we need the beatmap time (curMusicPos) as a relative
         // base m_iBeatmapAnimationTimeStartOffset must be set by all hitobjects live while drawing (e.g. to their
         // m_iTime-m_iObjectTime), since we don't have any animation state saved in the hitobjects!
-        m_iFrameCounter = max(
-            (int)((curMusicPos - m_iBeatmapAnimationTimeStartOffset) / (long)(frameDurationInSeconds * 1000.0f)),
-            0);  // freeze animation on frame 0 on negative offsets
+        m_iFrameCounter =
+            max((int)((curMusicPos - m_iBeatmapAnimationTimeStartOffset) / (long)(frameDurationInSeconds * 1000.0f)),
+                0);  // freeze animation on frame 0 on negative offsets
         m_iFrameCounterUnclamped = m_iFrameCounter;
         m_iFrameCounter = m_iFrameCounter % m_images.size();  // clamp and wrap around to the number of frames we have
     }

+ 2 - 13
src/App/Osu/SkinImage.h

@@ -1,13 +1,4 @@
-//================ Copyright (c) 2017, PG, All rights reserved. =================//
-//
-// Purpose:		skin images/drawables
-//
-// $NoKeywords: $osuskimg
-//===============================================================================//
-
-#ifndef OSUSKINIMAGE_H
-#define OSUSKINIMAGE_H
-
+#pragma once
 #include "cbase.h"
 
 class Skin;
@@ -33,7 +24,7 @@ class SkinImage {
                                         // depending on the diameter defined by the CS)
     virtual void update(float speedMultiplier, bool useEngineTimeForAnimations = true, long curMusicPos = 0);
 
-    void setAnimationFramerate(float fps) { m_fFrameDuration = 1.0f / clamp<float>(fps, 1.0f, 9999.0f); }
+    void setAnimationFramerate(float fps) { m_fFrameDuration = 1.0f / std::clamp<float>(fps, 1.0f, 9999.0f); }
     void setAnimationTimeOffset(float speedMultiplier,
                                 long offset);  // set this every frame (before drawing) to a fixed point in time
                                                // relative to curMusicPos where we become visible
@@ -100,5 +91,3 @@ class SkinImage {
     float m_fDrawClipWidthPercent;
     std::vector<std::string> m_filepathsForExport;
 };
-
-#endif

+ 8 - 6
src/App/Osu/Slider.cpp

@@ -20,6 +20,8 @@
 #include "SoundEngine.h"
 #include "VertexArrayObject.h"
 
+using namespace std;
+
 ConVar osu_slider_ball_tint_combo_color("osu_slider_ball_tint_combo_color", true, FCVAR_DEFAULT);
 
 ConVar osu_snaking_sliders("osu_snaking_sliders", true, FCVAR_DEFAULT);
@@ -379,7 +381,8 @@ void Slider::draw(Graphics *g) {
                                  1.0f - m_fEndSliderBodyFadeAnimation, getTime());
     }
 
-    if(osu_slider_sliderhead_fadeout.getBool() && m_fStartHitAnimation > 0.0f && m_fStartHitAnimation != 1.0f && !osu->getModHD()) {
+    if(osu_slider_sliderhead_fadeout.getBool() && m_fStartHitAnimation > 0.0f && m_fStartHitAnimation != 1.0f &&
+       !osu->getModHD()) {
         float alpha = 1.0f - m_fStartHitAnimation;
 
         float scale = m_fStartHitAnimation;
@@ -672,9 +675,9 @@ void Slider::update(long curPos) {
 
         // fade out over the duration of the slider, starting exactly when the default fadein finishes
         const long hiddenSliderBodyFadeOutStart =
-            min(m_iTime, m_iTime - m_iApproachTime +
-                                  m_iFadeInTime);  // min() ensures that the fade always starts at m_iTime (even if the
-                                                   // fadeintime is longer than the approachtime)
+            min(m_iTime,
+                m_iTime - m_iApproachTime + m_iFadeInTime);  // min() ensures that the fade always starts at m_iTime
+                                                             // (even if the fadeintime is longer than the approachtime)
         const float fade_percent = osu_mod_hd_slider_fade_percent.getFloat();
         const long hiddenSliderBodyFadeOutEnd = m_iTime + (long)(fade_percent * m_fSliderTime);
         if(curPos >= hiddenSliderBodyFadeOutStart) {
@@ -792,8 +795,7 @@ void Slider::update(long curPos) {
         // (for the end of the slider) is NOT checked at the exact end of the slider, but somewhere random before,
         // because fuck you
         const long offset = (long)osu_slider_end_inside_check_offset.getInt();
-        const long lenienceHackEndTime =
-            max(m_iTime + m_iObjectDuration / 2, (m_iTime + m_iObjectDuration) - offset);
+        const long lenienceHackEndTime = max(m_iTime + m_iObjectDuration / 2, (m_iTime + m_iObjectDuration) - offset);
         const bool isTrackingCorrectly = (isClickHeldSlider() || osu->getModRelax()) && m_bCursorInside;
         if(isTrackingCorrectly) {
             if(isTrackingStrictTrackingMod) {

+ 2 - 8
src/App/Osu/SliderCurves.cpp

@@ -1,16 +1,10 @@
-//================ Copyright (c) 2015, PG & Jeffrey Han (opsu!), All rights reserved. =================//
-//
-// Purpose:		curve classes have been taken from opsu!, albeit heavily modified.
-//				contains all classes and functions for calculating slider curves
-//
-// $NoKeywords: $slidercurves
-//=====================================================================================================//
-
 #include "SliderCurves.h"
 
 #include "ConVar.h"
 #include "Engine.h"
 
+using namespace std;
+
 ConVar osu_slider_curve_points_separation(
     "osu_slider_curve_points_separation", 2.5f, FCVAR_LOCKED,
     "slider body curve approximation step width in osu!pixels, don't set this lower than around 1.5");

+ 2 - 0
src/App/Osu/SliderRenderer.cpp

@@ -17,6 +17,8 @@
 #include "Skin.h"
 #include "VertexArrayObject.h"
 
+using namespace std;
+
 Shader *SliderRenderer::BLEND_SHADER = NULL;
 
 float SliderRenderer::MESH_CENTER_HEIGHT =

+ 2 - 0
src/App/Osu/SongBrowser/Button.cpp

@@ -14,6 +14,8 @@
 #include "Skin.h"
 #include "SoundEngine.h"
 
+using namespace std;
+
 ConVar osu_songbrowser_button_active_color_a("osu_songbrowser_button_active_color_a", 220 + 10, FCVAR_DEFAULT);
 ConVar osu_songbrowser_button_active_color_r("osu_songbrowser_button_active_color_r", 255, FCVAR_DEFAULT);
 ConVar osu_songbrowser_button_active_color_g("osu_songbrowser_button_active_color_g", 255, FCVAR_DEFAULT);

+ 2 - 0
src/App/Osu/SongBrowser/CollectionButton.cpp

@@ -15,6 +15,8 @@
 #include "Skin.h"
 #include "UIContextMenu.h"
 
+using namespace std;
+
 ConVar osu_songbrowser_button_collection_active_color_a("osu_songbrowser_button_collection_active_color_a", 255,
                                                         FCVAR_DEFAULT);
 ConVar osu_songbrowser_button_collection_active_color_r("osu_songbrowser_button_collection_active_color_r", 163,

+ 2 - 0
src/App/Osu/SongBrowser/SongDifficultyButton.cpp

@@ -17,6 +17,8 @@
 #include "Skin.h"
 #include "Timer.h"
 
+using namespace std;
+
 ConVar osu_songbrowser_button_difficulty_inactive_color_a("osu_songbrowser_button_difficulty_inactive_color_a", 255,
                                                           FCVAR_DEFAULT);
 ConVar osu_songbrowser_button_difficulty_inactive_color_r("osu_songbrowser_button_difficulty_inactive_color_r", 0,

+ 2 - 7
src/App/Osu/Spinner.cpp

@@ -1,10 +1,3 @@
-//================ Copyright (c) 2015, PG & Jeffrey Han (opsu!), All rights reserved. =================//
-//
-// Purpose:		spinner. spin logic has been taken from opsu!, I didn't have time to rewrite it yet
-//
-// $NoKeywords: $spin
-//=====================================================================================================//
-
 #include "Spinner.h"
 
 #include "AnimationHandler.h"
@@ -18,6 +11,8 @@
 #include "Skin.h"
 #include "SoundEngine.h"
 
+using namespace std;
+
 ConVar osu_spinner_use_ar_fadein(
     "osu_spinner_use_ar_fadein", false, FCVAR_DEFAULT,
     "whether spinners should fade in with AR (same as circles), or with hardcoded 400 ms fadein time (osu!default)");

+ 2 - 0
src/App/Osu/UIBackButton.cpp

@@ -7,6 +7,8 @@
 #include "Skin.h"
 #include "SkinImage.h"
 
+using namespace std;
+
 UIBackButton::UIBackButton(float xPos, float yPos, float xSize, float ySize, UString name)
     : CBaseUIButton(xPos, yPos, xSize, ySize, name, "") {
     m_fAnimation = 0.0f;

+ 2 - 0
src/App/Osu/UIButton.cpp

@@ -7,6 +7,8 @@
 #include "Skin.h"
 #include "TooltipOverlay.h"
 
+using namespace std;
+
 UIButton::UIButton(float xPos, float yPos, float xSize, float ySize, UString name, UString text)
     : CBaseUIButton(xPos, yPos, xSize, ySize, name, text) {
     m_bDefaultSkin = false;

+ 2 - 0
src/App/Osu/UIPauseMenuButton.cpp

@@ -6,6 +6,8 @@
 #include "Skin.h"
 #include "SoundEngine.h"
 
+using namespace std;
+
 UIPauseMenuButton::UIPauseMenuButton(std::function<Image *()> getImageFunc, float xPos, float yPos, float xSize,
                                      float ySize, UString name)
     : CBaseUIButton(xPos, yPos, xSize, ySize, name) {

+ 6 - 7
src/App/Osu/UpdateHandler.cpp

@@ -84,7 +84,9 @@ void UpdateHandler::wait() {
 }
 
 void UpdateHandler::checkForUpdates() {
-    if(!convar->getConVarByName("auto_update")->getBool() || Osu::debug->getBool() || (m_updateThread != NULL && m_updateThread->joinable())) return;
+    if(!convar->getConVarByName("auto_update")->getBool() || Osu::debug->getBool() ||
+       (m_updateThread != NULL && m_updateThread->joinable()))
+        return;
     if(env->getOS() != Environment::OS::WINDOWS) return;  // only windows gets releases right now
 
     m_updateThread = new std::thread(UpdateHandler::run, (void *)this);
@@ -248,12 +250,13 @@ void UpdateHandler::_installUpdate(std::string zipFilePath) {
 
         int mainDirectoryOffset = files[i].find(mainDirectory);
         if(mainDirectoryOffset == 0 && files[i].length() - mainDirectoryOffset > 0 &&
-                mainDirectoryOffset + mainDirectory.length() < files[i].length()) {
+           mainDirectoryOffset + mainDirectory.length() < files[i].length()) {
             std::string outFilePath = files[i].substr(mainDirectoryOffset + mainDirectory.length());
 
             // .exe and .dll can't be directly overwritten on windows
             if(outFilePath.length() > 4) {
-                if(!strcmp(outFilePath.c_str() + outFilePath.length() - 4, ".exe") || !strcmp(outFilePath.c_str() + outFilePath.length() - 4, ".dll")) {
+                if(!strcmp(outFilePath.c_str() + outFilePath.length() - 4, ".exe") ||
+                   !strcmp(outFilePath.c_str() + outFilePath.length() - 4, ".dll")) {
                     std::string old_path = outFilePath;
                     old_path.append(".old");
                     env->deleteFile(old_path);
@@ -271,10 +274,6 @@ void UpdateHandler::_installUpdate(std::string zipFilePath) {
 
     mz_zip_reader_end(&zip_archive);
 
-#ifndef _WIN32
-    chmod(executablePath.c_str(), S_IRWXU);
-#endif
-
     m_status = STATUS::STATUS_SUCCESS_INSTALLATION;
     env->deleteFile(zipFilePath);
 }

+ 2 - 0
src/App/Osu/UserCard.cpp

@@ -15,6 +15,8 @@
 #include "TooltipOverlay.h"
 #include "UIAvatar.h"
 
+using namespace std;
+
 // NOTE: selected username is stored in m_sText
 
 ConVar osu_user_draw_pp("osu_user_draw_pp", true, FCVAR_DEFAULT);

+ 5 - 5
src/App/Osu/score.cpp

@@ -14,6 +14,8 @@
 #include "Replay.h"
 #include "RoomScreen.h"
 
+using namespace std;
+
 ConVar osu_hiterrorbar_misses("osu_hiterrorbar_misses", true, FCVAR_DEFAULT);
 ConVar osu_debug_pp("osu_debug_pp", false, FCVAR_DEFAULT);
 
@@ -104,8 +106,8 @@ void LiveScore::reset() {
 
 void LiveScore::addHitResult(Beatmap *beatmap, HitObject *hitObject, HIT hit, long delta, bool ignoreOnHitErrorBar,
                              bool hitErrorBarOnly, bool ignoreCombo, bool ignoreScore) {
-    const int scoreComboMultiplier = max(
-        m_iCombo - 1, 0);  // current combo, excluding the current hitobject which caused the addHitResult() call
+    const int scoreComboMultiplier =
+        max(m_iCombo - 1, 0);  // current combo, excluding the current hitobject which caused the addHitResult() call
 
     // handle hits (and misses)
     if(hit != LiveScore::HIT::HIT_MISS) {
@@ -163,9 +165,7 @@ void LiveScore::addHitResult(Beatmap *beatmap, HitObject *hitObject, HIT hit, lo
     // add hitValue to score, recalculate score v1
     const unsigned long breakTimeMS = beatmap->getBreakDurationTotal();
     const unsigned long drainLength =
-        max(beatmap->getLengthPlayable() - min(breakTimeMS, beatmap->getLengthPlayable()),
-                 (unsigned long)1000) /
-        1000;
+        max(beatmap->getLengthPlayable() - min(breakTimeMS, beatmap->getLengthPlayable()), (unsigned long)1000) / 1000;
     const int difficultyMultiplier = (int)std::round(
         (beatmap->getSelectedDifficulty2()->getCS() + beatmap->getSelectedDifficulty2()->getHP() +
          beatmap->getSelectedDifficulty2()->getOD() +

+ 3 - 9
src/Engine/AnimationHandler.cpp

@@ -1,15 +1,10 @@
-//================ Copyright (c) 2012, PG, All rights reserved. =================//
-//
-// Purpose:		global fps independent animations
-//
-// $NoKeywords: $anim
-//===============================================================================//
-
 #include "AnimationHandler.h"
 
 #include "ConVar.h"
 #include "Engine.h"
 
+using namespace std;
+
 ConVar debug_anim("debug_anim", false, FCVAR_DEFAULT);
 
 AnimationHandler *anim = NULL;
@@ -177,8 +172,7 @@ void AnimationHandler::deleteExistingAnimation(float *base) {
 float AnimationHandler::getRemainingDuration(float *base) const {
     for(size_t i = 0; i < m_vAnimations.size(); i++) {
         if(m_vAnimations[i].m_fBase == base)
-            return max(0.0f,
-                            (m_vAnimations[i].m_fStartTime + m_vAnimations[i].m_fDuration) - (float)engine->getTime());
+            return max(0.0f, (m_vAnimations[i].m_fStartTime + m_vAnimations[i].m_fDuration) - (float)engine->getTime());
     }
 
     return 0.0f;

+ 2 - 8
src/Engine/Engine.cpp

@@ -14,6 +14,7 @@
 #include "Keyboard.h"
 #include "Mouse.h"
 #include "NetworkHandler.h"
+#include "Osu.h"
 #include "Profiler.h"
 #include "ResourceManager.h"
 #include "SoundEngine.h"
@@ -21,14 +22,7 @@
 #include "VisualProfiler.h"
 #include "XInputGamepad.h"
 
-//********************//
-//	Include App here  //
-//********************//
-
-#include "Osu.h"
-// #include "GUICoherenceMode.h"
-// #include "Asteroids.h"
-// #include "FrameworkTest.h"
+using namespace std;
 
 class EngineLoadingScreenApp : public App {
    public:

+ 3 - 9
src/Engine/Input/Mouse.cpp

@@ -1,10 +1,3 @@
-//================ Copyright (c) 2015, PG, All rights reserved. =================//
-//
-// Purpose:		mouse wrapper
-//
-// $NoKeywords: $mouse
-//===============================================================================//
-
 #include "Mouse.h"
 
 #include "ConVar.h"
@@ -12,6 +5,8 @@
 #include "Environment.h"
 #include "ResourceManager.h"
 
+using namespace std;
+
 ConVar debug_mouse("debug_mouse", false, FCVAR_LOCKED);
 
 ConVar mouse_sensitivity("mouse_sensitivity", 1.0f, FCVAR_DEFAULT);
@@ -239,8 +234,7 @@ void Mouse::update() {
     // first person games which call engine->getMouse()->setPos() every frame to manually re-center the cursor NEVER
     // need env->setPos() absolute input NEVER needs env->setPos() also update prevOsMousePos
     if(windowRect.contains(osMousePos) && (sensitivityAdjustmentNeeded || mouse_raw_input.getBool()) &&
-       !m_bSetPosWasCalledLastFrame && !m_bAbsolute &&
-       env->getOS() != Environment::OS::LINUX)  // HACKHACK: linux hack
+       !m_bSetPosWasCalledLastFrame && !m_bAbsolute && env->getOS() != Environment::OS::LINUX)  // HACKHACK: linux hack
     {
         const Vector2 newOsMousePos = m_vPosWithoutOffset;
 

+ 3 - 28
src/Engine/Main/main_Windows.cpp

@@ -7,10 +7,10 @@
 #define WINVER 0x0A00  // Windows 10, to enable the ifdefs in winuser.h for touch
 #endif
 
-#include "cbase.h"
-
 #include <dwmapi.h>
 
+#include "cbase.h"
+
 // NEXTRAWINPUTBLOCK macro requires this
 typedef uint64_t QWORD;
 
@@ -831,7 +831,7 @@ HWND createWinWindow(HINSTANCE hInstance) {
 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
 #ifdef _MSC_VER
     // When building with MSVC, vprintf() is not returning the correct value unless we have a console allocated.
-    FILE* dummy;
+    FILE *dummy;
 #ifdef _DEBUG
     AllocConsole();
     freopen_s(&dummy, "CONOUT$", "w", stdout);
@@ -1193,31 +1193,6 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
             }
         }
 
-        // IPC (2)
-        /*
-                        if (ipcSharedMemory != NULL && ((IPCState*)ipcSharedMemory)->state == IPC_STATE::MESSAGE)
-                        {
-                                g_engine->debugLog("IPC: Received message @ %f\n", g_engine->getTime());
-
-                                switch (((IPCState*)ipcSharedMemory)->type)
-                                {
-                                case IPC_MESSAGE_TYPE::URL:
-                                        char *content = (((char*)ipcSharedMemory) + sizeof(IPCState));
-                                        const size_t length = min(strlen(content), sharedMemorySize -
-           sizeof(IPCState) - 2); const UString ustring = UString(content, length);
-
-                                        g_engine->debugLog("IPC: Received URL %s\n", ustring.toUtf8());
-
-                                        if (ustring.find("mcengine://") == 0)
-                                                Console::processCommand(ustring.substr(11));
-
-                                        break;
-                                }
-
-                                ((IPCState*)ipcSharedMemory)->state = IPC_STATE::IDLE;
-                        }
-        */
-
         // update
         {
             deltaTimer->update();

+ 2 - 7
src/Engine/Platform/LinuxEnvironment.cpp

@@ -1,10 +1,3 @@
-//================ Copyright (c) 2015, PG, All rights reserved. =================//
-//
-// Purpose:		linux
-//
-// $NoKeywords: $linuxenv
-//===============================================================================//
-
 #ifdef __linux__
 
 #include "LinuxEnvironment.h"
@@ -26,6 +19,8 @@
 #include "LinuxContextMenu.h"
 #include "LinuxGLLegacyInterface.h"
 
+using namespace std;
+
 typedef struct {
     unsigned long flags;
     unsigned long functions;

+ 6 - 5
src/Engine/Platform/WinEnvironment.cpp

@@ -1,14 +1,12 @@
 #ifdef _WIN32
 
-#include "cbase.h"
-
 #include "WinEnvironment.h"
 
+#include <Commdlg.h>
 #include <Lmcons.h>
 #include <Shlobj.h>
-#include <tchar.h>
-#include <Commdlg.h>
 #include <shellapi.h>
+#include <tchar.h>
 
 #include <filesystem>
 #include <string>
@@ -20,6 +18,9 @@
 #include "WinContextMenu.h"
 #include "WinGL3Interface.h"
 #include "WinGLLegacyInterface.h"
+#include "cbase.h"
+
+using namespace std;
 
 bool g_bCursorVisible = true;
 
@@ -302,7 +303,7 @@ std::vector<std::string> WinEnvironment::getFoldersInFolder(std::string folder)
     std::wstring buffer;
     std::vector<std::string> folders;
 
-	int size = MultiByteToWideChar(CP_UTF8, 0, folder.c_str(), folder.length(), NULL, 0);
+    int size = MultiByteToWideChar(CP_UTF8, 0, folder.c_str(), folder.length(), NULL, 0);
     std::wstring wfolder(size, 0);
     MultiByteToWideChar(CP_UTF8, 0, folder.c_str(), folder.length(), (LPWSTR)wfolder.c_str(), wfolder.length());
 

+ 2 - 7
src/Engine/Renderer/OpenGL3Interface.cpp

@@ -1,10 +1,3 @@
-//================ Copyright (c) 2017, PG, All rights reserved. =================//
-//
-// Purpose:		raw opengl 3.x graphics interface
-//
-// $NoKeywords: $gl3i
-//===============================================================================//
-
 #include "OpenGL3Interface.h"
 
 #ifdef MCENGINE_FEATURE_OPENGL
@@ -19,6 +12,8 @@
 #include "OpenGLRenderTarget.h"
 #include "OpenGLShader.h"
 
+using namespace std;
+
 OpenGL3Interface::OpenGL3Interface() : Graphics() {
     // renderer
     m_bInScene = false;

+ 2 - 7
src/Engine/Renderer/OpenGL3VertexArrayObject.cpp

@@ -1,10 +1,3 @@
-//================ Copyright (c) 2017, PG, All rights reserved. =================//
-//
-// Purpose:		OpenGL baking support for vao
-//
-// $NoKeywords: $glvao
-//===============================================================================//
-
 #include "OpenGL3VertexArrayObject.h"
 
 #ifdef MCENGINE_FEATURE_OPENGL
@@ -13,6 +6,8 @@
 #include "OpenGL3Interface.h"
 #include "OpenGLHeaders.h"
 
+using namespace std;
+
 OpenGL3VertexArrayObject::OpenGL3VertexArrayObject(Graphics::PRIMITIVE primitive, Graphics::USAGE_TYPE usage,
                                                    bool keepInSystemMemory)
     : VertexArrayObject(primitive, usage, keepInSystemMemory) {

+ 2 - 7
src/Engine/Renderer/OpenGLVertexArrayObject.cpp

@@ -1,10 +1,3 @@
-//================ Copyright (c) 2017, PG, All rights reserved. =================//
-//
-// Purpose:		OpenGL baking support for vao
-//
-// $NoKeywords: $glvao
-//===============================================================================//
-
 #include "OpenGLVertexArrayObject.h"
 
 #ifdef MCENGINE_FEATURE_OPENGL
@@ -13,6 +6,8 @@
 #include "Engine.h"
 #include "OpenGLHeaders.h"
 
+using namespace std;
+
 ConVar r_opengl_legacy_vao_use_vertex_array(
     "r_opengl_legacy_vao_use_vertex_array", false, FCVAR_LOCKED,
     "dramatically reduces per-vao draw calls, but completely breaks legacy ffp draw calls (vertices work, but "

+ 6 - 3
src/Engine/ResourceManager.cpp

@@ -8,6 +8,8 @@
 #include "Environment.h"
 #include "Timer.h"
 
+using namespace std;
+
 static std::mutex g_resourceManagerMutex;             // internal lock for nested async loads
 static std::mutex g_resourceManagerLoadingWorkMutex;  // work vector lock across all threads
 
@@ -350,7 +352,8 @@ McFont *ResourceManager::loadFont(std::string filepath, std::string resourceName
     return fnt;
 }
 
-Sound *ResourceManager::loadSoundAbs(std::string filepath, std::string resourceName, bool stream, bool overlayable, bool loop) {
+Sound *ResourceManager::loadSoundAbs(std::string filepath, std::string resourceName, bool stream, bool overlayable,
+                                     bool loop) {
     // check if it already exists
     if(resourceName.length() > 0) {
         Resource *temp = checkIfExistsAndHandle(resourceName);
@@ -533,8 +536,8 @@ void ResourceManager::loadResource(Resource *res, bool load) {
                 work.threadIndex = MobileAtomicSizeT(threadIndex);
                 work.done = MobileAtomicBool(false);
 
-                threadIndexCounter = (threadIndexCounter + 1) %
-                                     (min(m_threads.size(), (size_t)max(rm_numthreads.getInt(), 1)));
+                threadIndexCounter =
+                    (threadIndexCounter + 1) % (min(m_threads.size(), (size_t)max(rm_numthreads.getInt(), 1)));
 
                 g_resourceManagerLoadingWorkMutex.lock();
                 {

+ 9 - 11
src/Engine/Sound.cpp

@@ -10,6 +10,8 @@
 #include "ResourceManager.h"
 #include "SoundEngine.h"
 
+using namespace std;
+
 ConVar snd_play_interp_duration(
     "snd_play_interp_duration", 0.75f, FCVAR_DEFAULT,
     "smooth over freshly started channel position jitter with engine time over this duration in seconds");
@@ -108,7 +110,8 @@ void Sound::initAsync() {
     // On Windows, we need to convert the UTF-8 path to UTF-16, or paths with unicode characters will fail to open
     int size = MultiByteToWideChar(CP_UTF8, 0, m_sFilePath.c_str(), m_sFilePath.length(), NULL, 0);
     std::wstring file_path(size, 0);
-    MultiByteToWideChar(CP_UTF8, 0, m_sFilePath.c_str(), m_sFilePath.length(), (LPWSTR)file_path.c_str(), file_path.length());
+    MultiByteToWideChar(CP_UTF8, 0, m_sFilePath.c_str(), m_sFilePath.length(), (LPWSTR)file_path.c_str(),
+                        file_path.length());
 #else
     std::string file_path = m_sFilePath;
 #endif
@@ -192,9 +195,7 @@ void Sound::destroy() {
     }
 }
 
-void Sound::setPosition(double percent) {
-    return setPositionMS(clamp<f64>(percent, 0.0, 1.0) * m_length);
-}
+void Sound::setPosition(double percent) { return setPositionMS(clamp<f64>(percent, 0.0, 1.0) * m_length); }
 
 void Sound::setPositionMS(unsigned long ms) {
     if(!m_bReady || ms > getLengthMS()) return;
@@ -223,7 +224,8 @@ void Sound::setPositionMS(unsigned long ms) {
     if(pos <= ms) {
         // Lucky path, we can just seek forward and be done
         if(isPlaying()) {
-            if(!BASS_Mixer_ChannelSetPosition(m_stream, target_pos, BASS_POS_BYTE | BASS_POS_DECODETO | BASS_POS_MIXER_RESET)) {
+            if(!BASS_Mixer_ChannelSetPosition(m_stream, target_pos,
+                                              BASS_POS_BYTE | BASS_POS_DECODETO | BASS_POS_MIXER_RESET)) {
                 if(Osu::debug->getBool()) {
                     debugLog("Sound::setPositionMS( %lu ) BASS_ChannelSetPosition() error %i on file %s\n", ms,
                              BASS_ErrorGetCode(), m_sFilePath.c_str());
@@ -431,13 +433,9 @@ float Sound::getFrequency() {
     return frequency;
 }
 
-bool Sound::isPlaying() {
-    return m_bReady && m_bStarted && !m_bPaused && !getActiveChannels().empty();
-}
+bool Sound::isPlaying() { return m_bReady && m_bStarted && !m_bPaused && !getActiveChannels().empty(); }
 
-bool Sound::isFinished() {
-    return m_bReady && m_bStarted && !isPlaying();
-}
+bool Sound::isFinished() { return m_bReady && m_bStarted && !isPlaying(); }
 
 void Sound::rebuild(std::string newFilePath) {
     m_sFilePath = newFilePath;

+ 2 - 7
src/Engine/TextureAtlas.cpp

@@ -1,15 +1,10 @@
-//================ Copyright (c) 2017, PG, All rights reserved. =================//
-//
-// Purpose:		container for dynamically merging multiple images into one
-//
-// $NoKeywords: $imgtxat
-//===============================================================================//
-
 #include "TextureAtlas.h"
 
 #include "Engine.h"
 #include "ResourceManager.h"
 
+using namespace std;
+
 TextureAtlas::TextureAtlas(int width, int height) : Resource() {
     m_iWidth = width;
     m_iHeight = height;

+ 2 - 7
src/Engine/VertexArrayObject.cpp

@@ -1,14 +1,9 @@
-//================ Copyright (c) 2016, PG, All rights reserved. =================//
-//
-// Purpose:		modern opengl style mesh wrapper (vertices, texcoords, etc.)
-//
-// $NoKeywords: $vao
-//===============================================================================//
-
 #include "VertexArrayObject.h"
 
 #include "Engine.h"
 
+using namespace std;
+
 VertexArrayObject::VertexArrayObject(Graphics::PRIMITIVE primitive, Graphics::USAGE_TYPE usage, bool keepInSystemMemory)
     : Resource() {
     m_primitive = primitive;

+ 2 - 7
src/GUI/CBaseUIContainer.cpp

@@ -1,14 +1,9 @@
-//================ Copyright (c) 2011, PG, All rights reserved. =================//
-//
-// Purpose:		a container for UI elements
-//
-// $NoKeywords: $
-//===============================================================================//
-
 #include "CBaseUIContainer.h"
 
 #include "Engine.h"
 
+using namespace std;
+
 CBaseUIContainer::CBaseUIContainer(float Xpos, float Ypos, float Xsize, float Ysize, UString name)
     : CBaseUIElement(Xpos, Ypos, Xsize, Ysize, name) {}
 

+ 2 - 7
src/GUI/CBaseUIContainerBase.cpp

@@ -1,14 +1,9 @@
-/*
- * CBaseUIContainerBase.cpp
- *
- *  Created on: May 31, 2017
- *      Author: Psy
- */
-
 #include "CBaseUIContainerBase.h"
 
 #include "Engine.h"
 
+using namespace std;
+
 CBaseUIContainerBase::CBaseUIContainerBase(UString name) : CBaseUIElement(0, 0, 0, 0, name) { m_bClipping = false; }
 
 CBaseUIContainerBase::~CBaseUIContainerBase() {}

+ 7 - 16
src/GUI/CBaseUIScrollView.cpp

@@ -1,10 +1,3 @@
-//================ Copyright (c) 2013, PG, All rights reserved. =================//
-//
-// Purpose:		smooth kinetic scrolling container
-//
-// $NoKeywords: $
-//===============================================================================//
-
 // TODO: refactor the spaghetti parts, this can be done way more elegantly
 
 #include "CBaseUIScrollView.h"
@@ -17,6 +10,8 @@
 #include "Mouse.h"
 #include "ResourceManager.h"
 
+using namespace std;
+
 ConVar ui_scrollview_resistance("ui_scrollview_resistance", 5.0f, FCVAR_DEFAULT,
                                 "how many pixels you have to pull before you start scrolling");
 ConVar ui_scrollview_scrollbarwidth("ui_scrollview_scrollbarwidth", 15.0f, FCVAR_DEFAULT);
@@ -110,12 +105,9 @@ void CBaseUIScrollView::draw(Graphics *g) {
 
     // draw elements & scrollbars
     if(m_bHorizontalClipping || m_bVerticalClipping) {
-        auto clip_rect = McRect(
-            m_bHorizontalClipping ? m_vPos.x + 1 : 0,
-            m_bVerticalClipping ? m_vPos.y + 2 : 0,
-            m_bHorizontalClipping ? m_vSize.x - 1 : engine->getScreenWidth(),
-            m_bVerticalClipping ? m_vSize.y - 1 : engine->getScreenHeight()
-        );
+        auto clip_rect = McRect(m_bHorizontalClipping ? m_vPos.x + 1 : 0, m_bVerticalClipping ? m_vPos.y + 2 : 0,
+                                m_bHorizontalClipping ? m_vSize.x - 1 : engine->getScreenWidth(),
+                                m_bVerticalClipping ? m_vSize.y - 1 : engine->getScreenHeight());
         g->pushClipRect(clip_rect);
     }
     {
@@ -527,9 +519,8 @@ void CBaseUIScrollView::updateScrollbars() {
         const float verticalPercent = clamp<float>(rawVerticalPercent, 0.0f, 1.0f);
 
         const float verticalHeightPercent = (m_vSize.y - (verticalBlockWidth * 2)) / m_vScrollSize.y;
-        const float verticalBlockHeight =
-            clamp<float>(max(verticalHeightPercent * m_vSize.y, verticalBlockWidth) * overscroll,
-                         verticalBlockWidth, m_vSize.y);
+        const float verticalBlockHeight = clamp<float>(
+            max(verticalHeightPercent * m_vSize.y, verticalBlockWidth) * overscroll, verticalBlockWidth, m_vSize.y);
 
         m_verticalScrollbar =
             McRect(m_vPos.x + m_vSize.x - (verticalBlockWidth * m_fScrollbarSizeMultiplier),

+ 2 - 7
src/GUI/CBaseUISlider.cpp

@@ -1,10 +1,3 @@
-//================ Copyright (c) 2012, PG, All rights reserved. =================//
-//
-// Purpose:		a simple slider
-//
-// $NoKeywords: $
-//===============================================================================//
-
 #include "CBaseUISlider.h"
 
 #include "AnimationHandler.h"
@@ -12,6 +5,8 @@
 #include "Keyboard.h"
 #include "Mouse.h"
 
+using namespace std;
+
 CBaseUISlider::CBaseUISlider(float xPos, float yPos, float xSize, float ySize, UString name)
     : CBaseUIElement(xPos, yPos, xSize, ySize, name) {
     grabs_clicks = true;

+ 2 - 7
src/GUI/CBaseUITextbox.cpp

@@ -1,10 +1,3 @@
-//================ Copyright (c) 2015, PG, All rights reserved. =================//
-//
-// Purpose:		a not so simple textbox, revision 4
-//
-// $NoKeywords: $
-//===============================================================================//
-
 // TODO: support SHIFT + LEFT/RIGHT selection adjustments
 // TODO: support CTRL + LEFT/RIGHT word caret jumping (to next space)
 // TODO: support both SHIFT + CTRL + LEFT/RIGHT selection word jumping
@@ -21,6 +14,8 @@
 #include "Mouse.h"
 #include "ResourceManager.h"
 
+using namespace std;
+
 ConVar ui_textbox_caret_blink_time("ui_textbox_caret_blink_time", 0.5f, FCVAR_DEFAULT);
 ConVar ui_textbox_text_offset_x("ui_textbox_text_offset_x", 3, FCVAR_DEFAULT);
 

+ 2 - 7
src/GUI/CBaseUIWindow.cpp

@@ -1,10 +1,3 @@
-//================ Copyright (c) 2014, PG, All rights reserved. =================//
-//
-// Purpose:		base class for windows
-//
-// $NoKeywords: $
-//===============================================================================//
-
 #include "CBaseUIWindow.h"
 
 #include "AnimationHandler.h"
@@ -19,6 +12,8 @@
 #include "RenderTarget.h"
 #include "ResourceManager.h"
 
+using namespace std;
+
 ConVar ui_window_animspeed("ui_window_animspeed", 0.29f, FCVAR_DEFAULT);
 ConVar ui_window_shadow_radius("ui_window_shadow_radius", 13.0f, FCVAR_DEFAULT);
 

+ 6 - 11
src/GUI/Windows/ConsoleBox.cpp

@@ -1,10 +1,3 @@
-//================ Copyright (c) 2011, PG, All rights reserved. =================//
-//
-// Purpose:		textbox + scrollview command suggestion list
-//
-// $NoKeywords: $
-//===============================================================================//
-
 #include "ConsoleBox.h"
 
 #include "AnimationHandler.h"
@@ -21,6 +14,8 @@
 #include "Mouse.h"
 #include "ResourceManager.h"
 
+using namespace std;
+
 ConVar showconsolebox("showconsolebox");
 
 ConVar consolebox_animspeed("consolebox_animspeed", 12.0f, FCVAR_DEFAULT);
@@ -85,10 +80,10 @@ class ConsoleBoxSuggestionButton : public CBaseUIButton {
 
                 g->pushTransform();
                 {
-                    const float scale = min(
-                        1.0f, (max(1.0f, m_consoleBox->getTextbox()->getSize().x - m_fStringWidth -
-                                                  helpTextOffset * 1.5f - helpTextSeparatorStringWidth * 1.5f)) /
-                                  (float)helpTextStringWidth);
+                    const float scale =
+                        min(1.0f, (max(1.0f, m_consoleBox->getTextbox()->getSize().x - m_fStringWidth -
+                                                 helpTextOffset * 1.5f - helpTextSeparatorStringWidth * 1.5f)) /
+                                      (float)helpTextStringWidth);
 
                     g->scale(scale, scale);
                     g->translate((int)(m_vPos.x + m_fStringWidth + helpTextOffset * scale / 2 +

+ 2 - 7
src/GUI/Windows/VinylScratcher/VSTitleBar.cpp

@@ -1,10 +1,3 @@
-//================ Copyright (c) 2014, PG, All rights reserved. =================//
-//
-// Purpose:		3D flip bar used for music scrolling/searching/play history
-//
-// $NoKeywords: $
-//===============================================================================//
-
 #include "VSTitleBar.h"
 
 #include "AnimationHandler.h"
@@ -15,6 +8,8 @@
 #include "Mouse.h"
 #include "ResourceManager.h"
 
+using namespace std;
+
 ConVar vs_percent("vs_percent", 0.0f, FCVAR_DEFAULT);
 
 class VSTitleBarButton : public CBaseUIButton {

+ 2 - 7
src/GUI/Windows/VinylScratcher/VinylScratcher.cpp

@@ -1,10 +1,3 @@
-//================ Copyright (c) 2014, PG, All rights reserved. =================//
-//
-// Purpose:		a music player with style
-//
-// $NoKeywords: $vs
-//===============================================================================//
-
 #include "VinylScratcher.h"
 
 #include "AnimationHandler.h"
@@ -20,6 +13,8 @@
 #include "VSMusicBrowser.h"
 #include "VSTitleBar.h"
 
+using namespace std;
+
 Sound *VinylScratcher::m_stream2 = NULL;
 
 VinylScratcher::VinylScratcher() : CBaseUIWindow(220, 90, 1000, 700, "Vinyl Scratcher") {

+ 2 - 7
src/GUI/Windows/VisualProfiler.cpp

@@ -1,10 +1,3 @@
-//================ Copyright (c) 2020, PG, All rights reserved. =================//
-//
-// Purpose:		vprof gui overlay
-//
-// $NoKeywords: $vprof
-//===============================================================================//
-
 #include "VisualProfiler.h"
 
 #include <string.h>
@@ -19,6 +12,8 @@
 #include "ResourceManager.h"
 #include "SoundEngine.h"
 
+using namespace std;
+
 ConVar vprof_graph("vprof_graph", true, FCVAR_DEFAULT, "whether to draw the graph when the overlay is enabled");
 ConVar vprof_graph_height("vprof_graph_height", 250.0f, FCVAR_DEFAULT);
 ConVar vprof_graph_width("vprof_graph_width", 800.0f, FCVAR_DEFAULT);

+ 2 - 0
src/Util/Rect.cpp

@@ -2,6 +2,8 @@
 
 #include "cbase.h"
 
+using namespace std;
+
 McRect::McRect(float x, float y, float width, float height, bool isCentered) { set(x, y, width, height, isCentered); }
 
 McRect::McRect(Vector2 pos, Vector2 size, bool isCentered) { set(pos.x, pos.y, size.x, size.y, isCentered); }

+ 2 - 14
src/Util/cbase.h

@@ -1,12 +1,14 @@
 #pragma once
 
 #ifdef _WIN32
+// clang-format off
 #define NOMINMAX
 #define WIN32_LEAN_AND_MEAN
 #include <winsock2.h>
 #include <windows.h>
 #include <shlwapi.h> // for StrStrIA
 #include <wincrypt.h> // for random number generation
+// clang-format on
 #endif
 
 // STD INCLUDES
@@ -54,15 +56,6 @@
 #ifndef PATH_MAX
 #define PATH_MAX MAX_PATH
 #endif
-#ifndef max
-#define max(...) std::max(__VA_ARGS__)
-#endif
-#ifndef min
-#define min(...) std::min(__VA_ARGS__)
-#endif
-#ifndef pow
-#define pow(...) std::pow(__VA_ARGS__)
-#endif
 
 typedef unsigned char COLORPART;
 
@@ -121,11 +114,6 @@ typedef unsigned char COLORPART;
 
 // UTIL
 
-template <class T>
-inline T clamp(T x, T a, T b) {
-    return x < a ? a : (x > b ? b : x);
-}
-
 template <class T>
 inline T lerp(T x1, T x2, T percent) {
     return x1 * (1 - percent) + x2 * percent;