commented out an error-message line in glutil.hpp that caused linking errors
authorMarek Moeckel <wansti@gmx.de>
Sun, 16 Oct 2005 16:25:01 +0000 (16:25 +0000)
committerMarek Moeckel <wansti@gmx.de>
Sun, 16 Oct 2005 16:25:01 +0000 (16:25 +0000)
snowsnail starts spinning fast when hit and gets slower over time

SVN-Revision: 2855

data/images/sprites.strf
src/badguy/snowsnail.cpp
src/sprite/sprite.cpp
src/sprite/sprite.hpp
src/video/glutil.hpp

index 0c72c54..953ff3c 100644 (file)
     (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"
index e3a8664..fdb10af 100644 (file)
@@ -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;
index 5047546..78972c9 100644 (file)
@@ -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;
+}
+
 
index 1c16632..cf5e603 100644 (file)
@@ -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; }
index f7d4310..bed9753 100644 (file)
@@ -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