From: Marek Moeckel Date: Sun, 16 Oct 2005 16:25:01 +0000 (+0000) Subject: commented out an error-message line in glutil.hpp that caused linking errors X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=b08db3ab7e6d4447f8005dcf5a6c9e61a7f8e937;p=supertux.git commented out an error-message line in glutil.hpp that caused linking errors snowsnail starts spinning fast when hit and gets slower over time SVN-Revision: 2855 --- diff --git a/data/images/sprites.strf b/data/images/sprites.strf index 0c72c549e..953ff3c67 100644 --- a/data/images/sprites.strf +++ b/data/images/sprites.strf @@ -854,7 +854,7 @@ (action (name "flat-left") (x-offset 2) (y-offset 3) - (images "creatures/snowsnail/snowsnail_flip1.png" + (images "creatures/snowsnail/snowsnail_flip1.png" "creatures/snowsnail/snowsnail_flip2.png" "creatures/snowsnail/snowsnail_flip3.png" "creatures/snowsnail/snowsnail_flip4.png" diff --git a/src/badguy/snowsnail.cpp b/src/badguy/snowsnail.cpp index e3a86645d..fdb10afd1 100644 --- a/src/badguy/snowsnail.cpp +++ b/src/badguy/snowsnail.cpp @@ -70,6 +70,9 @@ SnowSnail::activate() void SnowSnail::active_update(float elapsed_time) { + if(flat_timer.started()) { + sprite->set_fps(64 - 15 * flat_timer.get_timegone()); + } if(ice_state == ICESTATE_FLAT && flat_timer.check()) { ice_state = ICESTATE_NORMAL; physic.set_velocity_x(dir == LEFT ? -WALKSPEED : WALKSPEED); @@ -157,6 +160,7 @@ SnowSnail::collision_squished(Player& player) physic.set_velocity_y(0); sprite->set_action(dir == LEFT ? "flat-left" : "flat-right"); + sprite->set_fps(64); flat_timer.start(4); ice_state = ICESTATE_FLAT; break; diff --git a/src/sprite/sprite.cpp b/src/sprite/sprite.cpp index 50475461e..78972c923 100644 --- a/src/sprite/sprite.cpp +++ b/src/sprite/sprite.cpp @@ -138,4 +138,10 @@ Sprite::get_height() const return (int) action->surfaces[get_frame()]->get_height(); } +void +Sprite::set_fps(float new_fps) +{ + action->fps = new_fps; +} + diff --git a/src/sprite/sprite.hpp b/src/sprite/sprite.hpp index 1c166326f..cf5e6039b 100644 --- a/src/sprite/sprite.hpp +++ b/src/sprite/sprite.hpp @@ -46,6 +46,9 @@ public: /** Set action (or state) */ void set_action(const std::string& act, int loops = -1); + /** Set framerate */ + void set_fps(float new_fps); + /* Stop animation */ void stop_animation() { animation_loops = 0; } diff --git a/src/video/glutil.hpp b/src/video/glutil.hpp index f7d43109c..bed97538d 100644 --- a/src/video/glutil.hpp +++ b/src/video/glutil.hpp @@ -30,8 +30,8 @@ static inline void assert_gl(const char* message) GLenum error = glGetError(); if(error != GL_NO_ERROR) { std::ostringstream msg; - msg << "OpenGLError while '" << message << "': " - << gluErrorString(error); + msg << "OpenGLError while '" << message << "': "; + //<< gluErrorString(error); throw std::runtime_error(msg.str()); } #endif