]> git.jsancho.org Git - lugaru.git/commitdiff
removing unused mainmenu values (11, 13 and 17)
authorCôme BERNIGAUD <come.bernigaud@gmail.com>
Sun, 6 Jun 2010 16:44:14 +0000 (18:44 +0200)
committerCôme BERNIGAUD <come.bernigaud@gmail.com>
Sun, 6 Jun 2010 16:44:14 +0000 (18:44 +0200)
Source/GameDraw.cpp
Source/GameTick.cpp

index 656321e185d59b3a2d00cdba93409831e059b2ee..5286b5ddf6585f18b27680b92838ab041cbbc858 100644 (file)
@@ -2239,7 +2239,7 @@ int Game::DrawGLScene(StereoSide side)
 
                oldmainmenu=mainmenu;
 
-               if(mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==8||mainmenu==9||mainmenu==10||mainmenu==119||mainmenu==13||mainmenu==17||mainmenu==18){
+               if(mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==8||mainmenu==9||mainmenu==10||mainmenu==119||mainmenu==18){
                        glClear(GL_DEPTH_BUFFER_BIT);
                        glEnable(GL_ALPHA_TEST);
                        glAlphaFunc(GL_GREATER, 0.001f);
@@ -2815,51 +2815,6 @@ int Game::DrawGLScene(StereoSide side)
 
                                //numchallengelevels=tempncl;
 
-                       }
-                       if(mainmenu==11){                       
-                               nummenuitems=2+numchallengelevels;
-                               char temp[255];
-
-                               for(j=0;j<numchallengelevels;j++){
-                                       for(i=0;i<255;i++)menustring[j][i]='\0';
-                                       sprintf (temp, "Level %d",j+1);
-                                       strcpy(menustring[j],temp);
-                                       for(i=0;i<17;i++)if(menustring[j][i]=='\0')menustring[j][i]=' ';
-                                       menustring[j][17]='\0';
-                                       sprintf (temp, "%d",(int)accountactive->getHighScore(j));
-                                       strcat(menustring[j],temp);
-                                       for(i=18;i<32;i++)if(menustring[j][i]=='\0')menustring[j][i]=' ';
-                                       menustring[j][32]='\0';
-                                       sprintf (temp, "%d:",(int)(((int)accountactive->getFastTime(j)-(int)(accountactive->getFastTime(j))%60)/60));
-                                       strcat(menustring[j],temp);
-                                       if((int)(accountactive->getFastTime(j))%60<10)strcat(menustring[j],"0");
-                                       sprintf (temp, "%d",(int)(accountactive->getFastTime(j))%60);
-                                       strcat(menustring[j],temp);
-
-                                       startx[j]=10;
-                                       starty[j]=360-j*40;
-                                       endx[j]=startx[j]+strlen(menustring[j])*10;
-                                       endy[j]=starty[j]+20;
-                                       movex[j]=0;
-                                       movey[j]=0;
-                               }
-
-                               sprintf (menustring[numchallengelevels], "Back");
-                               startx[numchallengelevels]=10;
-                               endx[numchallengelevels]=startx[numchallengelevels]+strlen(menustring[numchallengelevels])*10;
-                               starty[numchallengelevels]=10;
-                               endy[numchallengelevels]=starty[numchallengelevels]+20;
-                               movex[numchallengelevels]=0;
-                               movey[numchallengelevels]=0;
-
-                               sprintf (menustring[numchallengelevels+1], "             High Score      Best Time");
-                               startx[numchallengelevels+1]=10;
-                               starty[numchallengelevels+1]=400;
-                               endx[numchallengelevels+1]=startx[numchallengelevels+1]+strlen(menustring[numchallengelevels+1])*10;
-                               endy[numchallengelevels+1]=starty[numchallengelevels+1]+20;
-                               movex[numchallengelevels+1]=0;
-                               movey[numchallengelevels+1]=0;
-
                        }
                        if(mainmenu==10){                       
                                nummenuitems=6;
@@ -3156,13 +3111,12 @@ int Game::DrawGLScene(StereoSide side)
                                }
                        }
 
-               if(mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==8||mainmenu==9||mainmenu==10||mainmenu==11||mainmenu==13||mainmenu==17||mainmenu==18)
+               if(mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==8||mainmenu==9||mainmenu==10||mainmenu==18)
                        for(i=0;i<nummenuitems;i++){
                                if((mousecoordh/screenwidth*640)>startx[i]&&(mousecoordh/screenwidth*640)<endx[i]&&480-(mousecoordv/screenheight*480)>starty[i]&&480-(mousecoordv/screenheight*480)<endy[i]){
                                        if(mainmenu!=5)selected=i;
                                        if(mainmenu==5&&(i!=0&&i!=6))selected=i;
-                                       if(mainmenu==9&&(i!=numchallengelevels+1))selected=i;
-                                       if(mainmenu==11&&(i!=numchallengelevels+1))selected=i;
+                                       if(mainmenu==9&&(i!=numchallengelevels+1))selected=i; // seem useless, if mainmenu==9 then mainmenu!=5, so selected==i.
                                }
                        }
 
@@ -3330,14 +3284,12 @@ int Game::DrawGLScene(StereoSide side)
                                                }
                                        }
                                }
-                               if(mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==8||mainmenu==9||mainmenu==10||mainmenu==11||mainmenu==13||mainmenu==17||mainmenu==18)
+                               if(mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==8||mainmenu==9||mainmenu==10||mainmenu==18)
                                {
                                        if(mainmenu!=5||j<6)
                                        {
                                                glColor4f(1,0,0,1);
                                                if(mainmenu==9&&j>accountactive->getProgress()&&j<numchallengelevels)glColor4f(0.5,0,0,1);
-                                               if(mainmenu==11&&j>accountactive->getProgress()&&j<numchallengelevels)glColor4f(0.5,0,0,1);
-                                               //if(1-((float)i)/10-(1-selectedlong[j])>0){
                                                glMatrixMode(GL_MODELVIEW);                                                     // Select The Modelview Matrix
                                                glPushMatrix();
                                                        if(mainmenu!=7||j!=0||!entername)
@@ -3370,10 +3322,7 @@ int Game::DrawGLScene(StereoSide side)
                                                                if(mainmenu==7&&(j!=0||!entername)) text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
                                                                if(mainmenu==8)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
                                                                if(mainmenu==9)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
-                                                               if(mainmenu==11)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
                                                                if(mainmenu==10)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
-                                                               if(mainmenu==17)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
-                                                               if(mainmenu==13&&j!=1)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
                                                                if(mainmenu==18)text.glPrint(startx[j]-((float)i)+offsetx[j]*((float)i)/4,starty[j]+offsety[j]*((float)i)/4,menustring[j],0,1+((float)i)/70,640,480);
                                                        }
                                                }
index 0330b0e460c23f6b432e52050ce6d08675ac6080..6ea23c2e87d01d1d27e4e8191fbd8b533d69ba5e 100644 (file)
@@ -2403,7 +2403,7 @@ void      Game::Tick()
                if(mainmenu&&endgame==1)mainmenu=10;
                if( (Input::isKeyDown(SDLK_ESCAPE)||(mainmenu==0&&((Input::isKeyDown(jumpkey)||Input::isKeyDown(SDLK_SPACE)||(campaign)))&&!oldjumpkeydown&&campaign&&winfreeze))
                    && !mainmenutogglekeydown
-                   && (!mainmenu||gameon||mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||(mainmenu==7&&!entername)||mainmenu==9||mainmenu==11||mainmenu==13||mainmenu==17||mainmenu==10)
+                   && (!mainmenu||gameon||mainmenu==3||mainmenu==4||mainmenu==5||mainmenu==6||(mainmenu==7&&!entername)||mainmenu==9||mainmenu==10)
                  ) { // go back
                        selected=-1;
                        if(mainmenu==1||mainmenu==2||mainmenu==0){
@@ -2439,7 +2439,7 @@ void      Game::Tick()
 
                                SaveSettings(*this);
                        }
-                       if(mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==9||mainmenu==13||mainmenu==10||mainmenu==11||mainmenu==100){
+                       if(mainmenu==4||mainmenu==5||mainmenu==6||mainmenu==7||mainmenu==9||mainmenu==10||mainmenu==100){
                                fireSound();
 
                                flash();
@@ -2452,8 +2452,6 @@ void      Game::Tick()
                        if(mainmenu==6)mainmenu=5;
                        if(mainmenu==7)mainmenu=1;
                        if(mainmenu==9)mainmenu=5;
-                       if(mainmenu==11)mainmenu=5;
-                       if(mainmenu==13)mainmenu=12;
                        if(mainmenu==10)mainmenu=5;
                        if(mainmenu==100){
                                mainmenu=5;
@@ -2467,16 +2465,6 @@ void     Game::Tick()
                }
        }
 
-       /*static bool minimaptogglekeydown;
-       if(Input::isKeyDown(SDLK_TAB)&&!minimaptogglekeydown){
-       minimap=1-minimap;
-       minimaptogglekeydown=1;
-       }
-       if(!Input::isKeyDown(SDLK_TAB)){
-       minimaptogglekeydown=0;
-       }
-       */
-
        static bool minimaptogglekeydown;
        if(Input::isKeyDown(SDLK_TAB)&&!minimaptogglekeydown&&tutoriallevel){
                if(tutorialstage!=51)
@@ -2835,36 +2823,6 @@ void     Game::Tick()
                                mainmenu=5;
                        }
                }
-               if(mainmenu==11){
-                       if(Input::Button()&&!oldbutton&&selected<numchallengelevels&&selected>=0&&selected<=accountactive->getProgress()){
-                               fireSound();
-
-                               flash();
-
-                               startbonustotal=0;
-
-                               loading=2;
-                               loadtime=0;
-                               targetlevel=selected;
-                               if(firstload) {
-                                       TickOnceAfter();
-                                       Loadlevel(selected);
-                               } else
-                                       LoadStuff();
-                               campaign=0;
-
-                               mainmenu=0;
-                               gameon=1;
-                               OPENAL_SetPaused(channels[stream_music3], true);
-                       }
-                       if(Input::Button()&&!oldbutton&&selected==numchallengelevels){
-                               fireSound();
-
-                               flash();
-
-                               mainmenu=5;
-                       }
-               }
                if(mainmenu==10){
                        endgame=2;
                        if(Input::Button()&&!oldbutton&&selected==3){