Skip to content

Commit

Permalink
windows: Minor tweaks that makes Windows XP vidmodes work again.
Browse files Browse the repository at this point in the history
(thanks @madebr!)

Fixes libsdl-org#8328.
Reference Issue libsdl-org#8666.
  • Loading branch information
icculus committed Jan 26, 2024
1 parent ca331f1 commit 54e0ec6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/video/windows/SDL_windowsmodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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? */
Expand Down

0 comments on commit 54e0ec6

Please sign in to comment.