+ update();
+
+ if((int)frame >= get_frames() || (int)frame < 0)
+ std::cerr << "Warning: frame out of range: " << (int)frame
+ << "/" << get_frames() << " at " << get_name()
+ << "/" << get_action_name() << std::endl;
+ else
+ context.draw_surface(action->surfaces[(int)frame],
+ pos - Vector(action->x_offset, action->y_offset), layer + action->z_order,
+ action->mirror ? drawing_effect | HORIZONTAL_FLIP : drawing_effect);
+}
+
+void
+Sprite::draw_part(DrawingContext& context, const Vector& source, const Vector& size,
+ const Vector& pos, int layer, Uint32 drawing_effect)
+{
+ update();
+
+ if((int)frame >= get_frames() || (int)frame < 0)
+ std::cerr << "Warning: frame out of range: " << (int)frame
+ << "/" << get_frames() << " at sprite: " << get_name()
+ << "/" << get_action_name() << std::endl;
+ else
+ context.draw_surface_part(action->surfaces[(int)frame], source, size,
+ pos - Vector(action->x_offset, action->y_offset), layer + action->z_order,
+ action->mirror ? drawing_effect | HORIZONTAL_FLIP : drawing_effect);