Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 16, 2008, 6:01:13 PM (15 years ago)
Author:
landauf
Message:

Merged objecthierarchy2 into presentation branch

Couln't merge 2 lines in Gamestate.cc and a whole block of code in GSDedicated.cc (it seems like oli implemented in both branches something like a network-tick-limiter but with different approaches)

Not yet tested in network mode and with bots
The SpaceShips movement is also not yet fully adopted to the new physics (see Engine class)

Location:
code/branches/presentation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation

  • code/branches/presentation/src/orxonox/Main.cc

    r2103 r2485  
    4343#include "core/ConfigFileManager.h"
    4444#include "core/CommandLine.h"
     45#include "core/CommandExecutor.h"
     46#include "core/Identifier.h"
     47#include "core/Core.h"
     48#include "core/Language.h"
    4549
    4650#include "gamestates/GSRoot.h"
     
    9296
    9397    // create a signal handler (only works for linux)
    94     SignalHandler::getInstance()->doCatch(argv[0], "orxonox.log");
     98    SignalHandler signalHandler;
     99    signalHandler.doCatch(argv[0], "orxonox.log");
    95100
    96101    // Parse command line arguments
     
    109114    ConfigFileManager* configFileManager = new ConfigFileManager();
    110115    configFileManager->setFilename(ConfigFileType::Settings, CommandLine::getValue("settingsFile").getString());
     116    // create the Core settings to configure the output level
     117    Language* language = new Language();
     118    Core*     core     = new Core();
    111119
    112     // create the gamestates
    113     GSRoot root;
    114     GSGraphics graphics;
    115     GSStandalone standalone;
    116     GSServer server;
    117     GSClient client;
    118     GSDedicated dedicated;
    119     GSGUI gui;
    120     GSIOConsole ioConsole;
     120    // put GameStates in its own scope so we can destroy the identifiers at the end of main().
     121    {
     122        // create the gamestates
     123        GSRoot root;
     124        GSGraphics graphics;
     125        GSStandalone standalone;
     126        GSServer server;
     127        GSClient client;
     128        GSDedicated dedicated;
     129        GSGUI gui;
     130        GSIOConsole ioConsole;
    121131
    122     // make the hierarchy
    123     root.addChild(&graphics);
    124     graphics.addChild(&standalone);
    125     graphics.addChild(&server);
    126     graphics.addChild(&client);
    127     graphics.addChild(&gui);
    128     root.addChild(&ioConsole);
    129     root.addChild(&dedicated);
     132        // make the hierarchy
     133        root.addChild(&graphics);
     134        graphics.addChild(&standalone);
     135        graphics.addChild(&server);
     136        graphics.addChild(&client);
     137        graphics.addChild(&gui);
     138        root.addChild(&ioConsole);
     139        root.addChild(&dedicated);
    130140
    131     // Here happens the game
    132     root.start();
     141        // Here happens the game
     142        root.start();
     143    }
    133144
    134     // Destroy ConfigFileManager again.
     145    // destroy singletons
     146    delete core;
     147    delete language;
    135148    delete configFileManager;
     149
     150    // Clean up class hierarchy stuff (identifiers, xmlport, configvalue, consolecommand)
     151    Identifier::destroyAllIdentifiers();
     152    // destroy command line arguments
     153    CommandLine::destroyAllArguments();
     154    // Also delete external console command that don't belong to an Identifier
     155    CommandExecutor::destroyExternalCommands();
    136156
    137157    return 0;
Note: See TracChangeset for help on using the changeset viewer.