windows: Minor tweaks that makes Windows XP vidmodes work again.

(thanks @madebr!)

Fixes #8328.
Reference Issue #8666.
This commit is contained in:
Ryan C. Gordon committed 2024-01-27 20:15:08 -05:00
1 parent 6ca596cfc1
commit dcd26a80e5
1 file changed
+4
+4
View File
@@ -70,11 +70,15 @@ static void WIN_UpdateDisplayMode(SDL_VideoDevice *_this, LPCWSTR deviceName, DW
mode->format = SDL_PIXELFORMAT_RGB555; mode->format = SDL_PIXELFORMAT_RGB555;
break; break;
} }
} else if (bmi->bmiHeader.biCompression == BI_RGB) {
if (bmi->bmiHeader.biBitCount == 24) {
mode->format = SDL_PIXELFORMAT_RGB24;
} else if (bmi->bmiHeader.biBitCount == 8) { } else if (bmi->bmiHeader.biBitCount == 8) {
mode->format = SDL_PIXELFORMAT_INDEX8; mode->format = SDL_PIXELFORMAT_INDEX8;
} else if (bmi->bmiHeader.biBitCount == 4) { } else if (bmi->bmiHeader.biBitCount == 4) {
mode->format = SDL_PIXELFORMAT_INDEX4LSB; mode->format = SDL_PIXELFORMAT_INDEX4LSB;
} }
}
} else if (mode->format == SDL_PIXELFORMAT_UNKNOWN) { } else if (mode->format == SDL_PIXELFORMAT_UNKNOWN) {
/* FIXME: Can we tell what this will be? */ /* FIXME: Can we tell what this will be? */
if ((data->DeviceMode.dmFields & DM_BITSPERPEL) == DM_BITSPERPEL) { if ((data->DeviceMode.dmFields & DM_BITSPERPEL) == DM_BITSPERPEL) {