X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FGameDraw.cpp;h=c92755ba192407e41dec8a8ac8f55b935d935c93;hb=9f74842b2c68ce6c62ddf9374252ac99e31879ca;hp=6342683c169f6a95c80e17330305e185e87260a9;hpb=113f1ee41edede8836361cc29119ea5f97104bd2;p=lugaru.git diff --git a/Source/GameDraw.cpp b/Source/GameDraw.cpp index 6342683..c92755b 100644 --- a/Source/GameDraw.cpp +++ b/Source/GameDraw.cpp @@ -549,7 +549,7 @@ int Game::DrawGLScene(StereoSide side) glEnable(GL_TEXTURE_2D); glColor4f(.5,.5,.5,1); - if(!console){ + if(!console) { sprintf (string, " ",(int)(fps)); text.glPrint(10,30,string,0,.8,screenwidth,screenheight); @@ -1322,7 +1322,7 @@ int Game::DrawGLScene(StereoSide side) glDepthMask(1); } - if(flashamount>0&&damageeffects){ + if(flashamount>0&&damageeffects) { if(flashamount>1)flashamount=1; if(flashdelay<=0)flashamount-=multiplier; flashdelay--; @@ -1358,7 +1358,7 @@ int Game::DrawGLScene(StereoSide side) glDepthMask(1); } - if(!console){ + if(!console) { displaytime[0]=0; glEnable(GL_TEXTURE_2D); glColor4f(1,1,1,1); @@ -1370,11 +1370,11 @@ int Game::DrawGLScene(StereoSide side) text.glPrint(30+(float)(displayselected)*10,30+(screenheight-330),string,0,1,screenwidth,screenheight); } } - for(i=0;i<15;i++){ + for(i=0;i<15;i++) { if((i!=0||chatting)&&displaytime[i]<4) - for(j=0;jgetCurrentCampaign()+":World.png").c_str())); - if(test.good()) { - LoadTextureData((":Data:Textures:"+accountactive->getCurrentCampaign()+":World.png").c_str(),&Mainmenuitems[7],0,0); - } else { - LoadTextureData(":Data:Textures:World.png",&Mainmenuitems[7],0,0); - } + ifstream test(ConvertFileName((":Data:Textures:"+accountactive->getCurrentCampaign()+":World.png").c_str())); + if(test.good()) { + LoadTexture((":Data:Textures:"+accountactive->getCurrentCampaign()+":World.png").c_str(),&Mainmenuitems[7],0,0); + } else { + LoadTexture(":Data:Textures:World.png",&Mainmenuitems[7],0,0); } if(accountactive->getCampaignChoicesMade()==0) { @@ -2058,27 +2056,12 @@ void Game::DrawMenu() { glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); ReSizeGLScene(90,.1f); - int temptexdetail; - temptexdetail=texdetail; - if(texdetail>2)texdetail=2; - //~ if(mainmenu!=oldmainmenu&&oldmainmenu!=0){ - //~ if(mainmenu==1){ - //~ LoadTexture(":Data:Textures:Newgame.png",&Mainmenuitems[1],0,0); - //~ LoadTexture(":Data:Textures:Quit.png",&Mainmenuitems[3],0,0); - //~ } - //~ if(mainmenu==2){ - //~ LoadTexture(":Data:Textures:Resume.png",&Mainmenuitems[1],0,0); - //~ LoadTexture(":Data:Textures:Endgame.png",&Mainmenuitems[3],0,0); - //~ } - //~ } if(oldmainmenu!=mainmenu){ if(mainmenu==5){ LoadCampaign(); } } - texdetail=temptexdetail; - oldmainmenu=mainmenu; glClear(GL_DEPTH_BUFFER_BIT); @@ -2185,41 +2168,41 @@ void Game::DrawMenu() { startx[0]=10+20; starty[0]=440; - if(newdetail==2)sprintf (menustring[1], "Detail: High"); - else if(newdetail==1)sprintf (menustring[1], "Detail: Medium"); - else sprintf (menustring[1], "Detail: Low"); + if(newdetail==2) sprintf (menustring[1], "Detail: High"); + else if(newdetail==1) sprintf (menustring[1], "Detail: Medium"); + else sprintf (menustring[1], "Detail: Low"); startx[1]=10+60; starty[1]=405; - if(bloodtoggle==2)sprintf (menustring[2], "Blood: On, high detail (slower)"); - if(bloodtoggle==1)sprintf (menustring[2], "Blood: On, low detail"); - if(bloodtoggle==0)sprintf (menustring[2], "Blood: Off"); + if(bloodtoggle==2) sprintf (menustring[2], "Blood: On, high detail (slower)"); + if(bloodtoggle==1) sprintf (menustring[2], "Blood: On, low detail"); + if(bloodtoggle==0) sprintf (menustring[2], "Blood: Off"); startx[2]=10+70; starty[2]=370; - if(difficulty==2)sprintf (menustring[3], "Difficulty: Insane"); - if(difficulty==1)sprintf (menustring[3], "Difficulty: Difficult"); - if(difficulty==0)sprintf (menustring[3], "Difficulty: Easier"); + if(difficulty==2) sprintf (menustring[3], "Difficulty: Insane"); + if(difficulty==1) sprintf (menustring[3], "Difficulty: Difficult"); + if(difficulty==0) sprintf (menustring[3], "Difficulty: Easier"); startx[3]=10+20-1000; starty[3]=335-1000; - if(ismotionblur==1)sprintf (menustring[4], "Blur Effects: Enabled (less compatible)"); - if(ismotionblur==0)sprintf (menustring[4], "Blur Effects: Disabled (more compatible)"); + if(ismotionblur==1) sprintf (menustring[4], "Blur Effects: Enabled (less compatible)"); + if(ismotionblur==0) sprintf (menustring[4], "Blur Effects: Disabled (more compatible)"); startx[4]=10; starty[4]=335; - if(decals==1)sprintf (menustring[5], "Decals: Enabled (slower)"); - if(decals==0)sprintf (menustring[5], "Decals: Disabled"); + if(decals==1) sprintf (menustring[5], "Decals: Enabled (slower)"); + if(decals==0) sprintf (menustring[5], "Decals: Disabled"); startx[5]=10+60; starty[5]=300; - if(musictoggle==1)sprintf (menustring[6], "Music: Enabled"); - if(musictoggle==0)sprintf (menustring[6], "Music: Disabled"); + if(musictoggle==1) sprintf (menustring[6], "Music: Enabled"); + if(musictoggle==0) sprintf (menustring[6], "Music: Disabled"); startx[6]=10+70; starty[6]=265; - if(invertmouse==1)sprintf (menustring[9], "Invert mouse: Yes"); - if(invertmouse==0)sprintf (menustring[9], "Invert mouse: No"); + if(invertmouse==1) sprintf (menustring[9], "Invert mouse: Yes"); + if(invertmouse==0) sprintf (menustring[9], "Invert mouse: No"); startx[9]=10; starty[9]=230; @@ -2295,10 +2278,18 @@ void Game::DrawMenu() { else sprintf (menustring[8], "Attack: _"); startx[8]=10+20; starty[8]=80; - - sprintf (menustring[9], "Back"); - startx[9]=10; - starty[9]=10; + + if(debugmode) { + if(keyselect!=9)sprintf (menustring[9], "Console: %s",Input::keyToChar(consolekey)); + else sprintf (menustring[9], "Console: _"); + startx[9]=10+10; + starty[9]=40; + nummenuitems++; + } + + sprintf (menustring[nummenuitems-1], "Back"); + startx[nummenuitems-1]=10; + starty[nummenuitems-1]=10; } break; case 5: { @@ -2347,18 +2338,6 @@ void Game::DrawMenu() { sprintf (menustring[2], "No"); startx[2]=10; starty[2]=320; - - sprintf (menustring[3], "Extra 4"); - startx[3]=10; - starty[3]=280; - - sprintf (menustring[4], "Extra 5"); - startx[4]=10; - starty[4]=240; - - sprintf (menustring[5], "Back"); - startx[5]=10; - starty[5]=10; } break; case 7: { @@ -2567,7 +2546,11 @@ void Game::DrawMenu() { { glColor4f(1,1,1,1); glBlendFunc(GL_SRC_ALPHA,GL_ONE); - glBindTexture( GL_TEXTURE_2D, Mainmenuitems[j]); + if(mainmenu==2 && (j==1 || j == 3)) { + glBindTexture( GL_TEXTURE_2D, Mainmenuitems[(j==1?5:6)]); + } else { + glBindTexture( GL_TEXTURE_2D, Mainmenuitems[j]); + } glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix @@ -2871,13 +2854,13 @@ void Game::DrawMenu() { //glScalef(.25,.25,.25); glBegin(GL_QUADS); glTexCoord2f(0,0); - glVertex3f(-1, -1, 0.0f); + glVertex3f(-1, -1, 0.0f); glTexCoord2f(1,0); - glVertex3f(1, -1, 0.0f); + glVertex3f(1, -1, 0.0f); glTexCoord2f(1,1); - glVertex3f(1, 1, 0.0f); + glVertex3f(1, 1, 0.0f); glTexCoord2f(0,1); - glVertex3f(-1, 1, 0.0f); + glVertex3f(-1, 1, 0.0f); glEnd(); glPopMatrix(); glPopMatrix();