… | |
… | |
45 | #include <plugin_common.h> |
45 | #include <plugin_common.h> |
46 | #include <sounds.h> |
46 | #include <sounds.h> |
47 | |
47 | |
48 | #include <stdarg.h> |
48 | #include <stdarg.h> |
49 | |
49 | |
|
|
50 | //#include "EventAPI.h" |
50 | #include "perlxsi.c" |
51 | #include "perlxsi.c" |
51 | |
52 | |
52 | typedef object object_ornull; |
53 | typedef object object_ornull; |
53 | typedef mapstruct mapstruct_ornull; |
54 | typedef mapstruct mapstruct_ornull; |
54 | |
55 | |
… | |
… | |
488 | if (sv) |
489 | if (sv) |
489 | clearSVptr (sv); |
490 | clearSVptr (sv); |
490 | |
491 | |
491 | rv = 0; |
492 | rv = 0; |
492 | } |
493 | } |
|
|
494 | else if (event_code == EVENT_CLOCK) |
|
|
495 | { |
|
|
496 | dSP; |
|
|
497 | |
|
|
498 | clean_obj_cache (); |
|
|
499 | |
|
|
500 | ENTER; |
|
|
501 | SAVETMPS; |
|
|
502 | PUSHMARK (SP); |
|
|
503 | XPUSHs (sv_2mortal (newSViv (0))); |
|
|
504 | PUTBACK; |
|
|
505 | call_pv ("Event::one_event", G_DISCARD | G_EVAL); |
|
|
506 | SPAGAIN; |
|
|
507 | FREETMPS; |
|
|
508 | LEAVE; |
|
|
509 | } |
493 | else |
510 | else |
494 | { |
511 | { |
495 | dSP; |
512 | dSP; |
496 | |
513 | |
497 | ENTER; |
514 | ENTER; |
… | |
… | |
552 | { |
569 | { |
553 | char *buf = va_arg (args, char *); |
570 | char *buf = va_arg (args, char *); |
554 | int len = va_arg (args, int); |
571 | int len = va_arg (args, int); |
555 | PUSHs (sv_2mortal (newSVpvn (buf, len))); |
572 | PUSHs (sv_2mortal (newSVpvn (buf, len))); |
556 | } |
573 | } |
557 | break; |
|
|
558 | |
|
|
559 | case EVENT_CLOCK: |
|
|
560 | clean_obj_cache (); |
|
|
561 | break; |
574 | break; |
562 | |
575 | |
563 | case EVENT_TELL: |
576 | case EVENT_TELL: |
564 | break; |
577 | break; |
565 | } |
578 | } |
… | |
… | |
1166 | const_event (CLOSE) |
1179 | const_event (CLOSE) |
1167 | const_event (TIMER) |
1180 | const_event (TIMER) |
1168 | const_event (MOVE) |
1181 | const_event (MOVE) |
1169 | |
1182 | |
1170 | const_event (BORN) |
1183 | const_event (BORN) |
1171 | const_event (CLOCK) |
1184 | //const_event (CLOCK) |
1172 | const_event (CRASH) |
1185 | const_event (CRASH) |
1173 | const_event (PLAYER_DEATH) |
1186 | const_event (PLAYER_DEATH) |
1174 | const_event (PLAYER_LOAD) |
1187 | const_event (PLAYER_LOAD) |
1175 | const_event (PLAYER_SAVE) |
1188 | const_event (PLAYER_SAVE) |
1176 | const_event (GKILL) |
1189 | const_event (GKILL) |
… | |
… | |
1330 | for (cprop = prop_table + sizeof (prop_table) / sizeof (prop_table [0]); cprop-- > prop_table; ) |
1343 | for (cprop = prop_table + sizeof (prop_table) / sizeof (prop_table [0]); cprop-- > prop_table; ) |
1331 | { |
1344 | { |
1332 | hv_store (prop_type, cprop->name, strlen (cprop->name), newSViv (cprop->dtype), 0); |
1345 | hv_store (prop_type, cprop->name, strlen (cprop->name), newSViv (cprop->dtype), 0); |
1333 | hv_store (prop_idx, cprop->name, strlen (cprop->name), newSViv (cprop->idx ), 0); |
1346 | hv_store (prop_idx, cprop->name, strlen (cprop->name), newSViv (cprop->idx ), 0); |
1334 | } |
1347 | } |
|
|
1348 | |
|
|
1349 | //I_EVENT_API (PACKAGE); |
1335 | } |
1350 | } |
1336 | |
1351 | |
1337 | void |
1352 | void |
1338 | LOG (int level, char *msg) |
1353 | LOG (int level, char *msg) |
1339 | PROTOTYPE: $$ |
1354 | PROTOTYPE: $$ |
… | |
… | |
1772 | void delete_map (mapstruct *map) |
1787 | void delete_map (mapstruct *map) |
1773 | |
1788 | |
1774 | void clean_tmp_map (mapstruct *map) |
1789 | void clean_tmp_map (mapstruct *map) |
1775 | |
1790 | |
1776 | void play_sound_map (mapstruct *map, int x, int y, int sound_num) |
1791 | void play_sound_map (mapstruct *map, int x, int y, int sound_num) |
|
|
1792 | |
|
|
1793 | mapstruct *tile_map (mapstruct *map, unsigned int dir) |
|
|
1794 | CODE: |
|
|
1795 | RETVAL = dir < 4 ? map->tile_map [dir] : 0; |
|
|
1796 | OUTPUT: |
|
|
1797 | RETVAL |
|
|
1798 | |
|
|
1799 | char *tile_path (mapstruct *map, unsigned int dir) |
|
|
1800 | CODE: |
|
|
1801 | if (dir >= 4) |
|
|
1802 | XSRETURN_UNDEF; |
|
|
1803 | RETVAL = map->tile_path [dir]; |
|
|
1804 | OUTPUT: |
|
|
1805 | RETVAL |
1777 | |
1806 | |
1778 | mapstruct *cf_map_get_map (char *name) |
1807 | mapstruct *cf_map_get_map (char *name) |
1779 | PROTOTYPE: $ |
1808 | PROTOTYPE: $ |
1780 | ALIAS: map = 0 |
1809 | ALIAS: map = 0 |
1781 | |
1810 | |