Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 4, 2009, 11:08:14 PM (15 years ago)
Author:
rgrieder
Message:

Cleanup in the GameStates (also moved debug overlay to the GraphicsManager).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/orxonox/gamestates/GSMainMenu.cc

    r5863 r5876  
    3131#include <OgreSceneManager.h>
    3232
    33 #include "util/Clock.h"
    3433#include "core/input/InputManager.h"
    3534#include "core/input/InputState.h"
     
    5756
    5857        // create an empty Scene
    59         this->scene_ = new Scene(0);
     58        this->scene_ = new Scene(NULL);
    6059        // and a Camera
    6160        this->camera_ = this->scene_->getSceneManager()->createCamera("mainMenu/Camera");
     61        // Load sound
     62        this->ambient_ = new SoundMainMenu();
    6263    }
    6364
     
    7778        GraphicsManager::getInstance().setCamera(this->camera_);
    7879
    79         this->ccStartStandalone_ = createConsoleCommand(createFunctor(&GSMainMenu::startStandalone, this), "startGame");
    80         CommandExecutor::addConsoleCommandShortcut(this->ccStartStandalone_);
    81         this->ccStartServer_ = createConsoleCommand(createFunctor(&GSMainMenu::startServer, this), "startServer");
    82         CommandExecutor::addConsoleCommandShortcut(this->ccStartServer_);
    83         this->ccStartClient_ = createConsoleCommand(createFunctor(&GSMainMenu::startClient, this), "startClient");
    84         CommandExecutor::addConsoleCommandShortcut(this->ccStartClient_);
    85         this->ccStartDedicated_ = createConsoleCommand(createFunctor(&GSMainMenu::startDedicated, this), "startDedicated");
    86         CommandExecutor::addConsoleCommandShortcut(this->ccStartDedicated_);
    87         this->ccStartMainMenu_ = createConsoleCommand(createFunctor(&GSMainMenu::startMainMenu, this), "startMainMenu");
    88         CommandExecutor::addConsoleCommandShortcut(this->ccStartMainMenu_);
     80        CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startStandalone, this), "startGame"));
     81        CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startServer, this), "startServer"));
     82        CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startClient, this), "startClient"));
     83        CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startDedicated, this), "startDedicated"));
     84        CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startMainMenu, this), "startMainMenu"));
    8985
    9086        KeyBinderManager::getInstance().setToDefault();
    9187        InputManager::getInstance().enterState("mainMenu");
    9288
    93         this->ambient_ = new SoundMainMenu();
    9489        this->ambient_->play(true);
    9590    }
     
    9792    void GSMainMenu::deactivate()
    9893    {
    99         this->ambient_->destroy();
     94        this->ambient_->stop();
    10095
    10196        InputManager::getInstance().leaveState("mainMenu");
     
    10398        GUIManager::getInstance().setCamera(0);
    10499        GraphicsManager::getInstance().setCamera(0);
    105 
    106 /*
    107         if (this->ccStartGame_)
    108         {
    109             delete this->ccStartGame_;
    110             this->ccStartGame_ = 0;
    111         }
    112 */
    113100    }
    114101
Note: See TracChangeset for help on using the changeset viewer.