ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/cfperl.xs
(Generate patch)

Comparing deliantra/server/server/cfperl.xs (file contents):
Revision 1.160 by elmex, Wed Jan 31 14:11:02 2007 UTC vs.
Revision 1.162 by root, Thu Feb 1 19:40:42 2007 UTC

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
611void cfperl_main () 620void 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
1725bool
1726load_regions (const char *filename)
1727 CODE:
1728 RETVAL = loader_region ().load (filename);
1729 OUTPUT: RETVAL
1730
1716MODULE = cf PACKAGE = cf::attachable 1731MODULE = cf PACKAGE = cf::attachable
1717 1732
1718int 1733int
1719valid (SV *obj) 1734valid (SV *obj)
1720 CODE: 1735 CODE:
2056 pl->orig_stats = pl->ob->stats; 2071 pl->orig_stats = pl->ob->stats;
2057 2072
2058void cf_player_move (player *pl, int dir) 2073void cf_player_move (player *pl, int dir)
2059 2074
2060void play_sound_player_only (player *pl, int soundnum, int x = 0, int y = 0); 2075void play_sound_player_only (player *pl, int soundnum, int x = 0, int y = 0);
2061
2062player *first ()
2063 CODE:
2064 RETVAL = first_player;
2065 OUTPUT: RETVAL
2066 2076
2067bool 2077bool
2068cell_visible (player *pl, int dx, int dy) 2078cell_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
2373INCLUDE: $PERL genacc partylist ../include/player.h | 2383INCLUDE: $PERL genacc partylist ../include/player.h |
2374 2384
2375MODULE = cf PACKAGE = cf::region 2385MODULE = cf PACKAGE = cf::region
2376 2386
2377region *first () 2387void
2378 PROTOTYPE: 2388list ()
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
2383region *find (char *name) 2393region *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
2399region *find_fuzzy (char *name)
2400 PROTOTYPE: $
2401 CODE:
2402 RETVAL = region::find_fuzzy (name);
2403 OUTPUT: RETVAL
2404
2389INCLUDE: $PERL genacc region ../include/map.h | 2405INCLUDE: $PERL genacc region ../include/map.h |
2390 2406
2391MODULE = cf PACKAGE = cf::living 2407MODULE = cf PACKAGE = cf::living
2392 2408
2393INCLUDE: $PERL genacc living ../include/living.h | 2409INCLUDE: $PERL genacc living ../include/living.h |

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines