Implemented SDL_LockSurface and SDL_UnlockSurface
authorRyan C. Gordon <icculus@icculus.org>
Wed, 20 Feb 2019 11:56:40 -0500
changeset 7676970160f0fb
parent 75 00631178b6d5
child 77 ce9a1f04bb36
Implemented SDL_LockSurface and SDL_UnlockSurface
src/SDL12_compat.c
src/SDL20_include_wrapper.h
src/SDL20_syms.h
     1.1 --- a/src/SDL12_compat.c	Wed Feb 20 11:56:19 2019 -0500
     1.2 +++ b/src/SDL12_compat.c	Wed Feb 20 11:56:40 2019 -0500
     1.3 @@ -2037,6 +2037,23 @@
     1.4      return SDL20_Unsupported();
     1.5  }
     1.6  
     1.7 +DECLSPEC int SDLCALL
     1.8 +SDL_LockSurface(SDL12_Surface *surface12)
     1.9 +{
    1.10 +    const int retval = SDL20_LockSurface(surface12->surface20);
    1.11 +    surface12->pixels = surface12->surface20->pixels;
    1.12 +    surface12->pitch = surface12->surface20->pitch;
    1.13 +    return retval;
    1.14 +}
    1.15 +
    1.16 +DECLSPEC void SDLCALL
    1.17 +SDL_UnlockSurface(SDL12_Surface *surface12)
    1.18 +{
    1.19 +    SDL20_UnlockSurface(surface12->surface20);
    1.20 +    surface12->pixels = surface12->surface20->pixels;
    1.21 +    surface12->pitch = surface12->surface20->pitch;
    1.22 +}
    1.23 +
    1.24  DECLSPEC SDL12_Surface * SDLCALL
    1.25  SDL_ConvertSurface(SDL12_Surface *src12, const SDL12_PixelFormat *format12, Uint32 flags12)
    1.26  {
     2.1 --- a/src/SDL20_include_wrapper.h	Wed Feb 20 11:56:19 2019 -0500
     2.2 +++ b/src/SDL20_include_wrapper.h	Wed Feb 20 11:56:40 2019 -0500
     2.3 @@ -87,6 +87,8 @@
     2.4  #define SDL_LowerBlit IGNORE_THIS_VERSION_OF_SDL_LowerBlit
     2.5  #define SDL_ConvertSurface IGNORE_THIS_VERSION_OF_SDL_ConvertSurface
     2.6  #define SDL_SetColorKey IGNORE_THIS_VERSION_OF_SDL_SetColorKey
     2.7 +#define SDL_LockSurface IGNORE_THIS_VERSION_OF_SDL_LockSurface
     2.8 +#define SDL_UnlockSurface IGNORE_THIS_VERSION_OF_SDL_UnlockSurface
     2.9  
    2.10  #define BUILD_SDL 1
    2.11  #include "SDL.h"
    2.12 @@ -151,6 +153,8 @@
    2.13  #undef SDL_LowerBlit
    2.14  #undef SDL_ConvertSurface
    2.15  #undef SDL_SetColorKey
    2.16 +#undef SDL_LockSurface
    2.17 +#undef SDL_UnlockSurface
    2.18  
    2.19  #ifdef SDL_BlitSurface
    2.20  #undef SDL_BlitSurface
     3.1 --- a/src/SDL20_syms.h	Wed Feb 20 11:56:19 2019 -0500
     3.2 +++ b/src/SDL20_syms.h	Wed Feb 20 11:56:40 2019 -0500
     3.3 @@ -88,6 +88,8 @@
     3.4  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)
     3.5  SDL20_SYM(SDL_Surface *,CreateRGBSurfaceWithFormat,(Uint32 a, int b, int c, int d, Uint32 e),(a,b,c,d,e),return)
     3.6  SDL20_SYM(SDL_Surface *,ConvertSurface,(SDL_Surface *a, const SDL_PixelFormat *b, Uint32 c),(a,b,c),return)
     3.7 +SDL20_SYM(int,LockSurface,(SDL_Surface *a),(a),return)
     3.8 +SDL20_SYM(void,UnlockSurface,(SDL_Surface *a),(a),)
     3.9  SDL20_SYM(int,UpperBlit,(SDL_Surface *a,const SDL_Rect *b,SDL_Surface *c, SDL_Rect *d),(a,b,c,d),return)
    3.10  SDL20_SYM(int,LowerBlit,(SDL_Surface *a,const SDL_Rect *b,SDL_Surface *c, SDL_Rect *d),(a,b,c,d),return)
    3.11  SDL20_SYM(int,SetColorKey,(SDL_Surface *a, int b, Uint32 c),(a,b,c),return)