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 53003f825465a14a
parent 5299 33987021a1ed
child 5301 248c5c7d6e29
Don't accidentally pick a YV12 format as the closest format.
src/render/SDL_render.c
     1.1 --- a/src/render/SDL_render.c	Tue Feb 15 14:17:42 2011 -0800
     1.2 +++ b/src/render/SDL_render.c	Tue Feb 15 15:50:21 2011 -0800
     1.3 @@ -244,7 +244,8 @@
     1.4  
     1.5          /* We just want to match the first format that has the same channels */
     1.6          for (i = 0; i < renderer->info.num_texture_formats; ++i) {
     1.7 -            if (SDL_ISPIXELFORMAT_ALPHA(renderer->info.texture_formats[i]) == hasAlpha) {
     1.8 +            if (!SDL_ISPIXELFORMAT_FOURCC(renderer->info.texture_formats[i]) &&
     1.9 +                SDL_ISPIXELFORMAT_ALPHA(renderer->info.texture_formats[i]) == hasAlpha) {
    1.10                  return renderer->info.texture_formats[i];
    1.11              }
    1.12          }