Changeset 1382


Ignore:
Timestamp:
09/15/06 21:27:38 (18 years ago)
Author:
giegl
Message:

GTPD - Jungle Rumble - pausing game for screenshots works (Michael)

Location:
GTP/trunk/App/Games/Jungle_Rumble
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Games/Jungle_Rumble/doc/readme.txt

    r1378 r1382  
    17175               Icethrower - Slow down your opponent to toast it with the firethrower 
    1818 
    19 F1              Display help 
     19F1              Display Help 
    2020F2              FPS on/off 
    2121F3              Enable PhysX Debugger (Note: you only can switch it on/off wenn you turn it on in the config.xml file) 
     
    2424F10             Raytracer on/off 
    2525F11             Enable/Disable fire of the opponents (Not for cheating! ;-) 
     26Pause           Pause Game 
  • GTP/trunk/App/Games/Jungle_Rumble/src/GameManager.cpp

    r1378 r1382  
    6767        if( bKeyDown ) 
    6868    { 
    69                 switch( nChar ) 
    70         { 
    71             case VK_ESCAPE: 
    72                                 break; 
    73                         case VK_F1: 
    74                                 if(activeScene == &this->gs) { 
    75                                         this->gs.getHUD()->message("HELP:\n drive: w-a-s-d\n shoot: left mouse\n F2: show FPS\n F3: PhysX Debugger\n F4: Music On/Off\n F9: Depth Imposters On/Off\n F10: Raytracer On/Off\n F11 Opponent Fire On/Off\n 1 Standard weapon\n 2 Bombs - explode late, but do cause lots of damage!\n 3 Alien weapon - just shoot!\n 4 Firethrower - Toast your opponent\n 5 Icethrower - Slow down your opponent", 2, 0.01f, true); 
    76                                 } 
    77                                 //this->gs.hasWon(); 
    78                                 break; 
    79                         case VK_F2: 
    80                                 this->gs.showFPS = !this->gs.showFPS; 
    81                                 break; 
    82                         case VK_F3: 
    83                                 if(!this->activeScene->usePhysXDebugger) 
    84                                         this->activeScene->usePhysXDebugger = true; 
    85                                 else 
    86                                         this->activeScene->usePhysXDebugger = false; 
    87                                 break; 
    88                         case VK_F4: 
    89                                 this->gs.setBackgroundSoundMute(!this->gs.getBackgroundSoundMute()); 
    90                                 this->ms.setBackgroundSoundMute(!this->ms.getBackgroundSoundMute()); 
    91                                 break; 
    92                         case VK_F5: 
    93                                 //this->gs.getHUD()->displayToasted(3, 0.01f); 
    94                                 break; 
    95                         case VK_F6: 
    96                                 //this->gs.getHUD()->message("hallo martin", 3, 0.01f); 
    97                                 break; 
    98                         case VK_F7: 
    99                                 //this->gs.getHUD()->displayLose(3, 0.01f); 
    100                                 break; 
    101                         case VK_F8: 
    102                                 this->gs.drawBBoxes = !this->gs.drawBBoxes; 
    103                                 break; 
    104                         case VK_F9: 
    105                                 this->gs.useDepthImposter = !this->gs.useDepthImposter; 
    106                                 break; 
    107                         case VK_F10: 
    108                                 this->gs.useRaytracer = !this->gs.useRaytracer; 
    109                                 break; 
    110                         case VK_F11: 
    111                                 this->gs.aiPlayerFireEnable = !this->gs.aiPlayerFireEnable; 
    112                                 break; 
    113                 } 
     69                //if(nChar == VK_PAUSE || nChar == VK_F9 || nChar == VK_F10 || !this->gs.preparepaused) { 
     70                        switch( nChar ) 
     71                        { 
     72                                case VK_ESCAPE: 
     73                                        break; 
     74                                case VK_F1: 
     75                                        if(activeScene == &this->gs) { 
     76                                                this->gs.getHUD()->message("HELP:\n drive: w-a-s-d\n shoot: left mouse\n F2: show FPS\n F3: PhysX Debugger\n F4: Music On/Off\n F9: Depth Imposters On/Off\n F10: Raytracer On/Off\n F11 Opponent Fire On/Off\n Pause: Pause Game\n 1 Standard weapon\n 2 Bombs - explode late, but do cause lots of damage!\n 3 Alien weapon - just shoot!\n 4 Firethrower - Toast your opponent\n 5 Icethrower - Slow down your opponent", 2, 0.01f, true); 
     77                                        } 
     78                                        //this->gs.hasWon(); 
     79                                        break; 
     80                                case VK_F2: 
     81                                        this->gs.showFPS = !this->gs.showFPS; 
     82                                        break; 
     83                                case VK_F3: 
     84                                        if(!this->activeScene->usePhysXDebugger) 
     85                                                this->activeScene->usePhysXDebugger = true; 
     86                                        else 
     87                                                this->activeScene->usePhysXDebugger = false; 
     88                                        break; 
     89                                case VK_F4: 
     90                                        this->gs.setBackgroundSoundMute(!this->gs.getBackgroundSoundMute()); 
     91                                        this->ms.setBackgroundSoundMute(!this->ms.getBackgroundSoundMute()); 
     92                                        break; 
     93                                case VK_F5: 
     94                                        //this->gs.getHUD()->displayToasted(3, 0.01f); 
     95                                        break; 
     96                                case VK_F6: 
     97                                        //this->gs.getHUD()->message("hallo martin", 3, 0.01f); 
     98                                        break; 
     99                                case VK_F7: 
     100                                        //this->gs.getHUD()->displayLose(3, 0.01f); 
     101                                        break; 
     102                                case VK_F8: 
     103                                        this->gs.drawBBoxes = !this->gs.drawBBoxes; 
     104                                        break; 
     105                                case VK_F9: 
     106                                        this->gs.useDepthImposter = !this->gs.useDepthImposter; 
     107                                        break; 
     108                                case VK_F10: 
     109                                        this->gs.useRaytracer = !this->gs.useRaytracer; 
     110                                        break; 
     111                                case VK_F11: 
     112                                        this->gs.aiPlayerFireEnable = !this->gs.aiPlayerFireEnable; 
     113                                        break; 
     114                                case VK_PAUSE: 
     115                                        if(activeScene == &this->gs) { 
     116                                                if(!this->gs.preparepaused) { 
     117                                                        this->gs.getHUD()->message("Game paused. Press Pause to Continue...", 1, 0.01f); 
     118                                                } else { 
     119                                                        this->gs.currentlypaused = false; 
     120                                                        this->gs.getHUD()->message("", 1, 0.01f); 
     121                                                } 
     122                                                this->gs.preparepaused= !this->gs.preparepaused; 
     123                                        } 
     124                                        break; 
     125                        } 
     126                //} 
    114127 
    115128        } 
     
    325338        //show mouse cursor: 
    326339        ShowCursor(true); 
     340        this->gs.currentlypaused = false; 
     341        this->gs.preparepaused = false; 
    327342} 
    328343 
     
    340355                //hide mouse cursor: 
    341356                ShowCursor(false); 
     357 
     358                this->gs.currentlypaused = false; 
     359                this->gs.preparepaused = false; 
    342360        } 
    343361} 
  • GTP/trunk/App/Games/Jungle_Rumble/src/GameScene.cpp

    r1378 r1382  
    4444 
    4545        this->recalcTransformations = true; 
     46 
     47        this->currentlypaused = false; 
     48        this->preparepaused = false; 
    4649} 
    4750 
     
    110113        this->sadSound = NULL; 
    111114        this->happySound = NULL; 
     115        this->currentlypaused = false; 
     116        this->preparepaused = false; 
    112117 
    113118        Scene::clearScene(); 
     
    124129        this->setNotifyReport(&this->userNotify); 
    125130        this->descSet = false; 
     131        this->currentlypaused = false; 
     132        this->preparepaused = false; 
    126133        Scene::initScene(_manager); 
    127134         
     
    194201                } 
    195202 
     203                if(this->preparepaused) { 
     204                        this->currentlypaused = true; 
     205                } 
     206 
    196207                //this->device->SetRenderTarget(0, this->finalImageSurface); 
    197208                //this->manager->printToConsole("renderScene"); 
     
    205216                } 
    206217 
    207                 this->takeTime(); 
     218                if(!this->currentlypaused) { 
     219                        this->takeTime(); 
     220                } 
     221                 
    208222                //ClearScreen 
    209223                //this->clearRenderTargetAndZBuffer(); 
     
    211225                this->clearSharedResources(); 
    212226                //Fetch Physic Results 
    213                 if(this->recalcTransformations) { 
     227        if(this->recalcTransformations && !this->currentlypaused) { 
    214228                        this->fetchPhysicResults(); 
    215229                } 
    216230                //Fading Stuff 
    217                 this->doFade(); 
    218                 //FIRST GAME UPDATE 
    219                 this->updateGameFirst(); 
    220                 //Trigger updates 
    221                 this->updateTrigger(); 
    222                 //Update Nodes 
    223                 this->updateNodes(); 
    224                 //Calculate Transformations 
    225                 if(this->recalcTransformations) { 
    226                         this->calculateTransformations(); 
    227                 } 
    228                 //SECOND GAME UPDATE 
    229                 this->updateGameSecond(); 
     231        if(!this->currentlypaused) { 
     232                        this->doFade(); 
     233                        //FIRST GAME UPDATE 
     234                        this->updateGameFirst(); 
     235                        //Trigger updates 
     236                        this->updateTrigger(); 
     237                        //Update Nodes 
     238                        this->updateNodes(); 
     239                        //Calculate Transformations 
     240                        if(this->recalcTransformations) { 
     241                                this->calculateTransformations(); 
     242                        } 
     243                        //SECOND GAME UPDATE 
     244                        this->updateGameSecond(); 
     245                } 
     246 
    230247                //startRenderPasses 
    231248                this->startRenderPasses(); 
     
    233250                //Cleanup Memory 
    234251                this->cleanUpScene(); 
    235                 //Start Physic 
    236                 if(this->recalcTransformations) { 
    237                         this->startPhysic(); 
     252 
     253                if(!this->currentlypaused) { 
     254                        //Start Physic 
     255                        if(this->recalcTransformations) { 
     256                                this->startPhysic(); 
     257                        } 
    238258                } 
    239259                this->cnt = 0; 
  • GTP/trunk/App/Games/Jungle_Rumble/src/GameScene.h

    r1378 r1382  
    108108        void reduceHealthOnPlayers(Bullet* bullet); 
    109109 
     110        bool preparepaused; 
     111        bool currentlypaused; 
     112 
    110113        void hasWon(); 
    111114protected: 
Note: See TracChangeset for help on using the changeset viewer.