Skip to content

Commit

Permalink
Deal with the SDL_*Blit functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Feb 15, 2019
1 parent 7340ad1 commit 98a9e58
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/SDL12_compat.c
Expand Up @@ -97,6 +97,8 @@

// !!! IMPLEMENT_ME X11_KeyToUnicode

#define SDL_BlitSurface SDL_UpperBlit


#if 0
#define FIXME(x) do {} while (0)
Expand Down Expand Up @@ -1931,6 +1933,18 @@ SDL_GetVideoSurface(void)
return VideoSurface12;
}

DECLSPEC int SDLCALL
SDL_UpperBlit(SDL12_Surface *src, SDL_Rect *srcrect, SDL12_Surface *dst, SDL_Rect *dstrect)
{
return SDL20_UpperBlit(src->surface20, srcrect, dst->surface20, dstrect);
}

DECLSPEC int SDLCALL
SDL_LowerBlit(SDL12_Surface *src, SDL_Rect *srcrect, SDL12_Surface *dst, SDL_Rect *dstrect)
{
return SDL20_LowerBlit(src->surface20, srcrect, dst->surface20, dstrect);
}

DECLSPEC int SDLCALL
SDL_SetAlpha(SDL12_Surface * surface, Uint32 flag, Uint8 value)
{
Expand Down
8 changes: 8 additions & 0 deletions src/SDL20_include_wrapper.h
Expand Up @@ -83,6 +83,8 @@
#define SDL_LoadBMP_RW IGNORE_THIS_VERSION_OF_SDL_LoadBMP_RW
#define SDL_SaveBMP_RW IGNORE_THIS_VERSION_OF_SDL_SaveBMP_RW
#define SDL_LoadWAV_RW IGNORE_THIS_VERSION_OF_SDL_LoadWAV_RW
#define SDL_UpperBlit IGNORE_THIS_VERSION_OF_SDL_UpperBlit
#define SDL_LowerBlit IGNORE_THIS_VERSION_OF_SDL_LowerBlit

#define BUILD_SDL 1
#include "SDL.h"
Expand Down Expand Up @@ -143,6 +145,12 @@
#undef SDL_LoadBMP_RW
#undef SDL_SaveBMP_RW
#undef SDL_LoadWAV_RW
#undef SDL_UpperBlit
#undef SDL_LowerBlit

#ifdef SDL_BlitSurface
#undef SDL_BlitSurface
#endif

#ifdef SDL_malloc
#undef SDL_malloc
Expand Down
2 changes: 2 additions & 0 deletions src/SDL20_syms.h
Expand Up @@ -87,6 +87,8 @@ SDL20_SYM(void,FreeFormat,(SDL_PixelFormat *a),(a),)
SDL20_SYM(SDL_Surface *,CreateRGBSurface,(Uint32 a, int b, int c, int d, Uint32 e, Uint32 f, Uint32 g, Uint32 h),(a,b,c,d,e,f,g,h),return)
SDL20_SYM(SDL_Surface *,CreateRGBSurfaceFrom,(void *a, int b, int c, int d, int e, Uint32 f, Uint32 g, Uint32 h, Uint32 i),(a,b,c,d,e,f,g,h,i),return)
SDL20_SYM(SDL_Surface *,CreateRGBSurfaceWithFormat,(Uint32 a, int b, int c, int d, Uint32 e),(a,b,c,d,e),return)
SDL20_SYM(int,UpperBlit,(SDL_Surface *a,const SDL_Rect *b,SDL_Surface *c, SDL_Rect *d),(a,b,c,d),return)
SDL20_SYM(int,LowerBlit,(SDL_Surface *a,const SDL_Rect *b,SDL_Surface *c, SDL_Rect *d),(a,b,c,d),return)
SDL20_SYM(void,FreeSurface,(SDL_Surface *a),(a),)
SDL20_SYM(SDL_Surface*,LoadBMP_RW,(SDL_RWops *a, int b),(a,b),return)
SDL20_SYM(int,SaveBMP_RW,(SDL_Surface *a, SDL_RWops *b, int c),(a,b,c),return)
Expand Down

0 comments on commit 98a9e58

Please sign in to comment.