… | |
… | |
29 | #include <plugin_common.h> |
29 | #include <plugin_common.h> |
30 | #include <sounds.h> |
30 | #include <sounds.h> |
31 | #include <cstdarg> |
31 | #include <cstdarg> |
32 | #include <sproto.h> |
32 | #include <sproto.h> |
33 | |
33 | |
|
|
34 | #include "loader.h" |
34 | #include "cfperl.h" |
35 | #include "cfperl.h" |
35 | #include "shstr.h" |
36 | #include "shstr.h" |
36 | |
37 | |
37 | #include <unistd.h> |
38 | #include <unistd.h> |
38 | #if _POSIX_MEMLOCK |
39 | #if _POSIX_MEMLOCK |
… | |
… | |
604 | if (perl_parse (perl, xs_init, 2, argv, (char **)NULL) || perl_run (perl)) |
605 | if (perl_parse (perl, xs_init, 2, argv, (char **)NULL) || perl_run (perl)) |
605 | { |
606 | { |
606 | printf ("unable to initialize perl-interpreter, aborting.\n"); |
607 | printf ("unable to initialize perl-interpreter, aborting.\n"); |
607 | exit (EXIT_FAILURE); |
608 | exit (EXIT_FAILURE); |
608 | } |
609 | } |
|
|
610 | |
|
|
611 | { |
|
|
612 | dSP; |
|
|
613 | |
|
|
614 | PUSHMARK (SP); |
|
|
615 | PUTBACK; |
|
|
616 | call_pv ("cf::init", G_DISCARD | G_VOID); |
|
|
617 | } |
609 | } |
618 | } |
610 | |
619 | |
611 | void cfperl_main () |
620 | void cfperl_main () |
612 | { |
621 | { |
613 | dSP; |
622 | dSP; |
… | |
… | |
1711 | RETVAL = newSVpv (resist_plus[atnr], 0); |
1720 | RETVAL = newSVpv (resist_plus[atnr], 0); |
1712 | else |
1721 | else |
1713 | XSRETURN_UNDEF; |
1722 | XSRETURN_UNDEF; |
1714 | OUTPUT: RETVAL |
1723 | OUTPUT: RETVAL |
1715 | |
1724 | |
|
|
1725 | bool |
|
|
1726 | load_regions (const char *filename) |
|
|
1727 | CODE: |
|
|
1728 | RETVAL = loader_region ().load (filename); |
|
|
1729 | OUTPUT: RETVAL |
|
|
1730 | |
1716 | MODULE = cf PACKAGE = cf::attachable |
1731 | MODULE = cf PACKAGE = cf::attachable |
1717 | |
1732 | |
1718 | int |
1733 | int |
1719 | valid (SV *obj) |
1734 | valid (SV *obj) |
1720 | CODE: |
1735 | CODE: |
… | |
… | |
2056 | pl->orig_stats = pl->ob->stats; |
2071 | pl->orig_stats = pl->ob->stats; |
2057 | |
2072 | |
2058 | void cf_player_move (player *pl, int dir) |
2073 | void cf_player_move (player *pl, int dir) |
2059 | |
2074 | |
2060 | void play_sound_player_only (player *pl, int soundnum, int x = 0, int y = 0); |
2075 | void play_sound_player_only (player *pl, int soundnum, int x = 0, int y = 0); |
2061 | |
|
|
2062 | player *first () |
|
|
2063 | CODE: |
|
|
2064 | RETVAL = first_player; |
|
|
2065 | OUTPUT: RETVAL |
|
|
2066 | |
2076 | |
2067 | bool |
2077 | bool |
2068 | cell_visible (player *pl, int dx, int dy) |
2078 | cell_visible (player *pl, int dx, int dy) |
2069 | CODE: |
2079 | CODE: |
2070 | RETVAL = FABS (dx) <= pl->ns->mapx / 2 && FABS (dy) <= pl->ns->mapy / 2 |
2080 | RETVAL = FABS (dx) <= pl->ns->mapx / 2 && FABS (dy) <= pl->ns->mapy / 2 |
… | |
… | |
2372 | |
2382 | |
2373 | INCLUDE: $PERL genacc partylist ../include/player.h | |
2383 | INCLUDE: $PERL genacc partylist ../include/player.h | |
2374 | |
2384 | |
2375 | MODULE = cf PACKAGE = cf::region |
2385 | MODULE = cf PACKAGE = cf::region |
2376 | |
2386 | |
2377 | region *first () |
2387 | void |
2378 | PROTOTYPE: |
2388 | list () |
2379 | CODE: |
2389 | PPCODE: |
2380 | RETVAL = first_region; |
2390 | for_all_regions (rgn) |
2381 | OUTPUT: RETVAL |
2391 | XPUSHs (sv_2mortal (to_sv (rgn))); |
2382 | |
2392 | |
2383 | region *find (char *name) |
2393 | region *find (char *name) |
2384 | PROTOTYPE: $ |
2394 | PROTOTYPE: $ |
2385 | CODE: |
2395 | CODE: |
2386 | RETVAL = region::find (name); |
2396 | RETVAL = region::find (name); |
2387 | OUTPUT: RETVAL |
2397 | OUTPUT: RETVAL |
2388 | |
2398 | |
|
|
2399 | region *find_fuzzy (char *name) |
|
|
2400 | PROTOTYPE: $ |
|
|
2401 | CODE: |
|
|
2402 | RETVAL = region::find_fuzzy (name); |
|
|
2403 | OUTPUT: RETVAL |
|
|
2404 | |
2389 | INCLUDE: $PERL genacc region ../include/map.h | |
2405 | INCLUDE: $PERL genacc region ../include/map.h | |
2390 | |
2406 | |
2391 | MODULE = cf PACKAGE = cf::living |
2407 | MODULE = cf PACKAGE = cf::living |
2392 | |
2408 | |
2393 | INCLUDE: $PERL genacc living ../include/living.h | |
2409 | INCLUDE: $PERL genacc living ../include/living.h | |