… | |
… | |
32 | #include <sproto.h> |
32 | #include <sproto.h> |
33 | |
33 | |
34 | #include "cfperl.h" |
34 | #include "cfperl.h" |
35 | #include "shstr.h" |
35 | #include "shstr.h" |
36 | |
36 | |
|
|
37 | #include <unistd.h> |
|
|
38 | #if _POSIX_MEMLOCK |
|
|
39 | # include <sys/mman.h> |
|
|
40 | #endif |
|
|
41 | |
37 | #include <EXTERN.h> |
42 | #include <EXTERN.h> |
38 | #include <perl.h> |
43 | #include <perl.h> |
39 | #include <XSUB.h> |
44 | #include <XSUB.h> |
40 | |
45 | |
41 | #include "CoroAPI.h" |
46 | #include "CoroAPI.h" |
… | |
… | |
140 | |
145 | |
141 | void |
146 | void |
142 | attachable::do_destroy () |
147 | attachable::do_destroy () |
143 | { |
148 | { |
144 | invoke (EVENT_ATTACHABLE_DESTROY, DT_END); |
149 | invoke (EVENT_ATTACHABLE_DESTROY, DT_END); |
|
|
150 | |
|
|
151 | if (self) |
|
|
152 | hv_clear (self); |
145 | |
153 | |
146 | //TODO: call generic destroy callback |
154 | //TODO: call generic destroy callback |
147 | mortals.push_back (this); |
155 | mortals.push_back (this); |
148 | } |
156 | } |
149 | |
157 | |
… | |
… | |
828 | CALL_CALL ("cf::map::emergency_save", G_VOID); |
836 | CALL_CALL ("cf::map::emergency_save", G_VOID); |
829 | CALL_END; |
837 | CALL_END; |
830 | } |
838 | } |
831 | |
839 | |
832 | maptile * |
840 | maptile * |
833 | maptile::load_map_sync (const char *path, maptile *origin) |
841 | maptile::find_sync (const char *path, maptile *origin) |
834 | { |
842 | { |
835 | CALL_BEGIN (2); |
843 | CALL_BEGIN (2); |
836 | CALL_ARG (path); |
844 | CALL_ARG (path); |
837 | CALL_ARG (origin); |
845 | CALL_ARG (origin); |
838 | CALL_CALL ("cf::map::load_map_sync", G_SCALAR); |
846 | CALL_CALL ("cf::map::find_sync", G_SCALAR); |
839 | |
847 | |
840 | maptile *retval; |
848 | maptile *retval; |
841 | |
849 | |
842 | if (count) |
850 | if (count) |
843 | sv_to (POPs, retval); |
851 | sv_to (POPs, retval); |
… | |
… | |
845 | retval = 0; |
853 | retval = 0; |
846 | |
854 | |
847 | CALL_END; |
855 | CALL_END; |
848 | |
856 | |
849 | return retval; |
857 | return retval; |
|
|
858 | } |
|
|
859 | |
|
|
860 | void |
|
|
861 | maptile::do_load_sync () |
|
|
862 | { |
|
|
863 | CALL_BEGIN (1); |
|
|
864 | CALL_ARG (this); |
|
|
865 | CALL_CALL ("cf::map::do_load_sync", G_SCALAR); |
|
|
866 | CALL_END; |
850 | } |
867 | } |
851 | |
868 | |
852 | void |
869 | void |
853 | maptile::change_all_map_light (int change) |
870 | maptile::change_all_map_light (int change) |
854 | { |
871 | { |
… | |
… | |
1603 | |
1620 | |
1604 | void emergency_save () |
1621 | void emergency_save () |
1605 | |
1622 | |
1606 | void _exit (int status = 0) |
1623 | void _exit (int status = 0) |
1607 | |
1624 | |
|
|
1625 | #if _POSIX_MEMLOCK |
|
|
1626 | |
|
|
1627 | int mlockall (int flags = MCL_CURRENT | MCL_FUTURE) |
|
|
1628 | |
|
|
1629 | int munlockall () |
|
|
1630 | |
|
|
1631 | #endif |
|
|
1632 | |
1608 | int find_animation (char *text) |
1633 | int find_animation (char *text) |
1609 | PROTOTYPE: $ |
1634 | PROTOTYPE: $ |
1610 | |
1635 | |
1611 | int random_roll (int min, int max, object *op, int goodbad); |
1636 | int random_roll (int min, int max, object *op, int goodbad); |
1612 | |
1637 | |