diff --git a/src/sdl/image.cpp b/src/sdl/image.cpp index 24b91f70c292..342d395fd1f1 100644 --- a/src/sdl/image.cpp +++ b/src/sdl/image.cpp @@ -287,6 +287,21 @@ bool timage::null() const return image_ == NULL; } +timage timage::clone() const +{ + timage res; + res.image_ = GPU_CopyImage(image_); + res.set_alpha(alpha()); + res.set_clip(clip()); + res.set_color_mod(red_mod(), green_mod(), blue_mod()); + res.set_wrap(hwrap(), vwrap()); + res.set_rotation(rotation()); + res.set_scale(hscale(), vscale()); + res.set_smooth_scaling(smooth_scaling()); + + return res; +} + } #endif diff --git a/src/sdl/image.hpp b/src/sdl/image.hpp index d97a0ea5488e..bc0dfbdc585d 100644 --- a/src/sdl/image.hpp +++ b/src/sdl/image.hpp @@ -243,6 +243,8 @@ class timage */ bool null() const; + timage clone() const; + private: /** The texture itself. */ GPU_Image *image_;