From 8afdcba610cded0e54b85069ba051268b29669a6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20BERNIGAUD?= Date: Wed, 18 May 2011 19:44:33 +0200 Subject: [PATCH] console commands works again. --- Source/GameDraw.cpp | 12 ++++++------ Source/GameTick.cpp | 30 +++++++++++++++--------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Source/GameDraw.cpp b/Source/GameDraw.cpp index 19b7f17..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;j= 0 && which <= 15){ + } else if(which >= 0 && which <= 15) { char buf[32]; snprintf(buf, 32, "map%d", which + 1); // challenges Loadlevel(buf); - }else + } else Loadlevel("mapsave"); } -void Game::Loadlevel(const char *name){ +void Game::Loadlevel(const char *name) { int templength; float lamefloat; static const char *pfx = ":Data:Maps:"; @@ -5970,9 +5970,9 @@ void Game::Tick(){ if(chatting) keyboardfrozen=true; - if(Input::isKeyPressed(consolekey)&&debugmode){ + if(Input::isKeyPressed(consolekey)&&debugmode) { console=!console; - if(console){ + if(console) { OPENAL_SetFrequency(OPENAL_ALL, 0.001); } else { freeze=0; @@ -5982,14 +5982,14 @@ void Game::Tick(){ if(console) freeze=1; - if(console&&!Input::isKeyDown(SDLK_LMETA)){ + if(console&&!Input::isKeyDown(SDLK_LMETA)) { inputText(consoletext[0],&consoleselected,&consolechars[0]); if(!waiting) { archiveselected=0; - if(consolechars[0]>0){ - consoletext[0][consolechars[0]]=' '; + if(consolechars[0]>0) { + consoletext[0][consolechars[0]]='\0'; cmd_dispatch(this, consoletext[0]); - for(int k=14;k>=1;k--){ + for(int k=14;k>=1;k--) { for(int j=0;j<255;j++) consoletext[k][j]=consoletext[k-1][j]; consolechars[k]=consolechars[k-1]; @@ -6002,7 +6002,7 @@ void Game::Tick(){ } consoleblinkdelay-=multiplier; - if(consoleblinkdelay<=0){ + if(consoleblinkdelay<=0) { consoleblinkdelay=.3; consoleblink=1-consoleblink; } -- 2.39.2