From dcd26a80e5aeb26d40c32129c91bdafc7d88af2d Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 25 Jan 2024 19:41:31 -0500 Subject: [PATCH] windows: Minor tweaks that makes Windows XP vidmodes work again. (thanks @madebr!) Fixes #8328. Reference Issue #8666. --- src/video/windows/SDL_windowsmodes.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/video/windows/SDL_windowsmodes.c b/src/video/windows/SDL_windowsmodes.c index b9fed2f9f5..6621d598e3 100644 --- a/src/video/windows/SDL_windowsmodes.c +++ b/src/video/windows/SDL_windowsmodes.c @@ -70,10 +70,14 @@ static void WIN_UpdateDisplayMode(SDL_VideoDevice *_this, LPCWSTR deviceName, DW mode->format = SDL_PIXELFORMAT_RGB555; break; } - } else if (bmi->bmiHeader.biBitCount == 8) { - mode->format = SDL_PIXELFORMAT_INDEX8; - } else if (bmi->bmiHeader.biBitCount == 4) { - mode->format = SDL_PIXELFORMAT_INDEX4LSB; + } else if (bmi->bmiHeader.biCompression == BI_RGB) { + if (bmi->bmiHeader.biBitCount == 24) { + mode->format = SDL_PIXELFORMAT_RGB24; + } else if (bmi->bmiHeader.biBitCount == 8) { + mode->format = SDL_PIXELFORMAT_INDEX8; + } else if (bmi->bmiHeader.biBitCount == 4) { + mode->format = SDL_PIXELFORMAT_INDEX4LSB; + } } } else if (mode->format == SDL_PIXELFORMAT_UNKNOWN) { /* FIXME: Can we tell what this will be? */