Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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/libraries
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.