Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 25, 2009, 7:37:00 PM (16 years ago)
Author:
rgrieder
Message:

Exported showsGraphics, etc. to a new class named GameMode in the core.

Location:
code/branches/gui/src/orxonox/gamestates
Files:
8 edited

Legend:

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

    r2846 r2848  
    3333#include "core/Clock.h"
    3434#include "core/CommandLine.h"
    35 #include "core/Core.h"
     35#include "core/Game.h"
     36#include "core/GameMode.h"
    3637#include "network/Client.h"
    37 #include "core/Game.h"
    3838
    3939namespace orxonox
     
    5555    void GSClient::activate()
    5656    {
    57         Core::setIsClient(true);
     57        GameMode::setIsClient(true);
    5858
    5959        this->client_ = new Client(CommandLine::getValue("ip").getString(), CommandLine::getValue("port"));
     
    7272        delete this->client_;
    7373
    74         Core::setIsClient(false);
     74        GameMode::setIsClient(false);
    7575    }
    7676
  • code/branches/gui/src/orxonox/gamestates/GSDedicated.cc

    r2844 r2848  
    3232#include "core/Clock.h"
    3333#include "core/CommandLine.h"
    34 #include "core/Core.h"
     34#include "core/Game.h"
     35#include "core/GameMode.h"
    3536#include "core/Iterator.h"
    3637#include "network/Server.h"
    3738#include "objects/Tickable.h"
    3839#include "util/Sleep.h"
    39 #include "core/Game.h"
    4040
    4141namespace orxonox
     
    5656    void GSDedicated::activate()
    5757    {
    58         Core::setHasServer(true);
     58        GameMode::setHasServer(true);
    5959
    6060        this->server_ = new Server(CommandLine::getValue("port"));
     
    6969        delete this->server_;
    7070
    71         Core::setHasServer(false);
     71        GameMode::setHasServer(false);
    7272    }
    7373
  • code/branches/gui/src/orxonox/gamestates/GSGUI.cc

    r2845 r2848  
    3333#include "core/Clock.h"
    3434#include "core/ConsoleCommand.h"
     35#include "core/Game.h"
    3536#include "core/input/InputManager.h"
    3637#include "core/input/SimpleInputState.h"
    3738#include "gui/GUIManager.h"
    3839#include "GraphicsManager.h"
    39 #include "core/Game.h"
    4040
    4141namespace orxonox
  • code/branches/gui/src/orxonox/gamestates/GSGraphics.cc

    r2847 r2848  
    3838#include "core/CoreIncludes.h"
    3939#include "core/Game.h"
     40#include "core/GameMode.h"
    4041#include "core/input/InputManager.h"
    4142#include "core/input/KeyBinder.h"
     
    7475    void GSGraphics::activate()
    7576    {
    76         Core::setShowsGraphics(true);
     77        GameMode::setShowsGraphics(true);
    7778
    7879        setConfigValues();
     
    128129        delete graphicsManager_;
    129130
    130         Core::setShowsGraphics(false);
     131        GameMode::setShowsGraphics(false);
    131132    }
    132133
  • code/branches/gui/src/orxonox/gamestates/GSLevel.cc

    r2844 r2848  
    3939#include "core/CommandLine.h"
    4040#include "core/ConfigValueIncludes.h"
     41#include "core/Core.h"
    4142#include "core/CoreIncludes.h"
    42 #include "core/Core.h"
     43#include "core/Game.h"
     44#include "core/GameMode.h"
    4345#include "objects/Tickable.h"
    4446#include "objects/Radar.h"
     
    4749#include "LevelManager.h"
    4850#include "PlayerManager.h"
    49 #include "core/Game.h"
    5051
    5152namespace orxonox
     
    8384        setConfigValues();
    8485
    85         if (Core::showsGraphics())
     86        if (GameMode::showsGraphics())
    8687        {
    8788            inputState_ = InputManager::getInstance().createInputState<SimpleInputState>("game");
     
    99100        this->playerManager_ = new PlayerManager();
    100101
    101         if (Core::isMaster())
     102        if (GameMode::isMaster())
    102103        {
    103104            // create the global LevelManager
     
    107108        }
    108109
    109         if (Core::showsGraphics())
     110        if (GameMode::showsGraphics())
    110111        {
    111112            // TODO: insert slomo console command with
     
    149150        //Loader::close();
    150151
    151         if (Core::showsGraphics())
     152        if (GameMode::showsGraphics())
    152153            InputManager::getInstance().requestLeaveState("game");
    153154
    154         if (Core::isMaster())
     155        if (GameMode::isMaster())
    155156            this->unloadLevel();
    156157
     
    179180        }
    180181
    181         if (Core::showsGraphics())
     182        if (GameMode::showsGraphics())
    182183        {
    183184            inputState_->setHandler(0);
     
    240241    void GSLevel::keybindInternal(const std::string& command, bool bTemporary)
    241242    {
    242         if (Core::showsGraphics())
     243        if (GameMode::showsGraphics())
    243244        {
    244245            static std::string bindingString = "";
  • code/branches/gui/src/orxonox/gamestates/GSRoot.cc

    r2846 r2848  
    3333#include "util/Debug.h"
    3434#include "core/Clock.h"
    35 #include "core/Core.h"
     35#include "core/Game.h"
     36#include "core/GameMode.h"
    3637#include "core/CommandLine.h"
    3738#include "core/ConsoleCommand.h"
     
    3940#include "tools/Timer.h"
    4041#include "objects/Tickable.h"
    41 #include "core/Game.h"
    4242
    4343namespace orxonox
     
    142142    void GSRoot::setTimeFactor(float factor)
    143143    {
    144         if (Core::isMaster())
     144        if (GameMode::isMaster())
    145145        {
    146146            if (!this->bPaused_)
     
    160160    void GSRoot::pause()
    161161    {
    162         if (Core::isMaster())
     162        if (GameMode::isMaster())
    163163        {
    164164            if (!this->bPaused_)
  • code/branches/gui/src/orxonox/gamestates/GSServer.cc

    r2844 r2848  
    3131
    3232#include "core/CommandLine.h"
    33 #include "core/Core.h"
     33#include "core/Game.h"
     34#include "core/GameMode.h"
    3435#include "network/Server.h"
    35 #include "core/Game.h"
    3636
    3737namespace orxonox
     
    5353    void GSServer::activate()
    5454    {
    55         Core::setHasServer(true);
     55        GameMode::setHasServer(true);
    5656
    5757        this->server_ = new Server(CommandLine::getValue("port"));
     
    6666        delete this->server_;
    6767
    68         Core::setHasServer(false);
     68        GameMode::setHasServer(false);
    6969    }
    7070
  • code/branches/gui/src/orxonox/gamestates/GSStandalone.cc

    r2844 r2848  
    3232#include <OgreViewport.h>
    3333#include <OgreCamera.h>
    34 #include "core/Core.h"
     34#include "core/Game.h"
     35#include "core/GameMode.h"
    3536#include "core/ConsoleCommand.h"
    3637#include "gui/GUIManager.h"
    3738#include "GraphicsManager.h"
    38 #include "core/Game.h"
    3939
    4040namespace orxonox
     
    5454    void GSStandalone::activate()
    5555    {
    56         Core::setIsStandalone(true);
     56        GameMode::setIsStandalone(true);
    5757
    5858        guiManager_ = GUIManager::getInstancePtr();
     
    6363    void GSStandalone::deactivate()
    6464    {
    65         Core::setIsStandalone(false);
     65        GameMode::setIsStandalone(false);
    6666    }
    6767
Note: See TracChangeset for help on using the changeset viewer.