X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=src%2FSDL.xs;h=6e07fe12e7f4de4cd0e8b103d820bb49692bedba;hb=2e2fd270bb6786a1bec87b18b0c648a5ceb0991e;hp=b880c5c15d04e55b2cd0dbbb541762440caf7a69;hpb=8ead669ea4af47d3c68a463f6974c63696ef1ca2;p=sdlgit%2FSDL_perl.git diff --git a/src/SDL.xs b/src/SDL.xs index b880c5c..6e07fe1 100644 --- a/src/SDL.xs +++ b/src/SDL.xs @@ -1,11 +1,31 @@ +// // SDL.xs // -// SDL Perl by David J. Goehrig +// Copyright (C) 2005 David J. Goehrig +// +// ------------------------------------------------------------------------------ +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// ------------------------------------------------------------------------------ +// +// Please feel free to send questions, suggestions or improvements to: +// +// David J. Goehrig +// dgoehrig@cpan.org // -// Copyright (C) 2000,2001,2002,2003,2004 David J. Goehrig -// Copyright (C) 2009 Kartik Thakore -// This software is under the GNU Library General Public License (LGPL) -// see the file COPYING for terms of use #include "EXTERN.h" #include "perl.h" @@ -17,6 +37,14 @@ #include +#ifdef HAVE_GL +#include +#endif + +#ifdef HAVE_GLU +#include +#endif + #ifdef HAVE_SDL_IMAGE #include #endif @@ -26,12 +54,8 @@ void (*mix_music_finished_cv)(); #endif -#ifdef HAVE_GL -#include -#endif - -#ifdef HAVE_GLU -#include +#ifdef HAVE_SDL_SOUND +#include #endif #ifdef HAVE_SDL_NET @@ -65,37 +89,35 @@ static int sdl_perl_use_smpeg_audio = 0; #include #endif +#ifdef HAVE_SDL_SVG +#include +#endif + #ifdef USE_THREADS #define HAVE_TLS_CONTEXT #endif -#include "defines.h" - -#ifdef MACOSX -#include -void CPSEnableForegroundOperation(ProcessSerialNumber* psn); -void NSApplicationLoad(); -void SDL_macosx_init(void) { - Boolean sameProc; - ProcessSerialNumber myProc, frProc; - if (GetFrontProcess(&frProc) == noErr) - if (GetCurrentProcess(&myProc) == noErr) - if (SameProcess(&frProc, &myProc, &sameProc) == noErr && sameProc == 0) { - /* - NSLog(@"creating bad autorelease pool"); - [[NSAutoreleasePool alloc] init]; - */ - NSApplicationLoad(); - CPSEnableForegroundOperation(&myProc); - } -} -void SDL_macosx_quit(void) { -} -#endif // MACOSX - - +/* For windows */ +#ifndef SDL_PERL_DEFINES_H +#define SDL_PERL_DEFINES_H +#ifdef HAVE_TLS_CONTEXT +PerlInterpreter *parent_perl = NULL; +extern PerlInterpreter *parent_perl; +#define GET_TLS_CONTEXT parent_perl = PERL_GET_CONTEXT; +#define ENTER_TLS_CONTEXT \ + PerlInterpreter *current_perl = PERL_GET_CONTEXT; \ + PERL_SET_CONTEXT(parent_perl); { \ + PerlInterpreter *my_perl = parent_perl; +#define LEAVE_TLS_CONTEXT \ + } PERL_SET_CONTEXT(current_perl); +#else +#define GET_TLS_CONTEXT /* TLS context not enabled */ +#define ENTER_TLS_CONTEXT /* TLS context not enabled */ +#define LEAVE_TLS_CONTEXT /* TLS context not enabled */ +#endif +#endif Uint32 sdl_perl_timer_callback ( Uint32 interval, void* param ) @@ -206,13 +228,15 @@ sdl_perl_music_finished_callback ( void ) #endif +#define INIT_NS_APPLICATION +#define QUIT_NS_APPLICATION + + void sdl_perl_atexit (void) { + QUIT_NS_APPLICATION SDL_Quit(); -#ifdef MACOSX - SDL_macosx_quit(); -#endif } void boot_SDL(); @@ -238,9 +262,7 @@ int Init ( flags ) Uint32 flags CODE: -#ifdef MACOSX - SDL_macosx_init(); -#endif + INIT_NS_APPLICATION RETVAL = SDL_Init(flags); #ifdef HAVE_TLS_CONTEXT Perl_call_atexit(PERL_GET_CONTEXT, (void*)sdl_perl_atexit,0); @@ -267,11 +289,8 @@ QuitSubSystem ( flags ) void Quit () CODE: + QUIT_NS_APPLICATION SDL_Quit(); -#ifdef MACOSX - SDL_macosx_quit(); -#endif - int WasInit ( flags ) @@ -337,6 +356,103 @@ RemoveTimer ( id ) OUTPUT: RETVAL +SDL_RWops* +RWFromFile ( file, mode ) + char* file + char * mode + CODE: + RETVAL = SDL_RWFromFile(file,mode); + OUTPUT: + RETVAL + +SDL_RWops* +RWFromFP ( fp, autoclose ) + FILE* fp + int autoclose + CODE: + RETVAL = SDL_RWFromFP(fp,autoclose); + OUTPUT: + RETVAL + +SDL_RWops* +RWFromMem ( mem, size ) + char* mem + int size + CODE: + RETVAL = SDL_RWFromMem((void*)mem,size); + OUTPUT: + RETVAL + +SDL_RWops* +RWFromConstMem ( mem, size ) + const char* mem + int size + CODE: + RETVAL = SDL_RWFromConstMem((const void*)mem,size); + OUTPUT: + RETVAL + +SDL_RWops* +AllocRW () + CODE: + RETVAL = SDL_AllocRW(); + OUTPUT: + RETVAL + +void +FreeRW ( rw ) + SDL_RWops* rw + CODE: + SDL_FreeRW(rw); + +int +RWseek ( rw, off, whence ) + SDL_RWops* rw + int off + int whence + CODE: + RETVAL = SDL_RWseek(rw,off,whence); + OUTPUT: + RETVAL + +int +RWtell ( rw ) + SDL_RWops* rw + CODE: + RETVAL = SDL_RWtell(rw); + OUTPUT: + RETVAL + +int +RWread ( rw, mem, size, n ) + SDL_RWops* rw + char* mem + int size + int n + CODE: + RETVAL = SDL_RWread(rw,mem,size,n); + OUTPUT: + RETVAL + +int +RWwrite ( rw, mem, size, n ) + SDL_RWops* rw + char* mem + int size + int n + CODE: + RETVAL = SDL_RWwrite(rw,mem,size,n); + OUTPUT: + RETVAL + +int +RWclose ( rw ) + SDL_RWops* rw + CODE: + RETVAL = SDL_RWclose(rw); + OUTPUT: + RETVAL + int CDNumDrives () CODE: @@ -527,19 +643,6 @@ FreeEvent ( e ) CODE: safefree(e); - -int -PeepEvents( e, numevents, action, mask) - SDL_Event *e - int numevents - SDL_eventaction action - Uint32 mask - CODE: - RETVAL = SDL_PeepEvents( e, numevents, action, mask); - OUTPUT: - RETVAL - - int PollEvent ( e ) SDL_Event *e @@ -755,22 +858,22 @@ GetKeyName ( sym ) OUTPUT: RETVAL +#ifdef HAVE_SDL_IMAGE + SDL_Surface * -CreateRGBSurface (flags, width, height, depth, Rmask, Gmask, Bmask, Amask ) - Uint32 flags - int width - int height - int depth - Uint32 Rmask - Uint32 Gmask - Uint32 Bmask - Uint32 Amask +IMG_Load ( filename ) + char *filename CODE: - RETVAL = SDL_CreateRGBSurface ( flags, width, height, - depth, Rmask, Gmask, Bmask, Amask ); - OUTPUT: + char* CLASS = "SDL::Surface"; + RETVAL = IMG_Load(filename); + OUTPUT: RETVAL +#endif + +=for comment + +Comment out for now as it does not compile SDL_Surface * CreateRGBSurfaceFrom (pixels, width, height, depth, pitch, Rmask, Gmask, Bmask, Amask ) @@ -793,18 +896,6 @@ CreateRGBSurfaceFrom (pixels, width, height, depth, pitch, Rmask, Gmask, Bmask, OUTPUT: RETVAL -#ifdef HAVE_SDL_IMAGE - -SDL_Surface * -IMGLoad ( fname ) - char *fname - CODE: - RETVAL = IMG_Load(fname); - OUTPUT: - RETVAL - -#endif - SDL_Surface* SurfaceCopy ( surface ) SDL_Surface *surface @@ -976,6 +1067,12 @@ SurfacePixels ( surface ) OUTPUT: RETVAL +=cut + +=for comment + +Comment out for now as it does not compile + SDL_Color* SurfacePixel ( surface, x, y, ... ) SDL_Surface *surface @@ -1069,6 +1166,7 @@ GetVideoSurface () OUTPUT: RETVAL +=cut HV * VideoInfo () @@ -1102,63 +1200,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 @@ -1179,87 +1220,74 @@ ListModes ( format, flags ) OUTPUT: RETVAL - -SDL_Color * -NewColor ( r, g, b ) - Uint8 r - Uint8 g - Uint8 b +SDL_Palette * +NewPalette ( number ) + int number CODE: - RETVAL = (SDL_Color *) safemalloc(sizeof(SDL_Color)); - RETVAL->r = r; - RETVAL->g = g; - RETVAL->b = b; + RETVAL = (SDL_Palette *)safemalloc(sizeof(SDL_Palette)); + RETVAL->colors = (SDL_Color *)safemalloc(number * + sizeof(SDL_Color)); + RETVAL->ncolors = number; OUTPUT: RETVAL -Uint8 -ColorR ( color, ... ) - SDL_Color *color +int +PaletteNColors ( palette, ... ) + SDL_Palette *palette CODE: - if (items > 1 ) color->r = SvIV(ST(1)); - RETVAL = color->r; + if ( items > 1 ) palette->ncolors = SvIV(ST(1)); + RETVAL = palette->ncolors; OUTPUT: RETVAL -Uint8 -ColorG ( color, ... ) - SDL_Color *color +SDL_Surface * +SetVideoMode ( width, height, bpp, flags ) + + int width + int height + int bpp + Uint32 flags + CODE: - if (items > 1 ) color->g = SvIV(ST(1)); - RETVAL = color->g; + char *CLASS = "SDL::Surface"; + RETVAL = SDL_SetVideoMode(width,height,bpp,flags); OUTPUT: RETVAL -Uint8 -ColorB ( color, ... ) - SDL_Color *color +int +Flip ( surface ) + SDL_Surface *surface CODE: - if (items > 1 ) color->b = SvIV(ST(1)); - RETVAL = color->b; + RETVAL = SDL_Flip(surface); OUTPUT: RETVAL -void -ColorRGB ( color, ... ) - SDL_Color *color - PPCODE: - if (items > 1 ) { - color->r = SvIV(ST(1)); - color->g = SvIV(ST(2)); - color->b = SvIV(ST(3)); - } - mXPUSHi( color->r ); - mXPUSHi( color->g ); - mXPUSHi( color->b ); - XSRETURN(3); - -void -FreeColor ( color ) - SDL_Color *color - CODE: - return; safefree(color); - -SDL_Palette * -NewPalette ( number ) - int number +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_Palette *)safemalloc(sizeof(SDL_Palette)); - RETVAL->colors = (SDL_Color *)safemalloc(number * - sizeof(SDL_Color)); - RETVAL->ncolors = number; + RETVAL = SDL_BlitSurface(src,src_rect,dest,dest_rect); OUTPUT: RETVAL -int -PaletteNColors ( palette, ... ) - SDL_Palette *palette +Uint32 +MapRGB ( pixel_format, r, g, b ) + SDL_PixelFormat *pixel_format + Uint8 r + Uint8 g + Uint8 b CODE: - if ( items > 1 ) palette->ncolors = SvIV(ST(1)); - RETVAL = palette->ncolors; + RETVAL = SDL_MapRGB(pixel_format,r,g,b); OUTPUT: RETVAL +=for comment + +Comment out for now as it does not compile + SDL_Color * PaletteColors ( palette, index, ... ) SDL_Palette *palette @@ -1274,6 +1302,8 @@ PaletteColors ( palette, index, ... ) OUTPUT: RETVAL + + int VideoModeOK ( width, height, bpp, flags ) int width @@ -1313,7 +1343,8 @@ UpdateRects ( surface, ... ) SDL_Rect *rects, *temp; int num_rects,i; if ( items < 2 ) return; - num_rects = items - 1; + num_rects = items - 1; + SDL_UpdateRects(surface,num_rects,rects); rects = (SDL_Rect *)safemalloc(sizeof(SDL_Rect)*items); for(i=0;iformat,r,g,b); - OUTPUT: - RETVAL - -Uint32 MapRGBA ( surface, r, g, b, a ) SDL_Surface *surface Uint8 r @@ -1505,22 +1525,16 @@ ConvertRGBA ( surface ) OUTPUT: RETVAL -int -BlitSurface ( src, src_rect, dest, dest_rect ) - SDL_Surface *src - SDL_Rect *src_rect - SDL_Surface *dest - SDL_Rect *dest_rect - CODE: - RETVAL = SDL_BlitSurface(src,src_rect,dest,dest_rect); - OUTPUT: - RETVAL +=cut 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); @@ -2146,7 +2160,16 @@ 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 () CODE: @@ -2342,7 +2365,7 @@ JoyAxisEventAxis ( e ) OUTPUT: RETVAL -Uint8 +Sint16 JoyAxisEventValue ( e ) SDL_Event *e CODE: @@ -2350,7 +2373,7 @@ JoyAxisEventValue ( e ) OUTPUT: RETVAL -Sint16 +Uint8 JoyButtonEventWhich ( e ) SDL_Event *e CODE: @@ -2437,14 +2460,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 @@ -2505,7 +2526,7 @@ NetResolveIP ( address ) int NetResolveHost ( address, host, port ) IPaddress *address - char *host + const char *host Uint16 port CODE: RETVAL = SDLNet_ResolveHost(address,host,port); @@ -2875,9 +2896,19 @@ TTFSizeText ( font, text ) CODE: int w,h; RETVAL = newAV(); - TTF_SizeText(font,text,&w,&h); - av_push(RETVAL,newSViv(w)); - av_push(RETVAL,newSViv(h)); + if(TTF_SizeText(font,text,&w,&h)) + { + printf("TTF error at TTFSizeText: %s \n", TTF_GetError()); + Perl_croak (aTHX_ "TTF error \n"); + } + else + { + av_push(RETVAL,newSViv(w)); + av_push(RETVAL,newSViv(h)); + sv_2mortal((SV*)RETVAL); + } + + OUTPUT: RETVAL @@ -2888,9 +2919,19 @@ TTFSizeUTF8 ( font, text ) CODE: int w,h; RETVAL = newAV(); - TTF_SizeUTF8(font,text,&w,&h); - av_push(RETVAL,newSViv(w)); - av_push(RETVAL,newSViv(h)); + if(TTF_SizeUTF8(font,text,&w,&h)) + { + av_push(RETVAL,newSViv(w)); + av_push(RETVAL,newSViv(h)); + sv_2mortal((SV*)RETVAL); + + } + else + { + printf("TTF error at TTFSizeUTF8 with : %s \n", TTF_GetError()); + Perl_croak (aTHX_ "TTF error \n"); + } + OUTPUT: RETVAL @@ -2901,12 +2942,24 @@ TTFSizeUNICODE ( font, text ) CODE: int w,h; RETVAL = newAV(); - TTF_SizeUNICODE(font,text,&w,&h); - av_push(RETVAL,newSViv(w)); - av_push(RETVAL,newSViv(h)); + if(TTF_SizeUNICODE(font,text,&w,&h)) + { + av_push(RETVAL,newSViv(w)); + av_push(RETVAL,newSViv(h)); + sv_2mortal((SV*)RETVAL); + + } + else + { + printf("TTF error at TTFSizeUNICODE : %s \n", TTF_GetError()); + Perl_croak (aTHX_ "TTF error \n"); + } + OUTPUT: RETVAL +=for comment + SDL_Surface* TTFRenderTextSolid ( font, text, fg ) TTF_Font *font @@ -3036,6 +3089,7 @@ TTFCloseFont ( font ) TTF_Font *font CODE: TTF_CloseFont(font); + font=NULL; //to be safe http://sdl.beuc.net/sdl.wiki/SDL_ttf_copy_Functions_Management_TTF_CloseFont SDL_Surface* TTFPutString ( font, mode, surface, x, y, fg, bg, text ) @@ -3129,6 +3183,8 @@ TTFPutString ( font, mode, surface, x, y, fg, bg, text ) OUTPUT: RETVAL +=cut + #endif SDL_Overlay* @@ -3302,13 +3358,13 @@ NewSMPEGInfo() void FreeSMPEGInfo ( info ) - SMPEG_Info *info; + SMPEG_Info *info CODE: safefree(info); int SMPEGInfoHasAudio ( info ) - SMPEG_Info* info; + SMPEG_Info* info CODE: RETVAL = info->has_audio; OUTPUT: @@ -3316,7 +3372,7 @@ SMPEGInfoHasAudio ( info ) int SMPEGInfoHasVideo ( info ) - SMPEG_Info* info; + SMPEG_Info* info CODE: RETVAL = info->has_video; OUTPUT: @@ -3324,7 +3380,7 @@ SMPEGInfoHasVideo ( info ) int SMPEGInfoWidth ( info ) - SMPEG_Info* info; + SMPEG_Info* info CODE: RETVAL = info->width; OUTPUT: @@ -3332,7 +3388,7 @@ SMPEGInfoWidth ( info ) int SMPEGInfoHeight ( info ) - SMPEG_Info* info; + SMPEG_Info* info CODE: RETVAL = info->height; OUTPUT: @@ -3340,7 +3396,7 @@ SMPEGInfoHeight ( info ) int SMPEGInfoCurrentFrame ( info ) - SMPEG_Info* info; + SMPEG_Info* info CODE: RETVAL = info->current_frame; OUTPUT: @@ -3348,7 +3404,7 @@ SMPEGInfoCurrentFrame ( info ) double SMPEGInfoCurrentFPS ( info ) - SMPEG_Info* info; + SMPEG_Info* info CODE: RETVAL = info->current_fps; OUTPUT: @@ -3356,7 +3412,7 @@ SMPEGInfoCurrentFPS ( info ) int SMPEGInfoCurrentAudioFrame ( info ) - SMPEG_Info* info; + SMPEG_Info* info CODE: RETVAL = info->audio_current_frame; OUTPUT: @@ -3364,7 +3420,7 @@ SMPEGInfoCurrentAudioFrame ( info ) int SMPEGInfoCurrentOffset ( info ) - SMPEG_Info* info; + SMPEG_Info* info CODE: RETVAL = info->current_offset; OUTPUT: @@ -3372,7 +3428,7 @@ SMPEGInfoCurrentOffset ( info ) int SMPEGInfoTotalSize ( info ) - SMPEG_Info* info; + SMPEG_Info* info CODE: RETVAL = info->total_size; OUTPUT: @@ -3380,7 +3436,7 @@ SMPEGInfoTotalSize ( info ) double SMPEGInfoCurrentTime ( info ) - SMPEG_Info* info; + SMPEG_Info* info CODE: RETVAL = info->current_time; OUTPUT: @@ -3388,7 +3444,7 @@ SMPEGInfoCurrentTime ( info ) double SMPEGInfoTotalTime ( info ) - SMPEG_Info* info; + SMPEG_Info* info CODE: RETVAL = info->total_time; OUTPUT: @@ -3396,7 +3452,7 @@ SMPEGInfoTotalTime ( info ) char * SMPEGError ( mpeg ) - SMPEG* mpeg ; + SMPEG* mpeg CODE: RETVAL = SMPEG_error(mpeg); OUTPUT: @@ -3404,8 +3460,8 @@ SMPEGError ( mpeg ) SMPEG* NewSMPEG ( filename, info, use_audio ) - char* filename; - SMPEG_Info* info; + char* filename + SMPEG_Info* info int use_audio CODE: #ifdef HAVE_SDL_MIXER @@ -3418,14 +3474,14 @@ NewSMPEG ( filename, info, use_audio ) void FreeSMPEG ( mpeg ) - SMPEG* mpeg; + SMPEG* mpeg CODE: SMPEG_delete(mpeg); void SMPEGEnableAudio ( mpeg , flag ) - SMPEG* mpeg ; - int flag; + SMPEG* mpeg + int flag CODE: SMPEG_enableaudio(mpeg,flag); #ifdef HAVE_SDL_MIXER @@ -3434,44 +3490,44 @@ SMPEGEnableAudio ( mpeg , flag ) void SMPEGEnableVideo ( mpeg , flag ) - SMPEG* mpeg ; - int flag; + SMPEG* mpeg + int flag CODE: SMPEG_enablevideo(mpeg,flag); void SMPEGSetVolume ( mpeg , volume ) - SMPEG* mpeg ; - int volume; + SMPEG* mpeg + int volume CODE: SMPEG_setvolume(mpeg,volume); void SMPEGSetDisplay ( mpeg, dest, surfLock ) - SMPEG* mpeg; - SDL_Surface* dest; - SDL_mutex* surfLock; + SMPEG* mpeg + SDL_Surface* dest + SDL_mutex* surfLock CODE: SMPEG_setdisplay(mpeg,dest,surfLock,NULL); void SMPEGScaleXY ( mpeg, w, h) - SMPEG* mpeg; - int w; - int h; + SMPEG* mpeg + int w + int h CODE: SMPEG_scaleXY(mpeg,w,h); void SMPEGScale ( mpeg, scale ) - SMPEG* mpeg; + SMPEG* mpeg int scale CODE: SMPEG_scale(mpeg,scale); void SMPEGPlay ( mpeg ) - SMPEG* mpeg; + SMPEG* mpeg CODE: SDL_AudioSpec audiofmt; Uint16 format; @@ -3492,7 +3548,7 @@ SMPEGPlay ( mpeg ) SMPEGstatus SMPEGStatus ( mpeg ) - SMPEG* mpeg; + SMPEG* mpeg CODE: RETVAL = SMPEG_status(mpeg); OUTPUT: @@ -3500,20 +3556,20 @@ SMPEGStatus ( mpeg ) void SMPEGPause ( mpeg ) - SMPEG* mpeg; + SMPEG* mpeg CODE: SMPEG_pause(mpeg); void SMPEGLoop ( mpeg, repeat ) - SMPEG* mpeg; + SMPEG* mpeg int repeat CODE: SMPEG_loop(mpeg,repeat); void SMPEGStop ( mpeg ) - SMPEG* mpeg; + SMPEG* mpeg CODE: SMPEG_stop(mpeg); #ifdef HAVE_SDL_MIXER @@ -3522,41 +3578,41 @@ SMPEGStop ( mpeg ) void SMPEGRewind ( mpeg ) - SMPEG* mpeg; + SMPEG* mpeg CODE: SMPEG_rewind(mpeg); void SMPEGSeek ( mpeg, bytes ) - SMPEG* mpeg; - int bytes; + SMPEG* mpeg + int bytes CODE: SMPEG_seek(mpeg,bytes); void SMPEGSkip ( mpeg, seconds ) - SMPEG* mpeg; - float seconds; + SMPEG* mpeg + float seconds CODE: SMPEG_skip(mpeg,seconds); void SMPEGSetDisplayRegion ( mpeg, rect ) - SMPEG* mpeg; - SDL_Rect* rect; + SMPEG* mpeg + SDL_Rect* rect CODE: SMPEG_setdisplayregion(mpeg,rect->x,rect->y,rect->w,rect->h); void SMPEGRenderFrame ( mpeg, frame ) - SMPEG* mpeg; - int frame; + SMPEG* mpeg + int frame CODE: SMPEG_renderFrame(mpeg,frame); SMPEG_Info * SMPEGGetInfo ( mpeg ) - SMPEG* mpeg; + SMPEG* mpeg CODE: RETVAL = (SMPEG_Info *) safemalloc (sizeof(SMPEG_Info)); SMPEG_getinfo(mpeg,RETVAL); @@ -3568,557 +3624,660 @@ SMPEGGetInfo ( mpeg ) #ifdef HAVE_SDL_GFX +=cut + SDL_Surface * GFXRotoZoom ( src, angle, zoom, smooth) - SDL_Surface * src; - double angle; - double zoom; - int smooth; - CODE: - RETVAL = rotozoomSurface( src, angle, zoom, smooth); - OUTPUT: - RETVAL + SDL_Surface * src + double angle + double zoom + int smooth + CODE: + RETVAL = rotozoomSurface( src, angle, zoom, smooth); + OUTPUT: + RETVAL SDL_Surface * GFXZoom ( src, zoomx, zoomy, smooth) - SDL_Surface *src; - double zoomx; - double zoomy; - int smooth; - CODE: - RETVAL = zoomSurface( src, zoomx, zoomy, smooth); - OUTPUT: - RETVAL + SDL_Surface *src + double zoomx + double zoomy + int smooth + CODE: + RETVAL = zoomSurface( src, zoomx, zoomy, smooth); + OUTPUT: + RETVAL +=cut int GFXPixelColor ( dst, x, y, color ) - SDL_Surface* dst; - Sint16 x; - Sint16 y; - Uint32 color; -CODE: - RETVAL = pixelColor( dst, x, y, color); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x + Sint16 y + Uint32 color + CODE: + RETVAL = pixelColor( dst, x, y, color); + OUTPUT: + RETVAL int GFXPixelRGBA ( dst, x, y, r, g, b, a ) - SDL_Surface* dst; - Sint16 x; - Sint16 y; - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 a; -CODE: - RETVAL = pixelRGBA( dst, x, y, r, g, b, a ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x + Sint16 y + Uint8 r + Uint8 g + Uint8 b + Uint8 a + CODE: + RETVAL = pixelRGBA( dst, x, y, r, g, b, a ); + OUTPUT: + RETVAL int GFXHlineColor ( dst, x1, x2, y, color ) - SDL_Surface* dst; - Sint16 x1; - Sint16 x2; - Sint16 y; - Uint32 color; -CODE: - RETVAL = hlineColor( dst, x1, x2, y, color ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x1 + Sint16 x2 + Sint16 y + Uint32 color + CODE: + RETVAL = hlineColor( dst, x1, x2, y, color ); + OUTPUT: + RETVAL int GFXHlineRGBA ( dst, x1, x2, y, r, g, b, a ) - SDL_Surface* dst; - Sint16 x1; - Sint16 x2; - Sint16 y; - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 a; -CODE: - RETVAL = hlineRGBA( dst, x1, x2, y, r, g, b, a ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x1 + Sint16 x2 + Sint16 y + Uint8 r + Uint8 g + Uint8 b + Uint8 a + CODE: + RETVAL = hlineRGBA( dst, x1, x2, y, r, g, b, a ); + OUTPUT: + RETVAL int GFXVlineColor ( dst, x, y1, y2, color ) - SDL_Surface* dst; - Sint16 x; - Sint16 y1; - Sint16 y2; - Uint32 color; -CODE: - RETVAL = vlineColor( dst, x, y1, y2, color ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x + Sint16 y1 + Sint16 y2 + Uint32 color + CODE: + RETVAL = vlineColor( dst, x, y1, y2, color ); + OUTPUT: + RETVAL int GFXVlineRGBA ( dst, x, y1, y2, r, g, b, a ) - SDL_Surface* dst; - Sint16 x; - Sint16 y1; - Sint16 y2; - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 a; -CODE: - RETVAL = vlineRGBA( dst, x, y1, y2, r, g, b, a ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x + Sint16 y1 + Sint16 y2 + Uint8 r + Uint8 g + Uint8 b + Uint8 a + CODE: + RETVAL = vlineRGBA( dst, x, y1, y2, r, g, b, a ); + OUTPUT: + RETVAL int GFXRectangleColor ( dst, x1, y1, x2, y2, color ) - SDL_Surface* dst; - Sint16 x1; - Sint16 y1; - Sint16 x2; - Sint16 y2; - Uint32 color; -CODE: - RETVAL = rectangleColor( dst, x1, y1, x2, y2, color ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x1 + Sint16 y1 + Sint16 x2 + Sint16 y2 + Uint32 color + CODE: + RETVAL = rectangleColor( dst, x1, y1, x2, y2, color ); + OUTPUT: + RETVAL int GFXRectangleRGBA ( dst, x1, y1, x2, y2, r, g, b, a ) - SDL_Surface* dst; - Sint16 x1; - Sint16 y1; - Sint16 x2; - Sint16 y2; - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 a; -CODE: - RETVAL = rectangleRGBA( dst, x1, y1, x2, y2, r, g, b, a ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x1 + Sint16 y1 + Sint16 x2 + Sint16 y2 + Uint8 r + Uint8 g + Uint8 b + Uint8 a + CODE: + RETVAL = rectangleRGBA( dst, x1, y1, x2, y2, r, g, b, a ); + OUTPUT: + RETVAL int GFXBoxColor ( dst, x1, y1, x2, y2, color ) - SDL_Surface* dst; - Sint16 x1; - Sint16 y1; - Sint16 x2; - Sint16 y2; - Uint32 color; -CODE: - RETVAL = boxColor( dst, x1, y1, x2, y2, color ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x1 + Sint16 y1 + Sint16 x2 + Sint16 y2 + Uint32 color + CODE: + RETVAL = boxColor( dst, x1, y1, x2, y2, color ); + OUTPUT: + RETVAL int GFXBoxRGBA ( dst, x1, y1, x2, y2, r, g, b, a ) - SDL_Surface* dst; - Sint16 x1; - Sint16 y1; - Sint16 x2; - Sint16 y2; - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 a; -CODE: - RETVAL = boxRGBA( dst, x1, y1, x2, y2, r, g, b, a ); -OUTPUT: - RETVAL + SDL_Surface* dst; + Sint16 x1 + Sint16 y1 + Sint16 x2 + Sint16 y2 + Uint8 r + Uint8 g + Uint8 b + Uint8 a + CODE: + RETVAL = boxRGBA( dst, x1, y1, x2, y2, r, g, b, a ); + OUTPUT: + RETVAL int GFXLineColor ( dst, x1, y1, x2, y2, color ) - SDL_Surface* dst; - Sint16 x1; - Sint16 y1; - Sint16 x2; - Sint16 y2; - Uint32 color; -CODE: - RETVAL = lineColor( dst, x1, y1, x2, y2, color ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x1 + Sint16 y1 + Sint16 x2 + Sint16 y2 + Uint32 color + CODE: + RETVAL = lineColor( dst, x1, y1, x2, y2, color ); + OUTPUT: + RETVAL int GFXLineRGBA ( dst, x1, y1, x2, y2, r, g, b, a ) - SDL_Surface* dst; - Sint16 x1; - Sint16 y1; - Sint16 x2; - Sint16 y2; - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 a; -CODE: - RETVAL = lineRGBA( dst, x1, y1, x2, y2, r, g, b, a ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x1 + Sint16 y1 + Sint16 x2 + Sint16 y2 + Uint8 r + Uint8 g + Uint8 b + Uint8 a + CODE: + RETVAL = lineRGBA( dst, x1, y1, x2, y2, r, g, b, a ); + OUTPUT: + RETVAL int GFXAalineColor ( dst, x1, y1, x2, y2, color ) - SDL_Surface* dst; - Sint16 x1; - Sint16 y1; - Sint16 x2; - Sint16 y2; - Uint32 color; -CODE: - RETVAL = aalineColor( dst, x1, y1, x2, y2, color ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x1 + Sint16 y1 + Sint16 x2 + Sint16 y2 + Uint32 color + CODE: + RETVAL = aalineColor( dst, x1, y1, x2, y2, color ); + OUTPUT: + RETVAL int GFXAalineRGBA ( dst, x1, y1, x2, y2, r, g, b, a ) - SDL_Surface* dst; - Sint16 x1; - Sint16 y1; - Sint16 x2; - Sint16 y2; - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 a; -CODE: - RETVAL = aalineRGBA( dst, x1, y1, x2, y2, r, g, b, a ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x1 + Sint16 y1 + Sint16 x2 + Sint16 y2 + Uint8 r + Uint8 g + Uint8 b + Uint8 a + CODE: + RETVAL = aalineRGBA( dst, x1, y1, x2, y2, r, g, b, a ); + OUTPUT: + RETVAL int GFXCircleColor ( dst, x, y, r, color ) - SDL_Surface* dst; - Sint16 x; - Sint16 y; - Sint16 r; - Uint32 color; -CODE: - RETVAL = circleColor( dst, x, y, r, color ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x + Sint16 y + Sint16 r + Uint32 color + CODE: + RETVAL = circleColor( dst, x, y, r, color ); + OUTPUT: + RETVAL int GFXCircleRGBA ( dst, x, y, rad, r, g, b, a ) - SDL_Surface* dst; - Sint16 x; - Sint16 y; - Sint16 rad; - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 a; -CODE: - RETVAL = circleRGBA( dst, x, y, rad, r, g, b, a ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x + Sint16 y + Sint16 rad + Uint8 r + Uint8 g + Uint8 b + Uint8 a + CODE: + RETVAL = circleRGBA( dst, x, y, rad, r, g, b, a ); + OUTPUT: + RETVAL int GFXAacircleColor ( dst, x, y, r, color ) - SDL_Surface* dst; - Sint16 x; - Sint16 y; - Sint16 r; - Uint32 color; -CODE: - RETVAL = aacircleColor( dst, x, y, r, color ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x + Sint16 y + Sint16 r + Uint32 color + CODE: + RETVAL = aacircleColor( dst, x, y, r, color ); + OUTPUT: + RETVAL int GFXAacircleRGBA ( dst, x, y, rad, r, g, b, a ) - SDL_Surface* dst; - Sint16 x; - Sint16 y; - Sint16 rad; - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 a; -CODE: - RETVAL = aacircleRGBA( dst, x, y, rad, r, g, b, a ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x + Sint16 y + Sint16 rad + Uint8 r + Uint8 g + Uint8 b + Uint8 a + CODE: + RETVAL = aacircleRGBA( dst, x, y, rad, r, g, b, a ); + OUTPUT: + RETVAL int GFXFilledCircleColor ( dst, x, y, r, color ) - SDL_Surface* dst; - Sint16 x; - Sint16 y; - Sint16 r; - Uint32 color; -CODE: - RETVAL = filledCircleColor( dst, x, y, r, color ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x + Sint16 y + Sint16 r + Uint32 color + CODE: + RETVAL = filledCircleColor( dst, x, y, r, color ); + OUTPUT: + RETVAL int GFXFilledCircleRGBA ( dst, x, y, rad, r, g, b, a ) - SDL_Surface* dst; - Sint16 x; - Sint16 y; - Sint16 rad; - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 a; -CODE: - RETVAL = filledCircleRGBA( dst, x, y, rad, r, g, b, a ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x + Sint16 y + Sint16 rad + Uint8 r + Uint8 g + Uint8 b + Uint8 a + CODE: + RETVAL = filledCircleRGBA( dst, x, y, rad, r, g, b, a ); + OUTPUT: + RETVAL int GFXEllipseColor ( dst, x, y, rx, ry, color ) - SDL_Surface* dst; - Sint16 x; - Sint16 y; - Sint16 rx; - Sint16 ry; - Uint32 color; -CODE: - RETVAL = ellipseColor( dst, x, y, rx, ry, color ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x + Sint16 y + Sint16 rx + Sint16 ry + Uint32 color + CODE: + RETVAL = ellipseColor( dst, x, y, rx, ry, color ); + OUTPUT: + RETVAL int GFXEllipseRGBA ( dst, x, y, rx, ry, r, g, b, a ) - SDL_Surface* dst; - Sint16 x; - Sint16 y; - Sint16 rx; - Sint16 ry; - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 a; -CODE: - RETVAL = ellipseRGBA( dst, x, y, rx, ry, r, g, b, a ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x + Sint16 y + Sint16 rx + Sint16 ry + Uint8 r + Uint8 g + Uint8 b + Uint8 a + CODE: + RETVAL = ellipseRGBA( dst, x, y, rx, ry, r, g, b, a ); + OUTPUT: + RETVAL int GFXAaellipseColor ( dst, xc, yc, rx, ry, color ) - SDL_Surface* dst; - Sint16 xc; - Sint16 yc; - Sint16 rx; - Sint16 ry; - Uint32 color; -CODE: - RETVAL = aaellipseColor( dst, xc, yc, rx, ry, color ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 xc + Sint16 yc + Sint16 rx + Sint16 ry + Uint32 color + CODE: + RETVAL = aaellipseColor( dst, xc, yc, rx, ry, color ); + OUTPUT: + RETVAL int GFXAaellipseRGBA ( dst, x, y, rx, ry, r, g, b, a ) - SDL_Surface* dst; - Sint16 x; - Sint16 y; - Sint16 rx; - Sint16 ry; - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 a; -CODE: - RETVAL = aaellipseRGBA( dst, x, y, rx, ry, r, g, b, a ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x + Sint16 y + Sint16 rx + Sint16 ry + Uint8 r + Uint8 g + Uint8 b + Uint8 a + CODE: + RETVAL = aaellipseRGBA( dst, x, y, rx, ry, r, g, b, a ); + OUTPUT: + RETVAL int GFXFilledEllipseColor ( dst, x, y, rx, ry, color ) - SDL_Surface* dst; - Sint16 x; - Sint16 y; - Sint16 rx; - Sint16 ry; - Uint32 color; -CODE: - RETVAL = filledEllipseColor( dst, x, y, rx, ry, color ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x + Sint16 y + Sint16 rx + Sint16 ry + Uint32 color + CODE: + RETVAL = filledEllipseColor( dst, x, y, rx, ry, color ); + OUTPUT: + RETVAL int GFXFilledEllipseRGBA ( dst, x, y, rx, ry, r, g, b, a ) - SDL_Surface* dst; - Sint16 x; - Sint16 y; - Sint16 rx; - Sint16 ry; - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 a; -CODE: - RETVAL = filledEllipseRGBA( dst, x, y, rx, ry, r, g, b, a ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x + Sint16 y + Sint16 rx + Sint16 ry + Uint8 r + Uint8 g + Uint8 b + Uint8 a + CODE: + RETVAL = filledEllipseRGBA( dst, x, y, rx, ry, r, g, b, a ); + OUTPUT: + RETVAL int GFXFilledPieColor ( dst, x, y, rad, start, end, color ) - SDL_Surface* dst; - Sint16 x; - Sint16 y; - Sint16 rad; - Sint16 start; - Sint16 end; - Uint32 color; -CODE: - RETVAL = filledPieColor( dst, x, y, rad, start, end, color ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x + Sint16 y + Sint16 rad + Sint16 start + Sint16 end + Uint32 color + CODE: + RETVAL = filledPieColor( dst, x, y, rad, start, end, color ); + OUTPUT: + RETVAL int GFXFilledPieRGBA ( dst, x, y, rad, start, end, r, g, b, a ) - SDL_Surface* dst; - Sint16 x; - Sint16 y; - Sint16 rad; - Sint16 start; - Sint16 end; - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 a; -CODE: - RETVAL = filledPieRGBA( dst, x, y, rad, start, end, r, g, b, a ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x + Sint16 y + Sint16 rad + Sint16 start + Sint16 end + Uint8 r + Uint8 g + Uint8 b + Uint8 a + CODE: + RETVAL = filledPieRGBA( dst, x, y, rad, start, end, r, g, b, a ); + OUTPUT: + RETVAL int GFXPolygonColor ( dst, vx, vy, n, color ) - SDL_Surface* dst; - Sint16* vx; - Sint16* vy; - int n; - Uint32 color; -CODE: - RETVAL = polygonColor( dst, vx, vy, n, color ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16* vx + Sint16* vy + int n + Uint32 color; + CODE: + RETVAL = polygonColor( dst, vx, vy, n, color ); + OUTPUT: + RETVAL int GFXPolygonRGBA ( dst, vx, vy, n, r, g, b, a ) - SDL_Surface* dst; - Sint16* vx; - Sint16* vy; - int n; - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 a; -CODE: - RETVAL = polygonRGBA( dst, vx, vy, n, r, g, b, a ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16* vx + Sint16* vy + int n + Uint8 r + Uint8 g + Uint8 b + Uint8 a + CODE: + RETVAL = polygonRGBA( dst, vx, vy, n, r, g, b, a ); + OUTPUT: + RETVAL int GFXAapolygonColor ( dst, vx, vy, n, color ) - SDL_Surface* dst; - Sint16* vx; - Sint16* vy; - int n; - Uint32 color; -CODE: - RETVAL = aapolygonColor( dst, vx, vy, n, color ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16* vx + Sint16* vy + int n + Uint32 color + CODE: + RETVAL = aapolygonColor( dst, vx, vy, n, color ); + OUTPUT: + RETVAL int GFXAapolygonRGBA ( dst, vx, vy, n, r, g, b, a ) - SDL_Surface* dst; - Sint16* vx; - Sint16* vy; - int n; - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 a; -CODE: - RETVAL = aapolygonRGBA( dst, vx, vy, n, r, g, b, a ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16* vx + Sint16* vy + int n + Uint8 r + Uint8 g + Uint8 b + Uint8 a + CODE: + RETVAL = aapolygonRGBA( dst, vx, vy, n, r, g, b, a ); + OUTPUT: + RETVAL int GFXFilledPolygonColor ( dst, vx, vy, n, color ) - SDL_Surface* dst; - Sint16* vx; - Sint16* vy; - int n; - int color; -CODE: - RETVAL = filledPolygonColor( dst, vx, vy, n, color ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16* vx + Sint16* vy + int n + int color + CODE: + RETVAL = filledPolygonColor( dst, vx, vy, n, color ); + OUTPUT: + RETVAL int GFXFilledPolygonRGBA ( dst, vx, vy, n, r, g, b, a ) - SDL_Surface* dst; - Sint16* vx; - Sint16* vy; - int n; - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 a; -CODE: - RETVAL = filledPolygonRGBA( dst, vx, vy, n, r, g, b, a ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16* vx + Sint16* vy + int n + Uint8 r + Uint8 g + Uint8 b + Uint8 a + CODE: + RETVAL = filledPolygonRGBA( dst, vx, vy, n, r, g, b, a ); + OUTPUT: + RETVAL int GFXCharacterColor ( dst, x, y, c, color ) - SDL_Surface* dst; - Sint16 x; - Sint16 y; - char c; - Uint32 color; -CODE: - RETVAL = characterColor( dst, x, y, c, color ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x + Sint16 y + char c + Uint32 color + CODE: + RETVAL = characterColor( dst, x, y, c, color ); + OUTPUT: + RETVAL int GFXCharacterRGBA ( dst, x, y, c, r, g, b, a ) - SDL_Surface* dst; - Sint16 x; - Sint16 y; - char c; - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 a; -CODE: - RETVAL = characterRGBA( dst, x, y, c, r, g, b, a ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x + Sint16 y + char c + Uint8 r + Uint8 g + Uint8 b + Uint8 a + CODE: + RETVAL = characterRGBA( dst, x, y, c, r, g, b, a ); + OUTPUT: + RETVAL int GFXStringColor ( dst, x, y, c, color ) - SDL_Surface* dst; - Sint16 x; - Sint16 y; - char* c; - Uint32 color; -CODE: - RETVAL = stringColor( dst, x, y, c, color ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x + Sint16 y + char* c + Uint32 color + CODE: + RETVAL = stringColor( dst, x, y, c, color ); + OUTPUT: + RETVAL int GFXStringRGBA ( dst, x, y, c, r, g, b, a ) - SDL_Surface* dst; - Sint16 x; - Sint16 y; - char* c; - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 a; -CODE: - RETVAL = stringRGBA( dst, x, y, c, r, g, b, a ); -OUTPUT: - RETVAL + SDL_Surface* dst + Sint16 x + Sint16 y + char* c + Uint8 r + Uint8 g + Uint8 b + Uint8 a + CODE: + RETVAL = stringRGBA( dst, x, y, c, r, g, b, a ); + OUTPUT: + RETVAL + +#endif + + +#ifdef HAVE_SDL_SVG + +SDL_svg_context * +SVG_Load ( filename ) + char* filename + CODE: + RETVAL = SVG_Load(filename); + OUTPUT: + RETVAL + +SDL_svg_context * +SVG_LoadBuffer ( data, len ) + char* data + int len + CODE: + RETVAL = SVG_LoadBuffer(data,len); + OUTPUT: + RETVAL + +int +SVG_SetOffset ( source, xoff, yoff ) + SDL_svg_context* source + double xoff + double yoff + CODE: + RETVAL = SVG_SetOffset(source,xoff,yoff); + OUTPUT: + RETVAL + +int +SVG_SetScale ( source, xscale, yscale ) + SDL_svg_context* source + double xscale + double yscale + CODE: + RETVAL = SVG_SetScale(source,xscale,yscale); + OUTPUT: + RETVAL + +int +SVG_RenderToSurface ( source, x, y, dest ) + SDL_svg_context* source + int x + int y + SDL_Surface* dest; + CODE: + RETVAL = SVG_RenderToSurface(source,x,y,dest); + OUTPUT: + RETVAL + +void +SVG_Free ( source ) + SDL_svg_context* source + CODE: + SVG_Free(source); + +void +SVG_Set_Flags ( source, flags ) + SDL_svg_context* source + Uint32 flags + CODE: + SVG_Set_Flags(source,flags); + +float +SVG_Width ( source ) + SDL_svg_context* source + CODE: + RETVAL = SVG_Width(source); + OUTPUT: + RETVAL + +float +SVG_HEIGHT ( source ) + SDL_svg_context* source + CODE: + RETVAL = SVG_Height(source); + OUTPUT: + RETVAL + +void +SVG_SetClipping ( source, minx, miny, maxx, maxy ) + SDL_svg_context* source + int minx + int miny + int maxx + int maxy + CODE: + SVG_SetClipping(source,minx,miny,maxx,maxy); + +int +SVG_Version ( ) + CODE: + RETVAL = SVG_Version(); + OUTPUT: + RETVAL + #endif @@ -4152,14 +4311,14 @@ AV* SoundDecoderInfoExtensions ( decoderinfo ) Sound_DecoderInfo* decoderinfo CODE: - char **ext; + const char **ext; for ( ext = decoderinfo->extensions; *ext != NULL; ext++ ){ - av_push(RETVAL,sv_2mortal(newSVpv(*ext,0))); + av_push(RETVAL,newSVpv(*ext,0)); } OUTPUT: RETVAL -char* +const char* SoundDecoderInfoDescription ( decoderinfo ) Sound_DecoderInfo* decoderinfo CODE: @@ -4167,7 +4326,7 @@ SoundDecoderInfoDescription ( decoderinfo ) OUTPUT: RETVAL -char* +const char* SoundDecoderInfoAuthor ( decoderinfo ) Sound_DecoderInfo* decoderinfo CODE: @@ -4175,7 +4334,7 @@ SoundDecoderInfoAuthor ( decoderinfo ) OUTPUT: RETVAL -char* +const char* SoundDecoderInfoUrl ( decoderinfo ) Sound_DecoderInfo* decoderinfo CODE: @@ -4219,7 +4378,7 @@ Uint32 SoundSampleBufferSize ( sample ) Sound_Sample* sample CODE: - RETVAL = sample->buffer; + RETVAL = sample->buffer_size; OUTPUT: RETVAL @@ -4231,7 +4390,134 @@ SoundSampleFlags ( sample ) OUTPUT: RETVAL +int +Sound_Init ( ) + CODE: + RETVAL = Sound_Init(); + OUTPUT: + RETVAL + +int +Sound_Quit ( ) + CODE: + RETVAL = Sound_Quit(); + OUTPUT: + RETVAL + +AV* +Sound_AvailableDecoders ( ) + CODE: + RETVAL = newAV(); + const Sound_DecoderInfo** sdi; + sdi = Sound_AvailableDecoders(); + if (sdi != NULL) { + for (;*sdi != NULL; ++sdi) { + av_push(RETVAL,sv_2mortal(newSViv(PTR2IV(*sdi)))); + } + } + OUTPUT: + RETVAL + +const char* +Sound_GetError ( ) + CODE: + RETVAL = Sound_GetError(); + OUTPUT: + RETVAL + +void +Sound_ClearError ( ) + CODE: + Sound_ClearError(); +Sound_Sample* +Sound_NewSample ( rw, ext, desired, buffsize ) + SDL_RWops* rw + const char* ext + Sound_AudioInfo* desired + Uint32 buffsize + CODE: + RETVAL = Sound_NewSample(rw,ext,desired,buffsize); + OUTPUT: + RETVAL + +Sound_Sample* +Sound_NewSampleFromMem ( data, size, ext, desired, buffsize ) + const Uint8 *data + Uint32 size + const char* ext + Sound_AudioInfo* desired + Uint32 buffsize + CODE: + RETVAL = Sound_NewSampleFromMem(data,size,ext,desired,buffsize); + OUTPUT: + RETVAL + +Sound_Sample* +Sound_NewSampleFromFile ( fname, desired, buffsize ) + const char* fname + Sound_AudioInfo* desired + Uint32 buffsize + CODE: + RETVAL = Sound_NewSampleFromFile(fname,desired,buffsize); + OUTPUT: + RETVAL + +void +Sound_FreeSample ( sample ) + Sound_Sample* sample + CODE: + Sound_FreeSample(sample); + +Sint32 +Sound_GetDuration ( sample ) + Sound_Sample* sample + CODE: + RETVAL = Sound_GetDuration(sample); + OUTPUT: + RETVAL + +int +Sound_SetBufferSize ( sample, size ) + Sound_Sample* sample + Uint32 size + CODE: + RETVAL = Sound_SetBufferSize(sample,size); + OUTPUT: + RETVAL + +Uint32 +Sound_Decode ( sample ) + Sound_Sample* sample + CODE: + RETVAL = Sound_Decode(sample); + OUTPUT: + RETVAL + +Uint32 +Sound_DecodeAll ( sample ) + Sound_Sample* sample + CODE: + RETVAL = Sound_DecodeAll(sample); + OUTPUT: + RETVAL + +int +Sound_Rewind ( sample ) + Sound_Sample* sample + CODE: + RETVAL = Sound_Rewind(sample); + OUTPUT: + RETVAL + +int +Sound_Seek ( sample, ms ) + Sound_Sample* sample + Uint32 ms + CODE: + RETVAL = Sound_Seek(sample,ms); + OUTPUT: + RETVAL #endif