made Constants use constant instead of being subs
[sdlgit/SDL_perl.git] / src / SDL.xs
index 09c2dbd..9c26874 100644 (file)
@@ -1357,11 +1357,11 @@ void
 UpdateRects ( surface, ... )
        SDL_Surface *surface
        CODE:
-               SDL_Rect *rects, *oldrects, *temp;
+               SDL_Rect *rects, *temp;
                int num_rects,i;
                if ( items < 2 ) return;
                num_rects = items - 1;
-               oldrects = rects;       
+                       
                rects = (SDL_Rect *)safemalloc(sizeof(SDL_Rect)*items);
                for(i=0;i<num_rects;i++) {
                        temp = (SDL_Rect *)SvIV(ST(i+1));
@@ -1372,7 +1372,7 @@ UpdateRects ( surface, ... )
                } 
                SDL_UpdateRects(surface,num_rects,rects);
                safefree(rects);
-               safefree(oldrects);
+               
 
 int
 Flip ( surface )
@@ -1557,8 +1557,11 @@ ConvertRGBA ( surface )
 int
 BlitSurface ( src, src_rect, dest, dest_rect )
        SDL_Surface *src
-       SDL_Rect *src_rect
+
        SDL_Surface *dest
+
+       SDL_Rect *src_rect
+
        SDL_Rect *dest_rect
        CODE:
                RETVAL = SDL_BlitSurface(src,src_rect,dest,dest_rect);
@@ -1568,8 +1571,11 @@ BlitSurface ( src, src_rect, dest, dest_rect )
 int
 FillRect ( dest, dest_rect, color )
        SDL_Surface *dest
-       SDL_Rect *dest_rect
+       
        SDL_Color *color
+       
+       SDL_Rect *dest_rect
+
        CODE:
                Uint32 pixel = SDL_MapRGB(dest->format,color->r,color->g,color->b);
                RETVAL = SDL_FillRect(dest,dest_rect,pixel);
@@ -2195,6 +2201,15 @@ MixPlayingMusic()
        OUTPUT:
                RETVAL
 
+int
+MixSetPanning ( channel, left, right )
+       int channel
+       int left
+       int right
+       CODE:
+               RETVAL = Mix_SetPanning(channel, left, right);
+       OUTPUT:
+               RETVAL
 
 void
 MixCloseAudio ()
@@ -2924,15 +2939,14 @@ TTFSizeText ( font, text )
                RETVAL = newAV();
                if(TTF_SizeText(font,text,&w,&h))
                {
-                       av_push(RETVAL,newSViv(w));
-                       av_push(RETVAL,newSViv(h));
-                       sv_2mortal((SV*)RETVAL);
+                       printf("TTF error at TTFSizeText: %s \n", TTF_GetError());
+                       Perl_croak (aTHX_ "TTF error \n");
                }
                else
                {
-                        printf("TTF error at TTFSizeText: %s \n", TTF_GetError()); 
-                        Perl_croak (aTHX_ "TTF error \n");     
-       
+                       av_push(RETVAL,newSViv(w));
+                       av_push(RETVAL,newSViv(h));
+                       sv_2mortal((SV*)RETVAL);
                }