Expose SDL::MapRGB
[sdlgit/SDL_perl.git] / src / SDL.xs
index cc0d135..6e07fe1 100644 (file)
@@ -858,6 +858,19 @@ GetKeyName ( sym )
        OUTPUT:
                RETVAL
 
+#ifdef HAVE_SDL_IMAGE
+
+SDL_Surface *
+IMG_Load ( filename )
+       char *filename
+       CODE:
+               char* CLASS = "SDL::Surface";
+               RETVAL = IMG_Load(filename);
+       OUTPUT:
+               RETVAL
+
+#endif
+
 =for comment
 
 Comment out for now as it does not compile
@@ -883,18 +896,6 @@ CreateRGBSurfaceFrom (pixels, width, height, depth, pitch, Rmask, Gmask, Bmask,
        OUTPUT: 
                RETVAL
 
-#ifdef HAVE_SDL_IMAGE
-
-SDL_Surface *
-IMGLoad ( fname )
-       char *fname
-       CODE:
-               RETVAL = IMG_Load(fname);
-       OUTPUT:
-               RETVAL
-
-#endif
-
 SDL_Surface*
 SurfaceCopy ( surface )
        SDL_Surface *surface
@@ -1241,13 +1242,14 @@ PaletteNColors ( palette, ... )
 
 SDL_Surface *
 SetVideoMode ( width, height, bpp, flags )
+
        int width
        int height
        int bpp
        Uint32 flags
 
        CODE:
-               char* CLASS;
+               char *CLASS = "SDL::Surface";
                RETVAL = SDL_SetVideoMode(width,height,bpp,flags);
        OUTPUT:
                RETVAL
@@ -1260,6 +1262,27 @@ Flip ( surface )
        OUTPUT:
                RETVAL
 
+int
+BlitSurface ( src, src_rect, dest, dest_rect )
+       SDL_Surface *src
+       SDL_Surface *dest
+       SDL_Rect *src_rect
+       SDL_Rect *dest_rect
+       CODE:
+               RETVAL = SDL_BlitSurface(src,src_rect,dest,dest_rect);
+       OUTPUT:
+               RETVAL
+
+Uint32
+MapRGB ( pixel_format, r, g, b )
+       SDL_PixelFormat *pixel_format
+       Uint8 r
+       Uint8 g
+       Uint8 b
+       CODE:
+               RETVAL = SDL_MapRGB(pixel_format,r,g,b);
+       OUTPUT:
+               RETVAL
 
 =for comment
 
@@ -1364,17 +1387,6 @@ all_done:
                RETVAL
 
 Uint32
-MapRGB ( surface, r, g, b )
-       SDL_Surface *surface
-       Uint8 r
-       Uint8 g
-       Uint8 b
-       CODE:
-               RETVAL = SDL_MapRGB(surface->format,r,g,b);
-       OUTPUT:
-               RETVAL
-
-Uint32
 MapRGBA ( surface, r, g, b, a )
        SDL_Surface *surface
        Uint8 r
@@ -1513,20 +1525,6 @@ ConvertRGBA ( surface )
        OUTPUT:
                RETVAL
 
-int
-BlitSurface ( src, src_rect, dest, dest_rect )
-       SDL_Surface *src
-
-       SDL_Surface *dest
-
-       SDL_Rect *src_rect
-
-       SDL_Rect *dest_rect
-       CODE:
-               RETVAL = SDL_BlitSurface(src,src_rect,dest,dest_rect);
-       OUTPUT:
-               RETVAL
-
 =cut
 
 int