X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=src%2FSDL.xs;h=9c268744794bfd863fef3d72243712f0ff30d28a;hb=dc4306f5dfac812c4c0de925c7048a70ff3787eb;hp=806e60991b50e96d1d79725e4bc53ce7dd512157;hpb=89d02e07e2ec3457fd3881110d018f6c1999214c;p=sdlgit%2FSDL_perl.git diff --git a/src/SDL.xs b/src/SDL.xs index 806e609..9c26874 100644 --- a/src/SDL.xs +++ b/src/SDL.xs @@ -1205,63 +1205,6 @@ VideoInfo () OUTPUT: RETVAL -SDL_Rect * -NewRect ( x, y, w, h ) - Sint16 x - Sint16 y - Uint16 w - Uint16 h - CODE: - RETVAL = (SDL_Rect *) safemalloc (sizeof(SDL_Rect)); - RETVAL->x = x; - RETVAL->y = y; - RETVAL->w = w; - RETVAL->h = h; - OUTPUT: - RETVAL - -void -FreeRect ( rect ) - SDL_Rect *rect - CODE: - safefree(rect); - -Sint16 -RectX ( rect, ... ) - SDL_Rect *rect - CODE: - if (items > 1 ) rect->x = SvIV(ST(1)); - RETVAL = rect->x; - OUTPUT: - RETVAL - -Sint16 -RectY ( rect, ... ) - SDL_Rect *rect - CODE: - if (items > 1 ) rect->y = SvIV(ST(1)); - RETVAL = rect->y; - OUTPUT: - RETVAL - -Uint16 -RectW ( rect, ... ) - SDL_Rect *rect - CODE: - if (items > 1 ) rect->w = SvIV(ST(1)); - RETVAL = rect->w; - OUTPUT: - RETVAL - -Uint16 -RectH ( rect, ... ) - SDL_Rect *rect - CODE: - if (items > 1 ) rect->h = SvIV(ST(1)); - RETVAL = rect->h; - OUTPUT: - RETVAL - AV* ListModes ( format, flags ) Uint32 flags @@ -1417,7 +1360,8 @@ UpdateRects ( surface, ... ) SDL_Rect *rects, *temp; int num_rects,i; if ( items < 2 ) return; - num_rects = items - 1; + num_rects = items - 1; + rects = (SDL_Rect *)safemalloc(sizeof(SDL_Rect)*items); for(i=0;iformat,color->r,color->g,color->b); RETVAL = SDL_FillRect(dest,dest_rect,pixel); @@ -2250,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 () @@ -2541,14 +2501,12 @@ SetClipRect ( surface, rect ) CODE: SDL_SetClipRect(surface,rect); -SDL_Rect* -GetClipRect ( surface ) +void +GetClipRect ( surface, rect ) SDL_Surface *surface + SDL_Rect *rect; CODE: - RETVAL = (SDL_Rect*) safemalloc(sizeof(SDL_Rect)); - SDL_GetClipRect(surface,RETVAL); - OUTPUT: - RETVAL + SDL_GetClipRect(surface, rect); #ifdef HAVE_SDL_NET @@ -2981,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); }