SDLPP: add function to change texture while keeping SRC rect
This commit is contained in:
parent
0e71dfa7d5
commit
79d9f266b4
@ -78,6 +78,9 @@ void RenderObject::setTexture( const std::shared_ptr< Texture > &t,
|
|||||||
texture = t;
|
texture = t;
|
||||||
src_rect = source_rect;
|
src_rect = source_rect;
|
||||||
}
|
}
|
||||||
|
void RenderObject::setTextureKeepSRC( const std::shared_ptr< Texture > &t ) {
|
||||||
|
setTexture(t, src_rect);
|
||||||
|
}
|
||||||
void RenderObject::setTexture( const std::shared_ptr< Texture > &t,
|
void RenderObject::setTexture( const std::shared_ptr< Texture > &t,
|
||||||
int source_x, int source_y, int source_width,
|
int source_x, int source_y, int source_width,
|
||||||
int source_height ) {
|
int source_height ) {
|
||||||
|
@ -63,6 +63,7 @@ public:
|
|||||||
bool hasCollisions() const;
|
bool hasCollisions() const;
|
||||||
const std::vector< std::shared_ptr< CollisionPolygon > > &
|
const std::vector< std::shared_ptr< CollisionPolygon > > &
|
||||||
getCollisions() const;
|
getCollisions() const;
|
||||||
|
virtual void setTextureKeepSRC( const std::shared_ptr< Texture > &t );
|
||||||
virtual void setTexture( const std::shared_ptr< Texture > &t, int source_x,
|
virtual void setTexture( const std::shared_ptr< Texture > &t, int source_x,
|
||||||
int source_y, int source_width,
|
int source_y, int source_width,
|
||||||
int source_height );
|
int source_height );
|
||||||
|
Loading…
Reference in New Issue
Block a user