Move blit out of Surface.xs, enable BlitSurface
Leon Brocard [Fri, 16 Oct 2009 08:45:13 +0000 (09:45 +0100)]
src/Core/objects/Surface.xs
src/SDL.xs
t/core_surface.t

index b34b58b..b35484a 100644 (file)
@@ -46,17 +46,6 @@ surface_new (CLASS, flags, width, height, depth, Rmask, Gmask, Bmask, Amask )
                RETVAL
 
 int
-surface_blit ( src, src_rect, dest, dest_rect )
-       SDL_Surface *src
-       SDL_Surface *dest
-       SDL_Rect *src_rect
-       SDL_Rect *dest_rect
-       CODE:
-               RETVAL = SDL_BlitSurface(src,src_rect,dest,dest_rect);
-       OUTPUT:
-               RETVAL
-
-int
 surface_fill_rect ( dest, dest_rect, color )
        SDL_Surface *dest
        SDL_Color *color
index 4e9f640..2577e40 100644 (file)
@@ -1262,6 +1262,16 @@ Flip ( surface )
        OUTPUT:
                RETVAL
 
+int
+BlitSurface ( src, src_rect, dest, dest_rect )
+       SDL_Surface *src
+       SDL_Surface *dest
+       SDL_Rect *src_rect
+       SDL_Rect *dest_rect
+       CODE:
+               RETVAL = SDL_BlitSurface(src,src_rect,dest,dest_rect);
+       OUTPUT:
+               RETVAL
 
 =for comment
 
@@ -1515,20 +1525,6 @@ ConvertRGBA ( surface )
        OUTPUT:
                RETVAL
 
-int
-BlitSurface ( src, src_rect, dest, dest_rect )
-       SDL_Surface *src
-
-       SDL_Surface *dest
-
-       SDL_Rect *src_rect
-
-       SDL_Rect *dest_rect
-       CODE:
-               RETVAL = SDL_BlitSurface(src,src_rect,dest,dest_rect);
-       OUTPUT:
-               RETVAL
-
 =cut
 
 int
index be98354..298a42d 100644 (file)
@@ -40,7 +40,7 @@ $surface->fill_rect( SDL::Rect->new( 0, 0, 32, 32 ),
 ok( 1, 'Managed to fill_rect' );
 
 my $small_rect = SDL::Rect->new( 0, 0, 64, 64 );
-$image->blit( $small_rect, $surface, $small_rect );
+SDL::BlitSurface($image, $small_rect, $surface, $small_rect );
 ok( 1, 'Managed to blit' );
 
 #my $image_format = $surface->display;