mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-27 10:57:22 +08:00
Prefer higher color depths in SDL_GetClosestFullscreenDisplayMode()
This commit is contained in:
committed by
Ryan C. Gordon
parent
7b23cd62ca
commit
9fa9edeadb
+10
-5
@@ -1421,11 +1421,16 @@ bool SDL_GetClosestFullscreenDisplayMode(SDL_DisplayID displayID, int w, int h,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode->w == closest->w && mode->h == closest->h &&
|
if (mode->w == closest->w && mode->h == closest->h) {
|
||||||
SDL_fabsf(closest->refresh_rate - refresh_rate) < SDL_fabsf(mode->refresh_rate - refresh_rate)) {
|
if (SDL_fabsf(closest->refresh_rate - refresh_rate) < SDL_fabsf(mode->refresh_rate - refresh_rate)) {
|
||||||
/* We already found a mode and the new mode is further from our
|
/* We already found a mode and the new mode is further from our
|
||||||
* refresh rate target */
|
* refresh rate target */
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
if (SDL_BYTESPERPIXEL(closest->format) >= SDL_BYTESPERPIXEL(mode->format)) {
|
||||||
|
// Prefer the highest color depth
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user