sdl12-compat: video: Only pretend to lock the screen surface.

From 86183bf42d74a967451483b89679ef099d4a4023 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Tue, 10 Jan 2023 20:50:12 -0500
Subject: [PATCH] video: Only pretend to lock the screen surface.

This fixes rendering in xrick.

Reference issue #283.
---
 src/SDL12_compat.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c
index 64c3836c5..be11e1ef4 100644
--- a/src/SDL12_compat.c
+++ b/src/SDL12_compat.c
@@ -6483,18 +6483,25 @@ SDL_SetAlpha(SDL12_Surface *surface12, Uint32 flags12, Uint8 value)
 DECLSPEC12 int SDLCALL
 SDL_LockSurface(SDL12_Surface *surface12)
 {
-    const int retval = SDL20_LockSurface(surface12->surface20);
-    surface12->pixels = surface12->surface20->pixels;
-    surface12->pitch = surface12->surface20->pitch;
+    int retval = 0;
+    /* just pretend to lock for the screen surface, but ignore it. */
+    if (surface12 != VideoSurface12) {
+        retval = SDL20_LockSurface(surface12->surface20);
+        surface12->pixels = surface12->surface20->pixels;
+        surface12->pitch = surface12->surface20->pitch;
+    }
     return retval;
 }
 
 DECLSPEC12 void SDLCALL
 SDL_UnlockSurface(SDL12_Surface *surface12)
 {
-    SDL20_UnlockSurface(surface12->surface20);
-    surface12->pixels = surface12->surface20->pixels;
-    surface12->pitch = surface12->surface20->pitch;
+    /* just pretend to lock for the screen surface, but ignore it. */
+    if (surface12 != VideoSurface12) {
+        SDL20_UnlockSurface(surface12->surface20);
+        surface12->pixels = surface12->surface20->pixels;
+        surface12->pitch = surface12->surface20->pitch;
+    }
 }
 
 DECLSPEC12 int SDLCALL