Sdl12-compat: SDL_SetVideoMode: SDL_HWSURFACE flag

From 37c12055390fc5ebc29cf5896fcbf0cd5357fafe Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Sat, 20 Feb 2021 23:27:35 +0300
Subject: [PATCH] SDL_SetVideoMode: SDL_HWSURFACE flag
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

some apps check for the presence/lack of double buffering via MUSTLOCK
so set SDL12_HWSURFACE so they are less confused.

Patch from Malte Kießling:
https://github.com/libsdl-org/sdl12-compat/issues/22
---
 src/SDL12_compat.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c
index 5b1513d..741a2a4 100644
--- a/src/SDL12_compat.c
+++ b/src/SDL12_compat.c
@@ -2977,6 +2977,9 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags12)
 
         VideoSurface12->flags &= ~SDL12_OPENGL;
         VideoSurface12->flags |= SDL12_DOUBLEBUF;
+        // some apps check for the presence/lack of double buffering via MUSTLOCK
+        // so set SDL12_HWSURFACE so they are less confused
+        VideoSurface12->flags |= SDL12_HWSURFACE;
         VideoSurface12->surface20->pixels = SDL20_malloc(height * VideoSurface12->pitch);
         VideoSurface12->pixels = VideoSurface12->surface20->pixels;
         if (!VideoSurface12->pixels) {