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.50 by root, Wed Apr 19 00:47:34 2006 UTC vs.
Revision 1.51 by root, Wed Apr 19 20:46:44 2006 UTC

241 241
242PROTOTYPES: ENABLE 242PROTOTYPES: ENABLE
243 243
244BOOT: 244BOOT:
245{ 245{
246 HV *stash = gv_stashpv ("CFClient", 1);
247 static const struct {
248 const char *name;
249 IV iv;
250 } *civ, const_iv[] = {
251# define const_iv(name) { # name, (IV)name }
252 const_iv (SDL_ACTIVEEVENT),
253 const_iv (SDL_KEYDOWN),
254 const_iv (SDL_KEYUP),
255 const_iv (SDL_MOUSEMOTION),
256 const_iv (SDL_MOUSEBUTTONDOWN),
257 const_iv (SDL_MOUSEBUTTONUP),
258 const_iv (SDL_JOYAXISMOTION),
259 const_iv (SDL_JOYBALLMOTION),
260 const_iv (SDL_JOYHATMOTION),
261 const_iv (SDL_JOYBUTTONDOWN),
262 const_iv (SDL_JOYBUTTONUP),
263 const_iv (SDL_QUIT),
264 const_iv (SDL_SYSWMEVENT),
265 const_iv (SDL_EVENT_RESERVEDA),
266 const_iv (SDL_EVENT_RESERVEDB),
267 const_iv (SDL_VIDEORESIZE),
268 const_iv (SDL_VIDEOEXPOSE),
269 const_iv (SDL_USEREVENT),
270 const_iv (SDLK_KP0),
271 const_iv (SDLK_KP1),
272 const_iv (SDLK_KP2),
273 const_iv (SDLK_KP3),
274 const_iv (SDLK_KP4),
275 const_iv (SDLK_KP5),
276 const_iv (SDLK_KP6),
277 const_iv (SDLK_KP7),
278 const_iv (SDLK_KP8),
279 const_iv (SDLK_KP9),
280 const_iv (SDLK_KP_PERIOD),
281 const_iv (SDLK_KP_DIVIDE),
282 const_iv (SDLK_KP_MULTIPLY),
283 const_iv (SDLK_KP_MINUS),
284 const_iv (SDLK_KP_PLUS),
285 const_iv (SDLK_KP_ENTER),
286 const_iv (SDLK_KP_EQUALS),
287 const_iv (SDLK_UP),
288 const_iv (SDLK_DOWN),
289 const_iv (SDLK_RIGHT),
290 const_iv (SDLK_LEFT),
291 const_iv (SDLK_INSERT),
292 const_iv (SDLK_HOME),
293 const_iv (SDLK_END),
294 const_iv (SDLK_PAGEUP),
295 const_iv (SDLK_PAGEDOWN),
296 const_iv (SDLK_F1),
297 const_iv (SDLK_F2),
298 const_iv (SDLK_F3),
299 const_iv (SDLK_F4),
300 const_iv (SDLK_F5),
301 const_iv (SDLK_F6),
302 const_iv (SDLK_F7),
303 const_iv (SDLK_F8),
304 const_iv (SDLK_F9),
305 const_iv (SDLK_F10),
306 const_iv (SDLK_F11),
307 const_iv (SDLK_F12),
308 const_iv (SDLK_F13),
309 const_iv (SDLK_F14),
310 const_iv (SDLK_F15),
311 const_iv (SDLK_NUMLOCK),
312 const_iv (SDLK_CAPSLOCK),
313 const_iv (SDLK_SCROLLOCK),
314 const_iv (SDLK_RSHIFT),
315 const_iv (SDLK_LSHIFT),
316 const_iv (SDLK_RCTRL),
317 const_iv (SDLK_LCTRL),
318 const_iv (SDLK_RALT),
319 const_iv (SDLK_LALT),
320 const_iv (SDLK_RMETA),
321 const_iv (SDLK_LMETA),
322 const_iv (SDLK_LSUPER),
323 const_iv (SDLK_RSUPER),
324 const_iv (SDLK_MODE),
325 const_iv (SDLK_COMPOSE),
326 const_iv (SDLK_HELP),
327 const_iv (SDLK_PRINT),
328 const_iv (SDLK_SYSREQ),
329 const_iv (SDLK_BREAK),
330 const_iv (SDLK_MENU),
331 const_iv (SDLK_POWER),
332 const_iv (SDLK_EURO),
333 const_iv (SDLK_UNDO),
334 const_iv (KMOD_NONE),
335 const_iv (KMOD_LSHIFT),
336 const_iv (KMOD_RSHIFT),
337 const_iv (KMOD_LCTRL),
338 const_iv (KMOD_RCTRL),
339 const_iv (KMOD_LALT),
340 const_iv (KMOD_RALT),
341 const_iv (KMOD_LMETA),
342 const_iv (KMOD_RMETA),
343 const_iv (KMOD_NUM),
344 const_iv (KMOD_CAPS),
345 const_iv (KMOD_MODE),
346 const_iv (KMOD_CTRL),
347 const_iv (KMOD_SHIFT),
348 const_iv (KMOD_ALT),
349 const_iv (KMOD_META)
350# undef const_iv
351 };
352
353 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; )
354 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv));
355
246 fontmap = pango_ft2_font_map_new (); 356 fontmap = pango_ft2_font_map_new ();
247 pango_ft2_font_map_set_default_substitute ((PangoFT2FontMap *)fontmap, substitute_func, 0, 0); 357 pango_ft2_font_map_set_default_substitute ((PangoFT2FontMap *)fontmap, substitute_func, 0, 0);
248 context = pango_ft2_font_map_create_context ((PangoFT2FontMap *)fontmap); 358 context = pango_ft2_font_map_create_context ((PangoFT2FontMap *)fontmap);
249} 359}
360
361int
362SDL_Init (U32 flags = SDL_INIT_VIDEO | SDL_INIT_AUDIO)
363
364void
365SDL_Quit ()
366
367void
368SDL_ListModes ()
369 PPCODE:
370{
371 SDL_Rect **m;
372
373 SDL_GL_SetAttribute (SDL_GL_RED_SIZE, 5);
374 SDL_GL_SetAttribute (SDL_GL_GREEN_SIZE, 5);
375 SDL_GL_SetAttribute (SDL_GL_BLUE_SIZE, 5);
376 SDL_GL_SetAttribute (SDL_GL_ALPHA_SIZE, 1);
377
378 SDL_GL_SetAttribute (SDL_GL_ACCUM_RED_SIZE, 0);
379 SDL_GL_SetAttribute (SDL_GL_ACCUM_GREEN_SIZE, 0);
380 SDL_GL_SetAttribute (SDL_GL_ACCUM_BLUE_SIZE, 0);
381 SDL_GL_SetAttribute (SDL_GL_ACCUM_ALPHA_SIZE, 0);
382
383 SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1);
384 SDL_GL_SetAttribute (SDL_GL_BUFFER_SIZE, 15);
385 SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, 0);
386
387 m = SDL_ListModes (0, SDL_FULLSCREEN | SDL_OPENGL);
388
389 if (m && m != (SDL_Rect **)-1)
390 while (*m)
391 {
392 AV *av = newAV ();
393 av_push (av, newSViv ((*m)->w));
394 av_push (av, newSViv ((*m)->h));
395 XPUSHs (sv_2mortal (newRV_noinc ((SV *)av)));
396
397 ++m;
398 }
399}
400
401int
402SDL_SetVideoMode (int w, int h, int fullscreen)
403 CODE:
404 RETVAL = !!SDL_SetVideoMode (
405 w, h, 0, SDL_OPENGL | (fullscreen ? SDL_FULLSCREEN : 0)
406 );
407 SDL_WM_SetCaption ("Crossfire+ Client " VERSION, "Crossfire+");
408 OUTPUT:
409 RETVAL
250 410
251void 411void
252lowdelay (int fd, int val = 1) 412lowdelay (int fd, int val = 1)
253 CODE: 413 CODE:
254#ifndef _WIN32 414#ifndef _WIN32

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines