… | |
… | |
31 | #include <cstdarg> |
31 | #include <cstdarg> |
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 | |
|
|
37 | #include <unistd.h> |
|
|
38 | #if _POSIX_MEMLOCK |
|
|
39 | # include <sys/mman.h> |
|
|
40 | #endif |
36 | |
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 | |
… | |
… | |
828 | CALL_CALL ("cf::map::emergency_save", G_VOID); |
833 | CALL_CALL ("cf::map::emergency_save", G_VOID); |
829 | CALL_END; |
834 | CALL_END; |
830 | } |
835 | } |
831 | |
836 | |
832 | maptile * |
837 | maptile * |
833 | maptile::load_map_sync (const char *path, maptile *origin) |
838 | maptile::find_sync (const char *path, maptile *origin) |
834 | { |
839 | { |
835 | CALL_BEGIN (2); |
840 | CALL_BEGIN (2); |
836 | CALL_ARG (path); |
841 | CALL_ARG (path); |
837 | CALL_ARG (origin); |
842 | CALL_ARG (origin); |
838 | CALL_CALL ("cf::map::load_map_sync", G_SCALAR); |
843 | CALL_CALL ("cf::map::find_sync", G_SCALAR); |
839 | |
844 | |
840 | maptile *retval; |
845 | maptile *retval; |
841 | |
846 | |
842 | if (count) |
847 | if (count) |
843 | sv_to (POPs, retval); |
848 | sv_to (POPs, retval); |
… | |
… | |
845 | retval = 0; |
850 | retval = 0; |
846 | |
851 | |
847 | CALL_END; |
852 | CALL_END; |
848 | |
853 | |
849 | return retval; |
854 | return retval; |
|
|
855 | } |
|
|
856 | |
|
|
857 | void |
|
|
858 | maptile::do_load_sync () |
|
|
859 | { |
|
|
860 | CALL_BEGIN (1); |
|
|
861 | CALL_ARG (this); |
|
|
862 | CALL_CALL ("cf::map::do_load_sync", G_SCALAR); |
|
|
863 | CALL_END; |
850 | } |
864 | } |
851 | |
865 | |
852 | void |
866 | void |
853 | maptile::change_all_map_light (int change) |
867 | maptile::change_all_map_light (int change) |
854 | { |
868 | { |
… | |
… | |
873 | |
887 | |
874 | ///////////////////////////////////////////////////////////////////////////// |
888 | ///////////////////////////////////////////////////////////////////////////// |
875 | |
889 | |
876 | struct EventAPI *watcher_base::GEventAPI; |
890 | struct EventAPI *watcher_base::GEventAPI; |
877 | struct CoroAPI *coroapi::GCoroAPI; |
891 | struct CoroAPI *coroapi::GCoroAPI; |
|
|
892 | |
|
|
893 | int coroapi::cede_counter; |
878 | |
894 | |
879 | static void iw_dispatch (pe_event *ev) |
895 | static void iw_dispatch (pe_event *ev) |
880 | { |
896 | { |
881 | iw *w = (iw *)ev->ext_data; |
897 | iw *w = (iw *)ev->ext_data; |
882 | w->call (*w); |
898 | w->call (*w); |
… | |
… | |
1288 | const_iv (P_BLOCKSVIEW) |
1304 | const_iv (P_BLOCKSVIEW) |
1289 | const_iv (P_PLAYER) |
1305 | const_iv (P_PLAYER) |
1290 | const_iv (P_NO_MAGIC) |
1306 | const_iv (P_NO_MAGIC) |
1291 | const_iv (P_IS_ALIVE) |
1307 | const_iv (P_IS_ALIVE) |
1292 | const_iv (P_NO_CLERIC) |
1308 | const_iv (P_NO_CLERIC) |
1293 | const_iv (P_NEED_UPDATE) |
|
|
1294 | const_iv (P_OUT_OF_MAP) |
1309 | const_iv (P_OUT_OF_MAP) |
1295 | const_iv (P_NEW_MAP) |
1310 | const_iv (P_NEW_MAP) |
|
|
1311 | const_iv (P_UPTODATE) |
1296 | |
1312 | |
1297 | const_iv (UP_OBJ_INSERT) |
1313 | const_iv (UP_OBJ_INSERT) |
1298 | const_iv (UP_OBJ_REMOVE) |
1314 | const_iv (UP_OBJ_REMOVE) |
1299 | const_iv (UP_OBJ_CHANGE) |
1315 | const_iv (UP_OBJ_CHANGE) |
1300 | const_iv (UP_OBJ_FACE) |
1316 | const_iv (UP_OBJ_FACE) |
… | |
… | |
1595 | case 5: RETVAL = settings.playerdir; break; |
1611 | case 5: RETVAL = settings.playerdir; break; |
1596 | case 6: RETVAL = settings.datadir ; break; |
1612 | case 6: RETVAL = settings.datadir ; break; |
1597 | } |
1613 | } |
1598 | OUTPUT: RETVAL |
1614 | OUTPUT: RETVAL |
1599 | |
1615 | |
|
|
1616 | void abort () |
|
|
1617 | |
1600 | void emergency_save () |
1618 | void emergency_save () |
1601 | |
1619 | |
1602 | void _exit (int status = 0) |
1620 | void _exit (int status = 0) |
|
|
1621 | |
|
|
1622 | #if _POSIX_MEMLOCK |
|
|
1623 | |
|
|
1624 | int mlockall (int flags = MCL_CURRENT | MCL_FUTURE) |
|
|
1625 | |
|
|
1626 | int munlockall () |
|
|
1627 | |
|
|
1628 | #endif |
1603 | |
1629 | |
1604 | int find_animation (char *text) |
1630 | int find_animation (char *text) |
1605 | PROTOTYPE: $ |
1631 | PROTOTYPE: $ |
1606 | |
1632 | |
1607 | int random_roll (int min, int max, object *op, int goodbad); |
1633 | int random_roll (int min, int max, object *op, int goodbad); |
… | |
… | |
1913 | RETVAL = op->contr; |
1939 | RETVAL = op->contr; |
1914 | OUTPUT: RETVAL |
1940 | OUTPUT: RETVAL |
1915 | |
1941 | |
1916 | void check_score (object *op) |
1942 | void check_score (object *op) |
1917 | |
1943 | |
1918 | void cf_player_message (object *obj, char *txt, int flags = NDI_ORANGE | NDI_UNIQUE) |
1944 | void message (object *op, char *txt, int flags = NDI_ORANGE | NDI_UNIQUE) |
|
|
1945 | CODE: |
|
|
1946 | new_draw_info (flags, 0, op, txt); |
1919 | |
1947 | |
1920 | object *cf_player_send_inventory (object *op) |
1948 | object *cf_player_send_inventory (object *op) |
1921 | |
1949 | |
1922 | char *cf_player_get_ip (object *op) |
1950 | char *cf_player_get_ip (object *op) |
1923 | ALIAS: ip = 0 |
1951 | ALIAS: ip = 0 |
… | |
… | |
2177 | case 4: RETVAL = newSVuv ( GET_MAP_MOVE_BLOCK (obj, x, y)); break; |
2205 | case 4: RETVAL = newSVuv ( GET_MAP_MOVE_BLOCK (obj, x, y)); break; |
2178 | case 5: RETVAL = newSVuv ( GET_MAP_MOVE_SLOW (obj, x, y)); break; |
2206 | case 5: RETVAL = newSVuv ( GET_MAP_MOVE_SLOW (obj, x, y)); break; |
2179 | case 6: RETVAL = newSVuv ( GET_MAP_MOVE_ON (obj, x, y)); break; |
2207 | case 6: RETVAL = newSVuv ( GET_MAP_MOVE_ON (obj, x, y)); break; |
2180 | case 7: RETVAL = newSVuv ( GET_MAP_MOVE_OFF (obj, x, y)); break; |
2208 | case 7: RETVAL = newSVuv ( GET_MAP_MOVE_OFF (obj, x, y)); break; |
2181 | } |
2209 | } |
2182 | OUTPUT: |
2210 | OUTPUT: RETVAL |
2183 | RETVAL |
|
|
2184 | |
2211 | |
2185 | void fix_walls (maptile *map, int x, int y) |
2212 | void fix_walls (maptile *map, int x, int y) |
2186 | |
2213 | |
2187 | void fix_walls_around (maptile *map, int x, int y) |
2214 | void fix_walls_around (maptile *map, int x, int y) |
|
|
2215 | |
|
|
2216 | const char * |
|
|
2217 | region_name (maptile *m) |
|
|
2218 | CODE: |
|
|
2219 | RETVAL = get_name_of_region_for_map (m); |
|
|
2220 | OUTPUT: RETVAL |
2188 | |
2221 | |
2189 | # worst xs function of my life |
2222 | # worst xs function of my life |
2190 | maptile * |
2223 | maptile * |
2191 | _create_random_map (\ |
2224 | _create_random_map (\ |
2192 | char *path,\ |
2225 | char *path,\ |
… | |
… | |
2236 | assign (rmp.monsterstyle , monsterstyle); |
2269 | assign (rmp.monsterstyle , monsterstyle); |
2237 | assign (rmp.treasurestyle , treasurestyle); |
2270 | assign (rmp.treasurestyle , treasurestyle); |
2238 | assign (rmp.layoutstyle , layoutstyle); |
2271 | assign (rmp.layoutstyle , layoutstyle); |
2239 | assign (rmp.doorstyle , doorstyle); |
2272 | assign (rmp.doorstyle , doorstyle); |
2240 | assign (rmp.decorstyle , decorstyle); |
2273 | assign (rmp.decorstyle , decorstyle); |
2241 | assign (rmp.origin_map , origin_map); |
|
|
2242 | assign (rmp.final_map , final_map); |
|
|
2243 | assign (rmp.exitstyle , exitstyle); |
2274 | assign (rmp.exitstyle , exitstyle); |
2244 | assign (rmp.this_map , this_map); |
|
|
2245 | assign (rmp.exit_on_final_map, exit_on_final_map); |
2275 | assign (rmp.exit_on_final_map, exit_on_final_map); |
2246 | |
2276 | |
|
|
2277 | rmp.origin_map = origin_map; |
|
|
2278 | rmp.final_map = final_map; |
|
|
2279 | rmp.this_map = this_map; |
2247 | rmp.Xsize = Xsize; |
2280 | rmp.Xsize = Xsize; |
2248 | rmp.Ysize = Ysize; |
2281 | rmp.Ysize = Ysize; |
2249 | rmp.expand2x = expand2x; |
2282 | rmp.expand2x = expand2x; |
2250 | rmp.layoutoptions1 = layoutoptions1; |
2283 | rmp.layoutoptions1 = layoutoptions1; |
2251 | rmp.layoutoptions2 = layoutoptions2; |
2284 | rmp.layoutoptions2 = layoutoptions2; |
… | |
… | |
2298 | |
2331 | |
2299 | INCLUDE: $PERL genacc partylist ../include/player.h | |
2332 | INCLUDE: $PERL genacc partylist ../include/player.h | |
2300 | |
2333 | |
2301 | MODULE = cf PACKAGE = cf::region |
2334 | MODULE = cf PACKAGE = cf::region |
2302 | |
2335 | |
2303 | region *first () |
2336 | region *first () |
2304 | PROTOTYPE: |
2337 | PROTOTYPE: |
2305 | CODE: |
2338 | CODE: |
2306 | RETVAL = first_region; |
2339 | RETVAL = first_region; |
|
|
2340 | OUTPUT: RETVAL |
|
|
2341 | |
|
|
2342 | region *find (char *name) |
|
|
2343 | PROTOTYPE: $ |
|
|
2344 | CODE: |
|
|
2345 | RETVAL = get_region_by_name (name); |
2307 | OUTPUT: RETVAL |
2346 | OUTPUT: RETVAL |
2308 | |
2347 | |
2309 | INCLUDE: $PERL genacc region ../include/map.h | |
2348 | INCLUDE: $PERL genacc region ../include/map.h | |
2310 | |
2349 | |
2311 | MODULE = cf PACKAGE = cf::living |
2350 | MODULE = cf PACKAGE = cf::living |