Don't accidentally pick a YV12 format as the closest format.

This commit is contained in:
Sam Lantinga
2011-02-15 15:50:21 -08:00
parent 2e54bfdc19
commit e5780896f6

View File

@@ -244,7 +244,8 @@ GetClosestSupportedFormat(SDL_Renderer * renderer, Uint32 format)
/* We just want to match the first format that has the same channels */
for (i = 0; i < renderer->info.num_texture_formats; ++i) {
if (SDL_ISPIXELFORMAT_ALPHA(renderer->info.texture_formats[i]) == hasAlpha) {
if (!SDL_ISPIXELFORMAT_FOURCC(renderer->info.texture_formats[i]) &&
SDL_ISPIXELFORMAT_ALPHA(renderer->info.texture_formats[i]) == hasAlpha) {
return renderer->info.texture_formats[i];
}
}