Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 4, 2009, 11:08:14 PM (16 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/GSGraphics.cc

    r5863 r5876  
    3535#include "GSGraphics.h"
    3636
    37 #include "util/Clock.h"
    38 #include "util/Convert.h"
    3937#include "core/CommandExecutor.h"
    4038#include "core/ConsoleCommand.h"
    4139#include "core/Game.h"
    4240#include "core/GUIManager.h"
    43 #include "core/Loader.h"
    44 #include "core/XMLFile.h"
    45 
    4641// HACK:
    4742#include "overlays/Map.h"
     
    5348    GSGraphics::GSGraphics(const GameStateInfo& info)
    5449        : GameState(info)
    55         , debugOverlay_(0)
    5650    {
    5751    }
     
    6559        This function is called when we enter this game state.
    6660
    67         Since graphics is very important for our game this function does quite a lot:
    68         \li starts graphics manager
    69         \li loads debug overlay
    70         \li manages render window
    71         \li creates input manager
    72         \li loads master key bindings
    73         \li loads the SoundManager
    74         \li loads ingame console
    75         \li loads GUI interface (GUIManager)
    76         \li creates console command to toggle GUI
     61        There is only one thing to do here:
     62        \li create console command to toggle GUI
    7763    */
    7864    void GSGraphics::activate()
    7965    {
    80         // load debug overlay
    81         COUT(3) << "Loading Debug Overlay..." << std::endl;
    82         this->debugOverlay_ = new XMLFile("debug.oxo");
    83         Loader::open(debugOverlay_);
    84 
    8566        // add console command to toggle GUI
    86         this->ccToggleGUI_ = createConsoleCommand(createFunctor(&GSGraphics::toggleGUI, this), "toggleGUI");
    87         CommandExecutor::addConsoleCommandShortcut(this->ccToggleGUI_);
     67        CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSGraphics::toggleGUI, this), "toggleGUI"));
    8868    }
    8969
     
    9171    @brief
    9272        This function is called when the game state is left
    93 
    94         Created references, input states and console commands are deleted.
    9573    */
    9674    void GSGraphics::deactivate()
    9775    {
    98 /*
    99         if (this->ccToggleGUI_)
    100         {
    101             delete this->ccToggleGUI_;
    102             this->ccToggleGUI_ = 0;
    103         }
    104 */
    105 
    106         Loader::unload(this->debugOverlay_);
    107         delete this->debugOverlay_;
    108 
    10976        // HACK: (destroys a resource smart pointer)
    11077        Map::hackDestroyMap();
     
    12390    }
    12491
    125     /**
    126     @note
    127         A note about the Ogre::FrameListener: Even though we don't use them,
    128         they still get called. However, the delta times are not correct (except
    129         for timeSinceLastFrame, which is the most important). A little research
    130         as shown that there is probably only one FrameListener that doesn't even
    131         need the time. So we shouldn't run into problems.
    132     */
    13392    void GSGraphics::update(const Clock& time)
    13493    {
Note: See TracChangeset for help on using the changeset viewer.