Commit fbb440d167af3a359c2a3bc9a05022b154a46781

Francisco Javier Trujillo Mata 2022-08-06T18:10:54

Invalidate texture in the UnlockTextureMethod

diff --git a/src/render/ps2/SDL_render_ps2.c b/src/render/ps2/SDL_render_ps2.c
index d8cec5d..b514333 100644
--- a/src/render/ps2/SDL_render_ps2.c
+++ b/src/render/ps2/SDL_render_ps2.c
@@ -158,6 +158,15 @@ PS2_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
     return 0;
 }
 
+static void
+PS2_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture)
+{
+    GSTEXTURE *ps2_texture = (GSTEXTURE *) texture->driverdata;
+    PS2_RenderData *data = (PS2_RenderData *) renderer->driverdata;
+
+    gsKit_TexManager_invalidate(data->gsGlobal, ps2_texture);
+}
+
 static int
 PS2_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
                    const SDL_Rect * rect, const void *pixels, int pitch)
@@ -181,17 +190,12 @@ PS2_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
         }
     }
 
-    gsKit_TexManager_invalidate(data->gsGlobal, ps2_texture);
+    PS2_UnlockTexture(renderer, texture);
 
     return 0;
 }
 
 static void
-PS2_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture)
-{
-}
-
-static void
 PS2_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL_ScaleMode scaleMode)
 {
 }