Move load out of Surface.xs, rename it to reflect the SDL name
Leon Brocard [Fri, 16 Oct 2009 08:38:48 +0000 (09:38 +0100)]
src/Core/objects/Surface.xs
src/SDL.xs
t/core_surface.t

index b3c5477..b34b58b 100644 (file)
@@ -45,16 +45,6 @@ surface_new (CLASS, flags, width, height, depth, Rmask, Gmask, Bmask, Amask )
        OUTPUT:
                RETVAL
 
-
-SDL_Surface *
-surface_load (CLASS, filename )
-       char* CLASS
-       char* filename
-       CODE:
-               RETVAL = IMG_Load(filename);
-       OUTPUT:
-               RETVAL
-
 int
 surface_blit ( src, src_rect, dest, dest_rect )
        SDL_Surface *src
index 13d265c..4e9f640 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
index 6b931b4..be98354 100644 (file)
@@ -31,7 +31,7 @@ is( $clip_rect->y, 0,   'clip_rect has y' );
 is( $clip_rect->w, 640, 'clip_rect has width' );
 is( $clip_rect->h, 320, 'clip_rect has height' );
 
-my $image = SDL::Surface->load('test/data/logo.png');
+my $image = SDL::IMG_Load('test/data/logo.png');
 is( $image->w, 608, 'image has width' );
 is( $image->h, 126, 'image has height' );