Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 12, 2009, 11:58:01 PM (15 years ago)
Author:
rgrieder
Message:

Merged most of the core4 revisions back to the trunk except for:

  • orxonox_cast
  • all the radical changes in the input library
Location:
code/trunk
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/gamestates/GSClient.cc

    r3196 r3280  
    3838namespace orxonox
    3939{
    40     AddGameState(GSClient, "client");
     40    DeclareGameState(GSClient, "client", false, true);
    4141
    42     SetCommandLineArgument(ip, "127.0.0.1").information("#.#.#.#");
     42    SetCommandLineArgument(ip, "127.0.0.1").information("Sever IP as strin in the form #.#.#.#");
    4343
    44     GSClient::GSClient(const std::string& name)
    45         : GameState(name)
     44    GSClient::GSClient(const GameStateConstrParams& params)
     45        : GameState(params)
    4646        , client_(0)
    4747    {
  • code/trunk/src/orxonox/gamestates/GSClient.h

    r3196 r3280  
    4040    {
    4141    public:
    42         GSClient(const std::string& name);
     42        GSClient(const GameStateConstrParams& params);
    4343        ~GSClient();
    4444
  • code/trunk/src/orxonox/gamestates/GSDedicated.cc

    r3205 r3280  
    5151    const unsigned int MAX_COMMAND_LENGTH = 255;
    5252   
    53     AddGameState(GSDedicated, "dedicated");
     53    DeclareGameState(GSDedicated, "dedicated", false, false);
    5454   
    5555    termios* GSDedicated::originalTerminalSettings_;
    5656
    57     GSDedicated::GSDedicated(const std::string& name)
    58         : GameState(name)
     57    GSDedicated::GSDedicated(const GameStateConstrParams& params)
     58        : GameState(params)
    5959        , server_(0)
    6060        , timeSinceLastUpdate_(0)
  • code/trunk/src/orxonox/gamestates/GSDedicated.h

    r3198 r3280  
    4848    {
    4949    public:
    50         GSDedicated(const std::string& name);
     50        GSDedicated(const GameStateConstrParams& params);
    5151        ~GSDedicated();
    5252
  • code/trunk/src/orxonox/gamestates/GSGraphics.cc

    r3196 r3280  
    5757namespace orxonox
    5858{
    59     AddGameState(GSGraphics, "graphics", false);
    60 
    61     GSGraphics::GSGraphics(const std::string& name, bool countTickTime)
    62         : GameState(name, countTickTime)
     59    DeclareGameState(GSGraphics, "graphics", true, true);
     60
     61    GSGraphics::GSGraphics(const GameStateConstrParams& params)
     62        : GameState(params)
    6363        , inputManager_(0)
    6464        , console_(0)
     
    108108        setConfigValues();
    109109
    110         // initialise graphics manager. Doesn't load the render window yet!
     110        // Load OGRE including the render window
    111111        this->graphicsManager_ = new GraphicsManager();
    112         this->graphicsManager_->initialise();
    113112
    114113        // load debug overlay
     
    198197    void GSGraphics::toggleGUI()
    199198    {
    200             GUIManager::getInstance().executeCode("toggleGUI()");
     199        GUIManager::getInstance().executeCode("toggleGUI()");
    201200    }
    202201
  • code/trunk/src/orxonox/gamestates/GSGraphics.h

    r3196 r3280  
    5252    {
    5353    public:
    54         GSGraphics(const std::string& name, bool countTickTime);
     54        GSGraphics(const GameStateConstrParams& params);
    5555        ~GSGraphics();
    5656        void setConfigValues();
  • code/trunk/src/orxonox/gamestates/GSIOConsole.cc

    r3196 r3280  
    3636namespace orxonox
    3737{
    38     AddGameState(GSIOConsole, "ioConsole");
     38    DeclareGameState(GSIOConsole, "ioConsole", false, false);
    3939
    40     GSIOConsole::GSIOConsole(const std::string& name)
    41         : GameState(name)
     40    GSIOConsole::GSIOConsole(const GameStateConstrParams& params)
     41        : GameState(params)
    4242    {
    4343    }
  • code/trunk/src/orxonox/gamestates/GSIOConsole.h

    r2896 r3280  
    3838    {
    3939    public:
    40         GSIOConsole(const std::string& name);
     40        GSIOConsole(const GameStateConstrParams& params);
    4141        ~GSIOConsole();
    4242
  • code/trunk/src/orxonox/gamestates/GSLevel.cc

    r3196 r3280  
    3434#include "core/input/KeyBinder.h"
    3535#include "core/Clock.h"
    36 #include "core/CommandLine.h"
    3736#include "core/ConsoleCommand.h"
    3837#include "core/ConfigValueIncludes.h"
     
    5655namespace orxonox
    5756{
    58     AddGameState(GSLevel, "level");
    59 
    60     SetCommandLineArgument(level, "").shortcut("l");
     57    DeclareGameState(GSLevel, "level", false, true);
    6158    SetConsoleCommand(GSLevel, showIngameGUI, true);
    6259
    6360    XMLFile* GSLevel::startFile_s = NULL;
    6461
    65     GSLevel::GSLevel(const std::string& name)
    66         : GameState(name)
     62    GSLevel::GSLevel(const GameStateConstrParams& params)
     63        : GameState(params)
    6764        , keyBinder_(0)
    6865        , gameInputState_(0)
     
    7168        , radar_(0)
    7269        , cameraManager_(0)
    73         , levelManager_(0)
    7470    {
    7571        RegisterObject(GSLevel);
     
    120116        if (GameMode::isMaster())
    121117        {
    122             // create the global LevelManager
    123             this->levelManager_ = new LevelManager();
    124 
    125118            this->loadLevel();
    126119        }
     
    202195        }
    203196
    204         if (this->levelManager_)
    205         {
    206             delete this->levelManager_;
    207             this->levelManager_ = 0;
    208         }
    209 
    210197        if (this->playerManager_)
    211198        {
     
    252239        // call the loader
    253240        COUT(0) << "Loading level..." << std::endl;
    254         std::string levelName;
    255         CommandLine::getValue("level", &levelName);
    256         if (levelName == "")
    257             startFile_s = new XMLFile(Core::getMediaPathString() + "levels" + '/' + Game::getInstance().getLevel());
    258         else
    259             startFile_s = new XMLFile(Core::getMediaPathString() + "levels" + '/' + levelName);
     241        startFile_s = new XMLFile(Core::getMediaPathString() + "levels" + '/' + LevelManager::getInstance().getDefaultLevel());
    260242        Loader::open(startFile_s);
    261243    }
  • code/trunk/src/orxonox/gamestates/GSLevel.h

    r3196 r3280  
    4141    {
    4242    public:
    43         GSLevel(const std::string& name);
     43        GSLevel(const GameStateConstrParams& params);
    4444        ~GSLevel();
    4545        void setConfigValues();
     
    6868        Radar*                radar_;                   //!< represents the Radar (not the HUD part)
    6969        CameraManager*        cameraManager_;           //!< camera manager for this level
    70         LevelManager*         levelManager_;            //!< global level manager
    7170        PlayerManager*        playerManager_;           //!< player manager for this level
    7271        QuestManager*         questManager_;
  • code/trunk/src/orxonox/gamestates/GSMainMenu.cc

    r3196 r3280  
    4343namespace orxonox
    4444{
    45     AddGameState(GSMainMenu, "mainMenu");
     45    DeclareGameState(GSMainMenu, "mainMenu", false, true);
    4646
    47     GSMainMenu::GSMainMenu(const std::string& name)
    48         : GameState(name)
     47    GSMainMenu::GSMainMenu(const GameStateConstrParams& params)
     48        : GameState(params)
    4949        , inputState_(0)
    5050    {
     
    6767
    6868        // show main menu
    69         GUIManager::getInstance().showGUI("mainmenu_2");
     69        GUIManager::getInstance().showGUI("mainmenu_3");
    7070        GUIManager::getInstance().setCamera(this->camera_);
    7171        GraphicsManager::getInstance().setCamera(this->camera_);
  • code/trunk/src/orxonox/gamestates/GSMainMenu.h

    r3196 r3280  
    4040    {
    4141    public:
    42         GSMainMenu(const std::string& name);
     42        GSMainMenu(const GameStateConstrParams& params);
    4343        ~GSMainMenu();
    4444
  • code/trunk/src/orxonox/gamestates/GSRoot.cc

    r3196 r3280  
    3737#include "interfaces/TimeFactorListener.h"
    3838#include "interfaces/Tickable.h"
     39#include "LevelManager.h"
    3940
    4041namespace orxonox
    4142{
    42     AddGameState(GSRoot, "root", false);
    43     SetCommandLineSwitch(console);
     43    DeclareGameState(GSRoot, "root", true, false);
     44    SetCommandLineSwitch(console).information("Start in console mode (text IO only)");
    4445    // Shortcuts for easy direct loading
    45     SetCommandLineSwitch(server);
    46     SetCommandLineSwitch(client);
    47     SetCommandLineSwitch(dedicated);
    48     SetCommandLineSwitch(standalone);
    49 
    50     GSRoot::GSRoot(const std::string& name, bool countTickTime)
    51         : GameState(name, countTickTime)
     46    SetCommandLineSwitch(server).information("Start in server mode");
     47    SetCommandLineSwitch(client).information("Start in client mode");
     48    SetCommandLineSwitch(dedicated).information("Start in dedicated server mode");
     49    SetCommandLineSwitch(standalone).information("Start in standalone mode");
     50
     51    GSRoot::GSRoot(const GameStateConstrParams& params)
     52        : GameState(params)
    5253        , timeFactor_(1.0f)
    5354        , bPaused_(false)
     
    8384        }
    8485
     86        // create the global LevelManager
     87        this->levelManager_ = new LevelManager();
     88
    8589        // Load level directly?
    8690        bool loadLevel = false;
     
    129133        }
    130134*/
     135
     136        delete this->levelManager_;
    131137    }
    132138
  • code/trunk/src/orxonox/gamestates/GSRoot.h

    r3196 r3280  
    3838    {
    3939    public:
    40         GSRoot(const std::string& name, bool countTickTime);
     40        GSRoot(const GameStateConstrParams& params);
    4141        ~GSRoot();
    4242
     
    5252
    5353    private:
    54         float                 timeFactor_;       //!< A factor that sets the gamespeed. 1 is normal.
     54        float                 timeFactor_;              //!< A factor that sets the gamespeed. 1 is normal.
    5555        bool                  bPaused_;
    5656        float                 timeFactorPauseBackup_;
     57
     58        LevelManager*         levelManager_;            //!< global level manager
    5759
    5860        // console commands
  • code/trunk/src/orxonox/gamestates/GSServer.cc

    r3196 r3280  
    3737namespace orxonox
    3838{
    39     AddGameState(GSServer, "server");
     39    DeclareGameState(GSServer, "server", false, true);
    4040
    41     SetCommandLineArgument(port, 55556).shortcut("p").information("0-65535");
     41    SetCommandLineArgument(port, 55556).shortcut("p").information("Network communication port to be used 0-65535 (default: 55556)");
    4242
    43     GSServer::GSServer(const std::string& name)
    44         : GameState(name)
     43    GSServer::GSServer(const GameStateConstrParams& params)
     44        : GameState(params)
    4545        , server_(0)
    4646    {
  • code/trunk/src/orxonox/gamestates/GSServer.h

    r3196 r3280  
    4040    {
    4141    public:
    42         GSServer(const std::string& name);
     42        GSServer(const GameStateConstrParams& params);
    4343        ~GSServer();
    4444
  • code/trunk/src/orxonox/gamestates/GSStandalone.cc

    r3196 r3280  
    3434namespace orxonox
    3535{
    36     AddGameState(GSStandalone, "standalone");
     36    DeclareGameState(GSStandalone, "standalone", false, true);
    3737
    38     GSStandalone::GSStandalone(const std::string& name)
    39         : GameState(name)
     38    GSStandalone::GSStandalone(const GameStateConstrParams& params)
     39        : GameState(params)
    4040    {
    4141    }
  • code/trunk/src/orxonox/gamestates/GSStandalone.h

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