aboutsummaryrefslogtreecommitdiff
path: root/src/GameTick.cpp
diff options
context:
space:
mode:
authorNguyễn Gia Phong <mcsinyx@disroot.org>2021-10-02 17:32:23 +0700
committerNguyễn Gia Phong <mcsinyx@disroot.org>2021-10-02 17:32:23 +0700
commit4aeff0886aa61ed3834ef4826aa1a1f3e99508b1 (patch)
tree0be178818e4ed9de7e70872c224ce73adaba8f6a /src/GameTick.cpp
parent7a4fdb3978c36e4309479806140f38669bcd3883 (diff)
downloadblackshades-4aeff0886aa61ed3834ef4826aa1a1f3e99508b1.tar.gz
Clean up unused functions and style2.4.0
Diffstat (limited to 'src/GameTick.cpp')
-rw-r--r--src/GameTick.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/GameTick.cpp b/src/GameTick.cpp
index 4e75895..fd9dad5 100644
--- a/src/GameTick.cpp
+++ b/src/GameTick.cpp
@@ -21,9 +21,13 @@
//
// You should have received a copy of the GNU General Public License
// along with Black Shades. If not, see <https://www.gnu.org/licenses/>.
+//
+#include <algorithm>
+#include <fstream>
-#include "Game.h"
#include "misc.h"
+#include "Game.h"
+#include "Support.h"
extern float multiplier;
extern int thirdperson;
@@ -90,7 +94,7 @@ void Game::saveHighScore()
if (score > highscore) {
highscore = score;
/* TODO */
- ofstream opstream("highscore.txt");
+ std::ofstream opstream("highscore.txt");
opstream << highscore;
opstream << "\n";
opstream << beatgame;
@@ -341,7 +345,7 @@ void look(Game* game, double xpos, double ypos)
player.playerrotation = 180 - camera.rotation;
camera.rotation2 = camera.rotation2 * 0.7 + camera.oldrotation2 * 0.3;
- camera.rotation2 = min(max(camera.rotation2, -89.0f), 89.0f);
+ camera.rotation2 = std::min(std::max(camera.rotation2, -89.0f), 89.0f);
camera.oldrotation2 = camera.rotation2;
if (game->zoom || visions || player.aimamount <= 0
@@ -351,10 +355,10 @@ void look(Game* game, double xpos, double ypos)
camera.visrotation = camera.rotation;
camera.visrotation2 = camera.rotation2;
} else {
- camera.visrotation = min(camera.rotation + 7,
- max(camera.rotation - 7, camera.visrotation));
- camera.visrotation2 = min(camera.rotation2 + 15,
- max(camera.rotation2 - 15, camera.visrotation2));
+ camera.visrotation = std::min(camera.rotation + 7,
+ std::max(camera.rotation - 7, camera.visrotation));
+ camera.visrotation2 = std::min(camera.rotation2 + 15,
+ std::max(camera.rotation2 - 15, camera.visrotation2));
}
}