Limitated the number of bullets to be shot at the same time.
[supertux.git] / src / sprite.cpp
index b5a091d..434c7d5 100644 (file)
@@ -18,6 +18,7 @@
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include <iostream>
+#include <math.h>
 #include "globals.h"
 #include "sprite.h"
 
@@ -71,6 +72,16 @@ Sprite::draw(float x, float y)
 }
 
 void
+Sprite::draw_part(float sx, float sy, float x, float y, float w, float h)
+{
+  time = SDL_GetTicks();
+  unsigned int frame = get_current_frame();
+
+  if (frame < surfaces.size())
+    surfaces[frame]->draw_part(sx, sy, x - x_hotspot, y - y_hotspot, w, h);
+}
+
+void
 Sprite::reset()
 {
   time = 0;