Sprites animation slows down together with the rest of the game: Now based on game_ti...
authorChristoph Sommer <mail@christoph-sommer.de>
Mon, 16 Apr 2007 18:18:40 +0000 (18:18 +0000)
committerChristoph Sommer <mail@christoph-sommer.de>
Mon, 16 Apr 2007 18:18:40 +0000 (18:18 +0000)
SVN-Revision: 4988

src/sprite/sprite.cpp

index 7b81827..0841a06 100644 (file)
@@ -41,7 +41,7 @@ Sprite::Sprite(SpriteData& newdata)
   action = data.get_action("normal");
   if(!action)
     action = data.actions.begin()->second;
-  last_ticks = real_time;
+  last_ticks = game_time;
 }
 
 Sprite::Sprite(const Sprite& other)
@@ -51,7 +51,7 @@ Sprite::Sprite(const Sprite& other)
     color(1.0f, 1.0f, 1.0f, 1.0f),
     action(other.action)
 {
-  last_ticks = real_time;
+  last_ticks = game_time;
 }
 
 Sprite::~Sprite()
@@ -87,8 +87,8 @@ Sprite::update()
   if(animation_done())
     return;
 
-  float frame_inc = action->fps * (real_time - last_ticks);
-  last_ticks = real_time;
+  float frame_inc = action->fps * (game_time - last_ticks);
+  last_ticks = game_time;
 
   frame += frame_inc;