]> git.jsancho.org Git - lugaru.git/blobdiff - Source/GameDraw.cpp
Cleaned a bit flashing by using a function
[lugaru.git] / Source / GameDraw.cpp
index f6d59539af1734216507ad36c6d5b5324ec59411..4994b1184b92c6b72763d7c694660bba05fe65d0 100644 (file)
@@ -29,9 +29,7 @@ extern int environment;
 extern float texscale;
 extern Light light;
 extern Terrain terrain;
-//extern Sprites sprites;
 extern float multiplier;
-extern float sps;
 extern float viewdistance;
 extern float fadestart;
 extern float screenwidth, screenheight;
@@ -61,20 +59,12 @@ extern int netstate;
 extern float motionbluramount;
 extern bool isclient;
 extern bool alwaysblur;
-extern int test;
-extern bool tilt2weird;
-extern bool tiltweird;
-extern bool midweird;
-extern bool proportionweird;
-extern bool vertexweird[6];
 extern bool velocityblur;
 extern bool debugmode;
 extern int mainmenu;
 extern int bloodtoggle;
 extern int difficulty;
 extern bool decals;
-// MODIFIED GWC
-//extern int texdetail;
 extern float texdetail;
 extern bool musictoggle;
 extern int tutoriallevel;
@@ -97,8 +87,6 @@ extern int currenthotspot;;
 extern bool campaign;
 extern bool winfreeze;
 
-extern float menupulse;
-
 extern bool gamestart;
 
 extern bool gamestarted;
@@ -119,13 +107,13 @@ enum drawmodes {
     realmotionblurmode, doublevisionmode, glowmode,
 };
 
-void Game::flash()   // shouldn't be that way, these should be attributes and Person class should not change rendering.
+void Game::flash(float amount, int delay)   // shouldn't be that way, these should be attributes and Person class should not change rendering.
 {
     flashr = 1;
     flashg = 0;
     flashb = 0;
-    flashamount = 1;
-    flashdelay = 1;
+    flashamount = amount;
+    flashdelay = delay;
 }
 
 void DrawMenu();
@@ -417,18 +405,6 @@ int Game::DrawGLScene(StereoSide side)
 
         glEnable(GL_COLOR_MATERIAL);
 
-        test = 2;
-        tilt2weird = 0;
-        tiltweird = 0;
-        midweird = 0;
-        proportionweird = 0;
-        vertexweird[0] = 0;
-        vertexweird[1] = 0;
-        vertexweird[2] = 0;
-        vertexweird[3] = 0;
-        vertexweird[4] = 0;
-        vertexweird[5] = 0;
-
         if (!cellophane) {
             glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
             glEnable(GL_CULL_FACE);
@@ -914,8 +890,8 @@ int Game::DrawGLScene(StereoSide side)
                 text->glPrint(screenwidth / 2 - 7.6 * strlen(string2)*screenwidth / 1024 * .8, 0 + screenheight * 1 / 10 - 20 * .8 * screenwidth / 1024, string2, 1, 1.5 * screenwidth / 1024 * .8, screenwidth, screenheight);
                 text->glPrint(screenwidth / 2 - 7.6 * strlen(string3)*screenwidth / 1024 * .8, 0 + screenheight * 1 / 10 - 40 * .8 * screenwidth / 1024, string3, 1, 1.5 * screenwidth / 1024 * .8, screenwidth, screenheight);
             }
-            //Hot spots
 
+            //Hot spots
             if (numhotspots && (bonustime >= 1 || bonus <= 0 || bonustime < 0) && !tutoriallevel) {
                 float closestdist = -1;
                 float distance = 0;
@@ -1483,11 +1459,9 @@ int Game::DrawGLScene(StereoSide side)
 
             float maxdistance = 0;
             float tempdist;
-            //~ int whichclosest;
             for (int i = 0; i < objects.numobjects; i++) {
                 tempdist = distsq(&center, &objects.position[i]);
                 if (tempdist > maxdistance) {
-                    //~ whichclosest=i;
                     maxdistance = tempdist;
                 }
             }
@@ -1495,7 +1469,6 @@ int Game::DrawGLScene(StereoSide side)
                 if (!Person::players[i]->dead) {
                     tempdist = distsq(&center, &Person::players[i]->coords);
                     if (tempdist > maxdistance) {
-                        //~ whichclosest=i;
                         maxdistance = tempdist;
                     }
                 }