Don't draw texture onto itself for scrolling

Drawing a texture onto itself seems to produce issues on Metal.

To fix this, use a temporary texture instead, that then gets drawn onto
the original texture.

Fixes #927.
This commit is contained in:
Misa
2023-03-03 16:02:53 -08:00
committed by Misa Elizabeth Kai
parent 8c697487fd
commit 5eecc2a21d
2 changed files with 16 additions and 41 deletions

View File

@@ -162,7 +162,7 @@ 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 scroll_texture(SDL_Texture* texture, int x, int y);
void scroll_texture(SDL_Texture* texture, SDL_Texture* temp, int x, int y);
void printcrewname(int x, int y, int t);
void printcrewnamedark(int x, int y, int t);
@@ -314,6 +314,7 @@ public:
SDL_Texture* ghostTexture;
SDL_Texture* backgroundTexture;
SDL_Texture* foregroundTexture;
SDL_Texture* tempScrollingTexture;
TowerBG towerbg;
TowerBG titlebg;