Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10613 in orxonox.OLD


Ignore:
Timestamp:
Mar 30, 2007, 11:28:20 AM (17 years ago)
Author:
rennerc
Message:

allow user to use shell with high gamespeed

Location:
branches/cleanup/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/cleanup/src/lib/shell/shell_input.cc

    r9916 r10613  
    2424#include "compiler.h"
    2525#include "key_names.h"
     26
     27#include "game_world.h"
     28#include "state.h"
    2629
    2730
     
    284287  {
    285288    if (this->delayed > 0.0)
    286       this->delayed -= dt;
     289    {
     290      StoryEntity* storyEntity = State::getCurrentStoryEntity();
     291      float speed = 1;
     292      if ( storyEntity && storyEntity->isA( GameWorld::staticClassID() ) )
     293      {
     294        speed = ((GameWorld*)storyEntity)->getSpeed();
     295      }
     296      this->delayed -= dt / speed;
     297    }
    287298    else if (this->pressedKey != SDLK_FIRST )
    288299    {
  • branches/cleanup/src/story_entities/game_world.h

    r10428 r10613  
    5656  inline double getGameTime() { return this->gameTime; }
    5757  /** sets the game speed @param speed speed of the Game */
    58   inline void setSpeed(float speed) { this->speed = speed; };
     58  inline void setSpeed(float speed) { this->speed = speed; }
     59  inline float getSpeed(){ return this->speed; }
    5960  /**  returns the track path of this world @returns the track path */
    6061
Note: See TracChangeset for help on using the changeset viewer.