Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 26, 2008, 4:26:04 PM (16 years ago)
Author:
rgrieder
Message:

Still working on the GameStates, but I have to save the work because of some major changes.

  • Exported InputManager- and TclThreadManager-tick to GSGraphics instead of Core
  • Fixed a few bugs in GameState by adding an internal state variable as bitfield (quite practical)
  • Fixed a bug in InputManager that occurred when destroying an active InputState
  • Added GSIO and GSIOConsole (3 lines of loop code with std::cin, but works ;))
  • Added more boost thread includes to OrxonoxStableHeaders.h
  • Many changes in all GameState derived classes
File:
1 edited

Legend:

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

    r1662 r1670  
    3838#include "core/ConfigValueIncludes.h"
    3939#include "core/input/InputManager.h"
    40 #include "core/Core.h"
     40#include "core/TclThreadManager.h"
     41//#include "core/Core.h"
    4142#include "overlays/console/InGameConsole.h"
    4243#include "gui/GUIManager.h"
     
    4849        : GameState("graphics")
    4950        , timer_(0)
    50         , bAbort_(false)
    5151        , debugRefreshTime_(0.0f)
    5252        , inputManager_(0)
     
    9090        // use the ogre timer class to measure time.
    9191        timer_ = new Ogre::Timer();
    92 
    93         // add console commands
    94         FunctorMember<GSGraphics>* functor = createFunctor(&GSGraphics::exitGame);
    95         functor->setObject(this);
    96         CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(functor, "exit"));
    9792    }
    9893
     
    123118        need the time. So we shouldn't run into problems.
    124119    */
    125     bool GSGraphics::tick(float dt)
     120    void GSGraphics::ticked(float dt)
    126121    {
    127122        // note: paramter 'dt' is of no meaning
     
    147142        {
    148143            timer_->reset();
    149             while (!bAbort_)
     144            while (!this->hasScheduledTransition())
    150145            {
    151146                // get current time
     
    154149                float dt = (timeBeforeTick - timeBeforeTickOld) / 1000000.0;
    155150
    156 
    157                 // tick the core (needs real time for input and tcl thread management)
    158                 // TODO: ticks of InputManager and tcl thread manager have to be separated.
    159                 Core::tick(dt);
    160 
    161                 // tick child state
    162                 if (this->getActiveChild())
    163                     this->getActiveChild()->tick(dt);
     151                this->inputManager_->tick(dt);
     152                TclThreadManager::getInstance().tick(dt);
     153
     154                this->tickChild(dt);
    164155
    165156                // tick console
     
    210201            COUT(1) << ex.what() << std::endl;
    211202            COUT(1) << "Main loop was stopped by an unhandled exception. Shutting down." << std::endl;
    212         }        return true;
     203        }
    213204    }
    214205}
Note: See TracChangeset for help on using the changeset viewer.