Don't accidentally pick a YV12 format as the closest format.
authorSam Lantinga <slouken@libsdl.org>
Tue, 15 Feb 2011 15:50:21 -0800
changeset 5300 3f825465a14a
parent 5299 33987021a1ed
child 5301 248c5c7d6e29
Don't accidentally pick a YV12 format as the closest format.
src/render/SDL_render.c
--- a/src/render/SDL_render.c	Tue Feb 15 14:17:42 2011 -0800
+++ b/src/render/SDL_render.c	Tue Feb 15 15:50:21 2011 -0800
@@ -244,7 +244,8 @@
 
         /* 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];
             }
         }