Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8830


Ignore:
Timestamp:
Aug 7, 2011, 10:51:54 PM (13 years ago)
Author:
landauf
Message:

added some output (user and internal) throughout the initialization of the game, graphics, and game states

Location:
code/branches/output/src
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • code/branches/output/src/Orxonox.cc

    r8812 r8830  
    6161    using namespace orxonox;
    6262
     63    orxout(user_status) << "Welcome to Orxonox (v" << ORXONOX_VERSION_MAJOR << '.' << ORXONOX_VERSION_MINOR << '.' << ORXONOX_VERSION_PATCH << ' ' << ORXONOX_VERSION_NAME << ')' << endl;
     64    orxout(internal_status) << "Congratulations, you survived the static initialization. Entering main()" << endl;
     65    if (argc > 0)
     66        orxout(internal_info) << "argv[0]: " << argv[0] << endl;
     67
    6368    try
    6469    {
     
    7883#endif
    7984
    80         return main(strCmdLine);
     85        int value = main(strCmdLine);
     86        orxout(internal_status) << "Terminating main() normally with value " << value << endl;
     87        return value;
    8188    }
    8289    catch (...)
    8390    {
    84         orxout(user_error) << "Orxonox failed to initialise: " << orxonox::Exception::handleMessage() << endl;
     91        orxout(user_error) << "Exception caught in main(): " << orxonox::Exception::handleMessage() << endl;
    8592        orxout(user_error) << "Terminating program." << endl;
    8693        return 1;
  • code/branches/output/src/libraries/core/Core.cc

    r8806 r8830  
    112112        , destructionHelper_(this)
    113113    {
     114        orxout(internal_status) << "initializing Core object..." << endl;
     115
    114116        // Set the hard coded fixed paths
    115117        this->pathConfig_ = new PathConfig();
     
    119121
    120122        // Load modules
     123        orxout(internal_info) << "Loading modules:" << endl;
    121124        const std::vector<std::string>& modulePaths = this->pathConfig_->getModulePaths();
    122125        for (std::vector<std::string>::const_iterator it = modulePaths.begin(); it != modulePaths.end(); ++it)
     
    138141        this->pathConfig_->setConfigurablePaths();
    139142
     143        orxout(internal_info) << "Root path:       " << PathConfig::getRootPathString() << endl;
     144        orxout(internal_info) << "Executable path: " << PathConfig::getExecutablePathString() << endl;
     145        orxout(internal_info) << "Data path:       " << PathConfig::getDataPathString() << endl;
     146        orxout(internal_info) << "Ext. data path:  " << PathConfig::getExternalDataPathString() << endl;
     147        orxout(internal_info) << "Config path:     " << PathConfig::getConfigPathString() << endl;
     148        orxout(internal_info) << "Log path:        " << PathConfig::getLogPathString() << endl;
     149        orxout(internal_info) << "Modules path:    " << PathConfig::getModulePathString() << endl;
     150
    140151        // create a signal handler (only active for Linux)
    141152        // This call is placed as soon as possible, but after the directories are set
     
    153164
    154165        // Manage ini files and set the default settings file (usually orxonox.ini)
     166        orxout(internal_info) << "Loading config:" << endl;
    155167        this->configFileManager_ = new ConfigFileManager();
    156168        this->configFileManager_->setFilename(ConfigFileType::Settings,
     
    158170
    159171        // Required as well for the config values
     172        orxout(internal_info) << "Loading language:" << endl;
    160173        this->languageInstance_ = new Language();
    161174
     
    163176        // possibility to configure everything below here
    164177        RegisterRootObject(Core);
     178        orxout(internal_info) << "configuring Core" << endl;
    165179        this->setConfigValues();
    166180
     
    175189        }
    176190        if (this->bStartIOConsole_)
     191        {
     192            orxout(internal_info) << "creating IO console" << endl;
    177193            this->ioConsole_ = new IOConsole();
     194        }
    178195#endif
    179196
    180197        // creates the class hierarchy for all classes with factories
     198        orxout(internal_info) << "creating class hierarchy" << endl;
    181199        Identifier::createClassHierarchy();
    182200
    183201        // Load OGRE excluding the renderer and the render window
     202        orxout(internal_info) << "creating GraphicsManager:" << endl;
    184203        this->graphicsManager_ = new GraphicsManager(false);
    185204
     
    189208
    190209        // Create singletons that always exist (in other libraries)
     210        orxout(internal_info) << "creating root scope:" << endl;
    191211        this->rootScope_ = new Scope<ScopeID::Root>();
    192212
     
    205225                orxout(internal_error) << "Could not open file for documentation writing" << endl;
    206226        }
     227
     228        orxout(internal_status) << "finished initializing Core object" << endl;
    207229    }
    208230
    209231    void Core::destroy()
    210232    {
     233        orxout(internal_status) << "destroying Core object..." << endl;
     234
    211235        // Remove us from the object lists again to avoid problems when destroying them
    212236        this->unregisterObject();
     
    227251        safeObjectDelete(&dynLibManager_);
    228252        safeObjectDelete(&pathConfig_);
     253
     254        orxout(internal_status) << "finished destroying Core object" << endl;
    229255    }
    230256
     
    310336    void Core::loadGraphics()
    311337    {
     338        orxout(internal_info) << "loading graphics in Core" << endl;
     339       
    312340        // Any exception should trigger this, even in upgradeToGraphics (see its remarks)
    313341        Loki::ScopeGuard unloader = Loki::MakeObjGuard(*this, &Core::unloadGraphics);
     
    351379
    352380        // Create singletons associated with graphics (in other libraries)
     381        orxout(internal_info) << "creating graphics scope:" << endl;
    353382        graphicsScope_ = new Scope<ScopeID::Graphics>();
    354383
    355384        unloader.Dismiss();
     385
     386        orxout(internal_info) << "finished loading graphics in Core" << endl;
    356387    }
    357388
    358389    void Core::unloadGraphics()
    359390    {
     391        orxout(internal_info) << "unloading graphics in Core" << endl;
     392
    360393        safeObjectDelete(&graphicsScope_);
    361394        safeObjectDelete(&guiManager_);
  • code/branches/output/src/libraries/core/GUIManager.cc

    r8806 r8830  
    257257    {
    258258        RegisterRootObject(GUIManager);
     259
     260        orxout(internal_status) << "initializing GUIManager..." << endl;
     261
    259262        this->setConfigValues();
    260263
     
    335338        // Set up the sheet manager in the Lua framework
    336339        this->luaState_->doFile("SheetManager.lua");
     340
     341        orxout(internal_status) << "finished initializing GUIManager" << endl;
    337342    }
    338343
    339344    void GUIManager::destroy()
    340345    {
     346        orxout(internal_status) << "destroying GUIManager..." << endl;
     347
    341348        using namespace CEGUI;
    342349
     
    355362#endif
    356363        safeObjectDelete(&luaState_);
     364
     365        orxout(internal_status) << "finished destroying GUIManager" << endl;
    357366    }
    358367
  • code/branches/output/src/libraries/core/Game.cc

    r8806 r8830  
    8484        , destructionHelper_(this)
    8585    {
     86        orxout(internal_status) << "initializing Game object..." << endl;
     87
    8688#ifdef ORXONOX_PLATFORM_WINDOWS
    8789        minimumSleepTime_ = 1000/*us*/;
     
    106108
    107109        // Create the Core
     110        orxout(internal_info) << "creating Core object:" << endl;
    108111        this->core_ = new Core(cmdLine);
    109112
     
    125128        this->loadedTopStateNode_ = this->rootStateNode_;
    126129        this->loadedStates_.push_back(this->getState(rootStateNode_->name_));
     130
     131        orxout(internal_status) << "finished initializing Game object" << endl;
    127132    }
    128133
    129134    void Game::destroy()
    130135    {
     136        orxout(internal_status) << "destroying Game object..." << endl;
     137
    131138        // Remove us from the object lists again to avoid problems when destroying them
    132139        this->unregisterObject();
     
    139146        safeObjectDelete(&core_);
    140147        safeObjectDelete(&gameClock_);
     148
     149        orxout(internal_status) << "finished destroying Game object..." << endl;
    141150    }
    142151
     
    165174            orxout(user_error) << "Starting game without requesting GameState. This automatically terminates the program." << endl;
    166175
     176        // Update the GameState stack if required. We do this already here to have a properly initialized game before entering the main loop
     177        this->updateGameStateStack();
     178
     179        orxout(user_status) << "Game loaded" << endl;
     180        orxout(internal_status) << "--------------------------------------------------" << endl;
     181        orxout(internal_status) << "starting main loop..." << endl;
     182
    167183        // START GAME
    168184        // first delta time should be about 0 seconds
     
    217233                this->updateFPSLimiter();
    218234        }
     235
     236        orxout(internal_status) << "finished main loop" << endl;
     237        orxout(internal_status) << "--------------------------------------------------" << endl;
    219238
    220239        // UNLOAD all remaining states
     
    338357    void Game::stop()
    339358    {
     359        orxout(user_status) << "Exit" << endl;
    340360        this->bAbort_ = true;
    341361    }
     
    507527        if (!GameMode::showsGraphics())
    508528        {
     529            orxout(user_status) << "Loading graphics" << endl;
     530            orxout(internal_info) << "loading graphics in Game" << endl;
     531
    509532            core_->loadGraphics();
    510533            Loki::ScopeGuard graphicsUnloader = Loki::MakeObjGuard(*this, &Game::unloadGraphics);
     
    524547            }
    525548            graphicsUnloader.Dismiss();
     549
     550            orxout(internal_info) << "finished loading graphics in Game" << endl;
    526551        }
    527552    }
     
    531556        if (GameMode::showsGraphics())
    532557        {
     558            orxout(user_status) << "Unloading graphics" << endl;
     559            orxout(internal_info) << "unloading graphics in Game" << endl;
     560
    533561            // Destroy all the GameStates that require graphics
    534562            for (GameStateMap::iterator it = constructedStates_.begin(); it != constructedStates_.end();)
     
    555583    void Game::loadState(const std::string& name)
    556584    {
     585        orxout(internal_status) << "loading state '" << name << "'" << endl;
     586
    557587        this->bChangingState_ = true;
    558588        LOKI_ON_BLOCK_EXIT_OBJ(*this, &Game::resetChangingState); (void)LOKI_ANONYMOUS_VARIABLE(scopeGuard);
     
    577607    void Game::unloadState(const std::string& name)
    578608    {
     609        orxout(internal_status) << "unloading state '" << name << "'" << endl;
     610
    579611        this->bChangingState_ = true;
    580612        try
  • code/branches/output/src/libraries/core/GraphicsManager.cc

    r8820 r8830  
    104104        RegisterObject(GraphicsManager);
    105105
     106        orxout(internal_status) << "initializing GraphicsManager..." << endl;
    106107        this->setConfigValues();
    107108
     
    129130            this->upgradeToGraphics();
    130131        }
     132
     133        orxout(internal_status) << "finished initializing GraphicsManager" << endl;
    131134    }
    132135
    133136    void GraphicsManager::destroy()
    134137    {
     138        orxout(internal_status) << "destroying GraphicsManager..." << endl;
     139
    135140        Loader::unload(debugOverlay_.get());
    136141
     
    148153        safeObjectDelete(&ogreLogger_);
    149154        safeObjectDelete(&ogreWindowEventListener_);
     155
     156        orxout(internal_status) << "finished destroying GraphicsManager" << endl;
    150157    }
    151158
     
    173180            return;
    174181
     182        orxout(internal_info) << "GraphicsManager upgrade to graphics" << endl;
     183
    175184        // load all the required plugins for Ogre
    176185        this->loadOgrePlugins();
     
    183192        // choose another resource group.
    184193        Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
     194
     195        orxout(internal_info) << "GraphicsManager finished upgrade to graphics" << endl;
    185196    }
    186197
     
    239250    void GraphicsManager::loadOgrePlugins()
    240251    {
     252        orxout(internal_info) << "loading ogre plugins" << endl;
     253
    241254        // Plugin path can have many different locations...
    242255        std::string pluginPath = specialConfig::ogrePluginsDirectory;
  • code/branches/output/src/libraries/core/Language.cc

    r8806 r8830  
    201201    void Language::readDefaultLanguageFile()
    202202    {
    203         orxout(internal_status, context::language) << "Read default language file." << endl;
     203        orxout(internal_info, context::language) << "Read default language file." << endl;
    204204
    205205        const std::string& filepath = PathConfig::getConfigPathString() + getFilename(this->defaultLanguage_);
     
    250250    void Language::readTranslatedLanguageFile()
    251251    {
    252         orxout(internal_status, context::language) << "Read translated language file (" << Core::getInstance().getLanguage() << ")." << endl;
     252        orxout(internal_info, context::language) << "Read translated language file (" << Core::getInstance().getLanguage() << ")." << endl;
    253253
    254254        const std::string& filepath = PathConfig::getConfigPathString() + getFilename(Core::getInstance().getLanguage());
     
    263263            orxout(internal_error, context::language) << "Couldn't open file " << getFilename(Core::getInstance().getLanguage()) << " to read the translated language entries!" << endl;
    264264            Core::getInstance().resetLanguage();
    265             orxout(internal_status, context::language) << "Reset language to " << this->defaultLanguage_ << '.' << endl;
     265            orxout(internal_info, context::language) << "Reset language to " << this->defaultLanguage_ << '.' << endl;
    266266            return;
    267267        }
     
    304304    void Language::writeDefaultLanguageFile() const
    305305    {
    306         orxout(internal_status, context::language) << "Write default language file." << endl;
     306        orxout(internal_info, context::language) << "Write default language file." << endl;
    307307
    308308        const std::string& filepath = PathConfig::getConfigPathString() + getFilename(this->defaultLanguage_);
  • code/branches/output/src/libraries/core/Loader.cc

    r8820 r8830  
    189189            if(bVerbose)
    190190            {
    191                 orxout(user_status, context::loader) << "Start loading " << file->getFilename() << "..." << endl;
     191                orxout(user_info) << "Start loading " << file->getFilename() << "..." << endl;
    192192                orxout(internal_info, context::loader) << "Mask: " << Loader::currentMask_s << endl;
    193193            }
     
    217217
    218218            if(bVerbose)
    219                 orxout(user_status, context::loader) << "Finished loading " << file->getFilename() << '.' << endl;
     219                orxout(user_info) << "Finished loading " << file->getFilename() << '.' << endl;
    220220            else
    221221                orxout(verbose, context::loader) << "Finished loading " << file->getFilename() << '.' << endl;
  • code/branches/output/src/libraries/util/Scope.h

    r8804 r8830  
    128128            Scope()
    129129            {
     130                orxout(internal_status) << "creating scope... (" << scope << ")" << endl;
     131
    130132                try
    131133                {
     
    148150                    throw;
    149151                }
     152
     153                orxout(internal_status) << "created scope (" << scope << ")" << endl;
    150154            }
    151155
     
    153157            ~Scope()
    154158            {
     159                orxout(internal_status) << "destroying scope... (" << scope << ")" << endl;
     160
    155161                ScopeManager::instanceCounts_s[scope]--;
    156162
     
    162168                if (ScopeManager::instanceCounts_s[scope] == 0)
    163169                    this->deactivateListeners();
     170
     171                orxout(internal_status) << "destroyed scope (" << scope << ")" << endl;
    164172            }
    165173
  • code/branches/output/src/orxonox/Main.cc

    r8729 r8830  
    6161    int main(const std::string& strCmdLine)
    6262    {
     63        orxout(internal_status) << "entering orxonox::main()" << endl;
     64        orxout(internal_info) << "command line: " << strCmdLine << endl;
     65
     66        orxout(internal_info) << "creating Game object:" << endl;
    6367        Game* game = new Game(strCmdLine);
     68        orxout(user_status) << "Finished initialization" << endl;
    6469
    6570        if (CommandLineParser::getValue("generateDoc").getString().empty())
    6671        {
     72            orxout(internal_info) << "preparing game states" << endl;
     73
    6774            /* TODO make this clear */
    6875            game->setStateHierarchy(
     
    98105            }
    99106
     107            orxout(internal_info) << "starting game" << endl;
    100108            game->run();
    101109        }
  • code/branches/output/src/orxonox/gamestates/GSClient.cc

    r8788 r8830  
    5252    void GSClient::activate()
    5353    {
     54        orxout(user_status) << "Starting client" << endl;
     55
    5456        GameMode::setIsClient(true);
    5557
  • code/branches/output/src/orxonox/gamestates/GSLevel.cc

    r8809 r8830  
    7474    void GSLevel::activate()
    7575    {
     76        orxout(user_status) << "Loading level" << endl;
     77
    7678        if (GameMode::showsGraphics())
    7779        {
     
    155157
    156158        // call the loader
    157         orxout(user_status) << "Loading level..." << endl;
    158159        startFile_ = new XMLFile(LevelManager::getInstance().getDefaultLevel());
    159160        bool loaded = Loader::open(startFile_);
     
    169170        delete startFile_;
    170171
    171         orxout(user_status) << "Unloaded level" << endl;
    172172        orxout(internal_info) << "Remaining objects:" << endl;
    173173        unsigned int i = 0;
  • code/branches/output/src/orxonox/gamestates/GSMainMenu.cc

    r8079 r8830  
    9595    void GSMainMenu::activate()
    9696    {
     97        orxout(user_status) << "Loading main menu" << endl;
     98
    9799        // show main menu
    98100        GraphicsManager::getInstance().setCamera(this->camera_);
  • code/branches/output/src/orxonox/gamestates/GSMasterServer.cc

    r8809 r8830  
    5050  void GSMasterServer::activate()
    5151  {
     52    orxout(user_status) << "Starting masterserver" << endl;
     53
    5254    /* TODO make this work for masterserver as well */
    5355    //GameMode::setIsServer(true);
    5456
    5557    this->mserver = new MasterServer();
    56     orxout(user_status) << "Loading masterserver mode" << endl;
    57 
    5858    this->mserver->run();
    5959  }
  • code/branches/output/src/orxonox/gamestates/GSServer.cc

    r8809 r8830  
    5454    void GSServer::activate()
    5555    {
     56        orxout(user_status) << "Starting server" << endl;
     57
    5658        GameMode::setIsServer(true);
    5759
  • code/branches/output/src/orxonox/sound/SoundManager.cc

    r8809 r8830  
    7171        RegisterRootObject(SoundManager);
    7272
     73        orxout(user_status) << "Loading sound" << endl;
     74
    7375        this->bDestructorCalled_ = false;
    7476         
Note: See TracChangeset for help on using the changeset viewer.