Skip to content

Commit

Permalink
Move load out of Surface.xs, rename it to reflect the SDL name
Browse files Browse the repository at this point in the history
  • Loading branch information
acme committed Oct 16, 2009
1 parent f32a534 commit a7fbee8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 23 deletions.
10 changes: 0 additions & 10 deletions src/Core/objects/Surface.xs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 13 additions & 12 deletions src/SDL.xs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion t/core_surface.t
Original file line number Diff line number Diff line change
Expand Up @@ -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' );

Expand Down

0 comments on commit a7fbee8

Please sign in to comment.