X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Ftile.cpp;h=7c7204a82a7f49e586d461aa78113e230dd26438;hb=2dcdb5c4759e73d6961770fed7250a939be3063f;hp=29575a04eb942a88b5aabd5f3b8b8bd4561ff519;hpb=d46c78c842ab4090a3f46e560c891234167f124b;p=supertux.git diff --git a/src/tile.cpp b/src/tile.cpp index 29575a04e..7c7204a82 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -17,7 +17,6 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA // 02111-1307, USA. - #include #include @@ -101,7 +100,7 @@ std::vector create_surfaces(lisp_object_t* cur) } Tile::Tile() - : id(0), attributes(0), data(0), next_tile(0), anim_speed(25) + : id(0), attributes(0), data(0), next_tile(0), anim_fps(1) { } @@ -147,7 +146,7 @@ Tile::read(LispReader& reader) attributes |= GOAL; reader.read_int("data", data); - reader.read_int("anim-speed", anim_speed); + reader.read_float("anim-fps", anim_fps); reader.read_int("next-tile", next_tile); if(reader.read_int("slope-type", data)) { @@ -162,7 +161,7 @@ void Tile::draw(DrawingContext& context, const Vector& pos, int layer) const { if(images.size() > 1) { - size_t frame = ((global_frame_counter*25) / anim_speed) % images.size(); + size_t frame = size_t(global_time * anim_fps) % images.size(); context.draw_surface(images[frame], pos, layer); } else if (images.size() == 1) { context.draw_surface(images[0], pos, layer);