]> git.jsancho.org Git - lugaru.git/commitdiff
almost nothing
authorCôme BERNIGAUD <come.bernigaud@gmail.com>
Wed, 11 May 2011 16:25:47 +0000 (18:25 +0200)
committerCôme BERNIGAUD <come.bernigaud@gmail.com>
Wed, 11 May 2011 16:25:47 +0000 (18:25 +0200)
Source/Game.cpp
Source/GameTick.cpp
Source/Input.cpp

index 5eb661fb99dc12e9fd4205a98ccf988677e18991..723396bd197b1370da05131663fdf5214020cb2a 100644 (file)
@@ -166,7 +166,7 @@ Game::Game()
        scoreadded = 0;
        numchallengelevels = 0;
 
-       console = 0;
+       console = false;
        archiveselected = 0;
 
        memset(consoletext, 0, sizeof(consoletext));
index e59580515b3008bc990985954ad11bb43b84fa9c..e88ff0e803dc4d87c716809cb6c4c5b69b418e1e 100644 (file)
@@ -1524,7 +1524,7 @@ void Game::Loadlevel(const char *name){
                if(console){
                        emit_sound_np(consolesuccesssound);
                        freeze=0;
-                       console=0;
+                       console=false;
                }
 
                if(!stealthloading){
@@ -5870,7 +5870,7 @@ void Game::Tick(){
                displaytime[i]+=multiplier;
        }
 
-       keyboardfrozen=0;
+       keyboardfrozen=false;
     Input::Tick();
 
        if(Input::isKeyPressed(SDLK_F6)){
@@ -6012,10 +6012,10 @@ void Game::Tick(){
                        }
                }
                if(chatting)
-            keyboardfrozen=1;
+            keyboardfrozen=true;
 
                if(Input::isKeyPressed(SDLK_BACKQUOTE)&&debugmode){
-                       console=1-console;
+                       console=!console;
                        if(console){
                                OPENAL_SetFrequency(OPENAL_ALL, 0.001);
                        } else {
@@ -6076,9 +6076,9 @@ void Game::Tick(){
                 winfreeze=0;
                if((Input::isKeyDown(SDLK_ESCAPE))&&!campaign&&gameon){
             if(console){
-                console=0;
+                console=false;
                 freeze=0;
-            }else if(winfreeze){
+            } else if(winfreeze) {
                                mainmenu=9;
                                gameon=0;
                        }
@@ -7720,7 +7720,7 @@ void Game::TickOnceAfter(){
                                killhotspot=0;
                        }
 
-                       if(!editorenabled&&gameon&&!mainmenu){
+                       if(!editorenabled&&gameon&&!mainmenu) {
                                if(changedelay!=-999)
                     changedelay-=multiplier/7;
                                if(player[0].dead)
@@ -7759,17 +7759,16 @@ void Game::TickOnceAfter(){
                         (player[0].dead||
                          (alldead&&maptype==mapkilleveryone)||
                          (winhotspot)||
-                         (killhotspot))&&
-                        !winfreeze)
+                         (killhotspot)))
                     loading=1;
                                if((player[0].dead||
                             (alldead&&maptype==mapkilleveryone)||
                             (winhotspot)||
                             (windialogue)||
                             (killhotspot))&&
-                        changedelay<=0){
-                    if(whichlevel!=-2&&!loading&&!player[0].dead){
-                        winfreeze=1;
+                        changedelay<=0) {
+                    if(whichlevel!=-2&&!loading&&!player[0].dead) {
+                        winfreeze=true;
                         changedelay=-999;
                     }
                     if(player[0].dead)
@@ -7778,14 +7777,11 @@ void Game::TickOnceAfter(){
                        }
 
                        if(campaign)
-                               if(mainmenu==0&&winfreeze&&(campaignchoosenext[campaignchoicewhich[whichchoice]])==1)
+                               if(mainmenu==0&&winfreeze&&(campaignchoosenext[campaignchoicewhich[whichchoice]]==1)) {
                                        if(campaignnumnext[campaignchoicewhich[whichchoice]]==0)
                                                endgame=1;
-                               else if(mainmenu==0&&winfreeze){
-                                       if(campaignchoosenext[campaignchoicewhich[whichchoice]]==2)
-                                               stealthloading=1;
-                                       else
-                        stealthloading=0;
+                               } else if(mainmenu==0&&winfreeze) {
+                                       stealthloading = (campaignchoosenext[campaignchoicewhich[whichchoice]]==2);
 
                                        if(!stealthloading){
                                                fireSound(firestartsound);
index 03a579fe33f1cd19708a125b8ae193436b132d0e..f7ab1ffa3dc6a5328c99a061575f0ba3df1410ca 100644 (file)
@@ -43,7 +43,7 @@ void Input::Tick(){
 }
 
 bool Input::isKeyDown(int k) {
-       if(keyboardfrozen||k>=SDLK_LAST+6) // vraiment utile? à vérifier
+       if(keyboardfrozen||k>=SDLK_LAST+6) // really useful? check that.
         return false;
     return keyDown[k];
 }