31 int margin,
int spacing) :
35 for (
int y = margin; y + height <= img->
getHeight() - margin; y += height + spacing)
37 for (
int x = margin; x + width <= img->
getWidth() - margin; x += width + spacing)
53 Log::warn(
"No sprite %d in this image set", (
int) i);
std::vector< Image * > mImages
ImageSet(Image *img, int w, int h, int margin=0, int spacing=0)
Cuts the passed image in a grid of sub images.
Image * get(size_t i) const
Defines a class for loading and storing images.
int getHeight() const
Returns the height of the image.
int getWidth() const
Returns the width of the image.
Image * getSubImage(int x, int y, int width, int height)
Creates a new image with the desired clipping rectangle.
void delete_all(Container &c)
void warn(const char *log_text,...) LOG_PRINTF_ATTR