--- deliantra/Deliantra-Client/Client.xs 2006/04/20 08:11:56 1.55 +++ deliantra/Deliantra-Client/Client.xs 2006/04/23 04:41:33 1.59 @@ -35,11 +35,15 @@ typedef signed int int32_t; #endif +#include "glext.h" + #define FOW_DARKNESS 32 #define MAP_EXTEND_X 32 #define MAP_EXTEND_Y 512 +#define MIN_FONT_HEIGHT 8 * PANGO_SCALE + typedef Mix_Chunk *CFClient__MixChunk; typedef Mix_Music *CFClient__MixMusic; @@ -64,14 +68,18 @@ /* use a random scale factor to account for unknown descenders, 0.8 works * reasonably well with bitstream vera */ - PangoFontDescription *font = pango_context_get_font_description (context); + PangoFontDescription *font = pango_layout_get_font_description (self->pl); int height = self->base_height * (PANGO_SCALE * 8 / 10); + if (height < MIN_FONT_HEIGHT) + height = MIN_FONT_HEIGHT; + if (pango_font_description_get_size (font) != height) { + font = pango_font_description_copy (font); pango_font_description_set_absolute_size (font, height); - pango_layout_context_changed (self->pl); + pango_layout_set_font_description (self->pl, font); } } @@ -241,6 +249,19 @@ } } +static void +music_finished () +{ + SDL_UserEvent ev; + + ev.type = SDL_USEREVENT; + ev.code = 0; + ev.data1 = 0; + ev.data2 = 0; + + SDL_PushEvent ((SDL_Event *)&ev); +} + MODULE = CFClient PACKAGE = CFClient PROTOTYPES: ENABLE @@ -465,6 +486,8 @@ int Mix_OpenAudio (int frequency = 22050, int format = MIX_DEFAULT_FORMAT, int channels = 1, int chunksize = 512) + POSTCALL: + Mix_HookMusicFinished (music_finished); void Mix_CloseAudio () @@ -506,6 +529,7 @@ FcPattern *pattern = FcFreeTypeQuery ((const FcChar8 *)file, 0, 0, &count); PangoFontDescription *font = pango_fc_font_description_from_pattern (pattern, 0); FcPatternDestroy (pattern); + pango_font_description_set_absolute_size (font, MIN_FONT_HEIGHT); pango_context_set_font_description (context, font); } @@ -617,6 +641,9 @@ RETVAL->base_height = base_height; RETVAL->pl = pango_layout_new (context); pango_layout_set_wrap (RETVAL->pl, PANGO_WRAP_WORD_CHAR); + pango_layout_set_font_description (RETVAL->pl, + pango_font_description_copy ( + pango_context_get_font_description (context))); OUTPUT: RETVAL @@ -1310,6 +1337,12 @@ const_iv (GL_REPEAT), const_iv (GL_NEAREST), const_iv (GL_LINEAR), + const_iv (GL_NEAREST_MIPMAP_NEAREST), + const_iv (GL_LINEAR_MIPMAP_NEAREST), + const_iv (GL_NEAREST_MIPMAP_LINEAR), + const_iv (GL_LINEAR_MIPMAP_LINEAR), + const_iv (GL_GENERATE_MIPMAP), + const_iv (GL_LINEAR), const_iv (GL_MODULATE), const_iv (GL_REPLACE), const_iv (GL_COLOR_BUFFER_BIT),