maybe fix Mac screenshot endianness problem

This commit is contained in:
Glenn Maynard
2004-03-08 07:28:07 +00:00
parent 81606a2fd7
commit 10015303e9
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -114,7 +114,7 @@ void IMG_SaveJPG_RW( SDL_Surface *surface, SDL_RWops *dest )
{
SDL_Surface *dst_surface;
if( ConvertSDLSurface( surface, dst_surface,
surface->w, surface->h, 24, mySDL_Swap24(0xFF0000), mySDL_Swap24(0x00FF00), mySDL_Swap24(0x0000FF), 0 ) )
surface->w, surface->h, 24, mySDL_SwapBE24(0xFF0000), mySDL_SwapBE24(0x00FF00), mySDL_SwapBE24(0x0000FF), 0 ) )
surface = dst_surface;
struct jpeg::jpeg_compress_struct cinfo;
+7
View File
@@ -10,6 +10,13 @@
#undef Screen
Uint32 mySDL_Swap24(Uint32 x);
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
#define mySDL_SwapLE24(n) (n)
#define mySDL_SwapBE24(n) (mySDL_Swap24(n))
#else
#define mySDL_SwapLE24(n) (mySDL_Swap24(n))
#define mySDL_SwapBE24(n) (n)
#endif
Uint32 decodepixel(const Uint8 *p, int bpp);
void encodepixel(Uint8 *p, int bpp, Uint32 pixel);