]> git.mxchange.org Git - quix0rs-blobwars.git/blobdiff - src/CGame.cpp
Added .gitignore to ignore certain files + fixed access rights on Makefile* as
[quix0rs-blobwars.git] / src / CGame.cpp
index a5fa060eb739dcc54bac2e2d7b04446c942f9021..666f1eca9e3700f2bdeb94fd1127cad300f5baca 100644 (file)
@@ -1,5 +1,6 @@
 /*
-Copyright (C) 2004 Parallel Realities
+Copyright (C) 2004-2011 Parallel Realities
+Copyright (C) 2011-2015 Perpendicular Dimensions
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -29,16 +30,6 @@ Game::Game()
 
        gore = 1;
        skill = 1;
-#ifdef SDL_FRAMEWORK
-       float r,g,b;
-       if (SDL_GetGamma(&r, &g, &b) != -1) {
-               if (r != g || g != b) {
-                       brightness = -1;
-               } else {
-                       brightness = 10 * r;
-               }
-       }
-#endif
 
        clear();
 }
@@ -66,8 +57,8 @@ void Game::clear()
                bulletsHit[i] = bulletsFired[i] = 0;
        }
 
-       strncpy(mapName, "data/grasslands1", sizeof mapName);
-       strncpy(stageName, "Grasslands", sizeof stageName);
+       strlcpy(mapName, "data/grasslands1", sizeof mapName);
+       strlcpy(stageName, "Grasslands", sizeof stageName);
 
        continuesUsed = 0;
        levelsStarted = 0;
@@ -117,7 +108,7 @@ void Game::setCheckPoint(float x, float y)
        checkPointY = (int)y;
 }
 
-void Game::getCheckPoint(float *x, float *y)
+void Game::getCheckPoint(float *x, float *y) const
 {
        *x = checkPointX;
        *y = checkPointY;
@@ -159,7 +150,7 @@ int Game::getWeaponAccuracy(int weapon)
        return 0;
 }
 
-int Game::getTotalBulletsFired()
+int Game::getTotalBulletsFired() const
 {
        return bulletsFired[0] + bulletsFired[1] + bulletsFired[2] + bulletsFired[3] + bulletsFired[4];
 }
@@ -221,12 +212,12 @@ void Game::totalUpStats()
 
 void Game::setStageName(const char *name)
 {
-       strncpy(stageName, name, sizeof stageName);
+       strlcpy(stageName, name, sizeof stageName);
 }
 
 void Game::setMapName(const char *name)
 {
-       strncpy(mapName, name, sizeof mapName);
+       strlcpy(mapName, name, sizeof mapName);
 }
 
 void Game::setMissionOver(int reason)