From 56119b273d54fcf91805b0026ddacf4a978335f2 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Thu, 1 Sep 2022 19:59:33 -0400
Subject: [PATCH] video: Apparently 24-bit video is intended to be BGR24
pixels.
We had changed this in 940352955ffef7ab4113bc28a2454a8f66b8e3f7, from
RGB24 to RGB888, which fixed Schismtracker, but this isn't actually correct
either, I guess. Using BGR24 fixes "Powder", which apparently _needs_ a
24-bit packed format, and Schismtracker still works correctly, so I think
we're good here now. I hope.
Fixes #199.
---
src/SDL12_compat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c
index d89a5b12..fa53b675 100644
--- a/src/SDL12_compat.c
+++ b/src/SDL12_compat.c
@@ -5693,7 +5693,7 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags12)
switch (bpp) {
case 8: appfmt = SDL_PIXELFORMAT_INDEX8; break;
case 16: appfmt = SDL_PIXELFORMAT_RGB565; break;
- case 24: appfmt = SDL_PIXELFORMAT_RGB888; break;
+ case 24: appfmt = SDL_PIXELFORMAT_BGR24; break;
case 32: appfmt = SDL_PIXELFORMAT_XRGB8888; break;
default: SDL20_SetError("Unsupported bits-per-pixel"); return NULL;
}