Some more cleanup to make SDL common code friendly to SDL1 and SDL2
This commit is contained in:
@@ -46,7 +46,11 @@ ColorToNative (Color color)
|
||||
native.r = color.r;
|
||||
native.g = color.g;
|
||||
native.b = color.b;
|
||||
#if SDL_MAJOR_VERSION == 1
|
||||
native.unused = 0;
|
||||
#else
|
||||
native.a = color.a;
|
||||
#endif
|
||||
return native;
|
||||
}
|
||||
|
||||
|
||||
@@ -533,12 +533,18 @@ blt_prim(SDL_Surface *src, SDL_Rect src_r, RenderPixelFn plot, int factor,
|
||||
mask = srcfmt->Amask;
|
||||
key = 0;
|
||||
}
|
||||
#if SDL_MAJOR_VERSION == 1
|
||||
else if (src->flags & SDL_SRCCOLORKEY)
|
||||
{ // colorkey transparency
|
||||
mask = ~srcfmt->Amask;
|
||||
key = srcfmt->colorkey & mask;
|
||||
}
|
||||
|
||||
#else
|
||||
else if (SDL_GetColorKey (src, &key) == 0)
|
||||
{
|
||||
mask = ~0;
|
||||
}
|
||||
#endif
|
||||
// TODO: calculate the source and destination pointers directly
|
||||
// instead of using the plot(x,y) version
|
||||
for (y = 0; y < src_r.h; ++y)
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
#include "port.h"
|
||||
#include SDL_INCLUDE(SDL.h)
|
||||
#include SDL_INCLUDE(SDL_byteorder.h)
|
||||
|
||||
#include "../gfxintrn.h"
|
||||
#include "libs/graphics/tfb_draw.h"
|
||||
|
||||
Reference in New Issue
Block a user