diff options
Diffstat (limited to 'src/GameTick.cpp')
-rw-r--r-- | src/GameTick.cpp | 18 |
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)); } } |