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.55 by root, Thu Apr 20 08:11:56 2006 UTC vs.
Revision 1.58 by root, Sun Apr 23 00:57:38 2006 UTC

33 typedef signed char int8_t; 33 typedef signed char int8_t;
34 typedef signed short int16_t; 34 typedef signed short int16_t;
35 typedef signed int int32_t; 35 typedef signed int int32_t;
36#endif 36#endif
37 37
38#include "glext.h"
39
38#define FOW_DARKNESS 32 40#define FOW_DARKNESS 32
39 41
40#define MAP_EXTEND_X 32 42#define MAP_EXTEND_X 32
41#define MAP_EXTEND_Y 512 43#define MAP_EXTEND_Y 512
44
45#define MIN_FONT_HEIGHT 8 * PANGO_SCALE
42 46
43typedef Mix_Chunk *CFClient__MixChunk; 47typedef Mix_Chunk *CFClient__MixChunk;
44typedef Mix_Music *CFClient__MixMusic; 48typedef Mix_Music *CFClient__MixMusic;
45 49
46static PangoContext *context; 50static PangoContext *context;
65 * reasonably well with bitstream vera 69 * reasonably well with bitstream vera
66 */ 70 */
67 PangoFontDescription *font = pango_context_get_font_description (context); 71 PangoFontDescription *font = pango_context_get_font_description (context);
68 72
69 int height = self->base_height * (PANGO_SCALE * 8 / 10); 73 int height = self->base_height * (PANGO_SCALE * 8 / 10);
74
75 if (height < MIN_FONT_HEIGHT)
76 height = MIN_FONT_HEIGHT;
70 77
71 if (pango_font_description_get_size (font) != height) 78 if (pango_font_description_get_size (font) != height)
72 { 79 {
73 pango_font_description_set_absolute_size (font, height); 80 pango_font_description_set_absolute_size (font, height);
74 pango_layout_context_changed (self->pl); 81 pango_layout_context_changed (self->pl);
237 break; 244 break;
238 245
239 row->col[x - row->c0].darkness = -1; 246 row->col[x - row->c0].darkness = -1;
240 } 247 }
241 } 248 }
249}
250
251static void
252music_finished ()
253{
254 SDL_UserEvent ev;
255
256 ev.type = SDL_USEREVENT;
257 ev.code = 0;
258 ev.data1 = 0;
259 ev.data2 = 0;
260
261 SDL_PushEvent ((SDL_Event *)&ev);
242} 262}
243 263
244MODULE = CFClient PACKAGE = CFClient 264MODULE = CFClient PACKAGE = CFClient
245 265
246PROTOTYPES: ENABLE 266PROTOTYPES: ENABLE
463 } 483 }
464} 484}
465 485
466int 486int
467Mix_OpenAudio (int frequency = 22050, int format = MIX_DEFAULT_FORMAT, int channels = 1, int chunksize = 512) 487Mix_OpenAudio (int frequency = 22050, int format = MIX_DEFAULT_FORMAT, int channels = 1, int chunksize = 512)
488 POSTCALL:
489 Mix_HookMusicFinished (music_finished);
468 490
469void 491void
470Mix_CloseAudio () 492Mix_CloseAudio ()
471 493
472int 494int
1308 const_iv (GL_TEXTURE_WRAP_T), 1330 const_iv (GL_TEXTURE_WRAP_T),
1309 const_iv (GL_CLAMP), 1331 const_iv (GL_CLAMP),
1310 const_iv (GL_REPEAT), 1332 const_iv (GL_REPEAT),
1311 const_iv (GL_NEAREST), 1333 const_iv (GL_NEAREST),
1312 const_iv (GL_LINEAR), 1334 const_iv (GL_LINEAR),
1335 const_iv (GL_NEAREST_MIPMAP_NEAREST),
1336 const_iv (GL_LINEAR_MIPMAP_NEAREST),
1337 const_iv (GL_NEAREST_MIPMAP_LINEAR),
1338 const_iv (GL_LINEAR_MIPMAP_LINEAR),
1339 const_iv (GL_GENERATE_MIPMAP),
1340 const_iv (GL_LINEAR),
1313 const_iv (GL_MODULATE), 1341 const_iv (GL_MODULATE),
1314 const_iv (GL_REPLACE), 1342 const_iv (GL_REPLACE),
1315 const_iv (GL_COLOR_BUFFER_BIT), 1343 const_iv (GL_COLOR_BUFFER_BIT),
1316 const_iv (GL_PROJECTION), 1344 const_iv (GL_PROJECTION),
1317 const_iv (GL_MODELVIEW), 1345 const_iv (GL_MODELVIEW),

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines