diff engine/core/video/sdl/sdlimage.cpp @ 620:853d25234671

* Moved the GLEnable and GLDisable structures from opengl_gui_graphics.cpp to fife_opengl.h as they may prove to be useful elsewhere. * Fixed the color mask definitions in fife_stdint.h * Added the nextPow2() function to calculate the nearest (greater) power of 2 * Removed a bunch of re-definitions of RGB masks * Modified GLImage to only generate one "texture chunk". I hope this makes better use of memory and speeds things up a hair * Made use of the GLEnable structure when clearing the screen
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Thu, 30 Sep 2010 21:24:55 +0000
parents d242e6ce6f9f
children f3457443c95f
line wrap: on
line diff
--- a/engine/core/video/sdl/sdlimage.cpp	Wed Sep 29 15:15:45 2010 +0000
+++ b/engine/core/video/sdl/sdlimage.cpp	Thu Sep 30 21:24:55 2010 +0000
@@ -284,16 +284,9 @@
 
 		// If source surface has no alpha channel then convert it
 		if (src->format->Amask == 0) {
-			Uint32 rmask, gmask, bmask, amask;
-			#if SDL_BYTEORDER == SDL_BIG_ENDIAN
-			rmask = 0xff000000; gmask = 0x00ff0000; bmask = 0x0000ff00; amask = 0x000000ff;
-			#else
-			rmask = 0x000000ff; gmask = 0x0000ff00; bmask = 0x00ff0000; amask = 0xff000000;
-			#endif
-
 			zoom_src = SDL_CreateRGBSurface(SDL_SWSURFACE, src->w, src->h, 32,
-					rmask, gmask,
-					bmask, amask);
+					RMASK, GMASK,
+					BMASK, AMASK);
 			SDL_BlitSurface(src, NULL, zoom_src, NULL);
 		} else {
 			zoom_src = src;
@@ -789,18 +782,11 @@
 		if(m_surface) {
 			const unsigned int swidth = getWidth();
 			const unsigned int sheight = getHeight();
-			Uint32 rmask, gmask, bmask, amask;
 			SDL_Surface *surface = NULL;
 
-			#if SDL_BYTEORDER == SDL_BIG_ENDIAN
-			rmask = 0xff000000; gmask = 0x00ff0000; bmask = 0x0000ff00; amask = 0x000000ff;
-			#else
-			rmask = 0x000000ff; gmask = 0x0000ff00; bmask = 0x00ff0000; amask = 0xff000000;
-			#endif
-
 			surface = SDL_CreateRGBSurface(SDL_SWSURFACE, swidth,
 				sheight, 24,
-				rmask, gmask, bmask, 0);
+				RMASK, GMASK, BMASK, 0);
 
 			if(surface == NULL) {
 				return;