summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-04-05 23:01:07 +0200
committerkdx <kikoodx@paranoici.org>2023-04-05 23:01:07 +0200
commit5431a6aba601a7fa6d6ce54eda2208a258bf96d4 (patch)
tree60fb3030306eafc450dfe4e08e3cf18901c6e553
parent387ef31ec277f67e58313b0faa906bad4a2dd255 (diff)
download006-5431a6aba601a7fa6d6ce54eda2208a258bf96d4.tar.gz
update tzr
-rw-r--r--src/TZR.c7
-rw-r--r--src/TZR.h7
2 files changed, 9 insertions, 5 deletions
diff --git a/src/TZR.c b/src/TZR.c
index 77ab2e0..497d111 100644
--- a/src/TZR.c
+++ b/src/TZR.c
@@ -300,8 +300,9 @@ _TZR_DrawImage(const TZR_DrawImageArgs *args)
if (simg_height + args->iy > img->height)
simg_height = img->height - args->iy;
- const int flip = (SDL_FLIP_HORIZONTAL * (scale_x < 0.0f)) |
- (SDL_FLIP_VERTICAL * (scale_y < 0.0f));
+ int flip = 0;
+ flip |= SDL_FLIP_HORIZONTAL * ((scale_x < 0.0f) ^ args->flip_x);
+ flip |= SDL_FLIP_VERTICAL * ((scale_y < 0.0f) ^ args->flip_y);
const SDL_Rect src = {
args->ix,
args->iy,
@@ -825,4 +826,4 @@ TZR_ShouldQuit(void)
return ___tzr_should_quit;
}
-/* commit hash: e96c359a840974adea4d3d1d3445377f159ecdf0 */
+/* commit hash: d0cfe92ee80536be34bfaf2ce99dedcca87088d7 */
diff --git a/src/TZR.h b/src/TZR.h
index d307f6e..bdbce2c 100644
--- a/src/TZR.h
+++ b/src/TZR.h
@@ -119,6 +119,8 @@ struct TZR_DrawImageArgs {
float sx;
float sy;
bool center;
+ bool flip_x;
+ bool flip_y;
};
struct TZR_DrawRectangleArgs {
@@ -271,7 +273,8 @@ int _TZR_DrawRectangle(const TZR_DrawRectangleArgs *args);
* the framebuffer. */
#define TZR_DrawImage(...) _TZR_DrawImage(&(const TZR_DrawImageArgs){ \
.x=0, .y=0, .ix=0, .iy=0, .w=INT_MIN, .h=INT_MIN, .r=0.0f, .sx=1.0f, \
- .sy=1.0f, .center=false, ._=0, __VA_ARGS__ })
+ .sy=1.0f, .center=false, .flip_x=false, .flip_y=false, ._=0, \
+ __VA_ARGS__ })
#ifdef TZR_PARANOID
[[nodiscard]]
#endif
@@ -317,4 +320,4 @@ int TZR_ShouldQuit(void);
unsigned long TZR_GetTick(void);
-/* commit hash: e96c359a840974adea4d3d1d3445377f159ecdf0 */
+/* commit hash: d0cfe92ee80536be34bfaf2ce99dedcca87088d7 */