diff options
Diffstat (limited to 'src/GameDraw.cpp')
-rw-r--r-- | src/GameDraw.cpp | 112 |
1 files changed, 11 insertions, 101 deletions
diff --git a/src/GameDraw.cpp b/src/GameDraw.cpp index a3d9fe7..471786d 100644 --- a/src/GameDraw.cpp +++ b/src/GameDraw.cpp @@ -42,7 +42,7 @@ extern Decals decals; void Game::DrawGLScene(void) { //Main menu - if (mainmenu == 1) { + if (this->menu) { //Setup fast sine fluctuation sinefluct=sin(sinefluctprog); sinefluctprog+=multiplier*1.5; @@ -425,106 +425,19 @@ void Game::DrawGLScene(void) glDepthMask(1); - //Text - + // Text glEnable(GL_TEXTURE_2D); + glColor4f(0.0f ,0.0f ,0.0f ,1.0f); + sprintf(string, gameinprogress ? "End Game" : "Quit"); + text.glPrint(197 - gameinprogress * 15, 87, string, 1, 1.5, 640, 480); - glColor4f(0,0,0,1); - - if(!gameinprogress)sprintf (string, "Quit"); - - if(gameinprogress)sprintf (string, "End Game"); - - text.glPrint(197-gameinprogress*15,87,string,1,1.5,640,480); - - //High score - - glColor4f(.5+sinefluct/5,0,0,1); - - if(!beatgame)sprintf (string, "High Score: %d", highscore); - - if(beatgame)sprintf (string, "High Score: %d *COMPLETED* Please vote for Black Shades at iDevGames.com!", highscore); - - text.glPrint(0,0,string,1,.8,640,480); - - //Mandatory udg text - - glColor4f(.3-sinefluct/20,.3-sinefluct/20,.3-sinefluct/20,1); - - sprintf (string, "uDevGame 2002 Entry - Visit iDevGames.com for more games!"); - - text.glPrint(500,750,string,1,.6,640,480); - - //Mouse (draw) - - glMatrixMode(GL_PROJECTION); // Select The Projection Matrix - - glPushMatrix(); // Store The Projection Matrix - - glLoadIdentity(); // Reset The Projection Matrix - - glOrtho(0,screenwidth,0,screenheight,-100,100); // Set Up An Ortho Screen - - glMatrixMode(GL_MODELVIEW); - - glDisable(GL_TEXTURE_2D); - - Point mouseloc; - - GetMouse(&mouseloc); - - mouseloc.v=screenheight-mouseloc.v; - - glColor4f(.1,0,0,1); - - float size=5; - - glBegin(GL_TRIANGLES); - - glVertex3f(mouseloc.h,mouseloc.v,0); - - glVertex3f(mouseloc.h+2*size,mouseloc.v-2*size,0); - - glVertex3f(mouseloc.h+.5*size,mouseloc.v-2*size,0); - - glEnd(); - - glColor4f(1,0,0,1); - - glBegin(GL_QUADS); - - glVertex3f(olddrawmouse.h,olddrawmouse.v,0); - - glVertex3f(mouseloc.h,mouseloc.v,0); - - glVertex3f(mouseloc.h+2*size,mouseloc.v-2*size,0); - - glVertex3f(olddrawmouse.h+2*size,olddrawmouse.v-2*size,0); - - glVertex3f(olddrawmouse.h,olddrawmouse.v,0); - - glVertex3f(mouseloc.h,mouseloc.v,0); - - glVertex3f(mouseloc.h+.5*size,mouseloc.v-2*size,0); - - glVertex3f(olddrawmouse.h+.5*size,olddrawmouse.v-2*size,0); - - glVertex3f(olddrawmouse.h+2*size,olddrawmouse.v-2*size,0); - - glVertex3f(mouseloc.h+2*size,mouseloc.v-2*size,0); - - glVertex3f(mouseloc.h+.5*size,mouseloc.v-2*size,0); - - glVertex3f(olddrawmouse.h+.5*size,olddrawmouse.v-2*size,0); - - glEnd(); - - glPopMatrix(); - - olddrawmouse=mouseloc; - - //Flash + // High score + glColor4f(0.5f + sinefluct / 5.0f, 0.0f, 0.0f, 1.0f); + sprintf(string, "High Score: %d%s", highscore, + beatgame ? " *COMPLETED*" : ""); + text.glPrint(0, 0, string, 1, 0.8, 640, 480); + // Flash if(flashamount>0){ if(flashamount>1)flashamount=1; @@ -592,9 +505,6 @@ void Game::DrawGLScene(void) glDepthMask(1); } } else { // in-game - // If flashing to fix menu bug, go back to menu after a frame - if (mainmenu == 2) - mainmenu = 1; glLoadIdentity(); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glEnable(GL_DEPTH_TEST); |