Commit 08ad85b6 authored by Gerhard Stein's avatar Gerhard Stein

More SDL Fixups

parent f34b5b3e
......@@ -203,7 +203,13 @@ SDL_Surface* CFont::fetchColoredTextSfc(const std::string& text, const Uint32 fg
drawFont( pColoredTextSurface, text, 0, 0);
// Adapt the newly created surface to the running screen.
SDL_Surface *temp = SDL_DisplayFormatAlpha(pColoredTextSurface);
SDL_Surface *temp;
if(RES_BPP == 32) // Only if there is an Alpha Channel (32 BPP)
temp = SDL_DisplayFormatAlpha(pColoredTextSurface);
else // or
temp = SDL_DisplayFormat(pColoredTextSurface);
SDL_FreeSurface(pColoredTextSurface);
pColoredTextSurface = temp;
......
......@@ -13,7 +13,7 @@
#include <SDL.h>
const unsigned int RES_BPP = 16;
const unsigned int RES_BPP = 32;
#ifdef USE_OPENGL
#include <SDL_opengl.h>
......
......@@ -73,17 +73,27 @@ inline Colormask getColourMask32bit()
SDL_Surface *CG_CreateRGBSurface( const SDL_Rect rect )
{
Colormask mask = getColourMask32bit();
//SDL_Surface *video = SDL_GetVideoSurface();
SDL_Surface *sfc = SDL_CreateRGBSurface( SDL_SWSURFACE, // TODO: Must be changed in future for better hardware support
SDL_Surface *sfc = SDL_CreateRGBSurface( SDL_SWSURFACE,
rect.w,
rect.h,
RES_BPP, // TODO: Must be changed in future for better 16 bpp support
RES_BPP,
mask.r,
mask.g,
mask.b,
mask.a );
/*SDL_Surface *sfc = SDL_CreateRGBSurface( SDL_SWSURFACE,
rect.w,
rect.h,
RES_BPP,
video->format->Rmask,
video->format->Gmask,
video->format->Bmask,
video->format->Amask);*/
return sfc;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment