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.298 by root, Tue Dec 22 00:46:05 2009 UTC vs.
Revision 1.301 by root, Thu Feb 4 20:01:08 2010 UTC

930 930
931 SDL_WM_SetCaption ("Deliantra MORPG Client " VERSION, "Deliantra"); 931 SDL_WM_SetCaption ("Deliantra MORPG Client " VERSION, "Deliantra");
932#define GL_FUNC(ptr,name) gl.name = (ptr)SDL_GL_GetProcAddress ("gl" # name); 932#define GL_FUNC(ptr,name) gl.name = (ptr)SDL_GL_GetProcAddress ("gl" # name);
933#include "glfunc.h" 933#include "glfunc.h"
934#undef GL_FUNC 934#undef GL_FUNC
935
936 if (!gl.ActiveTexture ) gl.ActiveTexture = gl.ActiveTextureARB;
937 if (!gl.MultiTexCoord2f) gl.MultiTexCoord2f = gl.MultiTexCoord2fARB;
935 } 938 }
936} 939}
937 OUTPUT: 940 OUTPUT:
938 RETVAL 941 RETVAL
939 942
1672void 1675void
1673draw_fow_texture (float intensity, int hidden_tex, int name1, uint8_t *data1, float s, float t, int w, int h, float blend = 0.f, int dx = 0, int dy = 0, int name2 = 0, uint8_t *data2 = data1) 1676draw_fow_texture (float intensity, int hidden_tex, int name1, uint8_t *data1, float s, float t, int w, int h, float blend = 0.f, int dx = 0, int dy = 0, int name2 = 0, uint8_t *data2 = data1)
1674 PROTOTYPE: @ 1677 PROTOTYPE: @
1675 CODE: 1678 CODE:
1676{ 1679{
1680 glEnable (GL_BLEND);
1681 glBlendFunc (intensity ? GL_SRC_ALPHA : GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
1677 glEnable (GL_TEXTURE_2D); 1682 glEnable (GL_TEXTURE_2D);
1678 glEnable (GL_BLEND);
1679 glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
1680 glBindTexture (GL_TEXTURE_2D, name1); 1683 glBindTexture (GL_TEXTURE_2D, name1);
1681 1684
1682 glColor3f (intensity, intensity, intensity); 1685 glColor3f (intensity, intensity, intensity);
1683 glPushMatrix (); 1686 glPushMatrix ();
1684 glScalef (1./3, 1./3, 1.); 1687 glScalef (1./3, 1./3, 1.);
1699 glBindTexture (GL_TEXTURE_2D, name2); 1702 glBindTexture (GL_TEXTURE_2D, name2);
1700 glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE); 1703 glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
1701 1704
1702 /* rgb == rgb(glcolor) */ 1705 /* rgb == rgb(glcolor) */
1703 glTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_REPLACE); 1706 glTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_REPLACE);
1704 glTexEnvi (GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_CONSTANT); 1707 glTexEnvi (GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_PRIMARY_COLOR);
1705 glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR); 1708 glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR);
1706 1709
1707 /* alpha = interpolate t0, t1 by env_alpha */ 1710 /* alpha = interpolate t0, t1 by env_alpha */
1708 glTexEnvfv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, env_color); 1711 glTexEnvfv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, env_color);
1709 1712
2867 2870
2868MODULE = Deliantra::Client PACKAGE = DC::MixChunk 2871MODULE = Deliantra::Client PACKAGE = DC::MixChunk
2869 2872
2870PROTOTYPES: DISABLE 2873PROTOTYPES: DISABLE
2871 2874
2875void
2876decoders ()
2877 PPCODE:
2878#if SDL_MIXER_MAJOR_VERSION > 1 || SDL_MIXER_MINOR_VERSION > 2 || SDL_MIXER_PATCHLEVEL >= 10
2879 int i, num = Mix_GetNumChunkDecoders ();
2880 EXTEND (SP, num);
2881 for (i = 0; i < num; ++i)
2882 PUSHs (sv_2mortal (newSVpv (Mix_GetChunkDecoder (i), 0)));
2883#else
2884 XPUSHs (sv_2mortal (newSVpv ("(sdl mixer too old)", 0)));
2885#endif
2886
2872DC::MixChunk 2887DC::MixChunk
2873new (SV *class, DC::RW rwops) 2888new (SV *class, DC::RW rwops)
2874 CODE: 2889 CODE:
2875 RETVAL = Mix_LoadWAV_RW (rwops, 1); 2890 RETVAL = Mix_LoadWAV_RW (rwops, 1);
2876 OUTPUT: 2891 OUTPUT:
2908 OUTPUT: 2923 OUTPUT:
2909 RETVAL 2924 RETVAL
2910 2925
2911MODULE = Deliantra::Client PACKAGE = DC::MixMusic 2926MODULE = Deliantra::Client PACKAGE = DC::MixMusic
2912 2927
2928void
2929decoders ()
2930 PPCODE:
2931#if SDL_MIXER_MAJOR_VERSION > 1 || SDL_MIXER_MINOR_VERSION > 2 || SDL_MIXER_PATCHLEVEL >= 10
2932 int i, num = Mix_GetNumMusicDecoders ();
2933 EXTEND (SP, num);
2934 for (i = 0; i < num; ++i)
2935 PUSHs (sv_2mortal (newSVpv (Mix_GetMusicDecoder (i), 0)));
2936#else
2937 XPUSHs (sv_2mortal (newSVpv ("(sdl mixer too old)", 0)));
2938#endif
2939
2913int 2940int
2914volume (int volume = -1) 2941volume (int volume = -1)
2915 PROTOTYPE: ;$ 2942 PROTOTYPE: ;$
2916 CODE: 2943 CODE:
2917 if (items > 0) 2944 if (items > 0)
2927 2954
2928void 2955void
2929halt () 2956halt ()
2930 CODE: 2957 CODE:
2931 Mix_HaltMusic (); 2958 Mix_HaltMusic ();
2959
2960int
2961playing ()
2962 CODE:
2963 RETVAL = Mix_PlayingMusic ();
2964 OUTPUT:
2965 RETVAL
2932 2966
2933DC::MixMusic 2967DC::MixMusic
2934new (SV *class, DC::RW rwops) 2968new (SV *class, DC::RW rwops)
2935 CODE: 2969 CODE:
2936 RETVAL = Mix_LoadMUS_RW (rwops); 2970 RETVAL = Mix_LoadMUS_RW (rwops);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines