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

Comparing deliantra/server/plugins/cfperl/cfperl.xs (file contents):
Revision 1.55 by root, Mon Jun 26 15:40:15 2006 UTC vs.
Revision 1.56 by root, Tue Jul 11 14:24:16 2006 UTC

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
52typedef object object_ornull; 53typedef object object_ornull;
53typedef mapstruct mapstruct_ornull; 54typedef 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
1337void 1352void
1338LOG (int level, char *msg) 1353LOG (int level, char *msg)
1339 PROTOTYPE: $$ 1354 PROTOTYPE: $$
1772void delete_map (mapstruct *map) 1787void delete_map (mapstruct *map)
1773 1788
1774void clean_tmp_map (mapstruct *map) 1789void clean_tmp_map (mapstruct *map)
1775 1790
1776void play_sound_map (mapstruct *map, int x, int y, int sound_num) 1791void play_sound_map (mapstruct *map, int x, int y, int sound_num)
1792
1793mapstruct *tile_map (mapstruct *map, unsigned int dir)
1794 CODE:
1795 RETVAL = dir < 4 ? map->tile_map [dir] : 0;
1796 OUTPUT:
1797 RETVAL
1798
1799char *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
1778mapstruct *cf_map_get_map (char *name) 1807mapstruct *cf_map_get_map (char *name)
1779 PROTOTYPE: $ 1808 PROTOTYPE: $
1780 ALIAS: map = 0 1809 ALIAS: map = 0
1781 1810

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines