--- deliantra/Deliantra-Client/Client.xs 2006/04/25 11:48:30 1.68 +++ deliantra/Deliantra-Client/Client.xs 2006/05/05 19:05:47 1.71 @@ -272,6 +272,19 @@ SDL_PushEvent ((SDL_Event *)&ev); } +static void +channel_finished (int channel) +{ + SDL_UserEvent ev; + + ev.type = SDL_USEREVENT; + ev.code = 1; + ev.data1 = channel; + ev.data2 = 0; + + SDL_PushEvent ((SDL_Event *)&ev); +} + MODULE = CFClient PACKAGE = CFClient PROTOTYPES: ENABLE @@ -459,6 +472,7 @@ { HV *hv = newHV (); hv_store (hv, "type", 4, newSViv (ev.type), 0); + switch (ev.type) { case SDL_KEYDOWN: @@ -488,6 +502,7 @@ hv_store (hv, "state", 5, newSViv (ev.button.state), 0); hv_store (hv, "x", 1, newSViv (ev.button.x), 0); hv_store (hv, "y", 1, newSViv (ev.button.y), 0); + break; } XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv))); @@ -498,6 +513,7 @@ Mix_OpenAudio (int frequency = 22050, int format = MIX_DEFAULT_FORMAT, int channels = 1, int chunksize = 512) POSTCALL: Mix_HookMusicFinished (music_finished); + Mix_ChannelFinished (channel_finished); void Mix_CloseAudio () @@ -642,11 +658,11 @@ MODULE = CFClient PACKAGE = CFClient::Font CFClient::Font -new_from_file (SV *class, char *path) +new_from_file (SV *class, char *path, int id = 0) CODE: { int count; - FcPattern *pattern = FcFreeTypeQuery ((const FcChar8 *)path, 0, 0, &count); + FcPattern *pattern = FcFreeTypeQuery ((const FcChar8 *)path, id, 0, &count); RETVAL = pango_fc_font_description_from_pattern (pattern, 0); FcPatternDestroy (pattern); } @@ -1350,7 +1366,9 @@ const_iv (GL_COLOR_MATERIAL), const_iv (GL_SMOOTH), const_iv (GL_FLAT), + const_iv (GL_DITHER), const_iv (GL_BLEND), + const_iv (GL_SCISSOR_TEST), const_iv (GL_AND), const_iv (GL_ONE), const_iv (GL_ZERO), @@ -1383,11 +1401,13 @@ const_iv (GL_LINEAR_MIPMAP_LINEAR), const_iv (GL_GENERATE_MIPMAP), const_iv (GL_MODULATE), + const_iv (GL_DECAL), const_iv (GL_REPLACE), const_iv (GL_COLOR_BUFFER_BIT), const_iv (GL_PROJECTION), const_iv (GL_MODELVIEW), const_iv (GL_COLOR_LOGIC_OP), + const_iv (GL_SEPARABLE_2D), const_iv (GL_CONVOLUTION_2D), const_iv (GL_CONVOLUTION_BORDER_MODE), const_iv (GL_CONSTANT_BORDER), @@ -1437,6 +1457,8 @@ void glViewport (int x, int y, int width, int height) +void glScissor (int x, int y, int width, int height) + void glTranslate (float x, float y, float z = 0.) CODE: glTranslatef (x, y, z); @@ -1456,7 +1478,7 @@ void glColor (float r, float g, float b, float a = 1.0) PROTOTYPE: @ CODE: - glColor4f (r, g, b, a); + glColor4ub (r * 255., g * 255., b * 255., a * 255.); void glVertex (float x, float y, float z = 0.) CODE: @@ -1485,6 +1507,11 @@ GL_CALL (PFNGLCONVOLUTIONFILTER2DEXTPROC, glConvolutionFilter2D, (target, internalformat, width, height, format, type, data)); +void glSeparableFilter2D (int target, int internalformat, int width, int height, int format, int type, char *row, char *column) + CODE: + GL_CALL (PFNGLSEPARABLEFILTER2DEXTPROC, glSeparableFilter2D, + (target, internalformat, width, height, format, type, row, column)); + void glTexImage2D (int target, int level, int internalformat, int width, int height, int border, int format, int type, char *data) void glCopyTexImage2D (int target, int level, int internalformat, int x, int y, int width, int height, int border)