… | |
… | |
347 | inline SV *to_sv (treasurelist * v) { return to_sv (v->name); } |
347 | inline SV *to_sv (treasurelist * v) { return to_sv (v->name); } |
348 | |
348 | |
349 | inline SV *to_sv (UUID v) |
349 | inline SV *to_sv (UUID v) |
350 | { |
350 | { |
351 | char buf[128]; |
351 | char buf[128]; |
352 | snprintf (buf, 128, "<1,%" PRIx64 ">", v.seq); |
352 | snprintf (buf, 128, "<1.%" PRIx64 ">", v.seq); |
353 | return newSVpv (buf, 0); |
353 | return newSVpv (buf, 0); |
354 | } |
354 | } |
355 | |
355 | |
356 | inline void sv_to (SV *sv, shstr &v) { v = SvOK (sv) ? SvPV_nolen (sv) : 0; } |
356 | inline void sv_to (SV *sv, shstr &v) { v = SvOK (sv) ? SvPV_nolen (sv) : 0; } |
357 | inline void sv_to (SV *sv, char * &v) { free (v); v = SvOK (sv) ? strdup (SvPV_nolen (sv)) : 0; } |
357 | inline void sv_to (SV *sv, char * &v) { free (v); v = SvOK (sv) ? strdup (SvPV_nolen (sv)) : 0; } |
… | |
… | |
1649 | |
1649 | |
1650 | void cleanup (const char *cause, bool make_core = false) |
1650 | void cleanup (const char *cause, bool make_core = false) |
1651 | |
1651 | |
1652 | void emergency_save () |
1652 | void emergency_save () |
1653 | |
1653 | |
|
|
1654 | void _exit (int status = EXIT_SUCCESS) |
|
|
1655 | |
1654 | UV sv_2watcher (SV *w) |
1656 | UV sv_2watcher (SV *w) |
1655 | CODE: |
1657 | CODE: |
1656 | RETVAL = (UV)GEventAPI->sv_2watcher (w); |
1658 | RETVAL = (UV)GEventAPI->sv_2watcher (w); |
1657 | OUTPUT: |
1659 | OUTPUT: |
1658 | RETVAL |
1660 | RETVAL |
1659 | |
|
|
1660 | void _exit (int status = 0) |
|
|
1661 | |
1661 | |
1662 | #if _POSIX_MEMLOCK |
1662 | #if _POSIX_MEMLOCK |
1663 | |
1663 | |
1664 | int mlockall (int flags = MCL_CURRENT | MCL_FUTURE) |
1664 | int mlockall (int flags = MCL_CURRENT | MCL_FUTURE) |
1665 | |
1665 | |
… | |
… | |
1804 | |
1804 | |
1805 | void |
1805 | void |
1806 | set_animation (object *op, int idx) |
1806 | set_animation (object *op, int idx) |
1807 | CODE: |
1807 | CODE: |
1808 | SET_ANIMATION (op, idx); |
1808 | SET_ANIMATION (op, idx); |
|
|
1809 | |
|
|
1810 | int |
|
|
1811 | num_animations (object *op) |
|
|
1812 | CODE: |
|
|
1813 | RETVAL = NUM_ANIMATIONS (op); |
|
|
1814 | OUTPUT: RETVAL |
1809 | |
1815 | |
1810 | object *find_best_object_match (object *op, const char *match) |
1816 | object *find_best_object_match (object *op, const char *match) |
1811 | |
1817 | |
1812 | object *find_marked_object (object *op) |
1818 | object *find_marked_object (object *op) |
1813 | |
1819 | |
… | |
… | |
2141 | EXTEND (SP, THIS->players); |
2147 | EXTEND (SP, THIS->players); |
2142 | for_all_players (pl) |
2148 | for_all_players (pl) |
2143 | if (pl->ob && pl->ob->map == THIS) |
2149 | if (pl->ob && pl->ob->map == THIS) |
2144 | PUSHs (sv_2mortal (to_sv (pl->ob))); |
2150 | PUSHs (sv_2mortal (to_sv (pl->ob))); |
2145 | } |
2151 | } |
|
|
2152 | |
|
|
2153 | void |
|
|
2154 | maptile::set_regiondata (SV *data, SV *plt) |
|
|
2155 | CODE: |
|
|
2156 | { |
|
|
2157 | if (!SvROK (plt) || SvTYPE (SvRV (plt)) != SVt_PVAV) |
|
|
2158 | croak ("maptile::set_regiondata needs arrayref as plt arg"); |
|
|
2159 | |
|
|
2160 | AV *av = (AV *)SvRV (plt); |
|
|
2161 | |
|
|
2162 | region **regionmap = (region **)malloc ((av_len (av) + 1) * sizeof (region *)); |
|
|
2163 | |
|
|
2164 | for (int i = av_len (av) + 1; i--; ) |
|
|
2165 | regionmap [i] = region::find (SvPVutf8_nolen (*av_fetch (av, i, 1))); |
|
|
2166 | |
|
|
2167 | THIS->regions = salloc<uint8_t> (THIS->size (), (uint8_t *)SvPVbyte_nolen (data)); |
|
|
2168 | THIS->regionmap = regionmap; |
|
|
2169 | } |
2146 | |
2170 | |
2147 | void play_sound_map (maptile *map, int x, int y, int sound_num) |
2171 | void play_sound_map (maptile *map, int x, int y, int sound_num) |
2148 | |
2172 | |
2149 | int out_of_map (maptile *map, int x, int y) |
2173 | int out_of_map (maptile *map, int x, int y) |
2150 | |
2174 | |
… | |
… | |
2231 | OUTPUT: RETVAL |
2255 | OUTPUT: RETVAL |
2232 | |
2256 | |
2233 | void fix_walls (maptile *map, int x, int y) |
2257 | void fix_walls (maptile *map, int x, int y) |
2234 | |
2258 | |
2235 | void fix_walls_around (maptile *map, int x, int y) |
2259 | void fix_walls_around (maptile *map, int x, int y) |
2236 | |
|
|
2237 | const char * |
|
|
2238 | region_name (maptile *m) |
|
|
2239 | CODE: |
|
|
2240 | RETVAL = get_name_of_region_for_map (m); |
|
|
2241 | OUTPUT: RETVAL |
|
|
2242 | |
2260 | |
2243 | # worst xs function of my life |
2261 | # worst xs function of my life |
2244 | bool |
2262 | bool |
2245 | _create_random_map (\ |
2263 | _create_random_map (\ |
2246 | maptile *self,\ |
2264 | maptile *self,\ |
… | |
… | |
2363 | OUTPUT: RETVAL |
2381 | OUTPUT: RETVAL |
2364 | |
2382 | |
2365 | region *find (char *name) |
2383 | region *find (char *name) |
2366 | PROTOTYPE: $ |
2384 | PROTOTYPE: $ |
2367 | CODE: |
2385 | CODE: |
2368 | RETVAL = get_region_by_name (name); |
2386 | RETVAL = region::find (name); |
2369 | OUTPUT: RETVAL |
2387 | OUTPUT: RETVAL |
2370 | |
2388 | |
2371 | INCLUDE: $PERL genacc region ../include/map.h | |
2389 | INCLUDE: $PERL genacc region ../include/map.h | |
2372 | |
2390 | |
2373 | MODULE = cf PACKAGE = cf::living |
2391 | MODULE = cf PACKAGE = cf::living |