SDLPP: add texture flipping/rotation

This commit is contained in:
2021-04-29 13:06:37 +02:00
parent b611e2479a
commit ff741dd882
3 changed files with 52 additions and 5 deletions
+9 -3
View File
@@ -57,9 +57,15 @@ void TextRenderer::render() {
if ( !getHidden() ) {
if ( polygon )
polygon->render( *renderer );
if ( texture != NULL )
SDL_RenderCopy( renderer->getRendererPtr(),
texture->getTexturePtr(), NULL, &dst_rect );
if ( texture != NULL ) {
SDL_Point *rotation_point = NULL;
if ( rotation_center.getX() != -1 ) {
rotation_point = &rotation_center_point;
}
SDL_RenderCopyEx( renderer->getRendererPtr(),
texture->getTexturePtr(), NULL, &dst_rect,
rotation_angle, rotation_point, flip );
}
}
if ( hasCollisions() && renderer->getRenderColiders() && !getHidden() ) {
for ( const auto &col : getCollisions() )