Some more cleanup to make SDL common code friendly to SDL1 and SDL2

This commit is contained in:
Michael Martin
2019-08-15 21:55:40 -07:00
parent f36a9339fc
commit ce92261641
3 changed files with 11 additions and 2 deletions
+4
View File
@@ -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;
}
+7 -1
View File
@@ -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)
-1
View File
@@ -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"