- int frameidx = (int) frame;
-
- if(frameidx >= get_frames() || frameidx < 0) {
-#ifndef DEBUG
- // in optimized mode we get some small rounding errors in floating point
- // number sometimes...
- log_warning << "frame out of range: " << frameidx << "/" << get_frames() << " at sprite: " << get_name() << "/" << get_action() << std::endl;
-#endif
- frameidx = get_frames() - 1;
- }
-
- context.draw_surface_part(action->surfaces[frameidx], source, size,
- pos - Vector(action->x_offset, action->y_offset),
- layer + action->z_order);
+ context.draw_surface_part(action->surfaces[frameidx],
+ Rectf(source, Sizef(size)),
+ Rectf(pos - Vector(action->x_offset, action->y_offset),
+ Sizef(size)),
+ layer + action->z_order);