diff --git a/src/commands/cmd_export_sprite_sheet.cpp b/src/commands/cmd_export_sprite_sheet.cpp index 40f87df52..f1fc425d1 100644 --- a/src/commands/cmd_export_sprite_sheet.cpp +++ b/src/commands/cmd_export_sprite_sheet.cpp @@ -140,13 +140,18 @@ protected: int sheet_w = sprite->getWidth()*columns; int sheet_h = sprite->getHeight()*((nframes/columns)+((nframes%columns)>0?1:0)); UniquePtr resultImage(Image::create(sprite->getPixelFormat(), sheet_w, sheet_h)); + UniquePtr tempImage(Image::create(sprite->getPixelFormat(), sprite->getWidth(), sprite->getHeight())); image_clear(resultImage, 0); int oldFrame = sprite->getCurrentFrame(); int column = 0, row = 0; for (int frame=0; frameclear(0); sprite->setCurrentFrame(frame); - sprite->render(resultImage, column*sprite->getWidth(), row*sprite->getHeight()); + sprite->render(tempImage, 0, 0); + resultImage->copy(tempImage, column*sprite->getWidth(), row*sprite->getHeight()); if (++column >= columns) { column = 0;