diff --git a/sdlpp/sdlpp_renderobject.cpp b/sdlpp/sdlpp_renderobject.cpp index 4cd1d5c..101e681 100644 --- a/sdlpp/sdlpp_renderobject.cpp +++ b/sdlpp/sdlpp_renderobject.cpp @@ -223,6 +223,9 @@ void RenderObject::setTextureSourceRect( const SDL_Rect &source_rect ) { void RenderObject::setTextureSourceRect( int x, int y, int w, int h ) { setTextureSourceRect( { x, y, w, h } ); } +SDL_Rect RenderObject::getTextureSourceRect() const { + return src_rect; +} void RenderObject::setAnimationFrames( const std::vector< SDL_Rect > &frames ) { animation = frames; } diff --git a/sdlpp/sdlpp_renderobject.hpp b/sdlpp/sdlpp_renderobject.hpp index 256258c..ef9f97e 100644 --- a/sdlpp/sdlpp_renderobject.hpp +++ b/sdlpp/sdlpp_renderobject.hpp @@ -111,6 +111,7 @@ public: void setTextureAlpha( uint8_t alpha ); void setTextureSourceRect( const SDL_Rect &source_rect ); void setTextureSourceRect( int x, int y, int w, int h ); + SDL_Rect getTextureSourceRect() const; void setAnimationFrames( const std::vector< SDL_Rect > &frames ); void addAnimationFrame( const SDL_Rect &frame ); void addAnimationFrame( const int x, const int y, const int w,