… | |
… | |
84 | *stash_cf_client_wrap, |
84 | *stash_cf_client_wrap, |
85 | *stash_cf_arch_wrap, |
85 | *stash_cf_arch_wrap, |
86 | *stash_cf_party_wrap, |
86 | *stash_cf_party_wrap, |
87 | *stash_cf_region_wrap, |
87 | *stash_cf_region_wrap, |
88 | *stash_cf_living_wrap, |
88 | *stash_cf_living_wrap, |
|
|
89 | *stash_cf_layout_wrap, |
89 | *stash_ext_map_world; |
90 | *stash_ext_map_world; |
90 | |
91 | |
91 | static SV |
92 | static SV |
92 | *cv_cf_do_invoke, |
93 | *cv_cf_do_invoke, |
93 | *cv_cf__can_merge, |
94 | *cv_cf__can_merge, |
… | |
… | |
539 | static inline SV *to_sv (archetype * v) { return newSVattachable (v, stash_cf_arch_wrap); } |
540 | static inline SV *to_sv (archetype * v) { return newSVattachable (v, stash_cf_arch_wrap); } |
540 | static inline SV *to_sv (region * v) { return newSVattachable (v, stash_cf_region_wrap); } |
541 | static inline SV *to_sv (region * v) { return newSVattachable (v, stash_cf_region_wrap); } |
541 | static inline SV *to_sv (partylist * v) { return newSVptr (v, stash_cf_party_wrap); } |
542 | static inline SV *to_sv (partylist * v) { return newSVptr (v, stash_cf_party_wrap); } |
542 | static inline SV *to_sv (living * v) { return newSVptr (v, stash_cf_living_wrap); } |
543 | static inline SV *to_sv (living * v) { return newSVptr (v, stash_cf_living_wrap); } |
543 | static inline SV *to_sv (mapspace * v) { return newSVptr (v, stash_cf_mapspace_wrap); } |
544 | static inline SV *to_sv (mapspace * v) { return newSVptr (v, stash_cf_mapspace_wrap); } |
|
|
545 | static inline SV *to_sv (layout * v) { return newSVptr (v, stash_cf_layout_wrap); } |
544 | |
546 | |
545 | static inline SV *to_sv (object & v) { return to_sv (&v); } |
547 | static inline SV *to_sv (object & v) { return to_sv (&v); } |
546 | static inline SV *to_sv (living & v) { return to_sv (&v); } |
548 | static inline SV *to_sv (living & v) { return to_sv (&v); } |
547 | |
549 | |
548 | static inline SV *to_sv (const std::string & v) { return newSVpvn (v.data (), v.size ()); } |
550 | static inline SV *to_sv (const std::string & v) { return newSVpvn (v.data (), v.size ()); } |
… | |
… | |
594 | static inline void sv_to (SV *sv, region * &v) { v = (region *) (attachable *)SvPTR_ornull (sv, "cf::region"); } |
596 | static inline void sv_to (SV *sv, region * &v) { v = (region *) (attachable *)SvPTR_ornull (sv, "cf::region"); } |
595 | static inline void sv_to (SV *sv, attachable * &v) { v = (attachable *)SvPTR_ornull (sv, "cf::attachable"); } |
597 | static inline void sv_to (SV *sv, attachable * &v) { v = (attachable *)SvPTR_ornull (sv, "cf::attachable"); } |
596 | static inline void sv_to (SV *sv, partylist * &v) { v = (partylist *) SvPTR_ornull (sv, "cf::party"); } |
598 | static inline void sv_to (SV *sv, partylist * &v) { v = (partylist *) SvPTR_ornull (sv, "cf::party"); } |
597 | static inline void sv_to (SV *sv, living * &v) { v = (living *) SvPTR_ornull (sv, "cf::living"); } |
599 | static inline void sv_to (SV *sv, living * &v) { v = (living *) SvPTR_ornull (sv, "cf::living"); } |
598 | static inline void sv_to (SV *sv, mapspace * &v) { v = (mapspace *) SvPTR_ornull (sv, "cf::mapspace"); } |
600 | static inline void sv_to (SV *sv, mapspace * &v) { v = (mapspace *) SvPTR_ornull (sv, "cf::mapspace"); } |
|
|
601 | static inline void sv_to (SV *sv, layout * &v) { v = (layout *) SvPTR_ornull (sv, "cf::layout"); } |
599 | static inline void sv_to (SV *sv, object_freezer * &v) { v = (object_freezer *) SvPTR_ornull (sv, "cf::object::freezer"); } |
602 | static inline void sv_to (SV *sv, object_freezer * &v) { v = (object_freezer *) SvPTR_ornull (sv, "cf::object::freezer"); } |
600 | static inline void sv_to (SV *sv, object_thawer * &v) { v = (object_thawer *) SvPTR_ornull (sv, "cf::object::thawer" ); } |
603 | static inline void sv_to (SV *sv, object_thawer * &v) { v = (object_thawer *) SvPTR_ornull (sv, "cf::object::thawer" ); } |
601 | |
604 | |
602 | //static inline void sv_to (SV *sv, faceinfo * &v) { v = &faces [face_find (SvPV_nolen (sv), 0)]; } |
605 | //static inline void sv_to (SV *sv, faceinfo * &v) { v = &faces [face_find (SvPV_nolen (sv), 0)]; } |
603 | static inline void sv_to (SV *sv, treasurelist * &v) { v = treasurelist::find (SvPV_nolen (sv)); } |
606 | static inline void sv_to (SV *sv, treasurelist * &v) { v = treasurelist::find (SvPV_nolen (sv)); } |
… | |
… | |
1397 | stash_cf_client_wrap = gv_stashpv ("cf::client::wrap", 1); |
1400 | stash_cf_client_wrap = gv_stashpv ("cf::client::wrap", 1); |
1398 | stash_cf_arch_wrap = gv_stashpv ("cf::arch::wrap" , 1); |
1401 | stash_cf_arch_wrap = gv_stashpv ("cf::arch::wrap" , 1); |
1399 | stash_cf_party_wrap = gv_stashpv ("cf::party::wrap" , 1); |
1402 | stash_cf_party_wrap = gv_stashpv ("cf::party::wrap" , 1); |
1400 | stash_cf_region_wrap = gv_stashpv ("cf::region::wrap", 1); |
1403 | stash_cf_region_wrap = gv_stashpv ("cf::region::wrap", 1); |
1401 | stash_cf_living_wrap = gv_stashpv ("cf::living::wrap", 1); |
1404 | stash_cf_living_wrap = gv_stashpv ("cf::living::wrap", 1); |
|
|
1405 | stash_cf_layout_wrap = gv_stashpv ("cf::layout::wrap", 1); |
1402 | stash_ext_map_world = gv_stashpv ("ext::map_world" , 1); |
1406 | stash_ext_map_world = gv_stashpv ("ext::map_world" , 1); |
1403 | |
1407 | |
1404 | sv_now = get_sv ("cf::NOW" , 1); SvUPGRADE (sv_now , SVt_NV); |
1408 | sv_now = get_sv ("cf::NOW" , 1); SvUPGRADE (sv_now , SVt_NV); |
1405 | sv_runtime = get_sv ("cf::RUNTIME" , 1); SvUPGRADE (sv_runtime , SVt_NV); |
1409 | sv_runtime = get_sv ("cf::RUNTIME" , 1); SvUPGRADE (sv_runtime , SVt_NV); |
1406 | sv_tick_start = get_sv ("cf::TICK_START", 1); SvUPGRADE (sv_tick_start, SVt_NV); |
1410 | sv_tick_start = get_sv ("cf::TICK_START", 1); SvUPGRADE (sv_tick_start, SVt_NV); |
… | |
… | |
2534 | } |
2538 | } |
2535 | OUTPUT: RETVAL |
2539 | OUTPUT: RETVAL |
2536 | |
2540 | |
2537 | # worst xs function of my life |
2541 | # worst xs function of my life |
2538 | bool |
2542 | bool |
2539 | _create_random_map (\ |
2543 | _create_random_map (maptile *self, SV *options) |
2540 | maptile *self,\ |
|
|
2541 | SV *options,\ |
|
|
2542 | val64 total_map_hp,\ |
|
|
2543 | region *region\ |
|
|
2544 | ) |
|
|
2545 | CODE: |
2544 | CODE: |
2546 | { |
2545 | { |
2547 | random_map_params rmp; |
2546 | random_map_params rmp ((HV *)SvRV (options)); |
2548 | |
|
|
2549 | rmp.hv = (HV *)SvREFCNT_inc_NN (SvRV (options)); |
|
|
2550 | |
|
|
2551 | assign (rmp.wall_name , rmp.get_str ("wall_name")); |
|
|
2552 | assign (rmp.monsterstyle , rmp.get_str ("monsterstyle")); |
|
|
2553 | assign (rmp.layoutstyle , rmp.get_str ("layoutstyle")); |
|
|
2554 | assign (rmp.doorstyle , rmp.get_str ("doorstyle")); |
|
|
2555 | assign (rmp.exit_on_final_map, rmp.get_str ("exit_on_final_map")); |
|
|
2556 | |
|
|
2557 | rmp.origin_map = rmp.get_str ("origin_map"); |
|
|
2558 | rmp.origin_x = rmp.get_iv ("origin_x"); |
|
|
2559 | rmp.origin_y = rmp.get_iv ("origin_y"); |
|
|
2560 | rmp.final_map = rmp.get_str ("final_map"); |
|
|
2561 | rmp.this_map = rmp.get_str ("this_map"); |
|
|
2562 | rmp.xsize = rmp.get_iv ("xsize"); |
|
|
2563 | rmp.ysize = rmp.get_iv ("ysize"); |
|
|
2564 | rmp.expand2x = rmp.get_iv ("expand2x"); |
|
|
2565 | rmp.layoutoptions1 = rmp.get_iv ("layoutoptions1"); |
|
|
2566 | rmp.layoutoptions2 = rmp.get_iv ("layoutoptions2"); |
|
|
2567 | rmp.layoutoptions3 = rmp.get_iv ("layoutoptions3"); |
|
|
2568 | rmp.symmetry = rmp.get_iv ("symmetry"); |
|
|
2569 | rmp.difficulty = rmp.get_iv ("difficulty"); |
|
|
2570 | rmp.difficulty_given = rmp.get_iv ("difficulty_given"); |
|
|
2571 | rmp.difficulty_increase = rmp.get_nv ("difficulty_increase"); |
|
|
2572 | rmp.dungeon_level = rmp.get_iv ("dungeon_level"); |
|
|
2573 | rmp.dungeon_depth = rmp.get_iv ("dungeon_depth"); |
|
|
2574 | rmp.orientation = rmp.get_iv ("orientation"); |
|
|
2575 | rmp.random_seed = rmp.get_uv ("random_seed"); |
|
|
2576 | rmp.total_map_hp = (uint64_t)total_map_hp; |
|
|
2577 | rmp.map_layout_style = rmp.get_iv ("map_layout_style"); |
|
|
2578 | rmp.symmetry_used = rmp.get_iv ("symmetry_used"); |
|
|
2579 | rmp.region = region; |
|
|
2580 | |
|
|
2581 | RETVAL = self->generate_random_map (&rmp); |
2547 | RETVAL = self->generate_random_map (&rmp); |
2582 | } |
2548 | } |
2583 | OUTPUT: |
2549 | OUTPUT: |
2584 | RETVAL |
2550 | RETVAL |
2585 | |
2551 | |
… | |
… | |
2919 | XPUSHs (sv_2mortal (newSVpv_utf8 (self->get_str ()))); |
2885 | XPUSHs (sv_2mortal (newSVpv_utf8 (self->get_str ()))); |
2920 | |
2886 | |
2921 | self->skip (); |
2887 | self->skip (); |
2922 | } |
2888 | } |
2923 | |
2889 | |
|
|
2890 | MODULE = cf PACKAGE = cf::layout |
|
|
2891 | |
|
|
2892 | INCLUDE: $PERL $srcdir/genacc layout $srcdir/../random_maps/random_map.h | |
|
|
2893 | |