diff --git a/src/classes/creatlist.cpp b/src/classes/creatlist.cpp index 38fe18d6..73d31658 100644 --- a/src/classes/creatlist.cpp +++ b/src/classes/creatlist.cpp @@ -15,10 +15,10 @@ #include "oldstructs.hpp" -void cPopulation::append(legacy::creature_list_type old){ +void cPopulation::import_legacy(legacy::creature_list_type old){ dudes.resize(60); for(int i = 0; i < 60; i++) - dudes[i].append(old.dudes[i]); + dudes[i].import_legacy(old.dudes[i]); which_town = old.which_town; hostile = old.hostile; } diff --git a/src/classes/creatlist.hpp b/src/classes/creatlist.hpp index f6f4a56e..51f3a2ab 100644 --- a/src/classes/creatlist.hpp +++ b/src/classes/creatlist.hpp @@ -24,7 +24,7 @@ public: short which_town; bool hostile; - void append(legacy::creature_list_type old); + void import_legacy(legacy::creature_list_type old); void init(size_t n); void assign(size_t n, const cTownperson& other, const cMonster& base, bool easy, int difficulty_adjust); void readFrom(std::istream& in, size_t n); diff --git a/src/classes/creature.cpp b/src/classes/creature.cpp index 03d88903..dfbd803e 100644 --- a/src/classes/creature.cpp +++ b/src/classes/creature.cpp @@ -29,13 +29,13 @@ cCreature::cCreature(int num) : cCreature() { number = num; } -void cCreature::append(legacy::creature_data_type old){ +void cCreature::import_legacy(legacy::creature_data_type old){ active = old.active; attitude = eAttitude(old.attitude); number = old.number; cur_loc.x = old.m_loc.x; cur_loc.y = old.m_loc.y; - cMonster::append(old.m_d); + cMonster::import_legacy(old.m_d); mobility = old.mobile; summon_time = old.summoned; if(summon_time >= 100) { diff --git a/src/classes/creature.hpp b/src/classes/creature.hpp index 842cdd7e..e15ba385 100644 --- a/src/classes/creature.hpp +++ b/src/classes/creature.hpp @@ -69,7 +69,7 @@ public: void killed_msg(); bool on_space(location loc) const; - void append(legacy::creature_data_type old); + void import_legacy(legacy::creature_data_type old); void writeTo(std::ostream& file) const; void readFrom(std::istream& file); }; diff --git a/src/classes/item.cpp b/src/classes/item.cpp index 5c76e741..a3a9aa4a 100644 --- a/src/classes/item.cpp +++ b/src/classes/item.cpp @@ -384,7 +384,7 @@ void cItem::enchant_weapon(eEnchant enchant_type,short new_val) { full_name = store_name; } -void cItem::append(legacy::item_record_type& old){ +void cItem::import_legacy(legacy::item_record_type& old){ variety = (eItemType) old.variety; item_level = old.item_level; awkward = old.awkward; diff --git a/src/classes/item.hpp b/src/classes/item.hpp index 909e6d4c..07e5e72f 100644 --- a/src/classes/item.hpp +++ b/src/classes/item.hpp @@ -53,7 +53,7 @@ public: cItem(); explicit cItem(long preset); explicit cItem(eAlchemy recipe); - void append(legacy::item_record_type& old); + void import_legacy(legacy::item_record_type& old); void writeTo(std::ostream& file, std::string prefix = "") const; void readFrom(std::istream& sin); }; diff --git a/src/classes/monster.cpp b/src/classes/monster.cpp index 7b3a9c2c..1f820b90 100644 --- a/src/classes/monster.cpp +++ b/src/classes/monster.cpp @@ -20,7 +20,7 @@ #include "fileio.hpp" #include "spell.hpp" -void cMonster::append(legacy::monster_record_type& old){ +void cMonster::import_legacy(legacy::monster_record_type& old){ level = old.level; m_name = std::string((char*) old.m_name, 26); m_name.erase(m_name.begin() + m_name.find_first_of('\0'), m_name.end()); @@ -437,7 +437,7 @@ cTownperson::cTownperson(location loc, mon_num_t num, const cMonster& monst) : c facial_pic = monst.default_facial_pic; } -void cTownperson::append(legacy::creature_start_type old){ +void cTownperson::import_legacy(legacy::creature_start_type old){ number = old.number; start_attitude = eAttitude(old.start_attitude); start_loc.x = old.start_loc.x; diff --git a/src/classes/monster.hpp b/src/classes/monster.hpp index 928d45f1..6d8e82c2 100644 --- a/src/classes/monster.hpp +++ b/src/classes/monster.hpp @@ -123,7 +123,7 @@ public: std::map::iterator addAbil(eMonstAbilTemplate what, int param = 0); int addAttack(unsigned short dice, unsigned short sides, eMonstMelee type = eMonstMelee::SWING); - void append(legacy::monster_record_type& old); + void import_legacy(legacy::monster_record_type& old); cMonster(); void writeTo(std::ostream& file) const; void readFrom(std::istream& file); @@ -142,7 +142,7 @@ public: short special_on_kill, special_on_talk; pic_num_t facial_pic; - void append(legacy::creature_start_type old); + void import_legacy(legacy::creature_start_type old); cTownperson(); cTownperson(location loc, mon_num_t num, const cMonster& monst); }; diff --git a/src/classes/outdoors.cpp b/src/classes/outdoors.cpp index c3a95caa..a977d664 100644 --- a/src/classes/outdoors.cpp +++ b/src/classes/outdoors.cpp @@ -17,7 +17,7 @@ #include "oldstructs.hpp" #include "scenario.hpp" -void cOutdoors::append(legacy::outdoor_record_type& old){ +void cOutdoors::import_legacy(legacy::outdoor_record_type& old){ ambient_sound = AMBIENT_NONE; // Collect a list of unused special nodes, to be used for fixing specials that could be triggered in a boat. std::vector unused_special_slots; @@ -90,14 +90,14 @@ void cOutdoors::append(legacy::outdoor_record_type& old){ info_rect[i].right = old.info_rect[i].right; } for(short i = 0; i < 4; i++){ - wandering[i].append(old.wandering[i]); - special_enc[i].append(old.special_enc[i]); + wandering[i].import_legacy(old.wandering[i]); + special_enc[i].import_legacy(old.special_enc[i]); wandering_locs[i].x = old.wandering_locs[i].x; wandering_locs[i].y = old.wandering_locs[i].y; } specials.resize(60); for(short i = 0; i < 60; i++) - specials[i].append(old.specials[i]); + specials[i].import_legacy(old.specials[i]); } cOutdoors::cWandering::cWandering() { @@ -126,7 +126,7 @@ cOutdoors::cOutdoors(cScenario& scenario) : scenario(&scenario) { comment = "Comment"; } -void cOutdoors::cWandering::append(legacy::out_wandering_type old){ +void cOutdoors::cWandering::import_legacy(legacy::out_wandering_type old){ for(int i = 0; i < 7; i++) monst[i] = old.monst[i]; for(int j = 0; j < 3; j++) @@ -140,10 +140,10 @@ void cOutdoors::cWandering::append(legacy::out_wandering_type old){ end_spec2 = old.end_spec2; } -void cOutdoors::cCreature::append(legacy::outdoor_creature_type old){ +void cOutdoors::cCreature::import_legacy(legacy::outdoor_creature_type old){ exists = old.exists; direction = old.direction; - what_monst.append(old.what_monst); + what_monst.import_legacy(old.what_monst); which_sector.x = old.which_sector.x; which_sector.y = old.which_sector.y; m_loc.x = old.m_loc.x; diff --git a/src/classes/outdoors.hpp b/src/classes/outdoors.hpp index a780d445..46dea8dc 100644 --- a/src/classes/outdoors.hpp +++ b/src/classes/outdoors.hpp @@ -45,7 +45,7 @@ public: bool cant_flee, forced; bool isNull(); - void append(legacy::out_wandering_type old); + void import_legacy(legacy::out_wandering_type old); void writeTo(std::ostream& file, std::string prefix = "") const; void readFrom(std::istream& sin); cWandering(); @@ -57,7 +57,7 @@ public: cWandering what_monst; location which_sector,m_loc,home_sector; // home_sector is the sector it was spawned in - void append(legacy::outdoor_creature_type old); + void import_legacy(legacy::outdoor_creature_type old); }; short x,y; // Used while loading legacy scenarios. ter_num_t terrain[48][48]; @@ -82,7 +82,7 @@ public: std::array, 48> maps; explicit cOutdoors(cScenario& scenario); - void append(legacy::outdoor_record_type& old); + void import_legacy(legacy::outdoor_record_type& old); void reattach(cScenario& to); }; diff --git a/src/classes/party.cpp b/src/classes/party.cpp index 6dff0a79..e1b5c37a 100644 --- a/src/classes/party.cpp +++ b/src/classes/party.cpp @@ -53,7 +53,7 @@ cParty::~cParty() { } } -void cParty::append(legacy::party_record_type& old, cUniverse& univ){ +void cParty::import_legacy(legacy::party_record_type& old, cUniverse& univ){ age = old.age; gold = old.gold; food = old.food; @@ -83,8 +83,8 @@ void cParty::append(legacy::party_record_type& old, cUniverse& univ){ } party_event_timers.reserve(30); for(short i = 0; i < 30; i++){ - boats[i].append(old.boats[i]); - horses[i].append(old.horses[i]); + boats[i].import_legacy(old.boats[i]); + horses[i].import_legacy(old.horses[i]); cTimer t; t.time = old.party_event_timers[i]; t.node_type = old.global_or_town[i]; @@ -92,15 +92,15 @@ void cParty::append(legacy::party_record_type& old, cUniverse& univ){ party_event_timers.push_back(t); } for(short i = 0; i < 4; i++){ - creature_save[i].append(old.creature_save[i]); + creature_save[i].import_legacy(old.creature_save[i]); imprisoned_monst[i] = old.imprisoned_monst[i]; } in_boat = old.in_boat; in_horse = old.in_horse; for(short i = 0; i < 10; i++){ - out_c[i].append(old.out_c[i]); + out_c[i].import_legacy(old.out_c[i]); for(short j = 0; j < 5; j++) - magic_store_items[j][i].append(old.magic_store_items[j][i]); + magic_store_items[j][i].import_legacy(old.magic_store_items[j][i]); } for(short i = 0; i < 256; i++) if(old.m_seen[i]) @@ -110,13 +110,13 @@ void cParty::append(legacy::party_record_type& old, cUniverse& univ){ for(short i = 0; i < 140; i++){ if(old.special_notes_str[i][0] <= 0) continue; cEncNote n; - n.append(old.special_notes_str[i], univ.scenario); + n.import_legacy(old.special_notes_str[i], univ.scenario); special_notes.push_back(n); } talk_save.reserve(120); for(short i = 0; i < 120; i++){ cConvers t; - t.append(old.talk_save[i], univ.scenario); + t.import_legacy(old.talk_save[i], univ.scenario); talk_save.push_back(t); } } @@ -139,20 +139,20 @@ void cParty::append(legacy::party_record_type& old, cUniverse& univ){ scen_name = old.scen_name; } -void cParty::append(legacy::stored_items_list_type& old,short which_list){ +void cParty::import_legacy(legacy::stored_items_list_type& old,short which_list){ stored_items[which_list].resize(115); for(int i = 0; i < 115; i++) - stored_items[which_list][i].append(old.items[i]); + stored_items[which_list][i].import_legacy(old.items[i]); } -void cParty::append(legacy::setup_save_type& old){ +void cParty::import_legacy(legacy::setup_save_type& old){ for(int n = 0; n < 4; n++) for(int i = 0; i < 64; i++) for(int j = 0; j < 64; j++) setup[n][i][j] = old.setup[n][i][j]; } -void cParty::cConvers::append(legacy::talk_save_type old, const cScenario& scenario){ +void cParty::cConvers::import_legacy(legacy::talk_save_type old, const cScenario& scenario){ who_said = scenario.towns[old.personality / 10]->talking.people[old.personality % 10].title; in_town = scenario.towns[old.town_num]->town_name; int strnums[2] = {old.str1, old.str2}; @@ -185,7 +185,7 @@ void cParty::cConvers::append(legacy::talk_save_type old, const cScenario& scena } } -void cParty::cEncNote::append(int16_t(& old)[2], const cScenario& scenario) { +void cParty::cEncNote::import_legacy(int16_t(& old)[2], const cScenario& scenario) { in_scen = scenario.scen_name; // TODO: Need to verify that I have the correct offsets here. switch(old[0] / 1000) { @@ -207,11 +207,11 @@ void cParty::cEncNote::append(int16_t(& old)[2], const cScenario& scenario) { } } -void cParty::append(legacy::pc_record_type(& old)[6]) { +void cParty::import_legacy(legacy::pc_record_type(& old)[6]) { for(int i = 0; i < 6; i++) { delete adven[i]; adven[i] = new cPlayer(*this); - adven[i]->append(old[i]); + adven[i]->import_legacy(old[i]); } } diff --git a/src/classes/party.hpp b/src/classes/party.hpp index 11aad307..85c60933 100644 --- a/src/classes/party.hpp +++ b/src/classes/party.hpp @@ -55,7 +55,7 @@ public: bool filled = false; std::string who_said, in_town, the_str1, the_str2, in_scen; - void append(legacy::talk_save_type old, const cScenario& scenario); + void import_legacy(legacy::talk_save_type old, const cScenario& scenario); }; class cJournal { public: @@ -67,7 +67,7 @@ public: eEncNoteType type; std::string the_str, where, in_scen; - void append(int16_t(& old)[2], const cScenario& scenario); + void import_legacy(int16_t(& old)[2], const cScenario& scenario); }; // formerly party_record_type // TODO: Should we make age a long long? @@ -136,11 +136,11 @@ public: void clear_ptr(unsigned short p); unsigned char get_ptr(unsigned short p); - void append(legacy::party_record_type& old, cUniverse& univ); - void append(legacy::big_tr_type& old); - void append(legacy::stored_items_list_type& old,short which_list); - void append(legacy::setup_save_type& old); - void append(legacy::pc_record_type(& old)[6]); + void import_legacy(legacy::party_record_type& old, cUniverse& univ); + void import_legacy(legacy::big_tr_type& old); + void import_legacy(legacy::stored_items_list_type& old,short which_list); + void import_legacy(legacy::setup_save_type& old); + void import_legacy(legacy::pc_record_type(& old)[6]); bool is_alive() const; bool is_friendly() const; diff --git a/src/classes/pc.cpp b/src/classes/pc.cpp index e060f938..72d147d6 100644 --- a/src/classes/pc.cpp +++ b/src/classes/pc.cpp @@ -24,7 +24,7 @@ extern std::map excluding_types; extern short skill_bonus[21]; -void cPlayer::append(legacy::pc_record_type old){ +void cPlayer::import_legacy(legacy::pc_record_type old){ main_status = (eMainStatus) old.main_status; name = old.name; for(short i = 0; i < 19; i++) { @@ -45,7 +45,7 @@ void cPlayer::append(legacy::pc_record_type old){ traits[trait] = old.traits[i]; } for(short i = 0; i < 24; i++){ - items[i].append(old.items[i]); + items[i].import_legacy(old.items[i]); equip[i] = old.equip[i]; } for(short i = 0; i < 62; i++){ diff --git a/src/classes/pc.hpp b/src/classes/pc.hpp index 15ed303b..e37e0346 100644 --- a/src/classes/pc.hpp +++ b/src/classes/pc.hpp @@ -114,7 +114,7 @@ public: void join_party(cParty& p) {party = &p;} cPlayer* leave_party() {party = nullptr; return this;} - void append(legacy::pc_record_type old); + void import_legacy(legacy::pc_record_type old); cPlayer(cParty& party); cPlayer(cParty& party,long key,short slot); short get_tnl(); diff --git a/src/classes/regtown.cpp b/src/classes/regtown.cpp index 3d72de64..33e42ffa 100644 --- a/src/classes/regtown.cpp +++ b/src/classes/regtown.cpp @@ -18,7 +18,7 @@ #include "oldstructs.hpp" #include "fileio.hpp" -void cTinyTown::append(legacy::tiny_tr_type& old, int){ +void cTinyTown::import_legacy(legacy::tiny_tr_type& old, int){ cField the_field, the_road; the_field.type = SPECIAL_SPOT; the_road.type = SPECIAL_ROAD; @@ -113,11 +113,11 @@ void cTinyTown::append(legacy::tiny_tr_type& old, int){ } creatures.resize(30); for(short i = 0; i < 30; i++) { - creatures[i].append(old.creatures[i]); + creatures[i].import_legacy(old.creatures[i]); } } -void cMedTown::append(legacy::ave_tr_type& old, int){ +void cMedTown::import_legacy(legacy::ave_tr_type& old, int){ cField the_field, the_road; the_field.type = SPECIAL_SPOT; the_road.type = SPECIAL_ROAD; @@ -212,11 +212,11 @@ void cMedTown::append(legacy::ave_tr_type& old, int){ } creatures.resize(40); for(short i = 0; i < 40; i++) { - creatures[i].append(old.creatures[i]); + creatures[i].import_legacy(old.creatures[i]); } } -void cBigTown::append(legacy::big_tr_type& old, int){ +void cBigTown::import_legacy(legacy::big_tr_type& old, int){ cField the_field, the_road; the_field.type = SPECIAL_SPOT; the_road.type = SPECIAL_ROAD; @@ -311,7 +311,7 @@ void cBigTown::append(legacy::big_tr_type& old, int){ } creatures.resize(60); for(short i = 0; i < 60; i++) { - creatures[i].append(old.creatures[i]); + creatures[i].import_legacy(old.creatures[i]); } } diff --git a/src/classes/regtown.hpp b/src/classes/regtown.hpp index 5f9c54a0..47910e9b 100644 --- a/src/classes/regtown.hpp +++ b/src/classes/regtown.hpp @@ -26,7 +26,7 @@ class cBigTown : public virtual cTown { // formerly big_tr_type ter_num_t ter[64][64]; unsigned char light[8][64]; public: - void append(legacy::big_tr_type& old, int town_num); + void import_legacy(legacy::big_tr_type& old, int town_num); ter_num_t& terrain(size_t x, size_t y); unsigned char& lighting(size_t i, size_t r); size_t max_dim() const; @@ -40,7 +40,7 @@ class cMedTown : public virtual cTown { // formerly ave_tr_type ter_num_t ter[48][48]; unsigned char light[6][48]; public: - void append(legacy::ave_tr_type& old, int town_num); + void import_legacy(legacy::ave_tr_type& old, int town_num); ter_num_t& terrain(size_t x, size_t y); unsigned char& lighting(size_t i, size_t r); size_t max_dim() const; @@ -54,7 +54,7 @@ class cTinyTown : public virtual cTown { // formerly tiny_tr_type ter_num_t ter[32][32]; unsigned char light[4][32]; public: - void append(legacy::tiny_tr_type& old, int town_num); + void import_legacy(legacy::tiny_tr_type& old, int town_num); ter_num_t& terrain(size_t x, size_t y); unsigned char& lighting(size_t i, size_t r); size_t max_dim() const; diff --git a/src/classes/scenario.cpp b/src/classes/scenario.cpp index d9afdd30..bc9d2852 100644 --- a/src/classes/scenario.cpp +++ b/src/classes/scenario.cpp @@ -100,7 +100,7 @@ cScenario::cItemStorage::cItemStorage() : ter_type(-1), property(0) { item_odds[i] = 0; } -void cScenario::append(legacy::scenario_data_type& old){ +void cScenario::import_legacy(legacy::scenario_data_type& old){ is_legacy = true; difficulty = old.difficulty; intro_pic = old.intro_pic; @@ -136,17 +136,17 @@ void cScenario::append(legacy::scenario_data_type& old){ // TODO: Is this used anywhere? uses_custom_graphics = old.uses_custom_graphics; for(short i = 0; i < 30; i++) { - boats[i].append(old.scen_boats[i]); - horses[i].append(old.scen_horses[i]); + boats[i].import_legacy(old.scen_boats[i]); + horses[i].import_legacy(old.scen_horses[i]); } ter_types.resize(256); scen_specials.resize(256); scen_monsters.resize(256); for(short i = 0; i < 256; i++){ ter_types[i].i = i; - ter_types[i].append(old.ter_types[i]); - scen_monsters[i].append(old.scen_monsters[i]); - scen_specials[i].append(old.scen_specials[i]); + ter_types[i].import_legacy(old.ter_types[i]); + scen_monsters[i].import_legacy(old.scen_monsters[i]); + scen_specials[i].import_legacy(old.scen_specials[i]); } for(short i = 0; i < 20; i++) { scenario_timers[i].time = old.scenario_timer_times[i]; @@ -166,10 +166,10 @@ cScenario::cItemStorage& cScenario::cItemStorage::operator = (legacy::item_stora return *this; } -void cScenario::append(legacy::scen_item_data_type& old){ +void cScenario::import_legacy(legacy::scen_item_data_type& old){ scen_items.resize(400); for(short i = 0; i < 400; i++) - scen_items[i].append(old.scen_items[i]); + scen_items[i].import_legacy(old.scen_items[i]); for(short i = 0; i < 256; i++) { scen_monsters[i].m_name = old.monst_names[i]; if(scen_monsters[i].m_type == eRace::UNDEAD && scen_monsters[i].m_name.find("Skeleton") != std::string::npos) diff --git a/src/classes/scenario.hpp b/src/classes/scenario.hpp index 3fe79907..9d999d9d 100644 --- a/src/classes/scenario.hpp +++ b/src/classes/scenario.hpp @@ -102,8 +102,8 @@ public: std::vector towns; template void addTown() {towns.push_back(new Town(*this));} - void append(legacy::scenario_data_type& old); - void append(legacy::scen_item_data_type& old); + void import_legacy(legacy::scenario_data_type& old); + void import_legacy(legacy::scen_item_data_type& old); void writeTo(std::ostream& file) const; std::string format_scen_version(); std::string format_ed_version(); diff --git a/src/classes/special.cpp b/src/classes/special.cpp index 153d5808..4c13574e 100644 --- a/src/classes/special.cpp +++ b/src/classes/special.cpp @@ -45,7 +45,7 @@ void cSpecial::writeTo(std::ostream& file, int n) const { file << "\tgoto " << jumpto << '\n'; } -void cSpecial::append(legacy::special_node_type& old){ +void cSpecial::import_legacy(legacy::special_node_type& old){ sd1 = old.sd1; sd2 = old.sd2; pic = old.pic; diff --git a/src/classes/special.hpp b/src/classes/special.hpp index ba7fb649..b3d0e2bc 100644 --- a/src/classes/special.hpp +++ b/src/classes/special.hpp @@ -36,7 +36,7 @@ public: short jumpto; cSpecial(); - void append(legacy::special_node_type& old); + void import_legacy(legacy::special_node_type& old); void writeTo(std::ostream& file, int n) const; }; diff --git a/src/classes/talking.cpp b/src/classes/talking.cpp index 0b02adcc..6b7ad189 100644 --- a/src/classes/talking.cpp +++ b/src/classes/talking.cpp @@ -15,7 +15,7 @@ #include "oldstructs.hpp" -void cSpeech::append(legacy::talking_record_type& old, std::vector& shops){ +void cSpeech::import_legacy(legacy::talking_record_type& old, std::vector& shops){ talk_nodes.resize(60); for(short i = 0; i < 60; i++){ talk_nodes[i].personality = old.talk_nodes[i].personality; diff --git a/src/classes/talking.hpp b/src/classes/talking.hpp index ae65cdc2..6749981c 100644 --- a/src/classes/talking.hpp +++ b/src/classes/talking.hpp @@ -50,7 +50,7 @@ public: std::array people; std::vector talk_nodes; - void append(legacy::talking_record_type& old, std::vector& shops); + void import_legacy(legacy::talking_record_type& old, std::vector& shops); void writeTo(std::ostream& file) const; }; diff --git a/src/classes/terrain.cpp b/src/classes/terrain.cpp index 686c7e13..c3f12115 100644 --- a/src/classes/terrain.cpp +++ b/src/classes/terrain.cpp @@ -17,7 +17,7 @@ #include "graphtool.hpp" // for NO_PIC #include "boe.consts.hpp" // TODO: Put these constants in a global file -void cTerrain::append(legacy::terrain_type_type& old){ +void cTerrain::import_legacy(legacy::terrain_type_type& old){ static const std::set archetypes = { // This lists graphics that represent the archetypal terrains for each ground type // One line per graphics sheet; last line is the animated sheet diff --git a/src/classes/terrain.hpp b/src/classes/terrain.hpp index beaf30ec..231ded22 100644 --- a/src/classes/terrain.hpp +++ b/src/classes/terrain.hpp @@ -46,7 +46,7 @@ public: pic_num_t map_pic = -1; unsigned short i; // for temporary use in porting - void append(legacy::terrain_type_type& old); + void import_legacy(legacy::terrain_type_type& old); void writeTo(std::ostream& file) const; }; diff --git a/src/classes/town.cpp b/src/classes/town.cpp index c6332944..bf9e2d95 100644 --- a/src/classes/town.cpp +++ b/src/classes/town.cpp @@ -17,11 +17,11 @@ #include "oldstructs.hpp" #include "mathutil.hpp" -void cTown::append(legacy::big_tr_type&, int){} -void cTown::append(legacy::ave_tr_type&, int){} -void cTown::append(legacy::tiny_tr_type&, int){} +void cTown::import_legacy(legacy::big_tr_type&, int){} +void cTown::import_legacy(legacy::ave_tr_type&, int){} +void cTown::import_legacy(legacy::tiny_tr_type&, int){} -void cTown::append(legacy::town_record_type& old){ +void cTown::import_legacy(legacy::town_record_type& old){ town_chop_time = old.town_chop_time; town_chop_key = old.town_chop_key; for(short i = 0; i < 4; i++){ @@ -30,7 +30,7 @@ void cTown::append(legacy::town_record_type& old){ exits[i].x = old.exit_locs[i].x; exits[i].y = old.exit_locs[i].y; exits[i].spec = old.exit_specs[i]; - wandering[i].append(old.wandering[i]); + wandering[i].import_legacy(old.wandering[i]); } preset_fields.clear(); preset_fields.reserve(50); @@ -42,7 +42,7 @@ void cTown::append(legacy::town_record_type& old){ special_locs[i].spec = -1; else special_locs[i].spec = old.spec_id[i]; cField temp; - temp.append(old.preset_fields[i]); + temp.import_legacy(old.preset_fields[i]); preset_fields.push_back(temp); } sign_locs.resize(15); @@ -57,7 +57,7 @@ void cTown::append(legacy::town_record_type& old){ in_town_rect.right = old.in_town_rect.right; preset_items.resize(64); for(short i = 0; i < 64; i++){ - preset_items[i].append(old.preset_items[i]); + preset_items[i].import_legacy(old.preset_items[i]); } max_num_monst = old.max_num_monst; spec_on_entry = old.spec_on_entry; @@ -69,7 +69,7 @@ void cTown::append(legacy::town_record_type& old){ } specials.resize(100); for(short i = 0; i < 100; i++) - specials[i].append(old.specials[i]); + specials[i].import_legacy(old.specials[i]); difficulty = old.difficulty; strong_barriers = defy_scrying = defy_mapping = false; } @@ -128,14 +128,14 @@ void cTown::init_start() { in_town_rect.right = s - 4; } -void cTown::cWandering::append(legacy::wandering_type old){ +void cTown::cWandering::import_legacy(legacy::wandering_type old){ monst[0] = old.monst[0]; monst[1] = old.monst[1]; monst[2] = old.monst[2]; monst[3] = old.monst[3]; } -void cTown::cItem::append(legacy::preset_item_type old){ +void cTown::cItem::import_legacy(legacy::preset_item_type old){ loc.x = old.item_loc.x; loc.y = old.item_loc.y; code = old.item_code; @@ -145,7 +145,7 @@ void cTown::cItem::append(legacy::preset_item_type old){ contained = old.contained; } -void cTown::cField::append(legacy::preset_field_type old){ +void cTown::cField::import_legacy(legacy::preset_field_type old){ loc.x = old.field_loc.x; loc.y = old.field_loc.y; switch(old.field_type) { diff --git a/src/classes/town.hpp b/src/classes/town.hpp index 2faa1656..828d13a0 100644 --- a/src/classes/town.hpp +++ b/src/classes/town.hpp @@ -41,7 +41,7 @@ public: std::array monst; bool isNull(); - void append(legacy::wandering_type old); + void import_legacy(legacy::wandering_type old); }; class cItem { // formerly preset_item_type public: @@ -50,7 +50,7 @@ public: int charges = -1; bool always_there = false, property = false, contained = false; - void append(legacy::preset_item_type old); + void import_legacy(legacy::preset_item_type old); cItem(); cItem(location loc, short num, ::cItem& item); }; @@ -59,7 +59,7 @@ public: location loc; eFieldType type; - void append(legacy::preset_field_type old); + void import_legacy(legacy::preset_field_type old); cField() : type(FIELD_DISPEL) {} cField(location l, eFieldType t) : loc(l), type(t) {} }; @@ -98,9 +98,9 @@ public: long m_killed; virtual ~cTown(){} - virtual void append(legacy::big_tr_type& old, int town_num); - virtual void append(legacy::ave_tr_type& old, int town_num); - virtual void append(legacy::tiny_tr_type& old, int town_num); + virtual void import_legacy(legacy::big_tr_type& old, int town_num); + virtual void import_legacy(legacy::ave_tr_type& old, int town_num); + virtual void import_legacy(legacy::tiny_tr_type& old, int town_num); virtual ter_num_t& terrain(size_t x, size_t y) = 0; virtual unsigned char& lighting(size_t i, size_t r) = 0; virtual size_t max_dim() const = 0; @@ -111,7 +111,7 @@ public: bool is_cleaned_out(); explicit cTown(cScenario& scenario); - void append(legacy::town_record_type& old); + void import_legacy(legacy::town_record_type& old); void reattach(cScenario& to); virtual void writeTerrainTo(std::ostream& file) = 0; virtual void readTerrainFrom(std::istream& file) = 0; diff --git a/src/classes/universe.cpp b/src/classes/universe.cpp index 29aa2bf2..8bc56294 100644 --- a/src/classes/universe.cpp +++ b/src/classes/universe.cpp @@ -19,26 +19,26 @@ #include "mathutil.hpp" #include "fileio.hpp" -void cCurOut::append(legacy::out_info_type& old){ +void cCurOut::import_legacy(legacy::out_info_type& old){ for(int i = 0; i < 96; i++) for(int j = 0; j < 96; j++) expl[i][j] = old.expl[i][j]; } -void cCurTown::append(legacy::current_town_type& old){ +void cCurTown::import_legacy(legacy::current_town_type& old){ univ.party.town_num = old.town_num; difficulty = old.difficulty; - record()->append(old.town); + record()->import_legacy(old.town); for(int i = 0; i < 64; i++) for(int j = 0; j < 64; j++) fields[i][j] = old.explored[i][j]; - monst.append(old.monst); + monst.import_legacy(old.monst); univ.party.town_loc.x = old.p_loc.x; univ.party.town_loc.y = old.p_loc.y; cur_talk_loaded = old.town_num; } -void cCurTown::append(legacy::big_tr_type& old){ +void cCurTown::import_legacy(legacy::big_tr_type& old){ for(short i = 0; i < record()->max_dim(); i++) for(short j = 0; j < record()->max_dim(); j++) record()->terrain(i,j) = old.terrain[i][j]; @@ -50,19 +50,19 @@ void cCurTown::append(legacy::big_tr_type& old){ } record()->creatures.resize(60); for(short i = 0; i < 60; i++) - record()->creatures[i].append(old.creatures[i]); + record()->creatures[i].import_legacy(old.creatures[i]); for(short i = 0; i < record()->max_dim() / 8; i++) for(short j = 0; j < record()->max_dim(); j++) record()->lighting(i,j) = old.lighting[i][j]; } -void cCurTown::append(legacy::town_item_list& old){ +void cCurTown::import_legacy(legacy::town_item_list& old){ items.resize(115); for(int i = 0; i < 115; i++) - items[i].append(old.items[i]); + items[i].import_legacy(old.items[i]); } -void cUniverse::append(legacy::stored_town_maps_type& old){ +void cUniverse::import_legacy(legacy::stored_town_maps_type& old){ for(int n = 0; n < 200; n++) for(int i = 0; i < 64; i++) for(int j = 0; j < 64; j++) @@ -73,7 +73,7 @@ static short onm(char x_sector,char y_sector, char w) { return y_sector * w + x_sector; } -void cUniverse::append(legacy::stored_outdoor_maps_type& old){ +void cUniverse::import_legacy(legacy::stored_outdoor_maps_type& old){ for(int x = 0; x < scenario.outdoors.width(); x++) for(int y = 0; y < scenario.outdoors.height(); y++) for(int i = 0; i < 48; i++) @@ -81,7 +81,7 @@ void cUniverse::append(legacy::stored_outdoor_maps_type& old){ scenario.outdoors[x][y]->maps[i][j] = old.outdoor_maps[onm(x,y,scenario.outdoors.width())][i / 8][j] & (1 << i % 8); } -void cCurTown::append(unsigned char(& old_sfx)[64][64], unsigned char(& old_misc_i)[64][64]){ +void cCurTown::import_legacy(unsigned char(& old_sfx)[64][64], unsigned char(& old_misc_i)[64][64]){ for(int i = 0; i < 64; i++) for(int j = 0; j < 64; j++){ unsigned long tmp_sfx, tmp_misc_i; diff --git a/src/classes/universe.hpp b/src/classes/universe.hpp index c3bdb4b0..c92159bc 100644 --- a/src/classes/universe.hpp +++ b/src/classes/universe.hpp @@ -50,10 +50,10 @@ public: unsigned long fields[64][64]; - void append(legacy::current_town_type& old); - void append(legacy::town_item_list& old); - void append(unsigned char(& old_sfx)[64][64], unsigned char(& old_misc_i)[64][64]); - void append(legacy::big_tr_type& old); + void import_legacy(legacy::current_town_type& old); + void import_legacy(legacy::town_item_list& old); + void import_legacy(unsigned char(& old_sfx)[64][64], unsigned char(& old_misc_i)[64][64]); + void import_legacy(legacy::big_tr_type& old); cTown* operator -> (); explicit cCurTown(cUniverse& univ); @@ -134,7 +134,7 @@ public: bool is_spot(int x, int y); bool is_road(int x, int y); - void append(legacy::out_info_type& old); + void import_legacy(legacy::out_info_type& old); typedef ter_num_t arr_96[96]; arr_96& operator [] (size_t i); @@ -181,8 +181,8 @@ public: bool debug_mode, ghost_mode, node_step_through; void clear_stored_pcs(); - void append(legacy::stored_town_maps_type& old); - void append(legacy::stored_outdoor_maps_type& old); + void import_legacy(legacy::stored_town_maps_type& old); + void import_legacy(legacy::stored_outdoor_maps_type& old); short difficulty_adjust() const; explicit cUniverse(long party_type = 'dflt'); ~cUniverse(); diff --git a/src/classes/vehicle.cpp b/src/classes/vehicle.cpp index 3efe7129..0989c305 100644 --- a/src/classes/vehicle.cpp +++ b/src/classes/vehicle.cpp @@ -28,7 +28,7 @@ cVehicle::cVehicle() : sector.x = 0; sector.y = 0; } -void cVehicle::append(legacy::horse_record_type& old){ +void cVehicle::import_legacy(legacy::horse_record_type& old){ which_town = old.which_town; exists = old.exists; property = old.property; @@ -40,7 +40,7 @@ void cVehicle::append(legacy::horse_record_type& old){ sector.y = old.horse_sector.y; } -void cVehicle::append(legacy::boat_record_type& old){ +void cVehicle::import_legacy(legacy::boat_record_type& old){ which_town = old.which_town; exists = old.exists; property = old.property; diff --git a/src/classes/vehicle.hpp b/src/classes/vehicle.hpp index 008e48b2..fd247fa1 100644 --- a/src/classes/vehicle.hpp +++ b/src/classes/vehicle.hpp @@ -29,8 +29,8 @@ public: bool property; cVehicle(); - void append(legacy::horse_record_type& old); - void append(legacy::boat_record_type& old); + void import_legacy(legacy::horse_record_type& old); + void import_legacy(legacy::boat_record_type& old); void writeTo(std::ostream& file) const; void readFrom(std::istream& file); }; diff --git a/src/tools/fileio_party.cpp b/src/tools/fileio_party.cpp index f8f94cdb..12875e00 100644 --- a/src/tools/fileio_party.cpp +++ b/src/tools/fileio_party.cpp @@ -233,21 +233,21 @@ bool load_party_v1(fs::path file_to_load, cUniverse& univ, bool town_restore, bo univ.party.scen_name = ""; } - univ.party.append(store_party, univ); - univ.party.append(store_setup); - univ.party.append(store_pc); + univ.party.import_legacy(store_party, univ); + univ.party.import_legacy(store_setup); + univ.party.import_legacy(store_pc); if(in_scen){ - univ.out.append(store_out_info); + univ.out.import_legacy(store_out_info); if(town_restore){ - univ.town.append(store_c_town); - univ.town.append(t_d); - univ.town.append(t_i); + univ.town.import_legacy(store_c_town); + univ.town.import_legacy(t_d); + univ.town.import_legacy(t_i); } for(int i = 0; i < 3; i++) - univ.party.append(stored_items[i],i); - univ.append(town_maps); - univ.append(o_maps); - univ.town.append(sfx, misc_i); + univ.party.import_legacy(stored_items[i],i); + univ.import_legacy(town_maps); + univ.import_legacy(o_maps); + univ.town.import_legacy(sfx, misc_i); // Check items in crates/barrels for(int i = 0; i < univ.town->max_dim(); i++) { for(int j = 0; j < univ.town->max_dim(); j++) { diff --git a/src/tools/fileio_scen.cpp b/src/tools/fileio_scen.cpp index 9d079734..57fb19a7 100644 --- a/src/tools/fileio_scen.cpp +++ b/src/tools/fileio_scen.cpp @@ -167,8 +167,8 @@ bool load_scenario_v1(fs::path file_to_load, cScenario& scenario, bool only_head return false; } port_item_list(item_data); - scenario.append(*temp_scenario); - scenario.append(*item_data); + scenario.import_legacy(*temp_scenario); + scenario.import_legacy(*item_data); // TODO: Consider skipping the fread and assignment when len is 0 scenario.special_items.resize(50); @@ -2219,24 +2219,24 @@ bool load_town_v1(fs::path scen_file, short which_town, cTown& the_town, legacy: len = sizeof(legacy::big_tr_type); fread(&t_d, len, 1, file_id); port_t_d(&t_d); - the_town.append(store_town); - the_town.append(t_d, which_town); + the_town.import_legacy(store_town); + the_town.import_legacy(t_d, which_town); break; case 1: len = sizeof(legacy::ave_tr_type); fread(&ave_t, len, 1, file_id); port_ave_t(&ave_t); - the_town.append(store_town); - the_town.append(ave_t, which_town); + the_town.import_legacy(store_town); + the_town.import_legacy(ave_t, which_town); break; case 2: len = sizeof(legacy::tiny_tr_type); fread(&tiny_t, len, 1, file_id); port_tiny_t(&tiny_t); - the_town.append(store_town); - the_town.append(tiny_t, which_town); + the_town.import_legacy(store_town); + the_town.import_legacy(tiny_t, which_town); break; } @@ -2289,7 +2289,7 @@ bool load_town_v1(fs::path scen_file, short which_town, cTown& the_town, legacy: } // Do this after strings are loaded because porting shops requires access to strings - the_town.talking.append(store_talk, shops); + the_town.talking.import_legacy(store_talk, shops); // And lastly, calculate lighting the_town.set_up_lights(); @@ -2349,7 +2349,7 @@ bool load_outdoors_v1(fs::path scen_file, location which_out,cOutdoors& the_out, the_out.x = which_out.x; the_out.y = which_out.y; port_out(&store_out); - the_out.append(store_out); + the_out.import_legacy(store_out); the_out.spec_strs.resize(90); the_out.sign_locs.resize(8); the_out.info_rect.resize(8);