Move display format and display format alpha out of Surface.xs
Leon Brocard [Fri, 16 Oct 2009 13:57:31 +0000 (14:57 +0100)]
src/Core/objects/Surface.xs
src/SDL.xs
t/core_surface.t

index 43bd8dc..33c95e5 100644 (file)
@@ -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
index 1dcddae..7994608 100644 (file)
@@ -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
index d87811c..d81eaf0 100644 (file)
@@ -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;