]> git.jsancho.org Git - lugaru.git/blobdiff - Source/GameDraw.cpp
Fixed a few ifs
[lugaru.git] / Source / GameDraw.cpp
index 3374fbd7c864ab6e02880b8742e537023e549d04..8f33c0cbe8338fdd448b2535fff063a8204cf602 100644 (file)
@@ -237,10 +237,11 @@ int Game::DrawGLScene(StereoSide side)
 
         static XYZ terrainlight;
         static float distance;
-        if (drawmode == normalmode)
+        if (drawmode == normalmode) {
             Game::ReSizeGLScene(90, .1f);
-        if (drawmode != normalmode)
+        } else {
             glViewport(0, 0, texviewwidth, texviewheight);
+        }
         glDepthFunc(GL_LEQUAL);
         glDepthMask(1);
         glAlphaFunc(GL_GREATER, 0.0001f);
@@ -286,9 +287,10 @@ int Game::DrawGLScene(StereoSide side)
         else
             blurness -= multiplier * 5;
 
-        if (environment == desertenvironment && detail == 2)
-            glTexEnvf( GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS, blurness + .4 );
         if (environment == desertenvironment) {
+            if (detail == 2) {
+                glTexEnvf( GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS, blurness + .4 );
+            }
             glRotatef((float)(abs(Random() % 100)) / 1000, 1, 0, 0);
             glRotatef((float)(abs(Random() % 100)) / 1000, 0, 1, 0);
         }
@@ -1331,19 +1333,6 @@ int Game::DrawGLScene(StereoSide side)
             glDepthMask(1);
         }
 
-        if (!console) {
-            displaytime[0] = 0;
-            glEnable(GL_TEXTURE_2D);
-            glColor4f(1, 1, 1, 1);
-            for (unsigned i = 1; i < 15; i++)
-                if (displaytime[i] < 4)
-                    for (unsigned j = 0; j < displaytext[i].size(); j++) {
-                        glColor4f(1, 1, 1, 4 - displaytime[i]);
-                        string = std::string(1, displaytext[i][j]);
-                        text->glPrint(30 + j * 10, 30 + i * 20 + (screenheight - 330), string, 0, 1, screenwidth, screenheight);
-                    }
-        }
-
         if (difficulty < 2 && !Dialog::inDialog()) { // minimap
             float mapviewdist = 20000;
 
@@ -1870,11 +1859,9 @@ int Game::DrawGLScene(StereoSide side)
             if (consoleblink) {
                 text->glPrint(30 + (float)(consoleselected) * 10 - offset * 10, 30, "_", 0, 1, 1024, 768);
             }
-            for (unsigned i = 0; i < 15; i++)
-                for (unsigned j = 0; j < consoletext[i].size(); j++) {
-                    glColor4f(1, 1, 1, 1 - (float)(i) / 16);
-                    text->glPrint(30 + j * 10 - offset * 10, 30 + i * 20, std::string(1, consoletext[i][j]), 0, 1, 1024, 768);
-                }
+            for (unsigned i = 0; i < 15; i++) {
+                text->glPrint(30 - offset * 10, 30 + i * 20, consoletext[i], 0, 1, 1024, 768);
+            }
         }
     }