Fixed endianness issues with fullscreen mode SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Wed, 23 Sep 2009 06:56:28 +0000
branchSDL-1.2
changeset 42361fc8c8a5ff00
parent 4235 88aa213ffc7b
child 4237 0adda8ff43ef
Fixed endianness issues with fullscreen mode
src/video/quartz/SDL_QuartzVideo.m
     1.1 --- a/src/video/quartz/SDL_QuartzVideo.m	Wed Sep 23 06:35:28 2009 +0000
     1.2 +++ b/src/video/quartz/SDL_QuartzVideo.m	Wed Sep 23 06:56:28 2009 +0000
     1.3 @@ -867,15 +867,24 @@
     1.4                  return NULL;
     1.5              case 32:   /* (8)-8-8-8 ARGB */
     1.6                  amask = 0x00000000;
     1.7 +		if ( flags & SDL_FULLSCREEN )
     1.8 +		{
     1.9 +			rmask = 0x00FF0000;
    1.10 +			gmask = 0x0000FF00;
    1.11 +			bmask = 0x000000FF;
    1.12 +		}
    1.13 +		else
    1.14 +		{
    1.15  #ifdef __LITTLE_ENDIAN__
    1.16 -                rmask = 0x0000FF00;
    1.17 -                gmask = 0x00FF0000;
    1.18 -                bmask = 0xFF000000;
    1.19 +			rmask = 0x0000FF00;
    1.20 +			gmask = 0x00FF0000;
    1.21 +			bmask = 0xFF000000;
    1.22  #else
    1.23 -                rmask = 0x00FF0000;
    1.24 -                gmask = 0x0000FF00;
    1.25 -                bmask = 0x000000FF;
    1.26 +			rmask = 0x00FF0000;
    1.27 +			gmask = 0x0000FF00;
    1.28 +			bmask = 0x000000FF;
    1.29  #endif
    1.30 +		}
    1.31                  break;
    1.32          }
    1.33  
    1.34 @@ -883,7 +892,7 @@
    1.35                                    rmask, gmask, bmask, amask ) ) {
    1.36              SDL_SetError ("Couldn't reallocate pixel format");
    1.37              return NULL;
    1.38 -           }
    1.39 +        }
    1.40      }
    1.41  
    1.42      /* Signal successful completion (used internally) */