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/GSLevel.cc

    r5863 r5876  
    3737#include "core/input/KeyBinderManager.h"
    3838#include "core/ConsoleCommand.h"
    39 #include "core/ConfigValueIncludes.h"
    40 #include "core/CoreIncludes.h"
    4139#include "core/Game.h"
    4240#include "core/GameMode.h"
     
    5149{
    5250    DeclareGameState(GSLevel, "level", false, false);
    53     SetConsoleCommand(GSLevel, showIngameGUI, true);
    54 
    55     XMLFile* GSLevel::startFile_s = NULL;
    5651
    5752    GSLevel::GSLevel(const GameStateInfo& info)
     
    6055        , guiMouseOnlyInputState_(0)
    6156        , guiKeysOnlyInputState_(0)
     57        , startFile_(0)
    6258    {
    63         RegisterObject(GSLevel);
    6459    }
    6560
     
    6863    }
    6964
    70     void GSLevel::setConfigValues()
    71     {
    72     }
    73 
    7465    void GSLevel::activate()
    7566    {
    76         setConfigValues();
    77 
    7867        if (GameMode::showsGraphics())
    7968        {
     
    8776            guiKeysOnlyInputState_ = InputManager::getInstance().createInputState("guiKeysOnly");
    8877            guiKeysOnlyInputState_->setKeyHandler(GUIManager::getInstancePtr());
     78
     79            CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSLevel::showIngameGUI, this), "showIngameGUI"));
    8980        }
    9081
     
    129120            // unload all compositors (this is only necessary because we don't yet destroy all resources!)
    130121            Ogre::CompositorManager::getSingleton().removeAll();
    131         }
    132122
    133         // this call will delete every BaseObject!
    134         // But currently this will call methods of objects that exist no more
    135         // The only 'memory leak' is the ParticleSpawer. They would be deleted here
    136         // and call a sceneNode method that has already been destroy by the corresponding space ship.
    137         //Loader::close();
    138 
    139         if (GameMode::showsGraphics())
    140         {
    141123            InputManager::getInstance().leaveState("game");
    142124        }
     
    158140    void GSLevel::update(const Clock& time)
    159141    {
    160         // Note: Temporarily moved to GSGraphics.
     142        // Note: Temporarily moved to GSRoot.
    161143        //// Call the scene objects
    162144        //for (ObjectList<Tickable>::iterator it = ObjectList<Tickable>::begin(); it; ++it)
     
    168150        // call the loader
    169151        COUT(0) << "Loading level..." << std::endl;
    170         startFile_s = new XMLFile(LevelManager::getInstance().getDefaultLevel());
    171         Loader::open(startFile_s);
     152        startFile_ = new XMLFile(LevelManager::getInstance().getDefaultLevel());
     153        Loader::open(startFile_);
    172154    }
    173155
    174156    void GSLevel::unloadLevel()
    175157    {
    176         Loader::unload(startFile_s);
    177 
    178         delete startFile_s;
     158        Loader::unload(startFile_);
     159        delete startFile_;
    179160    }
    180161}
Note: See TracChangeset for help on using the changeset viewer.