ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/Client.xs
(Generate patch)

Comparing deliantra/Deliantra-Client/Client.xs (file contents):
Revision 1.300 by root, Thu Dec 24 10:47:45 2009 UTC vs.
Revision 1.305 by root, Sun May 2 21:22:20 2010 UTC

1027 1027
1028 XPUSHs (sv_2mortal (sv_bless (newRV_noinc ((SV *)hv), gv_stashpv ("DC::UI::Event", 1)))); 1028 XPUSHs (sv_2mortal (sv_bless (newRV_noinc ((SV *)hv), gv_stashpv ("DC::UI::Event", 1))));
1029 } 1029 }
1030} 1030}
1031 1031
1032char *
1033SDL_AudioDriverName ()
1034 CODE:
1035{
1036 char buf [256];
1037 if (!SDL_AudioDriverName (buf, sizeof (buf)))
1038 XSRETURN_UNDEF;
1039
1040 RETVAL = buf;
1041}
1042 OUTPUT:
1043 RETVAL
1044
1032int 1045int
1033Mix_OpenAudio (int frequency = 44100, int format = MIX_DEFAULT_FORMAT, int channels = 2, int chunksize = 4096) 1046Mix_OpenAudio (int frequency = 44100, int format = MIX_DEFAULT_FORMAT, int channels = 2, int chunksize = 4096)
1034 POSTCALL: 1047 POSTCALL:
1035 Mix_HookMusicFinished (music_finished); 1048 Mix_HookMusicFinished (music_finished);
1036 Mix_ChannelFinished (channel_finished); 1049 Mix_ChannelFinished (channel_finished);
1098add_font (char *file) 1111add_font (char *file)
1099 CODE: 1112 CODE:
1100 RETVAL = FcConfigAppFontAddFile (0, (const FcChar8 *)file); 1113 RETVAL = FcConfigAppFontAddFile (0, (const FcChar8 *)file);
1101 OUTPUT: 1114 OUTPUT:
1102 RETVAL 1115 RETVAL
1116
1117void
1118IMG_Init (int flags = IMG_INIT_JPG | IMG_INIT_PNG)
1103 1119
1104void 1120void
1105load_image_inline (SV *image_) 1121load_image_inline (SV *image_)
1106 ALIAS: 1122 ALIAS:
1107 load_image_file = 1 1123 load_image_file = 1
2798 if (RETVAL < 0) 2814 if (RETVAL < 0)
2799 { 2815 {
2800 RETVAL = Mix_GroupOldest (-1); 2816 RETVAL = Mix_GroupOldest (-1);
2801 2817
2802 if (RETVAL < 0) 2818 if (RETVAL < 0)
2819 {
2820 // happens sometimes, maybe it just stopped playing(?)
2821 RETVAL = Mix_GroupAvailable (-1);
2822
2823 if (RETVAL < 0)
2803 XSRETURN_UNDEF; 2824 XSRETURN_UNDEF;
2804 2825 }
2826 else
2805 Mix_HaltChannel (RETVAL); 2827 Mix_HaltChannel (RETVAL);
2806 } 2828 }
2807 2829
2808 Mix_UnregisterAllEffects (RETVAL); 2830 Mix_UnregisterAllEffects (RETVAL);
2809 Mix_Volume (RETVAL, 128); 2831 Mix_Volume (RETVAL, 128);
2810} 2832}
2869 Mix_SetReverseStereo (self, flip); 2891 Mix_SetReverseStereo (self, flip);
2870 2892
2871MODULE = Deliantra::Client PACKAGE = DC::MixChunk 2893MODULE = Deliantra::Client PACKAGE = DC::MixChunk
2872 2894
2873PROTOTYPES: DISABLE 2895PROTOTYPES: DISABLE
2896
2897void
2898decoders ()
2899 PPCODE:
2900#if SDL_MIXER_MAJOR_VERSION > 1 || SDL_MIXER_MINOR_VERSION > 2 || SDL_MIXER_PATCHLEVEL >= 10
2901 int i, num = Mix_GetNumChunkDecoders ();
2902 EXTEND (SP, num);
2903 for (i = 0; i < num; ++i)
2904 PUSHs (sv_2mortal (newSVpv (Mix_GetChunkDecoder (i), 0)));
2905#else
2906 XPUSHs (sv_2mortal (newSVpv ("(sdl mixer too old)", 0)));
2907#endif
2874 2908
2875DC::MixChunk 2909DC::MixChunk
2876new (SV *class, DC::RW rwops) 2910new (SV *class, DC::RW rwops)
2877 CODE: 2911 CODE:
2878 RETVAL = Mix_LoadWAV_RW (rwops, 1); 2912 RETVAL = Mix_LoadWAV_RW (rwops, 1);
2911 OUTPUT: 2945 OUTPUT:
2912 RETVAL 2946 RETVAL
2913 2947
2914MODULE = Deliantra::Client PACKAGE = DC::MixMusic 2948MODULE = Deliantra::Client PACKAGE = DC::MixMusic
2915 2949
2950void
2951decoders ()
2952 PPCODE:
2953#if SDL_MIXER_MAJOR_VERSION > 1 || SDL_MIXER_MINOR_VERSION > 2 || SDL_MIXER_PATCHLEVEL >= 10
2954 int i, num = Mix_GetNumMusicDecoders ();
2955 EXTEND (SP, num);
2956 for (i = 0; i < num; ++i)
2957 PUSHs (sv_2mortal (newSVpv (Mix_GetMusicDecoder (i), 0)));
2958#else
2959 XPUSHs (sv_2mortal (newSVpv ("(sdl mixer too old)", 0)));
2960#endif
2961
2916int 2962int
2917volume (int volume = -1) 2963volume (int volume = -1)
2918 PROTOTYPE: ;$ 2964 PROTOTYPE: ;$
2919 CODE: 2965 CODE:
2920 if (items > 0) 2966 if (items > 0)
2930 2976
2931void 2977void
2932halt () 2978halt ()
2933 CODE: 2979 CODE:
2934 Mix_HaltMusic (); 2980 Mix_HaltMusic ();
2981
2982int
2983playing ()
2984 CODE:
2985 RETVAL = Mix_PlayingMusic ();
2986 OUTPUT:
2987 RETVAL
2935 2988
2936DC::MixMusic 2989DC::MixMusic
2937new (SV *class, DC::RW rwops) 2990new (SV *class, DC::RW rwops)
2938 CODE: 2991 CODE:
2939 RETVAL = Mix_LoadMUS_RW (rwops); 2992 RETVAL = Mix_LoadMUS_RW (rwops);
3134 3187
3135int glGetError () 3188int glGetError ()
3136 3189
3137void glFinish () 3190void glFinish ()
3138 3191
3192void glFlush ()
3193
3139void glClear (int mask) 3194void glClear (int mask)
3140 3195
3141void glClearColor (float r, float g, float b, float a = 1.0) 3196void glClearColor (float r, float g, float b, float a = 1.0)
3142 PROTOTYPE: @ 3197 PROTOTYPE: @
3143 3198

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines