From e3cf80ae045f9ece7bccb39cc6530389b0fb6d94 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 9 Jul 2003 06:16:19 +0000 Subject: [PATCH] Fix screenshot endianness. --- stepmania/src/RageDisplay_OGL.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stepmania/src/RageDisplay_OGL.cpp b/stepmania/src/RageDisplay_OGL.cpp index 5ecc812938..b856134e6b 100644 --- a/stepmania/src/RageDisplay_OGL.cpp +++ b/stepmania/src/RageDisplay_OGL.cpp @@ -614,12 +614,14 @@ void RageDisplay_OGL::SaveScreenshot( CString sPath ) int width = wind->GetVideoModeParams().width; int height = wind->GetVideoModeParams().height; + const PixelFormatDesc &desc = PIXEL_FORMAT_DESC[FMT_RGB8]; SDL_Surface *image = SDL_CreateRGBSurfaceSane( SDL_SWSURFACE, width, height, - 24, 0x0000FF, 0x00FF00, 0xFF0000, 0x000000); + desc.bpp, desc.masks[0], desc.masks[1], desc.masks[2], desc.masks[3] ); + SDL_Surface *temp = SDL_CreateRGBSurfaceSane( SDL_SWSURFACE, width, height, - 24, 0x0000FF, 0x00FF00, 0xFF0000, 0x000000); + desc.bpp, desc.masks[0], desc.masks[1], desc.masks[2], desc.masks[3] ); glReadPixels(0, 0, wind->GetVideoModeParams().width, wind->GetVideoModeParams().height, GL_RGB, GL_UNSIGNED_BYTE, image->pixels);