Commit 591381ae authored by Mike Gorchak's avatar Mike Gorchak

Fixed support for 4bpp video modes enumeration, otherwise mode with zero bpp appears in the list.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403633
parent 372f9b06
...@@ -96,29 +96,35 @@ WIN_GetDisplayMode(LPCTSTR deviceName, DWORD index, SDL_DisplayMode * mode) ...@@ -96,29 +96,35 @@ WIN_GetDisplayMode(LPCTSTR deviceName, DWORD index, SDL_DisplayMode * mode)
} }
} 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) {
mode->format = SDL_PIXELFORMAT_INDEX4LSB;
} }
} else } else
#endif /* _WIN32_WCE */ #endif /* _WIN32_WCE */
{ {
/* FIXME: Can we tell what this will be? */ /* FIXME: Can we tell what this will be? */
switch (devmode.dmBitsPerPel) { if ((devmode.dmFields & DM_BITSPERPEL)==DM_BITSPERPEL) {
case 32: switch (devmode.dmBitsPerPel) {
mode->format = SDL_PIXELFORMAT_RGB888; case 32:
break; mode->format = SDL_PIXELFORMAT_RGB888;
case 24: break;
mode->format = SDL_PIXELFORMAT_RGB24; case 24:
break; mode->format = SDL_PIXELFORMAT_RGB24;
case 16: break;
mode->format = SDL_PIXELFORMAT_RGB565; case 16:
break; mode->format = SDL_PIXELFORMAT_RGB565;
case 15: break;
mode->format = SDL_PIXELFORMAT_RGB555; case 15:
break; mode->format = SDL_PIXELFORMAT_RGB555;
case 8: break;
mode->format = SDL_PIXELFORMAT_INDEX8; case 8:
break; mode->format = SDL_PIXELFORMAT_INDEX8;
} break;
case 4:
mode->format = SDL_PIXELFORMAT_INDEX4LSB;
break;
}
}
} }
return SDL_TRUE; return SDL_TRUE;
} }
...@@ -200,8 +206,9 @@ WIN_GetDisplayModes(_THIS) ...@@ -200,8 +206,9 @@ WIN_GetDisplayModes(_THIS)
if (!WIN_GetDisplayMode(data->DeviceName, i, &mode)) { if (!WIN_GetDisplayMode(data->DeviceName, i, &mode)) {
break; break;
} }
if (!SDL_AddDisplayMode(_this->current_display, &mode)) { if (mode.format != SDL_PIXELFORMAT_UNKNOWN)
SDL_free(mode.driverdata); if (!SDL_AddDisplayMode(_this->current_display, &mode)) {
SDL_free(mode.driverdata);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment