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.71 by root, Fri May 5 19:05:47 2006 UTC vs.
Revision 1.75 by root, Mon May 8 18:28:40 2006 UTC

1#ifdef _WIN32 1#ifdef _WIN32
2# include <malloc.h> 2# include <malloc.h>
3# pragma warning(disable:4244)
3#endif 4#endif
4 5
5#include "EXTERN.h" 6#include "EXTERN.h"
6#include "perl.h" 7#include "perl.h"
7#include "XSUB.h" 8#include "XSUB.h"
258 } 259 }
259 } 260 }
260} 261}
261 262
262static void 263static void
263music_finished () 264music_finished (void)
264{ 265{
265 SDL_UserEvent ev; 266 SDL_UserEvent ev;
266 267
267 ev.type = SDL_USEREVENT; 268 ev.type = SDL_USEREVENT;
268 ev.code = 0; 269 ev.code = 0;
277{ 278{
278 SDL_UserEvent ev; 279 SDL_UserEvent ev;
279 280
280 ev.type = SDL_USEREVENT; 281 ev.type = SDL_USEREVENT;
281 ev.code = 1; 282 ev.code = 1;
282 ev.data1 = channel; 283 ev.data1 = (void *)(long)channel;
283 ev.data2 = 0; 284 ev.data2 = 0;
284 285
285 SDL_PushEvent ((SDL_Event *)&ev); 286 SDL_PushEvent ((SDL_Event *)&ev);
286} 287}
287 288
501 hv_store (hv, "button", 6, newSViv (ev.button.button), 0); 502 hv_store (hv, "button", 6, newSViv (ev.button.button), 0);
502 hv_store (hv, "state", 5, newSViv (ev.button.state), 0); 503 hv_store (hv, "state", 5, newSViv (ev.button.state), 0);
503 hv_store (hv, "x", 1, newSViv (ev.button.x), 0); 504 hv_store (hv, "x", 1, newSViv (ev.button.x), 0);
504 hv_store (hv, "y", 1, newSViv (ev.button.y), 0); 505 hv_store (hv, "y", 1, newSViv (ev.button.y), 0);
505 break; 506 break;
507
508 case SDL_USEREVENT:
509 hv_store (hv, "code", 4, newSViv (ev.user.code), 0);
510 hv_store (hv, "data1", 5, newSViv ((IV)ev.user.data1), 0);
511 hv_store (hv, "data2", 5, newSViv ((IV)ev.user.data2), 0);
512 break;
506 } 513 }
507 514
508 XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv))); 515 XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv)));
509 } 516 }
510} 517}
511 518
512int 519int
513Mix_OpenAudio (int frequency = 22050, int format = MIX_DEFAULT_FORMAT, int channels = 1, int chunksize = 512) 520Mix_OpenAudio (int frequency = 48000, int format = MIX_DEFAULT_FORMAT, int channels = 1, int chunksize = 2048)
514 POSTCALL: 521 POSTCALL:
515 Mix_HookMusicFinished (music_finished); 522 Mix_HookMusicFinished (music_finished);
516 Mix_ChannelFinished (channel_finished); 523 Mix_ChannelFinished (channel_finished);
517 524
518void 525void

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines