From: Leon Brocard Date: Fri, 16 Oct 2009 13:57:31 +0000 (+0100) Subject: Move display format and display format alpha out of Surface.xs X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f7ce55ec6ad0a21bb1fa18aec222fa0274764557;p=sdlgit%2FSDL_perl.git Move display format and display format alpha out of Surface.xs --- diff --git a/src/Core/objects/Surface.xs b/src/Core/objects/Surface.xs index 43bd8dc..33c95e5 100644 --- a/src/Core/objects/Surface.xs +++ b/src/Core/objects/Surface.xs @@ -74,29 +74,6 @@ surface_update_rects ( surface, ... ) SDL_UpdateRects(surface,num_rects,rects); safefree(rects); -SDL_Surface * -surface_display ( surface ) - SDL_Surface *surface - CODE: - char* CLASS = "SDL::Surface"; - - SDL_Surface *new_surface = SDL_DisplayFormat(surface); - SDL_FreeSurface(surface); - RETVAL = new_surface; - OUTPUT: - RETVAL - -SDL_Surface * -surface_display_alpha ( surface ) - SDL_Surface *surface - CODE: - char* CLASS = "SDL::Surface"; - SDL_Surface *new_surface = SDL_DisplayFormatAlpha(surface); - SDL_FreeSurface(surface); - RETVAL = new_surface; - OUTPUT: - RETVAL - Uint16 surface_pitch( surface ) SDL_Surface *surface diff --git a/src/SDL.xs b/src/SDL.xs index 1dcddae..7994608 100644 --- a/src/SDL.xs +++ b/src/SDL.xs @@ -1294,6 +1294,24 @@ UpdateRect ( surface, x, y, w ,h ) CODE: SDL_UpdateRect(surface,x,y,w,h); +SDL_Surface * +DisplayFormat ( surface ) + SDL_Surface *surface + CODE: + char* CLASS = "SDL::Surface"; + RETVAL = SDL_DisplayFormat(surface); + OUTPUT: + RETVAL + +SDL_Surface * +DisplayFormatAlpha ( surface ) + SDL_Surface *surface + CODE: + char* CLASS = "SDL::Surface"; + RETVAL = SDL_DisplayFormatAlpha(surface); + OUTPUT: + RETVAL + =for comment Comment out for now as it does not compile @@ -1457,22 +1475,6 @@ SetAlpha ( surface, flag, alpha ) OUTPUT: RETVAL -SDL_Surface * -DisplayFormat ( surface ) - SDL_Surface *surface - CODE: - RETVAL = SDL_DisplayFormat(surface); - OUTPUT: - RETVAL - -SDL_Surface* -DisplayFormatAlpha ( surface ) - SDL_Surface *surface - CODE: - RETVAL = SDL_DisplayFormatAlpha(surface); - OUTPUT: - RETVAL - SDL_Surface* ConvertRGB ( surface ) SDL_Surface * surface diff --git a/t/core_surface.t b/t/core_surface.t index d87811c..d81eaf0 100644 --- a/t/core_surface.t +++ b/t/core_surface.t @@ -79,10 +79,10 @@ my $app = SDL::App->new( pass 'did this pass'; -my $image_format = $image->display; +my $image_format = SDL::DisplayFormat($image); isa_ok( $image_format, 'SDL::Surface' ); -my $image_format_alpha = $image->display_alpha; +my $image_format_alpha = SDL::DisplayFormatAlpha($image); isa_ok( $image_format_alpha, 'SDL::Surface' ); my $app_pixel_format = $app->format;