From: Leon Brocard Date: Fri, 16 Oct 2009 08:38:48 +0000 (+0100) Subject: Move load out of Surface.xs, rename it to reflect the SDL name X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a7fbee873b639bb9c89f763b68068985fc4f3123;p=sdlgit%2FSDL_perl.git Move load out of Surface.xs, rename it to reflect the SDL name --- diff --git a/src/Core/objects/Surface.xs b/src/Core/objects/Surface.xs index b3c5477..b34b58b 100644 --- a/src/Core/objects/Surface.xs +++ b/src/Core/objects/Surface.xs @@ -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 diff --git a/src/SDL.xs b/src/SDL.xs index 13d265c..4e9f640 100644 --- a/src/SDL.xs +++ b/src/SDL.xs @@ -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 diff --git a/t/core_surface.t b/t/core_surface.t index 6b931b4..be98354 100644 --- a/t/core_surface.t +++ b/t/core_surface.t @@ -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' );