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.52 by root, Wed Apr 19 21:17:15 2006 UTC vs.
Revision 1.53 by root, Wed Apr 19 21:38:04 2006 UTC

386 386
387 SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1); 387 SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1);
388 SDL_GL_SetAttribute (SDL_GL_BUFFER_SIZE, 15); 388 SDL_GL_SetAttribute (SDL_GL_BUFFER_SIZE, 15);
389 SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, 0); 389 SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, 0);
390 390
391 SDL_EnableUNICODE (1);
392 SDL_EnableKeyRepeat (SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
393
391 m = SDL_ListModes (0, SDL_FULLSCREEN | SDL_OPENGL); 394 m = SDL_ListModes (0, SDL_FULLSCREEN | SDL_OPENGL);
392 395
393 if (m && m != (SDL_Rect **)-1) 396 if (m && m != (SDL_Rect **)-1)
394 while (*m) 397 while (*m)
395 { 398 {
410 ); 413 );
411 SDL_WM_SetCaption ("Crossfire+ Client " VERSION, "Crossfire+"); 414 SDL_WM_SetCaption ("Crossfire+ Client " VERSION, "Crossfire+");
412 OUTPUT: 415 OUTPUT:
413 RETVAL 416 RETVAL
414 417
415int 418void
416Mix_VolumeMusic (int newvol = -1) 419SDL_PollEvent ()
420 PPCODE:
421{
422 SDL_Event ev;
423
424 while (SDL_PollEvent (&ev))
425 {
426 HV *hv = newHV ();
427 hv_store (hv, "type", 4, newSViv (ev.type), 0);
428 switch (ev.type)
429 {
430 case SDL_KEYDOWN:
431 case SDL_KEYUP:
432 hv_store (hv, "state", 5, newSViv (ev.key.state), 0);
433 hv_store (hv, "sym", 3, newSViv (ev.key.keysym.sym), 0);
434 hv_store (hv, "mod", 3, newSViv (ev.key.keysym.mod), 0);
435 hv_store (hv, "unicode", 7, newSViv (ev.key.keysym.unicode), 0);
436 break;
437
438 case SDL_ACTIVEEVENT:
439 hv_store (hv, "gain", 4, newSViv (ev.active.gain), 0);
440 hv_store (hv, "state", 5, newSViv (ev.active.state), 0);
441 break;
442
443 case SDL_MOUSEMOTION:
444 hv_store (hv, "state", 5, newSViv (ev.motion.state), 0);
445 hv_store (hv, "x", 1, newSViv (ev.motion.x), 0);
446 hv_store (hv, "y", 1, newSViv (ev.motion.y), 0);
447 hv_store (hv, "xrel", 4, newSViv (ev.motion.xrel), 0);
448 hv_store (hv, "yrel", 4, newSViv (ev.motion.yrel), 0);
449 break;
450
451 case SDL_MOUSEBUTTONDOWN:
452 case SDL_MOUSEBUTTONUP:
453 hv_store (hv, "button", 6, newSViv (ev.button.button), 0);
454 hv_store (hv, "state", 5, newSViv (ev.button.state), 0);
455 hv_store (hv, "x", 1, newSViv (ev.button.x), 0);
456 hv_store (hv, "y", 1, newSViv (ev.button.y), 0);
457 }
458
459 XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv)));
460 }
461}
417 462
418int 463int
419Mix_OpenAudio (int frequency = 22050, int format = MIX_DEFAULT_FORMAT, int channels = 1, int chunksize = 512) 464Mix_OpenAudio (int frequency = 22050, int format = MIX_DEFAULT_FORMAT, int channels = 1, int chunksize = 512)
420 465
421void 466void

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines