From 037c2fda32f118ad778cdb57c2c7efcbeb96fe6b Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Mon, 16 Apr 2007 18:18:40 +0000 Subject: [PATCH] Sprites animation slows down together with the rest of the game: Now based on game_time instead of real_time SVN-Revision: 4988 --- src/sprite/sprite.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sprite/sprite.cpp b/src/sprite/sprite.cpp index 7b818279a..0841a0641 100644 --- a/src/sprite/sprite.cpp +++ b/src/sprite/sprite.cpp @@ -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; -- 2.11.0