From: Christoph Sommer Date: Mon, 16 Apr 2007 18:18:40 +0000 (+0000) Subject: Sprites animation slows down together with the rest of the game: Now based on game_ti... X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=037c2fda32f118ad778cdb57c2c7efcbeb96fe6b;p=supertux.git Sprites animation slows down together with the rest of the game: Now based on game_time instead of real_time SVN-Revision: 4988 --- 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;