Index: vultures-2.2.100/vultures/vultures_sdl.cpp
===================================================================
--- vultures-2.2.100.orig/vultures/vultures_sdl.cpp	2010-01-18 19:19:26.000000000 +0100
+++ vultures-2.2.100/vultures/vultures_sdl.cpp	2010-01-18 19:19:45.000000000 +0100
@@ -236,8 +236,8 @@
 		(actual_winsize.x != vultures_opts.width ||
 		actual_winsize.y != vultures_opts.height))
 	{
-		vultures_screen = SDL_SetVideoMode(vultures_opts.width, vultures_opts.height, 32,
-										SDL_SWSURFACE | SDL_RESIZABLE | SDL_ASYNCBLIT);
+		vultures_screen = SDL_SetVideoMode(vultures_opts.width, vultures_opts.height,
+							SCREEN_DEPTH, SDL_SWSURFACE | SDL_RESIZABLE);
 		vultures_win_resize(vultures_opts.width, vultures_opts.height);
 		actual_winsize.x = vultures_opts.width;
 		actual_winsize.y = vultures_opts.height;
@@ -418,8 +418,8 @@
 
 			/* SDL will not actually change the size of the window here, only the size of the buffer.
 			* therefore we may need_kludge to call SDL_SetVideoMode AGAIN to set the window size. */
-			vultures_screen = SDL_SetVideoMode(vultures_opts.width, vultures_opts.height, 32,
-										SDL_SWSURFACE | SDL_RESIZABLE | SDL_ASYNCBLIT);
+			vultures_screen = SDL_SetVideoMode(vultures_opts.width, vultures_opts.height,
+								SCREEN_DEPTH, SDL_SWSURFACE | SDL_RESIZABLE);
 			vultures_win_resize(vultures_opts.width, vultures_opts.height);
 			break;
 	}
@@ -452,16 +452,17 @@
 	SDL_WM_SetCaption(VERSION_ID,NULL);
 
 	if (vultures_opts.fullscreen)
-		vultures_screen = SDL_SetVideoMode(vultures_opts.width, vultures_opts.height, 32,
-										SDL_SWSURFACE | SDL_FULLSCREEN | SDL_ASYNCBLIT);
+		vultures_screen = SDL_SetVideoMode(vultures_opts.width, vultures_opts.height,
+							SCREEN_DEPTH, SDL_SWSURFACE | SDL_FULLSCREEN);
 	else
-		vultures_screen = SDL_SetVideoMode(vultures_opts.width, vultures_opts.height, 32,
-										SDL_SWSURFACE | SDL_RESIZABLE | SDL_ASYNCBLIT);
+		vultures_screen = SDL_SetVideoMode(vultures_opts.width, vultures_opts.height,
+							SCREEN_DEPTH, SDL_SWSURFACE | SDL_RESIZABLE);
 
 	/* no screen: maybe the configured video mode didn't work */
 	if (!vultures_screen) {
 		vultures_sdl_error(__FILE__, __LINE__, "Failed to set configured video mode, trying to fall back to 800x600 windowed");
-		vultures_screen = SDL_SetVideoMode(800, 600, 32, SDL_SWSURFACE | SDL_RESIZABLE | SDL_ASYNCBLIT);
+		vultures_screen = SDL_SetVideoMode(800, 600, 16,
+								SDL_SWSURFACE | SDL_RESIZABLE);
 		vultures_opts.fullscreen = 0;
 	}
 
Index: vultures-2.2.100/vultures/vultures_gra.cpp
===================================================================
--- vultures-2.2.100.orig/vultures/vultures_gra.cpp	2010-01-18 19:19:26.000000000 +0100
+++ vultures-2.2.100/vultures/vultures_gra.cpp	2010-01-18 19:19:45.000000000 +0100
@@ -120,7 +120,29 @@
 	SDL_SetClipRect( vultures_screen, &rect );
 }
 
+template <typename T>
+static void vultures_rect_surface_t
+(
+	T *screen,
+	unsigned int w,
+	int x1, int y1,
+	int x2, int y2,
+	T color
+)
+{
+	int i,j;
 
+	for (i = x1; i <= x2; i++)
+	{
+		screen[y1*w+i] = color;
+		screen[y2*w+i] = color;
+	}
+	for (j = y1; j <= y2; j++)
+	{
+		screen[j*w+x1] = color;
+		screen[j*w+x2] = color;
+	}
+}
 
 /* draws an unfilled rectangle onto the given surface;
 * this function may blow up if given invalid coordinates */
@@ -132,21 +154,20 @@
 	Uint32 color
 )
 {
-	int i,j; 
-	Uint32 *screen;
-
 	if (SDL_MUSTLOCK(surface)) SDL_LockSurface(surface);
-	screen = (Uint32 *)surface->pixels;
 
-	for (i = x1; i <= x2; i++)
-	{
-		screen[y1*surface->w+i] = color;
-		screen[y2*surface->w+i] = color;
-	}
-	for (j = y1; j <= y2; j++)
-	{
-		screen[j*surface->w+x1] = color;
-		screen[j*surface->w+x2] = color;
+	if (surface->format->BitsPerPixel == 32) {
+		vultures_rect_surface_t<Uint32>(
+			reinterpret_cast<Uint32*>(surface->pixels), surface->w,
+			x1, y1, x2, y2, color);
+	} else if (surface->format->BitsPerPixel == 16) {
+		vultures_rect_surface_t<Uint16>(
+			reinterpret_cast<Uint16*>(surface->pixels), surface->w,
+			x1, y1, x2, y2, color);
+	} else if (surface->format->BitsPerPixel == 8) {
+		vultures_rect_surface_t<Uint8>(
+			reinterpret_cast<Uint8*>(surface->pixels), surface->w,
+			x1, y1, x2, y2, color);
 	}
 
 	if (SDL_MUSTLOCK(surface)) SDL_UnlockSurface(surface);
@@ -181,7 +202,8 @@
 			SDL_SWSURFACE | SDL_SRCALPHA,
 			srcrect.w,
 			srcrect.h,
-			32, surface->format->Rmask, surface->format->Gmask, surface->format->Bmask, DEF_AMASK);
+			surface->format->BitsPerPixel,
+			surface->format->Rmask, surface->format->Gmask, surface->format->Bmask, DEF_AMASK);
 
 	SDL_FillRect(tmp_surface, &srcrect, color);
 	
@@ -251,12 +273,14 @@
 	if (destwidth <= 0 || destheight <= 0)
 		return toSurface;
 
+	const int bpp = img_source->format->BitsPerPixel / 8;
+
 	/* Blitting would be a mistake here, because we need to preserve
 	* the alpha channel, which blitting does not do */
 	for (i = topoffset; i < (y2+1-y1-bottomoffset); i++)
-		memcpy((char*)toSurface->pixels + toSurface->pitch*i + (leftoffset * 4),
-			&srcpixels[(i+y1)*img_source->pitch + (x1 + leftoffset)*4],
-			destwidth*4);
+		memcpy((char*)toSurface->pixels + toSurface->pitch*i + (leftoffset * bpp),
+			&srcpixels[(i+y1)*img_source->pitch + (x1 + leftoffset)*bpp],
+			destwidth*bpp);
 
 	return toSurface;
 }
Index: vultures-2.2.100/vultures/vultures_txt.cpp
===================================================================
--- vultures-2.2.100.orig/vultures/vultures_txt.cpp	2010-01-18 19:19:26.000000000 +0100
+++ vultures-2.2.100/vultures/vultures_txt.cpp	2010-01-18 19:19:45.000000000 +0100
@@ -58,7 +58,7 @@
 	SDL_Surface *textsurface;
 	SDL_Color fontcolor;
 	SDL_Rect dstrect;
-  std::string cleaned_str;
+	std::string cleaned_str;
 	unsigned int i;
 
 	if (font_id >= VULTURES_MAX_FONTS || (!vultures_fonts[font_id].fontptr) || str.empty())
@@ -70,11 +70,9 @@
 		if (!isprint(cleaned_str[i]))
 			cleaned_str[i] = ' ';
 
-
 	/* extract components from the 32-bit color value */
-	fontcolor.r = (color & dest->format->Rmask) >> dest->format->Rshift;
-	fontcolor.g = (color & dest->format->Gmask) >> dest->format->Gshift;
-	fontcolor.b = (color & dest->format->Bmask) >> dest->format->Bshift;
+	SDL_GetRGB(color, vultures_px_format,
+		&fontcolor.r, &fontcolor.g, &fontcolor.b);
 	fontcolor.unused = 0;
 
 	textsurface = TTF_RenderText_Blended(vultures_fonts[font_id].fontptr,
Index: vultures-2.2.100/vultures/vultures_txt.h
===================================================================
--- vultures-2.2.100.orig/vultures/vultures_txt.h	2010-01-18 19:19:26.000000000 +0100
+++ vultures-2.2.100/vultures/vultures_txt.h	2010-01-18 19:46:23.000000000 +0100
@@ -4,6 +4,7 @@
 #define _vultures_txt_h_
 
 #include <string>
+#include "vultures_gra.h"
 #include "SDL_ttf.h"
 
 
@@ -22,8 +23,8 @@
 /*
 * colors used to draw text
 */
-#define V_COLOR_TEXT       0xffffffff
-#define V_COLOR_INTRO_TEXT 0xffffffff
+#define V_COLOR_TEXT       CLR32_WHITE
+#define V_COLOR_INTRO_TEXT CLR32_WHITE
 
 /*---------------------------------------------------------------------------
  Text displaying
