Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 26, 2009, 2:15:08 PM (15 years ago)
Author:
rgrieder
Message:

Loading and unloading graphics automatically: As soon as a GameState requires graphics (defined at the GameState declaration with a bool) it gets loaded. And vice versa.

Location:
code/branches/resource/src/orxonox/gamestates
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • code/branches/resource/src/orxonox/gamestates/GSClient.cc

    r3280 r3355  
    4242    SetCommandLineArgument(ip, "127.0.0.1").information("Sever IP as strin in the form #.#.#.#");
    4343
    44     GSClient::GSClient(const GameStateConstrParams& params)
    45         : GameState(params)
     44    GSClient::GSClient(const GameStateInfo& info)
     45        : GameState(info)
    4646        , client_(0)
    4747    {
  • code/branches/resource/src/orxonox/gamestates/GSClient.h

    r3280 r3355  
    4040    {
    4141    public:
    42         GSClient(const GameStateConstrParams& params);
     42        GSClient(const GameStateInfo& info);
    4343        ~GSClient();
    4444
  • code/branches/resource/src/orxonox/gamestates/GSDedicated.cc

    r3304 r3355  
    5555    termios* GSDedicated::originalTerminalSettings_;
    5656
    57     GSDedicated::GSDedicated(const GameStateConstrParams& params)
    58         : GameState(params)
     57    GSDedicated::GSDedicated(const GameStateInfo& info)
     58        : GameState(info)
    5959        , server_(0)
    6060        , closeThread_(false)
  • code/branches/resource/src/orxonox/gamestates/GSDedicated.h

    r3304 r3355  
    4848    {
    4949    public:
    50         GSDedicated(const GameStateConstrParams& params);
     50        GSDedicated(const GameStateInfo& info);
    5151        ~GSDedicated();
    5252
  • code/branches/resource/src/orxonox/gamestates/GSGraphics.cc

    r3349 r3355  
    5757    DeclareGameState(GSGraphics, "graphics", false, true);
    5858
    59     GSGraphics::GSGraphics(const GameStateConstrParams& params)
    60         : GameState(params)
     59    GSGraphics::GSGraphics(const GameStateInfo& info)
     60        : GameState(info)
    6161        , console_(0)
    6262        , soundManager_(0)
     
    8888    void GSGraphics::activate()
    8989    {
    90         // Load OGRE, CEGUI and OIS
    91         Core::getInstance().loadGraphics();
    92 
    9390        // load debug overlay
    9491        COUT(3) << "Loading Debug Overlay..." << std::endl;
     
    147144        // HACK: (destroys a resource smart pointer)
    148145        Map::hackDestroyMap();
    149 
    150         // Unload OGRE, CEGUI and OIS
    151         Core::getInstance().loadGraphics();
    152146    }
    153147
  • code/branches/resource/src/orxonox/gamestates/GSGraphics.h

    r3349 r3355  
    5050    {
    5151    public:
    52         GSGraphics(const GameStateConstrParams& params);
     52        GSGraphics(const GameStateInfo& info);
    5353        ~GSGraphics();
    5454
  • code/branches/resource/src/orxonox/gamestates/GSIOConsole.cc

    r3280 r3355  
    3838    DeclareGameState(GSIOConsole, "ioConsole", false, false);
    3939
    40     GSIOConsole::GSIOConsole(const GameStateConstrParams& params)
    41         : GameState(params)
     40    GSIOConsole::GSIOConsole(const GameStateInfo& info)
     41        : GameState(info)
    4242    {
    4343    }
  • code/branches/resource/src/orxonox/gamestates/GSIOConsole.h

    r3280 r3355  
    3838    {
    3939    public:
    40         GSIOConsole(const GameStateConstrParams& params);
     40        GSIOConsole(const GameStateInfo& info);
    4141        ~GSIOConsole();
    4242
  • code/branches/resource/src/orxonox/gamestates/GSLevel.cc

    r3346 r3355  
    6060    XMLFile* GSLevel::startFile_s = NULL;
    6161
    62     GSLevel::GSLevel(const GameStateConstrParams& params)
    63         : GameState(params)
     62    GSLevel::GSLevel(const GameStateInfo& info)
     63        : GameState(info)
    6464        , keyBinder_(0)
    6565        , gameInputState_(0)
  • code/branches/resource/src/orxonox/gamestates/GSLevel.h

    r3327 r3355  
    4141    {
    4242    public:
    43         GSLevel(const GameStateConstrParams& params);
     43        GSLevel(const GameStateInfo& info);
    4444        ~GSLevel();
    4545        void setConfigValues();
  • code/branches/resource/src/orxonox/gamestates/GSMainMenu.cc

    r3346 r3355  
    4545    DeclareGameState(GSMainMenu, "mainMenu", false, true);
    4646
    47     GSMainMenu::GSMainMenu(const GameStateConstrParams& params)
    48         : GameState(params)
     47    GSMainMenu::GSMainMenu(const GameStateInfo& info)
     48        : GameState(info)
    4949        , inputState_(0)
    5050    {
  • code/branches/resource/src/orxonox/gamestates/GSMainMenu.h

    r3327 r3355  
    4040    {
    4141    public:
    42         GSMainMenu(const GameStateConstrParams& params);
     42        GSMainMenu(const GameStateInfo& info);
    4343        ~GSMainMenu();
    4444
  • code/branches/resource/src/orxonox/gamestates/GSRoot.cc

    r3349 r3355  
    5353    SetCommandLineSwitch(standalone).information("Start in standalone mode");
    5454
    55     GSRoot::GSRoot(const GameStateConstrParams& params)
    56         : GameState(params)
     55    GSRoot::GSRoot(const GameStateInfo& info)
     56        : GameState(info)
    5757        , timeFactor_(1.0f)
    5858        , bPaused_(false)
     
    174174    @brief
    175175        Changes the speed of Orxonox
     176    @remark
     177        This function is a hack when placed here!
     178        Timefactor should be related to the scene (level or so), not the game
    176179    */
    177180    void GSRoot::setTimeFactor(float factor)
  • code/branches/resource/src/orxonox/gamestates/GSRoot.h

    r3280 r3355  
    3838    {
    3939    public:
    40         GSRoot(const GameStateConstrParams& params);
     40        GSRoot(const GameStateInfo& info);
    4141        ~GSRoot();
    4242
  • code/branches/resource/src/orxonox/gamestates/GSServer.cc

    r3280 r3355  
    4141    SetCommandLineArgument(port, 55556).shortcut("p").information("Network communication port to be used 0-65535 (default: 55556)");
    4242
    43     GSServer::GSServer(const GameStateConstrParams& params)
    44         : GameState(params)
     43    GSServer::GSServer(const GameStateInfo& info)
     44        : GameState(info)
    4545        , server_(0)
    4646    {
  • code/branches/resource/src/orxonox/gamestates/GSServer.h

    r3280 r3355  
    4040    {
    4141    public:
    42         GSServer(const GameStateConstrParams& params);
     42        GSServer(const GameStateInfo& info);
    4343        ~GSServer();
    4444
  • code/branches/resource/src/orxonox/gamestates/GSStandalone.cc

    r3280 r3355  
    3636    DeclareGameState(GSStandalone, "standalone", false, true);
    3737
    38     GSStandalone::GSStandalone(const GameStateConstrParams& params)
    39         : GameState(params)
     38    GSStandalone::GSStandalone(const GameStateInfo& info)
     39        : GameState(info)
    4040    {
    4141    }
  • code/branches/resource/src/orxonox/gamestates/GSStandalone.h

    r3280 r3355  
    3838    {
    3939    public:
    40         GSStandalone(const GameStateConstrParams& params);
     40        GSStandalone(const GameStateInfo& info);
    4141        ~GSStandalone();
    4242
Note: See TracChangeset for help on using the changeset viewer.