Adding flip support.

This commit is contained in:
Ulysse Cura 2026-07-22 13:42:14 +02:00
parent cb419be11e
commit c1a3dea560
1 changed files with 7 additions and 1 deletions

View File

@ -215,7 +215,13 @@ texture_t *asset_manager_get_texture(asset_manager_t *asset_manager, const char
return asset->data.texture;
}
void asset_manager_draw_texture(texture_t *texture, rect_t *src_rect, rect_t *dst_rect, bool flip __attribute__((unused)))
void asset_manager_draw_texture(texture_t *texture, rect_t *src_rect, rect_t *dst_rect, bool flip)
{
if(flip)
{
dst_rect->x = dst_rect->x + dst_rect->w;
dst_rect->w = -dst_rect->w;
}
SDL_RenderCopy(renderer, texture, src_rect, dst_rect);
}