From 414b0647aa27ab7cd0f02361ef683a4c35742442 Mon Sep 17 00:00:00 2001 From: Misa Date: Sat, 3 Jun 2023 16:00:30 -0700 Subject: [PATCH] Correct orientation of Game Saved clock in Flip Mode The clock on the Game Saved quicksave screen has always been upside-down in Flip Mode. And technically, the trinket was too, but this was unnoticeable because the default trinket sprite is symmetrical. To fix this, draw flipsprites.png if these sprites are being drawn in Flip Mode instead of sprites.png. --- desktop_version/src/Graphics.cpp | 5 +++++ desktop_version/src/Graphics.h | 2 ++ desktop_version/src/Render.cpp | 12 ++++++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index a076db86..bc8fdbaa 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -632,6 +632,11 @@ void Graphics::draw_sprite(const int x, const int y, const int t, const SDL_Colo draw_grid_tile(grphx.im_sprites, t, x, y, sprites_rect.w, sprites_rect.h, color); } +void Graphics::draw_flipsprite(const int x, const int y, const int t, const SDL_Color color) +{ + draw_grid_tile(grphx.im_flipsprites, t, x, y, sprites_rect.w, sprites_rect.h, color); +} + void Graphics::scroll_texture(SDL_Texture* texture, SDL_Texture* temp, const int x, const int y) { SDL_Texture* target = SDL_GetRenderTarget(gameScreen.m_renderer); diff --git a/desktop_version/src/Graphics.h b/desktop_version/src/Graphics.h index 8d3276fa..6608c64f 100644 --- a/desktop_version/src/Graphics.h +++ b/desktop_version/src/Graphics.h @@ -164,6 +164,8 @@ public: void draw_sprite(int x, int y, int t, int r, int g, int b); void draw_sprite(int x, int y, int t, SDL_Color color); + void draw_flipsprite(int x, int y, int t, SDL_Color color); + void scroll_texture(SDL_Texture* texture, SDL_Texture* temp, int x, int y); void printcrewname(int x, int y, int t); diff --git a/desktop_version/src/Render.cpp b/desktop_version/src/Render.cpp index f2308e6d..b16144de 100644 --- a/desktop_version/src/Render.cpp +++ b/desktop_version/src/Render.cpp @@ -2935,8 +2935,16 @@ void maprender(void) ); font::print(PR_RIGHT, 262, FLIP(132, 8), buffer, 255 - help.glow/2, 255 - help.glow/2, 255 - help.glow/2); - graphics.draw_sprite(34, FLIP(126, 17), 50, graphics.col_clock); - graphics.draw_sprite(270, FLIP(126, 17), 22, graphics.col_trinket); + if (graphics.flipmode) + { + graphics.draw_flipsprite(34, FLIP(126, 17), 50, graphics.col_clock); + graphics.draw_flipsprite(270, FLIP(126, 17), 22, graphics.col_trinket); + } + else + { + graphics.draw_sprite(34, FLIP(126, 17), 50, graphics.col_clock); + graphics.draw_sprite(270, FLIP(126, 17), 22, graphics.col_trinket); + } break; } case 10: