diff --git a/apps/esmtool/CMakeLists.txt b/apps/esmtool/CMakeLists.txt index 122ca2f3af..914a40699e 100644 --- a/apps/esmtool/CMakeLists.txt +++ b/apps/esmtool/CMakeLists.txt @@ -4,6 +4,9 @@ set(ESMTOOL labels.cpp record.hpp record.cpp + arguments.hpp + tes4.hpp + tes4.cpp ) source_group(apps\\esmtool FILES ${ESMTOOL}) diff --git a/apps/esmtool/arguments.hpp b/apps/esmtool/arguments.hpp new file mode 100644 index 0000000000..96b4bb8f04 --- /dev/null +++ b/apps/esmtool/arguments.hpp @@ -0,0 +1,28 @@ +#ifndef OPENMW_ESMTOOL_ARGUMENTS_H +#define OPENMW_ESMTOOL_ARGUMENTS_H + +#include +#include + +#include + +namespace EsmTool +{ + struct Arguments + { + std::optional mRawFormat; + bool quiet_given; + bool loadcells_given; + bool plain_given; + + std::string mode; + std::string encoding; + std::string filename; + std::string outname; + + std::vector types; + std::string name; + }; +} + +#endif diff --git a/apps/esmtool/esmtool.cpp b/apps/esmtool/esmtool.cpp index a6178d692d..3eb78f3e41 100644 --- a/apps/esmtool/esmtool.cpp +++ b/apps/esmtool/esmtool.cpp @@ -7,17 +7,29 @@ #include #include #include +#include +#include #include #include #include #include +#include +#include #include "record.hpp" #include "labels.hpp" +#include "arguments.hpp" +#include "tes4.hpp" + +namespace +{ + +using namespace EsmTool; -#define ESMTOOL_VERSION 1.2 +constexpr unsigned majorVersion = 1; +constexpr unsigned minorVersion = 3; // Create a local alias for brevity namespace bpo = boost::program_options; @@ -36,27 +48,6 @@ struct ESMData }; -// Based on the legacy struct -struct Arguments -{ - bool raw_given; - bool quiet_given; - bool loadcells_given; - bool plain_given; - - std::string mode; - std::string encoding; - std::string filename; - std::string outname; - - std::vector types; - std::string name; - - ESMData data; - ESM::ESMReader reader; - ESM::ESMWriter writer; -}; - bool parseOptions (int argc, char** argv, Arguments &info) { bpo::options_description desc("Inspect and extract from Morrowind ES files (ESM, ESP, ESS)\nSyntax: esmtool [options] mode infile [outfile]\nAllowed modes:\n dump\t Dumps all readable data from the input file.\n clone\t Clones the input file to the output file.\n comp\t Compares the given files.\n\nAllowed options"); @@ -64,7 +55,10 @@ bool parseOptions (int argc, char** argv, Arguments &info) desc.add_options() ("help,h", "print help message.") ("version,v", "print version information and quit.") - ("raw,r", "Show an unformatted list of all records and subrecords.") + ("raw,r", bpo::value(), + "Show an unformatted list of all records and subrecords of given format:\n" + "\n\tTES3" + "\n\tTES4") // The intention is that this option would interact better // with other modes including clone, dump, and raw. ("type,t", bpo::value< std::vector >(), @@ -126,7 +120,7 @@ bool parseOptions (int argc, char** argv, Arguments &info) } if (variables.count ("version")) { - std::cout << "ESMTool version " << ESMTOOL_VERSION << std::endl; + std::cout << "ESMTool version " << majorVersion << '.' << minorVersion << std::endl; return false; } if (!variables.count("mode")) @@ -168,7 +162,9 @@ bool parseOptions (int argc, char** argv, Arguments &info) if (variables["input-file"].as< std::vector >().size() > 1) info.outname = variables["input-file"].as< std::vector >()[1]; - info.raw_given = variables.count ("raw") != 0; + if (const auto it = variables.find("raw"); it != variables.end()) + info.mRawFormat = ESM::parseFormat(it->second.as()); + info.quiet_given = variables.count ("quiet") != 0; info.loadcells_given = variables.count ("loadcells") != 0; info.plain_given = variables.count("plain") != 0; @@ -185,12 +181,13 @@ bool parseOptions (int argc, char** argv, Arguments &info) return true; } -void printRaw(ESM::ESMReader &esm); -void loadCell(ESM::Cell &cell, ESM::ESMReader &esm, Arguments& info); +void loadCell(const Arguments& info, ESM::Cell &cell, ESM::ESMReader &esm, ESMData* data); -int load(Arguments& info); -int clone(Arguments& info); -int comp(Arguments& info); +int load(const Arguments& info, ESMData* data); +int clone(const Arguments& info); +int comp(const Arguments& info); + +} int main(int argc, char**argv) { @@ -201,7 +198,7 @@ int main(int argc, char**argv) return 1; if (info.mode == "dump") - return load(info); + return load(info, nullptr); else if (info.mode == "clone") return clone(info); else if (info.mode == "comp") @@ -221,7 +218,10 @@ int main(int argc, char**argv) return 0; } -void loadCell(ESM::Cell &cell, ESM::ESMReader &esm, Arguments& info) +namespace +{ + +void loadCell(const Arguments& info, ESM::Cell &cell, ESM::ESMReader &esm, ESMData* data) { bool quiet = (info.quiet_given || info.mode == "clone"); bool save = (info.mode == "clone"); @@ -241,9 +241,8 @@ void loadCell(ESM::Cell &cell, ESM::ESMReader &esm, Arguments& info) bool moved = false; while(cell.getNextRef(esm, ref, deleted, movedCellRef, moved)) { - if (save) { - info.data.mCellRefs[&cell].push_back(std::make_pair(ref, deleted)); - } + if (data != nullptr && save) + data->mCellRefs[&cell].push_back(std::make_pair(ref, deleted)); if(quiet) continue; @@ -289,8 +288,11 @@ void loadCell(ESM::Cell &cell, ESM::ESMReader &esm, Arguments& info) } } -void printRaw(ESM::ESMReader &esm) +void printRawTes3(const std::string& path) { + std::cout << "TES3 RAW file listing: " << path << '\n'; + ESM::ESMReader esm; + esm.openRaw(path); while(esm.hasMoreRecs()) { ESM::NAME n = esm.getRecName(); @@ -310,39 +312,30 @@ void printRaw(ESM::ESMReader &esm) } } -int load(Arguments& info) +int loadTes3(const Arguments& info, std::unique_ptr&& stream, ESMData* data) { - ESM::ESMReader& esm = info.reader; + std::cout << "Loading TES3 file: " << info.filename << '\n'; + + ESM::ESMReader esm; ToUTF8::Utf8Encoder encoder (ToUTF8::calculateEncoding(info.encoding)); esm.setEncoder(&encoder); - std::string filename = info.filename; - std::cout << "Loading file: " << filename << '\n'; - std::unordered_set skipped; - try { - - if(info.raw_given && info.mode == "dump") - { - std::cout << "RAW file listing:\n"; - - esm.openRaw(filename); - - printRaw(esm); - - return 0; - } - + try + { bool quiet = (info.quiet_given || info.mode == "clone"); bool loadCells = (info.loadcells_given || info.mode == "clone"); bool save = (info.mode == "clone"); - esm.open(filename); + esm.open(std::move(stream), info.filename); - info.data.author = esm.getAuthor(); - info.data.description = esm.getDesc(); - info.data.masters = esm.getGameFiles(); + if (data != nullptr) + { + data->author = esm.getAuthor(); + data->description = esm.getDesc(); + data->masters = esm.getGameFiles(); + } if (!quiet) { @@ -387,12 +380,8 @@ int load(Arguments& info) // Is the user interested in this record type? bool interested = true; - if (!info.types.empty()) - { - std::vector::iterator match; - match = std::find(info.types.begin(), info.types.end(), n.toStringView()); - if (match == info.types.end()) interested = false; - } + if (!info.types.empty() && std::find(info.types.begin(), info.types.end(), n.toStringView()) == info.types.end()) + interested = false; if (!info.name.empty() && !Misc::StringUtils::ciEqual(info.name, record->getId())) interested = false; @@ -406,29 +395,73 @@ int load(Arguments& info) if (record->getType().toInt() == ESM::REC_CELL && loadCells && interested) { - loadCell(record->cast()->get(), esm, info); + loadCell(info, record->cast()->get(), esm, data); } - if (save) + if (data != nullptr) { - info.data.mRecords.push_back(std::move(record)); + if (save) + data->mRecords.push_back(std::move(record)); + ++data->mRecordStats[n.toInt()]; } - ++info.data.mRecordStats[n.toInt()]; } - - } catch(std::exception &e) { + } + catch (const std::exception &e) + { std::cout << "\nERROR:\n\n " << e.what() << std::endl; - - info.data.mRecords.clear(); + if (data != nullptr) + data->mRecords.clear(); return 1; } return 0; } -#include +int load(const Arguments& info, ESMData* data) +{ + if (info.mRawFormat.has_value() && info.mode == "dump") + { + switch (*info.mRawFormat) + { + case ESM::Format::Tes3: + printRawTes3(info.filename); + break; + case ESM::Format::Tes4: + std::cout << "Printing raw TES4 file is not supported: " << info.filename << "\n"; + break; + } + return 0; + } -int clone(Arguments& info) + auto stream = Files::openBinaryInputFileStream(info.filename); + if (!stream->is_open()) + { + std::cout << "Failed to open file: " << std::strerror(errno) << '\n'; + return -1; + } + + const ESM::Format format = ESM::readFormat(*stream); + stream->seekg(0); + + switch (format) + { + case ESM::Format::Tes3: + return loadTes3(info, std::move(stream), data); + case ESM::Format::Tes4: + if (data != nullptr) + { + std::cout << "Collecting data from esm file is not supported for TES4\n"; + return -1; + } + return loadTes4(info, std::move(stream)); + } + + std::cout << "Unsupported ESM format: " << ESM::NAME(format).toStringView() << '\n'; + + return -1; +} + +int clone(const Arguments& info) { if (info.outname.empty()) { @@ -436,13 +469,14 @@ int clone(Arguments& info) return 1; } - if (load(info) != 0) + ESMData data; + if (load(info, &data) != 0) { std::cout << "Failed to load, aborting." << std::endl; return 1; } - size_t recordCount = info.data.mRecords.size(); + size_t recordCount = data.mRecords.size(); int digitCount = 1; // For a nicer output if (recordCount > 0) @@ -451,7 +485,7 @@ int clone(Arguments& info) std::cout << "Loaded " << recordCount << " records:\n\n"; int i = 0; - for (std::pair stat : info.data.mRecordStats) + for (std::pair stat : data.mRecordStats) { ESM::NAME name; name = stat.first; @@ -466,22 +500,22 @@ int clone(Arguments& info) std::cout << "\nSaving records to: " << info.outname << "...\n"; - ESM::ESMWriter& esm = info.writer; + ESM::ESMWriter esm; ToUTF8::Utf8Encoder encoder (ToUTF8::calculateEncoding(info.encoding)); esm.setEncoder(&encoder); - esm.setAuthor(info.data.author); - esm.setDescription(info.data.description); - esm.setVersion(info.data.version); + esm.setAuthor(data.author); + esm.setDescription(data.description); + esm.setVersion(data.version); esm.setRecordCount (recordCount); - for (const ESM::Header::MasterData &master : info.data.masters) + for (const ESM::Header::MasterData &master : data.masters) esm.addMaster(master.name, master.size); std::fstream save(info.outname.c_str(), std::fstream::out | std::fstream::binary); esm.save(save); int saved = 0; - for (auto& record : info.data.mRecords) + for (auto& record : data.mRecords) { if (i <= 0) break; @@ -493,9 +527,9 @@ int clone(Arguments& info) record->save(esm); if (typeName.toInt() == ESM::REC_CELL) { ESM::Cell *ptr = &record->cast()->get(); - if (!info.data.mCellRefs[ptr].empty()) + if (!data.mCellRefs[ptr].empty()) { - for (std::pair &ref : info.data.mCellRefs[ptr]) + for (std::pair &ref : data.mCellRefs[ptr]) ref.first.save(esm, ref.second); } } @@ -518,7 +552,7 @@ int clone(Arguments& info) return 0; } -int comp(Arguments& info) +int comp(const Arguments& info) { if (info.filename.empty() || info.outname.empty()) { @@ -529,9 +563,6 @@ int comp(Arguments& info) Arguments fileOne; Arguments fileTwo; - fileOne.raw_given = false; - fileTwo.raw_given = false; - fileOne.mode = "clone"; fileTwo.mode = "clone"; @@ -541,19 +572,21 @@ int comp(Arguments& info) fileOne.filename = info.filename; fileTwo.filename = info.outname; - if (load(fileOne) != 0) + ESMData dataOne; + if (load(fileOne, &dataOne) != 0) { std::cout << "Failed to load " << info.filename << ", aborting comparison." << std::endl; return 1; } - if (load(fileTwo) != 0) + ESMData dataTwo; + if (load(fileTwo, &dataTwo) != 0) { std::cout << "Failed to load " << info.outname << ", aborting comparison." << std::endl; return 1; } - if (fileOne.data.mRecords.size() != fileTwo.data.mRecords.size()) + if (dataOne.mRecords.size() != dataTwo.mRecords.size()) { std::cout << "Not equal, different amount of records." << std::endl; return 1; @@ -561,3 +594,5 @@ int comp(Arguments& info) return 0; } + +} diff --git a/apps/esmtool/tes4.cpp b/apps/esmtool/tes4.cpp new file mode 100644 index 0000000000..3f213ff0b7 --- /dev/null +++ b/apps/esmtool/tes4.cpp @@ -0,0 +1,329 @@ +#include "tes4.hpp" +#include "arguments.hpp" +#include "labels.hpp" + +#include +#include +#include + +#include +#include +#include + +namespace EsmTool +{ + namespace + { + struct Params + { + const bool mQuite; + + explicit Params(const Arguments& info) + : mQuite(info.quiet_given || info.mode == "clone") + {} + }; + + std::string toString(ESM4::GroupType type) + { + switch (type) + { + case ESM4::Grp_RecordType: return "RecordType"; + case ESM4::Grp_WorldChild: return "WorldChild"; + case ESM4::Grp_InteriorCell: return "InteriorCell"; + case ESM4::Grp_InteriorSubCell: return "InteriorSubCell"; + case ESM4::Grp_ExteriorCell: return "ExteriorCell"; + case ESM4::Grp_ExteriorSubCell: return "ExteriorSubCell"; + case ESM4::Grp_CellChild: return "CellChild"; + case ESM4::Grp_TopicChild: return "TopicChild"; + case ESM4::Grp_CellPersistentChild: return "CellPersistentChild"; + case ESM4::Grp_CellTemporaryChild: return "CellTemporaryChild"; + case ESM4::Grp_CellVisibleDistChild: return "CellVisibleDistChild"; + } + + return "Unknown (" + std::to_string(type) + ")"; + } + + template > + struct HasFormId : std::false_type {}; + + template + struct HasFormId> : std::true_type {}; + + template + constexpr bool hasFormId = HasFormId::value; + + template > + struct HasFlags : std::false_type {}; + + template + struct HasFlags> : std::true_type {}; + + template + constexpr bool hasFlags = HasFlags::value; + + template + void readTypedRecord(const Params& params, ESM4::Reader& reader) + { + reader.getRecordData(); + + T value; + value.load(reader); + + if (params.mQuite) + return; + + std::cout << "\n Record: " << ESM::NAME(reader.hdr().record.typeId).toStringView(); + if constexpr (hasFormId) + std::cout << ' ' << value.mFormId; + if constexpr (hasFlags) + std::cout << "\n Record flags: " << recordFlags(value.mFlags); + std::cout << '\n'; + } + + void readRecord(const Params& params, ESM4::Reader& reader) + { + switch (static_cast(reader.hdr().record.typeId)) + { + case ESM4::REC_AACT: break; + case ESM4::REC_ACHR: return readTypedRecord(params, reader); + case ESM4::REC_ACRE: return readTypedRecord(params, reader); + case ESM4::REC_ACTI: return readTypedRecord(params, reader); + case ESM4::REC_ADDN: break; + case ESM4::REC_ALCH: return readTypedRecord(params, reader); + case ESM4::REC_ALOC: return readTypedRecord(params, reader); + case ESM4::REC_AMMO: return readTypedRecord(params, reader); + case ESM4::REC_ANIO: return readTypedRecord(params, reader); + case ESM4::REC_APPA: return readTypedRecord(params, reader); + case ESM4::REC_ARMA: return readTypedRecord(params, reader); + case ESM4::REC_ARMO: return readTypedRecord(params, reader); + case ESM4::REC_ARTO: break; + case ESM4::REC_ASPC: return readTypedRecord(params, reader); + case ESM4::REC_ASTP: break; + case ESM4::REC_AVIF: break; + case ESM4::REC_BOOK: return readTypedRecord(params, reader); + case ESM4::REC_BPTD: return readTypedRecord(params, reader); + case ESM4::REC_CAMS: break; + case ESM4::REC_CCRD: break; + case ESM4::REC_CELL: return readTypedRecord(params, reader); + case ESM4::REC_CLAS: return readTypedRecord(params, reader); + case ESM4::REC_CLFM: return readTypedRecord(params, reader); + case ESM4::REC_CLMT: break; + case ESM4::REC_CLOT: return readTypedRecord(params, reader); + case ESM4::REC_CMNY: break; + case ESM4::REC_COBJ: break; + case ESM4::REC_COLL: break; + case ESM4::REC_CONT: return readTypedRecord(params, reader); + case ESM4::REC_CPTH: break; + case ESM4::REC_CREA: return readTypedRecord(params, reader); + case ESM4::REC_CSTY: break; + case ESM4::REC_DEBR: break; + case ESM4::REC_DIAL: return readTypedRecord(params, reader); + case ESM4::REC_DLBR: break; + case ESM4::REC_DLVW: break; + case ESM4::REC_DOBJ: return readTypedRecord(params, reader); + case ESM4::REC_DOOR: return readTypedRecord(params, reader); + case ESM4::REC_DUAL: break; + case ESM4::REC_ECZN: break; + case ESM4::REC_EFSH: break; + case ESM4::REC_ENCH: break; + case ESM4::REC_EQUP: break; + case ESM4::REC_EXPL: break; + case ESM4::REC_EYES: return readTypedRecord(params, reader); + case ESM4::REC_FACT: break; + case ESM4::REC_FLOR: return readTypedRecord(params, reader); + case ESM4::REC_FLST: return readTypedRecord(params, reader); + case ESM4::REC_FSTP: break; + case ESM4::REC_FSTS: break; + case ESM4::REC_FURN: return readTypedRecord(params, reader); + case ESM4::REC_GLOB: return readTypedRecord(params, reader); + case ESM4::REC_GMST: break; + case ESM4::REC_GRAS: return readTypedRecord(params, reader); + case ESM4::REC_GRUP: break; + case ESM4::REC_HAIR: return readTypedRecord(params, reader); + case ESM4::REC_HAZD: break; + case ESM4::REC_HDPT: return readTypedRecord(params, reader); + case ESM4::REC_IDLE: + // FIXME: ESM4::IdleAnimation::load does not work with Oblivion.esm + // return readTypedRecord(params, reader); + break; + case ESM4::REC_IDLM: return readTypedRecord(params, reader); + case ESM4::REC_IMAD: break; + case ESM4::REC_IMGS: break; + case ESM4::REC_IMOD: return readTypedRecord(params, reader); + case ESM4::REC_INFO: return readTypedRecord(params, reader); + case ESM4::REC_INGR: return readTypedRecord(params, reader); + case ESM4::REC_IPCT: break; + case ESM4::REC_IPDS: break; + case ESM4::REC_KEYM: return readTypedRecord(params, reader); + case ESM4::REC_KYWD: break; + case ESM4::REC_LAND: return readTypedRecord(params, reader); + case ESM4::REC_LCRT: break; + case ESM4::REC_LCTN: break; + case ESM4::REC_LGTM: return readTypedRecord(params, reader); + case ESM4::REC_LIGH: return readTypedRecord(params, reader); + case ESM4::REC_LSCR: break; + case ESM4::REC_LTEX: return readTypedRecord(params, reader); + case ESM4::REC_LVLC: return readTypedRecord(params, reader); + case ESM4::REC_LVLI: return readTypedRecord(params, reader); + case ESM4::REC_LVLN: return readTypedRecord(params, reader); + case ESM4::REC_LVSP: break; + case ESM4::REC_MATO: return readTypedRecord(params, reader); + case ESM4::REC_MATT: break; + case ESM4::REC_MESG: break; + case ESM4::REC_MGEF: break; + case ESM4::REC_MISC: return readTypedRecord(params, reader); + case ESM4::REC_MOVT: break; + case ESM4::REC_MSET: return readTypedRecord(params, reader); + case ESM4::REC_MSTT: return readTypedRecord(params, reader); + case ESM4::REC_MUSC: return readTypedRecord(params, reader); + case ESM4::REC_MUST: break; + case ESM4::REC_NAVI: return readTypedRecord(params, reader); + case ESM4::REC_NAVM: return readTypedRecord(params, reader); + case ESM4::REC_NOTE: return readTypedRecord(params, reader); + case ESM4::REC_NPC_: return readTypedRecord(params, reader); + case ESM4::REC_OTFT: return readTypedRecord(params, reader); + case ESM4::REC_PACK: return readTypedRecord(params, reader); + case ESM4::REC_PERK: break; + case ESM4::REC_PGRD: return readTypedRecord(params, reader); + case ESM4::REC_PGRE: return readTypedRecord(params, reader); + case ESM4::REC_PHZD: break; + case ESM4::REC_PROJ: break; + case ESM4::REC_PWAT: return readTypedRecord(params, reader); + case ESM4::REC_QUST: return readTypedRecord(params, reader); + case ESM4::REC_RACE: return readTypedRecord(params, reader); + case ESM4::REC_REFR: return readTypedRecord(params, reader); + case ESM4::REC_REGN: return readTypedRecord(params, reader); + case ESM4::REC_RELA: break; + case ESM4::REC_REVB: break; + case ESM4::REC_RFCT: break; + case ESM4::REC_ROAD: return readTypedRecord(params, reader); + case ESM4::REC_SBSP: return readTypedRecord(params, reader); + case ESM4::REC_SCEN: break; + case ESM4::REC_SCOL: return readTypedRecord(params, reader); + case ESM4::REC_SCPT: return readTypedRecord(params, reader); + case ESM4::REC_SCRL: return readTypedRecord(params, reader); + case ESM4::REC_SGST: return readTypedRecord(params, reader); + case ESM4::REC_SHOU: break; + case ESM4::REC_SLGM: return readTypedRecord(params, reader); + case ESM4::REC_SMBN: break; + case ESM4::REC_SMEN: break; + case ESM4::REC_SMQN: break; + case ESM4::REC_SNCT: break; + case ESM4::REC_SNDR: return readTypedRecord(params, reader); + case ESM4::REC_SOPM: break; + case ESM4::REC_SOUN: return readTypedRecord(params, reader); + case ESM4::REC_SPEL: break; + case ESM4::REC_SPGD: break; + case ESM4::REC_STAT: return readTypedRecord(params, reader); + case ESM4::REC_TACT: return readTypedRecord(params, reader); + case ESM4::REC_TERM: return readTypedRecord(params, reader); + case ESM4::REC_TES4: return readTypedRecord(params, reader); + case ESM4::REC_TREE: return readTypedRecord(params, reader); + case ESM4::REC_TXST: return readTypedRecord(params, reader); + case ESM4::REC_VTYP: break; + case ESM4::REC_WATR: break; + case ESM4::REC_WEAP: return readTypedRecord(params, reader); + case ESM4::REC_WOOP: break; + case ESM4::REC_WRLD: return readTypedRecord(params, reader); + case ESM4::REC_WTHR: break; + } + + if (!params.mQuite) + std::cout << "\n Unsupported record: " << ESM::NAME(reader.hdr().record.typeId).toStringView() << '\n'; + + reader.skipRecordData(); + } + + bool readItem(const Params& params, ESM4::Reader& reader); + + bool readGroup(const Params& params, ESM4::Reader& reader) + { + const ESM4::RecordHeader& header = reader.hdr(); + + if (!params.mQuite) + std::cout << "\nGroup: " << toString(static_cast(header.group.type)) + << " " << ESM::NAME(header.group.typeId).toStringView() << '\n'; + + switch (static_cast(header.group.type)) + { + case ESM4::Grp_RecordType: + case ESM4::Grp_InteriorCell: + case ESM4::Grp_InteriorSubCell: + case ESM4::Grp_ExteriorCell: + case ESM4::Grp_ExteriorSubCell: + reader.enterGroup(); + return readItem(params, reader); + case ESM4::Grp_WorldChild: + case ESM4::Grp_CellChild: + case ESM4::Grp_TopicChild: + case ESM4::Grp_CellPersistentChild: + case ESM4::Grp_CellTemporaryChild: + case ESM4::Grp_CellVisibleDistChild: + reader.adjustGRUPFormId(); + reader.enterGroup(); + if (!reader.hasMoreRecs()) + return false; + return readItem(params, reader); + } + + reader.skipGroup(); + + return true; + } + + bool readItem(const Params& params, ESM4::Reader& reader) + { + if (!reader.getRecordHeader() || !reader.hasMoreRecs()) + return false; + + const ESM4::RecordHeader& header = reader.hdr(); + + if (header.record.typeId == ESM4::REC_GRUP) + return readGroup(params, reader); + + readRecord(params, reader); + return true; + } + } + + int loadTes4(const Arguments& info, std::unique_ptr&& stream) + { + std::cout << "Loading TES4 file: " << info.filename << '\n'; + + try + { + const ToUTF8::StatelessUtf8Encoder encoder(ToUTF8::calculateEncoding(info.encoding)); + ESM4::Reader reader(std::move(stream), info.filename); + reader.setEncoder(&encoder); + const Params params(info); + + if (!params.mQuite) + { + std::cout << "Author: " << reader.getAuthor() << '\n' + << "Description: " << reader.getDesc() << '\n' + << "File format version: " << reader.esmVersion() << '\n'; + + if (const std::vector& masterData = reader.getGameFiles(); !masterData.empty()) + { + std::cout << "Masters:" << '\n'; + for (const auto& master : masterData) + std::cout << " " << master.name << ", " << master.size << " bytes\n"; + } + } + + while (reader.hasMoreRecs()) + { + reader.exitGroupCheck(); + if (!readItem(params, reader)) + break; + } + } + catch (const std::exception& e) + { + std::cout << "\nERROR:\n\n " << e.what() << std::endl; + return -1; + } + + return 0; + } +} diff --git a/apps/esmtool/tes4.hpp b/apps/esmtool/tes4.hpp new file mode 100644 index 0000000000..8149b26049 --- /dev/null +++ b/apps/esmtool/tes4.hpp @@ -0,0 +1,15 @@ +#ifndef OPENMW_ESMTOOL_TES4_H +#define OPENMW_ESMTOOL_TES4_H + +#include +#include +#include + +namespace EsmTool +{ + struct Arguments; + + int loadTes4(const Arguments& info, std::unique_ptr&& stream); +} + +#endif diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 7121bde103..32c7c9535f 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -80,7 +80,7 @@ add_component_dir (to_utf8 to_utf8 ) -add_component_dir(esm attr common defs esmcommon reader records util luascripts) +add_component_dir(esm attr common defs esmcommon reader records util luascripts format) add_component_dir (esm3 esmreader esmwriter loadacti loadalch loadappa loadarmo loadbody loadbook loadbsgn loadcell diff --git a/components/esm/format.cpp b/components/esm/format.cpp new file mode 100644 index 0000000000..b41d81d57d --- /dev/null +++ b/components/esm/format.cpp @@ -0,0 +1,40 @@ +#include "format.hpp" + +#include + +namespace ESM +{ + namespace + { + bool isValidFormat(std::uint32_t value) + { + return value == static_cast(Format::Tes3) + || value == static_cast(Format::Tes4); + } + + Format toFormat(std::uint32_t value) + { + if (!isValidFormat(value)) + throw std::runtime_error("Invalid format: " + std::to_string(value)); + return static_cast(value); + } + } + + Format readFormat(std::istream& stream) + { + std::uint32_t format = 0; + stream.read(reinterpret_cast(&format), sizeof(format)); + if (stream.gcount() != sizeof(format)) + throw std::runtime_error("Not enough bytes to read file header"); + return toFormat(format); + } + + Format parseFormat(std::string_view value) + { + if (value.size() != sizeof(std::uint32_t)) + throw std::logic_error("Invalid format value: " + std::string(value)); + std::uint32_t format; + std::memcpy(&format, value.data(), sizeof(std::uint32_t)); + return toFormat(format); + } +} diff --git a/components/esm/format.hpp b/components/esm/format.hpp new file mode 100644 index 0000000000..acd93b4075 --- /dev/null +++ b/components/esm/format.hpp @@ -0,0 +1,23 @@ +#ifndef COMPONENT_ESM_FORMAT_H +#define COMPONENT_ESM_FORMAT_H + +#include "defs.hpp" + +#include +#include +#include + +namespace ESM +{ + enum class Format : std::uint32_t + { + Tes3 = fourCC("TES3"), + Tes4 = fourCC("TES4"), + }; + + Format readFormat(std::istream& stream); + + Format parseFormat(std::string_view value); +} + +#endif diff --git a/components/esm/reader.cpp b/components/esm/reader.cpp index 519c547bb8..0e2e9a9b8a 100644 --- a/components/esm/reader.cpp +++ b/components/esm/reader.cpp @@ -38,7 +38,7 @@ namespace ESM } bool Reader::getStringImpl(std::string& str, std::size_t size, - std::istream& stream, ToUTF8::StatelessUtf8Encoder* encoder, bool hasNull) + std::istream& stream, const ToUTF8::StatelessUtf8Encoder* encoder, bool hasNull) { std::size_t newSize = size; diff --git a/components/esm/reader.hpp b/components/esm/reader.hpp index ffc416dc18..fc3845d87e 100644 --- a/components/esm/reader.hpp +++ b/components/esm/reader.hpp @@ -31,7 +31,7 @@ namespace ESM virtual inline bool hasMoreRecs() const = 0; - virtual inline void setEncoder(ToUTF8::StatelessUtf8Encoder* encoder) = 0; + virtual inline void setEncoder(const ToUTF8::StatelessUtf8Encoder* encoder) = 0; // used to check for dependencies e.g. CS::Editor::run() virtual inline const std::vector& getGameFiles() const = 0; @@ -53,7 +53,7 @@ namespace ESM protected: bool getStringImpl(std::string& str, std::size_t size, - std::istream& stream, ToUTF8::StatelessUtf8Encoder* encoder, bool hasNull = false); + std::istream& stream, const ToUTF8::StatelessUtf8Encoder* encoder, bool hasNull = false); }; } diff --git a/components/esm4/common.hpp b/components/esm4/common.hpp index b92a48e070..11286e4b03 100644 --- a/components/esm4/common.hpp +++ b/components/esm4/common.hpp @@ -76,7 +76,7 @@ namespace ESM4 REC_DOBJ = fourCC("DOBJ"), // Default Object Manager REC_DOOR = fourCC("DOOR"), // Door REC_DUAL = fourCC("DUAL"), // Dual Cast Data (possibly unused) - //REC_ECZN = fourCC("ECZN"), // Encounter Zone + REC_ECZN = fourCC("ECZN"), // Encounter Zone REC_EFSH = fourCC("EFSH"), // Effect Shader REC_ENCH = fourCC("ENCH"), // Enchantment REC_EQUP = fourCC("EQUP"), // Equip Slot (flag-type values) @@ -93,7 +93,7 @@ namespace ESM4 REC_GRAS = fourCC("GRAS"), // Grass REC_GRUP = fourCC("GRUP"), // Form Group REC_HAIR = fourCC("HAIR"), // Hair - //REC_HAZD = fourCC("HAZD"), // Hazard + REC_HAZD = fourCC("HAZD"), // Hazard REC_HDPT = fourCC("HDPT"), // Head Part REC_IDLE = fourCC("IDLE"), // Idle Animation REC_IDLM = fourCC("IDLM"), // Idle Marker diff --git a/components/esm4/loadachr.cpp b/components/esm4/loadachr.cpp index e006588475..7a62b5cdbd 100644 --- a/components/esm4/loadachr.cpp +++ b/components/esm4/loadachr.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::ActorCharacter::~ActorCharacter() -{ -} - void ESM4::ActorCharacter::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadachr.hpp b/components/esm4/loadachr.hpp index 7f78aa32d1..89b1ad7c86 100644 --- a/components/esm4/loadachr.hpp +++ b/components/esm4/loadachr.hpp @@ -57,10 +57,8 @@ namespace ESM4 EnableParent mEsp; - virtual ~ActorCharacter(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadacre.cpp b/components/esm4/loadacre.cpp index 9eb0cc7e5f..33d402eb81 100644 --- a/components/esm4/loadacre.cpp +++ b/components/esm4/loadacre.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::ActorCreature::~ActorCreature() -{ -} - void ESM4::ActorCreature::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadacre.hpp b/components/esm4/loadacre.hpp index 0b436d762b..4be76a5a8a 100644 --- a/components/esm4/loadacre.hpp +++ b/components/esm4/loadacre.hpp @@ -54,10 +54,8 @@ namespace ESM4 EnableParent mEsp; - virtual ~ActorCreature(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadacti.cpp b/components/esm4/loadacti.cpp index 801cb9cdd8..8c64e0477c 100644 --- a/components/esm4/loadacti.cpp +++ b/components/esm4/loadacti.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Activator::~Activator() -{ -} - void ESM4::Activator::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadacti.hpp b/components/esm4/loadacti.hpp index f86a4aa370..7d5798c033 100644 --- a/components/esm4/loadacti.hpp +++ b/components/esm4/loadacti.hpp @@ -57,10 +57,8 @@ namespace ESM4 std::string mActivationPrompt; - virtual ~Activator(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadalch.cpp b/components/esm4/loadalch.cpp index 2c346d71b9..579bf309f0 100644 --- a/components/esm4/loadalch.cpp +++ b/components/esm4/loadalch.cpp @@ -33,10 +33,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Potion::~Potion() -{ -} - void ESM4::Potion::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadalch.hpp b/components/esm4/loadalch.hpp index a3ff9ffe34..dbc8b80f82 100644 --- a/components/esm4/loadalch.hpp +++ b/components/esm4/loadalch.hpp @@ -75,10 +75,8 @@ namespace ESM4 Data mData; EnchantedItem mItem; - virtual ~Potion(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadaloc.cpp b/components/esm4/loadaloc.cpp index 9907e5908b..b14341f682 100644 --- a/components/esm4/loadaloc.cpp +++ b/components/esm4/loadaloc.cpp @@ -38,10 +38,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::MediaLocationController::~MediaLocationController() -{ -} - void ESM4::MediaLocationController::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadaloc.hpp b/components/esm4/loadaloc.hpp index 1c2d17d11e..3c5ae39f55 100644 --- a/components/esm4/loadaloc.hpp +++ b/components/esm4/loadaloc.hpp @@ -75,11 +75,8 @@ namespace ESM4 std::uint32_t mDayStart; std::uint32_t mNightStart; - MediaLocationController(); - virtual ~MediaLocationController(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadammo.cpp b/components/esm4/loadammo.cpp index 3c30a7a73b..16cd7cab1c 100644 --- a/components/esm4/loadammo.cpp +++ b/components/esm4/loadammo.cpp @@ -31,10 +31,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Ammunition::~Ammunition() -{ -} - void ESM4::Ammunition::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadammo.hpp b/components/esm4/loadammo.hpp index c31d38c10c..b399245a1b 100644 --- a/components/esm4/loadammo.hpp +++ b/components/esm4/loadammo.hpp @@ -71,10 +71,8 @@ namespace ESM4 Data mData; - virtual ~Ammunition(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadanio.cpp b/components/esm4/loadanio.cpp index 15847fbbda..86441e36ee 100644 --- a/components/esm4/loadanio.cpp +++ b/components/esm4/loadanio.cpp @@ -31,10 +31,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::AnimObject::~AnimObject() -{ -} - void ESM4::AnimObject::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadanio.hpp b/components/esm4/loadanio.hpp index f7e85f613b..5e40b5f9d8 100644 --- a/components/esm4/loadanio.hpp +++ b/components/esm4/loadanio.hpp @@ -50,10 +50,8 @@ namespace ESM4 FormId mIdleAnim; // only in TES4 std::string mUnloadEvent; // only in TES5 - virtual ~AnimObject(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadappa.cpp b/components/esm4/loadappa.cpp index c0561322b0..a7814d99c4 100644 --- a/components/esm4/loadappa.cpp +++ b/components/esm4/loadappa.cpp @@ -31,10 +31,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Apparatus::~Apparatus() -{ -} - void ESM4::Apparatus::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadappa.hpp b/components/esm4/loadappa.hpp index f3b2966518..7e4e48ce5a 100644 --- a/components/esm4/loadappa.hpp +++ b/components/esm4/loadappa.hpp @@ -62,10 +62,8 @@ namespace ESM4 Data mData; - virtual ~Apparatus(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadarma.cpp b/components/esm4/loadarma.cpp index 6306845689..389a5b122c 100644 --- a/components/esm4/loadarma.cpp +++ b/components/esm4/loadarma.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::ArmorAddon::~ArmorAddon() -{ -} - void ESM4::ArmorAddon::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadarma.hpp b/components/esm4/loadarma.hpp index f7abb404a1..8bee9d0396 100644 --- a/components/esm4/loadarma.hpp +++ b/components/esm4/loadarma.hpp @@ -57,10 +57,8 @@ namespace ESM4 BodyTemplate mBodyTemplate; // TES5 - virtual ~ArmorAddon(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadarmo.cpp b/components/esm4/loadarmo.cpp index c6237f326d..b2b43e1111 100644 --- a/components/esm4/loadarmo.cpp +++ b/components/esm4/loadarmo.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Armor::~Armor() -{ -} - void ESM4::Armor::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadarmo.hpp b/components/esm4/loadarmo.hpp index b44ba1a973..e7f6fa5a7c 100644 --- a/components/esm4/loadarmo.hpp +++ b/components/esm4/loadarmo.hpp @@ -183,10 +183,8 @@ namespace ESM4 std::vector mAddOns; // TES5 ARMA Data mData; - virtual ~Armor(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadaspc.cpp b/components/esm4/loadaspc.cpp index 8fb9d70c71..b1e856056a 100644 --- a/components/esm4/loadaspc.cpp +++ b/components/esm4/loadaspc.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::AcousticSpace::~AcousticSpace() -{ -} - void ESM4::AcousticSpace::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadaspc.hpp b/components/esm4/loadaspc.hpp index 179297a604..9fd17ea27c 100644 --- a/components/esm4/loadaspc.hpp +++ b/components/esm4/loadaspc.hpp @@ -53,10 +53,8 @@ namespace ESM4 std::uint32_t mIsInterior; // if true only use mAmbientLoopSounds[0] - virtual ~AcousticSpace(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadbook.cpp b/components/esm4/loadbook.cpp index 939888fc43..c17ef102be 100644 --- a/components/esm4/loadbook.cpp +++ b/components/esm4/loadbook.cpp @@ -31,10 +31,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Book::~Book() -{ -} - void ESM4::Book::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadbook.hpp b/components/esm4/loadbook.hpp index 9cb5358bdb..a1176a3320 100644 --- a/components/esm4/loadbook.hpp +++ b/components/esm4/loadbook.hpp @@ -101,10 +101,8 @@ namespace ESM4 FormId mPickUpSound; FormId mDropSound; - virtual ~Book(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadbptd.cpp b/components/esm4/loadbptd.cpp index a65d2dd482..33229edd07 100644 --- a/components/esm4/loadbptd.cpp +++ b/components/esm4/loadbptd.cpp @@ -43,10 +43,6 @@ void ESM4::BodyPartData::BodyPart::clear() mGoreEffectsTarget.clear(); } -ESM4::BodyPartData::~BodyPartData() -{ -} - void ESM4::BodyPartData::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadbptd.hpp b/components/esm4/loadbptd.hpp index 0b971ca083..f831a53653 100644 --- a/components/esm4/loadbptd.hpp +++ b/components/esm4/loadbptd.hpp @@ -115,10 +115,8 @@ namespace ESM4 std::vector mBodyParts; - virtual ~BodyPartData(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadcell.cpp b/components/esm4/loadcell.cpp index 0b90a7cdbf..1bd7cb783a 100644 --- a/components/esm4/loadcell.cpp +++ b/components/esm4/loadcell.cpp @@ -39,11 +39,14 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Cell::~Cell() -{ -} - -void ESM4::Cell::init(ESM4::Reader& reader) +// TODO: Try loading only EDID and XCLC (along with mFormId, mFlags and mParent) +// +// But, for external cells we may be scanning the whole record since we don't know if there is +// going to be an EDID subrecord. And the vast majority of cells are these kinds. +// +// So perhaps some testing needs to be done to see if scanning and skipping takes +// longer/shorter/same as loading the subrecords. +void ESM4::Cell::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; reader.adjustFormId(mFormId); @@ -64,33 +67,10 @@ void ESM4::Cell::init(ESM4::Reader& reader) currCellGrid.grid.y = 0; reader.setCurrCellGrid(currCellGrid); // side effect: sets mCellGridValid true } -} - -// TODO: Try loading only EDID and XCLC (along with mFormId, mFlags and mParent) -// -// But, for external cells we may be scanning the whole record since we don't know if there is -// going to be an EDID subrecord. And the vast majority of cells are these kinds. -// -// So perhaps some testing needs to be done to see if scanning and skipping takes -// longer/shorter/same as loading the subrecords. -bool ESM4::Cell::preload(ESM4::Reader& reader) -{ - if (!mPreloaded) - load(reader); - - mPreloaded = true; - return true; -} - -void ESM4::Cell::load(ESM4::Reader& reader) -{ - if (mPreloaded) - return; // WARN: we need to call setCurrCell (and maybe setCurrCellGrid?) again before loading // cell child groups if we are loading them after restoring the context // (may be easier to update the context before saving?) - init(reader); reader.setCurrCell(mFormId); // save for LAND (and other children) to access later std::uint32_t esmVer = reader.esmVersion(); bool isFONV = esmVer == ESM::VER_132 || esmVer == ESM::VER_133 || esmVer == ESM::VER_134; diff --git a/components/esm4/loadcell.hpp b/components/esm4/loadcell.hpp index c2274fcbe9..ff51c64f00 100644 --- a/components/esm4/loadcell.hpp +++ b/components/esm4/loadcell.hpp @@ -91,15 +91,8 @@ namespace ESM4 CellGroup *mCellGroup; - virtual ~Cell(); - - void init(ESM4::Reader& reader); // common setup for both preload() and load() - - bool mPreloaded; - bool preload(ESM4::Reader& reader); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; void blank(); }; diff --git a/components/esm4/loadclas.cpp b/components/esm4/loadclas.cpp index 80c9fc2b0f..eca978276b 100644 --- a/components/esm4/loadclas.cpp +++ b/components/esm4/loadclas.cpp @@ -36,10 +36,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Class::~Class() -{ -} - void ESM4::Class::load(ESM4::Reader& reader) { //mFormId = reader.adjustFormId(reader.hdr().record.id); // FIXME: use master adjusted? diff --git a/components/esm4/loadclas.hpp b/components/esm4/loadclas.hpp index c68a1c1ae5..bf091fa7f4 100644 --- a/components/esm4/loadclas.hpp +++ b/components/esm4/loadclas.hpp @@ -53,8 +53,6 @@ namespace ESM4 std::string mIcon; Data mData; - ~Class(); - void load(ESM4::Reader& reader); //void save(ESM4::Writer& reader) const; diff --git a/components/esm4/loadclfm.cpp b/components/esm4/loadclfm.cpp index 7ad9f56615..efaf1461e4 100644 --- a/components/esm4/loadclfm.cpp +++ b/components/esm4/loadclfm.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Colour::~Colour() -{ -} - void ESM4::Colour::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadclfm.hpp b/components/esm4/loadclfm.hpp index 35d4a28686..4fb81c6e00 100644 --- a/components/esm4/loadclfm.hpp +++ b/components/esm4/loadclfm.hpp @@ -57,10 +57,8 @@ namespace ESM4 ColourRGB mColour; std::uint32_t mPlayable; - virtual ~Colour(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadclot.cpp b/components/esm4/loadclot.cpp index 8f43cf2ac6..cdcc692caa 100644 --- a/components/esm4/loadclot.cpp +++ b/components/esm4/loadclot.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Clothing::~Clothing() -{ -} - void ESM4::Clothing::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadclot.hpp b/components/esm4/loadclot.hpp index 8870c58a45..16c8a145a0 100644 --- a/components/esm4/loadclot.hpp +++ b/components/esm4/loadclot.hpp @@ -70,10 +70,8 @@ namespace ESM4 Data mData; - virtual ~Clothing(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadcont.cpp b/components/esm4/loadcont.cpp index 6ddb6c17f9..f0c7309967 100644 --- a/components/esm4/loadcont.cpp +++ b/components/esm4/loadcont.cpp @@ -31,10 +31,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Container::~Container() -{ -} - void ESM4::Container::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadcont.hpp b/components/esm4/loadcont.hpp index 7218da9729..e7b47e8944 100644 --- a/components/esm4/loadcont.hpp +++ b/components/esm4/loadcont.hpp @@ -58,10 +58,8 @@ namespace ESM4 std::vector mInventory; - virtual ~Container(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadcrea.cpp b/components/esm4/loadcrea.cpp index a78aadd82d..3da8a0c114 100644 --- a/components/esm4/loadcrea.cpp +++ b/components/esm4/loadcrea.cpp @@ -40,10 +40,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Creature::~Creature() -{ -} - void ESM4::Creature::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadcrea.hpp b/components/esm4/loadcrea.hpp index 8062a670d0..05e6840312 100644 --- a/components/esm4/loadcrea.hpp +++ b/components/esm4/loadcrea.hpp @@ -138,10 +138,8 @@ namespace ESM4 FormId mBaseTemplate; // FO3/FONV std::vector mBodyParts; // FO3/FONV - virtual ~Creature(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loaddial.cpp b/components/esm4/loaddial.cpp index 28176e7c52..342828a9d6 100644 --- a/components/esm4/loaddial.cpp +++ b/components/esm4/loaddial.cpp @@ -33,10 +33,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Dialogue::~Dialogue() -{ -} - void ESM4::Dialogue::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loaddial.hpp b/components/esm4/loaddial.hpp index 6463da4f19..8097c94baf 100644 --- a/components/esm4/loaddial.hpp +++ b/components/esm4/loaddial.hpp @@ -57,10 +57,8 @@ namespace ESM4 float mPriority; - virtual ~Dialogue(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loaddobj.cpp b/components/esm4/loaddobj.cpp index b81e29c9fc..6d791ff044 100644 --- a/components/esm4/loaddobj.cpp +++ b/components/esm4/loaddobj.cpp @@ -37,10 +37,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::DefaultObj::~DefaultObj() -{ -} - void ESM4::DefaultObj::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loaddobj.hpp b/components/esm4/loaddobj.hpp index b9557bbb05..c959a62e50 100644 --- a/components/esm4/loaddobj.hpp +++ b/components/esm4/loaddobj.hpp @@ -87,10 +87,8 @@ namespace ESM4 Defaults mData; - virtual ~DefaultObj(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loaddoor.cpp b/components/esm4/loaddoor.cpp index 7af92fa870..555c7a7d3f 100644 --- a/components/esm4/loaddoor.cpp +++ b/components/esm4/loaddoor.cpp @@ -31,10 +31,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Door::~Door() -{ -} - void ESM4::Door::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loaddoor.hpp b/components/esm4/loaddoor.hpp index 71e7ae70ac..9810a45989 100644 --- a/components/esm4/loaddoor.hpp +++ b/components/esm4/loaddoor.hpp @@ -63,10 +63,8 @@ namespace ESM4 FormId mLoopSound; FormId mRandomTeleport; - virtual ~Door(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadeyes.cpp b/components/esm4/loadeyes.cpp index d4f4fc4bbb..f91de07926 100644 --- a/components/esm4/loadeyes.cpp +++ b/components/esm4/loadeyes.cpp @@ -31,10 +31,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Eyes::~Eyes() -{ -} - void ESM4::Eyes::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadeyes.hpp b/components/esm4/loadeyes.hpp index dfc5d5e983..5f0bb0f31b 100644 --- a/components/esm4/loadeyes.hpp +++ b/components/esm4/loadeyes.hpp @@ -55,10 +55,8 @@ namespace ESM4 Data mData; - virtual ~Eyes(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadflor.cpp b/components/esm4/loadflor.cpp index fcc7fa05c1..ae9770ab74 100644 --- a/components/esm4/loadflor.cpp +++ b/components/esm4/loadflor.cpp @@ -31,10 +31,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Flora::~Flora() -{ -} - void ESM4::Flora::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadflor.hpp b/components/esm4/loadflor.hpp index f4961adf9c..d454108233 100644 --- a/components/esm4/loadflor.hpp +++ b/components/esm4/loadflor.hpp @@ -65,10 +65,8 @@ namespace ESM4 FormId mSound; Production mPercentHarvest; - virtual ~Flora(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadflst.cpp b/components/esm4/loadflst.cpp index f73f883148..32de2fe813 100644 --- a/components/esm4/loadflst.cpp +++ b/components/esm4/loadflst.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::FormIdList::~FormIdList() -{ -} - void ESM4::FormIdList::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadflst.hpp b/components/esm4/loadflst.hpp index c7e098b9ba..5a3d048fd4 100644 --- a/components/esm4/loadflst.hpp +++ b/components/esm4/loadflst.hpp @@ -47,10 +47,8 @@ namespace ESM4 std::vector mObjects; - virtual ~FormIdList(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadfurn.cpp b/components/esm4/loadfurn.cpp index 046f105451..0b27f50194 100644 --- a/components/esm4/loadfurn.cpp +++ b/components/esm4/loadfurn.cpp @@ -31,10 +31,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Furniture::~Furniture() -{ -} - void ESM4::Furniture::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadfurn.hpp b/components/esm4/loadfurn.hpp index c04f78f462..051d2b03d6 100644 --- a/components/esm4/loadfurn.hpp +++ b/components/esm4/loadfurn.hpp @@ -51,10 +51,8 @@ namespace ESM4 FormId mScriptId; std::uint32_t mActiveMarkerFlags; - virtual ~Furniture(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadglob.cpp b/components/esm4/loadglob.cpp index 3435726d76..739aab5b82 100644 --- a/components/esm4/loadglob.cpp +++ b/components/esm4/loadglob.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::GlobalVariable::~GlobalVariable() -{ -} - void ESM4::GlobalVariable::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadglob.hpp b/components/esm4/loadglob.hpp index 59e2c1fbd0..abe3a8ac93 100644 --- a/components/esm4/loadglob.hpp +++ b/components/esm4/loadglob.hpp @@ -47,10 +47,8 @@ namespace ESM4 std::uint8_t mType; float mValue; - virtual ~GlobalVariable(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadgras.cpp b/components/esm4/loadgras.cpp index 81be002bc9..8c4699b25b 100644 --- a/components/esm4/loadgras.cpp +++ b/components/esm4/loadgras.cpp @@ -31,10 +31,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Grass::~Grass() -{ -} - void ESM4::Grass::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadgras.hpp b/components/esm4/loadgras.hpp index f142779637..e5b9cb18ff 100644 --- a/components/esm4/loadgras.hpp +++ b/components/esm4/loadgras.hpp @@ -85,10 +85,8 @@ namespace ESM4 Data mData; - virtual ~Grass(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadgrup.hpp b/components/esm4/loadgrup.hpp index 8eb53a0e58..4b9aa9547b 100644 --- a/components/esm4/loadgrup.hpp +++ b/components/esm4/loadgrup.hpp @@ -86,8 +86,6 @@ namespace ESM4 FormId mRoad; std::vector mCells; // FIXME should this be CellGroup* instead? - - WorldGroup() : mWorld(0), mRoad(0) {} }; // http://www.uesp.net/wiki/Tes4Mod:Mod_File_Format/CELL @@ -150,8 +148,6 @@ namespace ESM4 // need to keep modindex and context for lazy loading (of all the files that contribute // to this group) - - CellGroup() : mCell(0), mLand(0), mPgrd(0) {} }; } diff --git a/components/esm4/loadhair.cpp b/components/esm4/loadhair.cpp index f558a46521..64d0b2192e 100644 --- a/components/esm4/loadhair.cpp +++ b/components/esm4/loadhair.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Hair::~Hair() -{ -} - void ESM4::Hair::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadhair.hpp b/components/esm4/loadhair.hpp index 22ae6ef605..b0b07f9281 100644 --- a/components/esm4/loadhair.hpp +++ b/components/esm4/loadhair.hpp @@ -58,10 +58,8 @@ namespace ESM4 Data mData; - virtual ~Hair(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadhdpt.cpp b/components/esm4/loadhdpt.cpp index ce579f5371..9e5d4c9ffd 100644 --- a/components/esm4/loadhdpt.cpp +++ b/components/esm4/loadhdpt.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::HeadPart::~HeadPart() -{ -} - void ESM4::HeadPart::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadhdpt.hpp b/components/esm4/loadhdpt.hpp index 9b67b0fce8..89a486eba8 100644 --- a/components/esm4/loadhdpt.hpp +++ b/components/esm4/loadhdpt.hpp @@ -53,11 +53,8 @@ namespace ESM4 std::array mTriFile; FormId mBaseTexture; - HeadPart(); - virtual ~HeadPart(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadidle.cpp b/components/esm4/loadidle.cpp index 16bcfcf9dc..df84e3df4c 100644 --- a/components/esm4/loadidle.cpp +++ b/components/esm4/loadidle.cpp @@ -31,10 +31,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::IdleAnimation::~IdleAnimation() -{ -} - void ESM4::IdleAnimation::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadidle.hpp b/components/esm4/loadidle.hpp index d41d715906..ad4e796359 100644 --- a/components/esm4/loadidle.hpp +++ b/components/esm4/loadidle.hpp @@ -49,10 +49,8 @@ namespace ESM4 FormId mParent; // IDLE or AACT FormId mPrevious; - virtual ~IdleAnimation(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadidlm.cpp b/components/esm4/loadidlm.cpp index 0aada6a3a3..c94cd37310 100644 --- a/components/esm4/loadidlm.cpp +++ b/components/esm4/loadidlm.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::IdleMarker::~IdleMarker() -{ -} - void ESM4::IdleMarker::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadidlm.hpp b/components/esm4/loadidlm.hpp index 717aade9c3..2874426217 100644 --- a/components/esm4/loadidlm.hpp +++ b/components/esm4/loadidlm.hpp @@ -50,10 +50,8 @@ namespace ESM4 float mIdleTimer; std::vector mIdleAnim; - virtual ~IdleMarker(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadimod.cpp b/components/esm4/loadimod.cpp index 7be99fbae0..4ec6518a01 100644 --- a/components/esm4/loadimod.cpp +++ b/components/esm4/loadimod.cpp @@ -34,10 +34,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::ItemMod::~ItemMod() -{ -} - void ESM4::ItemMod::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadimod.hpp b/components/esm4/loadimod.hpp index 2fee4f3156..5e6078384e 100644 --- a/components/esm4/loadimod.hpp +++ b/components/esm4/loadimod.hpp @@ -46,10 +46,8 @@ namespace ESM4 std::string mEditorId; - virtual ~ItemMod(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadinfo.cpp b/components/esm4/loadinfo.cpp index d72051e8a7..a0a99b13dc 100644 --- a/components/esm4/loadinfo.cpp +++ b/components/esm4/loadinfo.cpp @@ -33,10 +33,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::DialogInfo::~DialogInfo() -{ -} - void ESM4::DialogInfo::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadinfo.hpp b/components/esm4/loadinfo.hpp index be7e77efc4..2decff05e0 100644 --- a/components/esm4/loadinfo.hpp +++ b/components/esm4/loadinfo.hpp @@ -77,10 +77,8 @@ namespace ESM4 ScriptDefinition mScript; // FIXME: ignoring the second one after the NEXT sub-record - virtual ~DialogInfo(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadingr.cpp b/components/esm4/loadingr.cpp index 38f38463d0..9001329662 100644 --- a/components/esm4/loadingr.cpp +++ b/components/esm4/loadingr.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Ingredient::~Ingredient() -{ -} - void ESM4::Ingredient::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadingr.hpp b/components/esm4/loadingr.hpp index c011ff54cf..08b3e73efc 100644 --- a/components/esm4/loadingr.hpp +++ b/components/esm4/loadingr.hpp @@ -70,10 +70,8 @@ namespace ESM4 Data mData; - virtual ~Ingredient(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadkeym.cpp b/components/esm4/loadkeym.cpp index 85d348465f..f0c5dbedb7 100644 --- a/components/esm4/loadkeym.cpp +++ b/components/esm4/loadkeym.cpp @@ -31,10 +31,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Key::~Key() -{ -} - void ESM4::Key::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadkeym.hpp b/components/esm4/loadkeym.hpp index 6a31395618..68835eeeb6 100644 --- a/components/esm4/loadkeym.hpp +++ b/components/esm4/loadkeym.hpp @@ -64,10 +64,8 @@ namespace ESM4 Data mData; - virtual ~Key(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadland.cpp b/components/esm4/loadland.cpp index aadc2f3aaf..651a285a72 100644 --- a/components/esm4/loadland.cpp +++ b/components/esm4/loadland.cpp @@ -38,10 +38,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Land::~Land() -{ -} - // overlap north // // 32 diff --git a/components/esm4/loadland.hpp b/components/esm4/loadland.hpp index 80a2490855..305b48c157 100644 --- a/components/esm4/loadland.hpp +++ b/components/esm4/loadland.hpp @@ -123,8 +123,6 @@ namespace ESM4 Texture mTextures[4]; // 0 = bottom left, 1 = bottom right, 2 = top left, 3 = top right std::vector mIds; // land texture (LTEX) formids - virtual ~Land(); - virtual void load(Reader& reader); //virtual void save(Writer& writer) const; diff --git a/components/esm4/loadlgtm.cpp b/components/esm4/loadlgtm.cpp index 74486c3615..d0aa3a5b49 100644 --- a/components/esm4/loadlgtm.cpp +++ b/components/esm4/loadlgtm.cpp @@ -35,10 +35,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::LightingTemplate::~LightingTemplate() -{ -} - void ESM4::LightingTemplate::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadlgtm.hpp b/components/esm4/loadlgtm.hpp index 9e54bf53d9..1b625e458f 100644 --- a/components/esm4/loadlgtm.hpp +++ b/components/esm4/loadlgtm.hpp @@ -50,10 +50,8 @@ namespace ESM4 Lighting mLighting; - virtual ~LightingTemplate(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadligh.cpp b/components/esm4/loadligh.cpp index c4f0a94d51..394d10114d 100644 --- a/components/esm4/loadligh.cpp +++ b/components/esm4/loadligh.cpp @@ -31,10 +31,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Light::~Light() -{ -} - void ESM4::Light::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadligh.hpp b/components/esm4/loadligh.hpp index b1c642eb27..974385dbf8 100644 --- a/components/esm4/loadligh.hpp +++ b/components/esm4/loadligh.hpp @@ -84,10 +84,8 @@ namespace ESM4 Data mData; - virtual ~Light(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadltex.cpp b/components/esm4/loadltex.cpp index 7b442ef8df..6edcd4ae05 100644 --- a/components/esm4/loadltex.cpp +++ b/components/esm4/loadltex.cpp @@ -37,10 +37,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::LandTexture::~LandTexture() -{ -} - void ESM4::LandTexture::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadltex.hpp b/components/esm4/loadltex.hpp index 6347df2827..e445f54525 100644 --- a/components/esm4/loadltex.hpp +++ b/components/esm4/loadltex.hpp @@ -62,10 +62,8 @@ namespace ESM4 // ---------------------- - virtual ~LandTexture(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadlvlc.cpp b/components/esm4/loadlvlc.cpp index cef4c0aff9..a3067a0561 100644 --- a/components/esm4/loadlvlc.cpp +++ b/components/esm4/loadlvlc.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::LevelledCreature::~LevelledCreature() -{ -} - void ESM4::LevelledCreature::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadlvlc.hpp b/components/esm4/loadlvlc.hpp index 61f2d90e24..44aadbe36e 100644 --- a/components/esm4/loadlvlc.hpp +++ b/components/esm4/loadlvlc.hpp @@ -58,10 +58,8 @@ namespace ESM4 bool calcEachItemInCount() const; std::int8_t chanceNone() const; - virtual ~LevelledCreature(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadlvli.cpp b/components/esm4/loadlvli.cpp index 44395e92ea..68e458e73c 100644 --- a/components/esm4/loadlvli.cpp +++ b/components/esm4/loadlvli.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::LevelledItem::~LevelledItem() -{ -} - void ESM4::LevelledItem::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadlvli.hpp b/components/esm4/loadlvli.hpp index 479d556d5c..290658e86d 100644 --- a/components/esm4/loadlvli.hpp +++ b/components/esm4/loadlvli.hpp @@ -54,15 +54,13 @@ namespace ESM4 std::vector mLvlObject; - virtual ~LevelledItem(); - bool calcAllLvlLessThanPlayer() const; bool calcEachItemInCount() const; bool useAll() const; std::int8_t chanceNone() const; - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadlvln.cpp b/components/esm4/loadlvln.cpp index f4782a9c40..bd1423d0ac 100644 --- a/components/esm4/loadlvln.cpp +++ b/components/esm4/loadlvln.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::LevelledNpc::~LevelledNpc() -{ -} - void ESM4::LevelledNpc::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadlvln.hpp b/components/esm4/loadlvln.hpp index 7c82a44ded..49a7bb943b 100644 --- a/components/esm4/loadlvln.hpp +++ b/components/esm4/loadlvln.hpp @@ -52,14 +52,12 @@ namespace ESM4 std::uint8_t mListCount; std::vector mLvlObject; - virtual ~LevelledNpc(); - inline bool calcAllLvlLessThanPlayer() const { return (mLvlActorFlags & 0x01) != 0; } inline bool calcEachItemInCount() const { return (mLvlActorFlags & 0x02) != 0; } inline std::int8_t chanceNone() const { return mChanceNone; } - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadmato.cpp b/components/esm4/loadmato.cpp index 839a6211df..7e3ab43026 100644 --- a/components/esm4/loadmato.cpp +++ b/components/esm4/loadmato.cpp @@ -31,10 +31,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Material::~Material() -{ -} - void ESM4::Material::load(ESM4::Reader& reader) { //mFormId = reader.adjustFormId(reader.hdr().record.id); // FIXME: use master adjusted? diff --git a/components/esm4/loadmato.hpp b/components/esm4/loadmato.hpp index 8f60824bd8..041b158c29 100644 --- a/components/esm4/loadmato.hpp +++ b/components/esm4/loadmato.hpp @@ -45,10 +45,8 @@ namespace ESM4 std::string mEditorId; std::string mModel; - virtual ~Material(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadmisc.cpp b/components/esm4/loadmisc.cpp index 8231df28f5..966910f775 100644 --- a/components/esm4/loadmisc.cpp +++ b/components/esm4/loadmisc.cpp @@ -31,10 +31,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::MiscItem::~MiscItem() -{ -} - void ESM4::MiscItem::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadmisc.hpp b/components/esm4/loadmisc.hpp index 308a6ec326..49297330ea 100644 --- a/components/esm4/loadmisc.hpp +++ b/components/esm4/loadmisc.hpp @@ -64,10 +64,8 @@ namespace ESM4 Data mData; - virtual ~MiscItem(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadmset.cpp b/components/esm4/loadmset.cpp index 67ee5666d1..55a2619239 100644 --- a/components/esm4/loadmset.cpp +++ b/components/esm4/loadmset.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::MediaSet::~MediaSet() -{ -} - void ESM4::MediaSet::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadmset.hpp b/components/esm4/loadmset.hpp index c66273bc6c..7fa9450236 100644 --- a/components/esm4/loadmset.hpp +++ b/components/esm4/loadmset.hpp @@ -86,10 +86,8 @@ namespace ESM4 FormId mSoundIntro; // HNAM FormId mSoundOutro; // INAM - virtual ~MediaSet(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadmstt.cpp b/components/esm4/loadmstt.cpp index 35c69c8a31..1deb5603f8 100644 --- a/components/esm4/loadmstt.cpp +++ b/components/esm4/loadmstt.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::MovableStatic::~MovableStatic() -{ -} - void ESM4::MovableStatic::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadmstt.hpp b/components/esm4/loadmstt.hpp index 77dc453d35..eceabda161 100644 --- a/components/esm4/loadmstt.hpp +++ b/components/esm4/loadmstt.hpp @@ -47,11 +47,8 @@ namespace ESM4 std::int8_t mData; FormId mLoopingSound; - MovableStatic(); - virtual ~MovableStatic(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadmusc.cpp b/components/esm4/loadmusc.cpp index a328fbce1e..566fcb2401 100644 --- a/components/esm4/loadmusc.cpp +++ b/components/esm4/loadmusc.cpp @@ -36,10 +36,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Music::~Music() -{ -} - void ESM4::Music::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadmusc.hpp b/components/esm4/loadmusc.hpp index 2ec10abc8c..c54c9fa67c 100644 --- a/components/esm4/loadmusc.hpp +++ b/components/esm4/loadmusc.hpp @@ -47,10 +47,8 @@ namespace ESM4 std::string mEditorId; std::string mMusicFile; - virtual ~Music(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadnavi.cpp b/components/esm4/loadnavi.cpp index 818a8e98aa..4ed72c20f1 100644 --- a/components/esm4/loadnavi.cpp +++ b/components/esm4/loadnavi.cpp @@ -38,10 +38,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Navigation::~Navigation() -{ -} - void ESM4::Navigation::IslandInfo::load(ESM4::Reader& reader) { reader.get(minX); diff --git a/components/esm4/loadnavi.hpp b/components/esm4/loadnavi.hpp index ff0d033f3b..117aa102d0 100644 --- a/components/esm4/loadnavi.hpp +++ b/components/esm4/loadnavi.hpp @@ -104,10 +104,8 @@ namespace ESM4 std::map mPathIndexMap; - virtual ~Navigation(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadnavm.cpp b/components/esm4/loadnavm.cpp index 1e84a9ffee..5fce00893c 100644 --- a/components/esm4/loadnavm.cpp +++ b/components/esm4/loadnavm.cpp @@ -35,10 +35,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::NavMesh::~NavMesh() -{ -} - void ESM4::NavMesh::NVNMstruct::load(ESM4::Reader& reader) { //std::cout << "start: divisor " << std::dec << divisor << ", segments " << triSegments.size() << //std::endl; diff --git a/components/esm4/loadnavm.hpp b/components/esm4/loadnavm.hpp index 7910b1373d..a7a86cf71d 100644 --- a/components/esm4/loadnavm.hpp +++ b/components/esm4/loadnavm.hpp @@ -98,10 +98,8 @@ namespace ESM4 FormId mFormId; // from the header std::uint32_t mFlags; // from the header, see enum type RecordFlag for details - virtual ~NavMesh(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; void blank(); }; diff --git a/components/esm4/loadnote.cpp b/components/esm4/loadnote.cpp index 90e39811af..5f4b836fcf 100644 --- a/components/esm4/loadnote.cpp +++ b/components/esm4/loadnote.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Note::~Note() -{ -} - void ESM4::Note::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadnote.hpp b/components/esm4/loadnote.hpp index 506674081f..33f08257e9 100644 --- a/components/esm4/loadnote.hpp +++ b/components/esm4/loadnote.hpp @@ -47,10 +47,8 @@ namespace ESM4 std::string mModel; std::string mIcon; - virtual ~Note(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadnpc.cpp b/components/esm4/loadnpc.cpp index 51d1d0b181..a05bedd90e 100644 --- a/components/esm4/loadnpc.cpp +++ b/components/esm4/loadnpc.cpp @@ -41,10 +41,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Npc::~Npc() -{ -} - void ESM4::Npc::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadnpc.hpp b/components/esm4/loadnpc.hpp index 1bd38e189c..316caeecc2 100644 --- a/components/esm4/loadnpc.hpp +++ b/components/esm4/loadnpc.hpp @@ -217,10 +217,8 @@ namespace ESM4 std::vector mSymTextureModeCoefficients; // size 0 or 50 std::int16_t mFgRace; - virtual ~Npc(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadotft.cpp b/components/esm4/loadotft.cpp index d1b1bb23a7..e24e3fbc9c 100644 --- a/components/esm4/loadotft.cpp +++ b/components/esm4/loadotft.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Outfit::~Outfit() -{ -} - void ESM4::Outfit::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadotft.hpp b/components/esm4/loadotft.hpp index b982a3c468..cf15775a91 100644 --- a/components/esm4/loadotft.hpp +++ b/components/esm4/loadotft.hpp @@ -47,10 +47,8 @@ namespace ESM4 std::vector mInventory; - virtual ~Outfit(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadpack.cpp b/components/esm4/loadpack.cpp index 5ab9555cd6..7d0e1027c7 100644 --- a/components/esm4/loadpack.cpp +++ b/components/esm4/loadpack.cpp @@ -33,10 +33,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::AIPackage::~AIPackage() -{ -} - void ESM4::AIPackage::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadpack.hpp b/components/esm4/loadpack.hpp index 849a51c017..e04c67a7d8 100644 --- a/components/esm4/loadpack.hpp +++ b/components/esm4/loadpack.hpp @@ -97,10 +97,8 @@ namespace ESM4 PTDT mTarget; std::vector mConditions; - virtual ~AIPackage(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadpgrd.cpp b/components/esm4/loadpgrd.cpp index 4a95c8af0a..d1b9f6d57f 100644 --- a/components/esm4/loadpgrd.cpp +++ b/components/esm4/loadpgrd.cpp @@ -36,10 +36,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Pathgrid::~Pathgrid() -{ -} - void ESM4::Pathgrid::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadpgrd.hpp b/components/esm4/loadpgrd.hpp index 9f522af5ca..5ee864b93b 100644 --- a/components/esm4/loadpgrd.hpp +++ b/components/esm4/loadpgrd.hpp @@ -83,11 +83,8 @@ namespace ESM4 std::vector mForeign; std::vector mObjects; - Pathgrid(); - virtual ~Pathgrid(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadpgre.cpp b/components/esm4/loadpgre.cpp index 665b07e523..b38305b3b5 100644 --- a/components/esm4/loadpgre.cpp +++ b/components/esm4/loadpgre.cpp @@ -34,10 +34,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::PlacedGrenade::~PlacedGrenade() -{ -} - void ESM4::PlacedGrenade::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadpgre.hpp b/components/esm4/loadpgre.hpp index bb36acfc37..90e3749508 100644 --- a/components/esm4/loadpgre.hpp +++ b/components/esm4/loadpgre.hpp @@ -46,11 +46,8 @@ namespace ESM4 std::string mEditorId; - PlacedGrenade(); - virtual ~PlacedGrenade(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadpwat.cpp b/components/esm4/loadpwat.cpp index 52852b0e8a..8f403470a2 100644 --- a/components/esm4/loadpwat.cpp +++ b/components/esm4/loadpwat.cpp @@ -34,10 +34,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::PlaceableWater::~PlaceableWater() -{ -} - void ESM4::PlaceableWater::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadpwat.hpp b/components/esm4/loadpwat.hpp index e1de91ab96..4a74faeb02 100644 --- a/components/esm4/loadpwat.hpp +++ b/components/esm4/loadpwat.hpp @@ -46,11 +46,8 @@ namespace ESM4 std::string mEditorId; - PlaceableWater(); - virtual ~PlaceableWater(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadqust.cpp b/components/esm4/loadqust.cpp index 5588f90580..39eb592514 100644 --- a/components/esm4/loadqust.cpp +++ b/components/esm4/loadqust.cpp @@ -33,10 +33,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Quest::~Quest() -{ -} - void ESM4::Quest::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadqust.hpp b/components/esm4/loadqust.hpp index 853805900c..2fa9ff7097 100644 --- a/components/esm4/loadqust.hpp +++ b/components/esm4/loadqust.hpp @@ -71,10 +71,8 @@ namespace ESM4 ScriptDefinition mScript; - virtual ~Quest(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadrace.cpp b/components/esm4/loadrace.cpp index 3fa9661122..142cfd2adf 100644 --- a/components/esm4/loadrace.cpp +++ b/components/esm4/loadrace.cpp @@ -35,10 +35,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Race::~Race() -{ -} - void ESM4::Race::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadrace.hpp b/components/esm4/loadrace.hpp index c5912b719b..9166282e17 100644 --- a/components/esm4/loadrace.hpp +++ b/components/esm4/loadrace.hpp @@ -162,10 +162,8 @@ namespace ESM4 std::vector mHeadPartIdsMale; // TES5 std::vector mHeadPartIdsFemale; // TES5 - virtual ~Race(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadrefr.cpp b/components/esm4/loadrefr.cpp index 24cd3d5cde..91c10c564e 100644 --- a/components/esm4/loadrefr.cpp +++ b/components/esm4/loadrefr.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Reference::~Reference() -{ -} - void ESM4::Reference::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadrefr.hpp b/components/esm4/loadrefr.hpp index b631b334ee..0494dcb074 100644 --- a/components/esm4/loadrefr.hpp +++ b/components/esm4/loadrefr.hpp @@ -106,10 +106,8 @@ namespace ESM4 FormId mTargetRef; - virtual ~Reference(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; void blank(); }; diff --git a/components/esm4/loadregn.cpp b/components/esm4/loadregn.cpp index 7acda43350..2455966036 100644 --- a/components/esm4/loadregn.cpp +++ b/components/esm4/loadregn.cpp @@ -39,10 +39,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Region::~Region() -{ -} - void ESM4::Region::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadregn.hpp b/components/esm4/loadregn.hpp index 86b5ca5799..9b7962ba3c 100644 --- a/components/esm4/loadregn.hpp +++ b/components/esm4/loadregn.hpp @@ -85,10 +85,8 @@ namespace ESM4 RegionData mData; std::vector mSounds; - virtual ~Region(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; void blank(); }; diff --git a/components/esm4/loadroad.cpp b/components/esm4/loadroad.cpp index fca11db779..b131811c64 100644 --- a/components/esm4/loadroad.cpp +++ b/components/esm4/loadroad.cpp @@ -33,10 +33,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Road::~Road() -{ -} - void ESM4::Road::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadroad.hpp b/components/esm4/loadroad.hpp index 85745d000a..33fc332643 100644 --- a/components/esm4/loadroad.hpp +++ b/components/esm4/loadroad.hpp @@ -76,10 +76,8 @@ namespace ESM4 std::vector mNodes; std::vector mLinks; - virtual ~Road(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadsbsp.cpp b/components/esm4/loadsbsp.cpp index 9daef0f89c..79ad846414 100644 --- a/components/esm4/loadsbsp.cpp +++ b/components/esm4/loadsbsp.cpp @@ -31,10 +31,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::SubSpace::~SubSpace() -{ -} - void ESM4::SubSpace::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadsbsp.hpp b/components/esm4/loadsbsp.hpp index 601b2b0cb7..8e949cc6ad 100644 --- a/components/esm4/loadsbsp.hpp +++ b/components/esm4/loadsbsp.hpp @@ -51,8 +51,6 @@ namespace ESM4 std::string mEditorId; Dimension mDimension; - virtual ~SubSpace(); - virtual void load(Reader& reader); //virtual void save(Writer& writer) const; diff --git a/components/esm4/loadscol.cpp b/components/esm4/loadscol.cpp index 23a3cad1a3..0dd206a08f 100644 --- a/components/esm4/loadscol.cpp +++ b/components/esm4/loadscol.cpp @@ -34,10 +34,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::StaticCollection::~StaticCollection() -{ -} - void ESM4::StaticCollection::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadscol.hpp b/components/esm4/loadscol.hpp index dc1bf296e1..6a0005699d 100644 --- a/components/esm4/loadscol.hpp +++ b/components/esm4/loadscol.hpp @@ -46,10 +46,8 @@ namespace ESM4 std::string mEditorId; - virtual ~StaticCollection(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadscpt.cpp b/components/esm4/loadscpt.cpp index c95a212e75..4c606e3351 100644 --- a/components/esm4/loadscpt.cpp +++ b/components/esm4/loadscpt.cpp @@ -33,10 +33,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Script::~Script() -{ -} - void ESM4::Script::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadscpt.hpp b/components/esm4/loadscpt.hpp index 459c552876..dbf36aa367 100644 --- a/components/esm4/loadscpt.hpp +++ b/components/esm4/loadscpt.hpp @@ -46,10 +46,8 @@ namespace ESM4 ScriptDefinition mScript; - virtual ~Script(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadscrl.cpp b/components/esm4/loadscrl.cpp index c09c38ae90..ae084afae3 100644 --- a/components/esm4/loadscrl.cpp +++ b/components/esm4/loadscrl.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Scroll::~Scroll() -{ -} - void ESM4::Scroll::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadscrl.hpp b/components/esm4/loadscrl.hpp index d4feded5d8..d7872f551e 100644 --- a/components/esm4/loadscrl.hpp +++ b/components/esm4/loadscrl.hpp @@ -55,10 +55,8 @@ namespace ESM4 Data mData; - virtual ~Scroll(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadsgst.cpp b/components/esm4/loadsgst.cpp index 9453cdc27d..843644fe8b 100644 --- a/components/esm4/loadsgst.cpp +++ b/components/esm4/loadsgst.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::SigilStone::~SigilStone() -{ -} - void ESM4::SigilStone::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadsgst.hpp b/components/esm4/loadsgst.hpp index 3a2d32850d..aa9b95166b 100644 --- a/components/esm4/loadsgst.hpp +++ b/components/esm4/loadsgst.hpp @@ -62,10 +62,8 @@ namespace ESM4 Data mData; - virtual ~SigilStone(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadslgm.cpp b/components/esm4/loadslgm.cpp index 97bbab9569..53e30fd1da 100644 --- a/components/esm4/loadslgm.cpp +++ b/components/esm4/loadslgm.cpp @@ -31,10 +31,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::SoulGem::~SoulGem() -{ -} - void ESM4::SoulGem::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadslgm.hpp b/components/esm4/loadslgm.hpp index e101fbf8a5..893603a1fe 100644 --- a/components/esm4/loadslgm.hpp +++ b/components/esm4/loadslgm.hpp @@ -63,10 +63,8 @@ namespace ESM4 Data mData; - virtual ~SoulGem(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadsndr.cpp b/components/esm4/loadsndr.cpp index 4c0bf30b24..d01fb0ed74 100644 --- a/components/esm4/loadsndr.cpp +++ b/components/esm4/loadsndr.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::SoundReference::~SoundReference() -{ -} - void ESM4::SoundReference::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadsndr.hpp b/components/esm4/loadsndr.hpp index fba1912264..de0ca3eb1a 100644 --- a/components/esm4/loadsndr.hpp +++ b/components/esm4/loadsndr.hpp @@ -73,10 +73,8 @@ namespace ESM4 TargetCondition mTargetCondition; - virtual ~SoundReference(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadsoun.cpp b/components/esm4/loadsoun.cpp index bcb776e100..a3358236b0 100644 --- a/components/esm4/loadsoun.cpp +++ b/components/esm4/loadsoun.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Sound::~Sound() -{ -} - void ESM4::Sound::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadsoun.hpp b/components/esm4/loadsoun.hpp index b766aa5534..da1d7fbd71 100644 --- a/components/esm4/loadsoun.hpp +++ b/components/esm4/loadsoun.hpp @@ -88,10 +88,8 @@ namespace ESM4 SNDX mData; SoundData mExtra; - virtual ~Sound(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadstat.cpp b/components/esm4/loadstat.cpp index d08812b4ee..10ce91980c 100644 --- a/components/esm4/loadstat.cpp +++ b/components/esm4/loadstat.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Static::~Static() -{ -} - void ESM4::Static::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadstat.hpp b/components/esm4/loadstat.hpp index 9c689462ef..07369b3357 100644 --- a/components/esm4/loadstat.hpp +++ b/components/esm4/loadstat.hpp @@ -49,10 +49,8 @@ namespace ESM4 float mBoundRadius; std::vector mMODT; // FIXME texture hash - virtual ~Static(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadtact.cpp b/components/esm4/loadtact.cpp index f82e70c483..0d684719be 100644 --- a/components/esm4/loadtact.cpp +++ b/components/esm4/loadtact.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::TalkingActivator::~TalkingActivator() -{ -} - void ESM4::TalkingActivator::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadtact.hpp b/components/esm4/loadtact.hpp index f3fd91a433..3a79006d78 100644 --- a/components/esm4/loadtact.hpp +++ b/components/esm4/loadtact.hpp @@ -63,10 +63,8 @@ namespace ESM4 FormId mLoopSound; // SOUN FormId mRadioTemplate; // SOUN - virtual ~TalkingActivator(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadterm.cpp b/components/esm4/loadterm.cpp index e9eedc3651..fc1d10cf70 100644 --- a/components/esm4/loadterm.cpp +++ b/components/esm4/loadterm.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Terminal::~Terminal() -{ -} - void ESM4::Terminal::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadterm.hpp b/components/esm4/loadterm.hpp index 1b1486d7a2..32ec613ff5 100644 --- a/components/esm4/loadterm.hpp +++ b/components/esm4/loadterm.hpp @@ -53,10 +53,8 @@ namespace ESM4 FormId mPasswordNote; FormId mSound; - virtual ~Terminal(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadtree.cpp b/components/esm4/loadtree.cpp index c70863a51b..1ac3301c3f 100644 --- a/components/esm4/loadtree.cpp +++ b/components/esm4/loadtree.cpp @@ -31,10 +31,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Tree::~Tree() -{ -} - void ESM4::Tree::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadtree.hpp b/components/esm4/loadtree.hpp index 2c88812b46..48c59468b2 100644 --- a/components/esm4/loadtree.hpp +++ b/components/esm4/loadtree.hpp @@ -49,10 +49,8 @@ namespace ESM4 std::string mLeafTexture; - virtual ~Tree(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadtxst.cpp b/components/esm4/loadtxst.cpp index 51f58c9816..b0f8c1113c 100644 --- a/components/esm4/loadtxst.cpp +++ b/components/esm4/loadtxst.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::TextureSet::~TextureSet() -{ -} - void ESM4::TextureSet::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadtxst.hpp b/components/esm4/loadtxst.hpp index 71251c2dcb..be968f2e6e 100644 --- a/components/esm4/loadtxst.hpp +++ b/components/esm4/loadtxst.hpp @@ -53,10 +53,8 @@ namespace ESM4 std::string mUnknown; std::string mSpecular; - virtual ~TextureSet(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadweap.cpp b/components/esm4/loadweap.cpp index 463496187e..56ae2174d2 100644 --- a/components/esm4/loadweap.cpp +++ b/components/esm4/loadweap.cpp @@ -31,10 +31,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::Weapon::~Weapon() -{ -} - void ESM4::Weapon::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadweap.hpp b/components/esm4/loadweap.hpp index 7128e26ec9..1abfc5b577 100644 --- a/components/esm4/loadweap.hpp +++ b/components/esm4/loadweap.hpp @@ -83,10 +83,8 @@ namespace ESM4 Data mData; - virtual ~Weapon(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; //void blank(); }; diff --git a/components/esm4/loadwrld.cpp b/components/esm4/loadwrld.cpp index ca8e5fd2c5..d8ec79b625 100644 --- a/components/esm4/loadwrld.cpp +++ b/components/esm4/loadwrld.cpp @@ -32,10 +32,6 @@ #include "reader.hpp" //#include "writer.hpp" -ESM4::World::~World() -{ -} - void ESM4::World::load(ESM4::Reader& reader) { mFormId = reader.hdr().record.id; diff --git a/components/esm4/loadwrld.hpp b/components/esm4/loadwrld.hpp index 5937670daf..b6b643446c 100644 --- a/components/esm4/loadwrld.hpp +++ b/components/esm4/loadwrld.hpp @@ -126,10 +126,8 @@ namespace ESM4 std::vector mCells; std::vector mRoads; - virtual ~World(); - - virtual void load(ESM4::Reader& reader); - //virtual void save(ESM4::Writer& writer) const; + void load(ESM4::Reader& reader); + //void save(ESM4::Writer& writer) const; }; } diff --git a/components/esm4/reader.hpp b/components/esm4/reader.hpp index 863121cf38..aaebeb335a 100644 --- a/components/esm4/reader.hpp +++ b/components/esm4/reader.hpp @@ -78,7 +78,7 @@ namespace ESM4 { ReaderContext mCtx; - ToUTF8::StatelessUtf8Encoder* mEncoder; + const ToUTF8::StatelessUtf8Encoder* mEncoder; std::size_t mFileSize; @@ -143,7 +143,7 @@ namespace ESM4 { inline bool isEsm4() const final { return true; } - inline void setEncoder(ToUTF8::StatelessUtf8Encoder* encoder) final { mEncoder = encoder; }; + inline void setEncoder(const ToUTF8::StatelessUtf8Encoder* encoder) final { mEncoder = encoder; }; const std::vector& getGameFiles() const final { return mHeader.mMaster; } diff --git a/components/esm4/records.hpp b/components/esm4/records.hpp new file mode 100644 index 0000000000..ae2a7a78f7 --- /dev/null +++ b/components/esm4/records.hpp @@ -0,0 +1,84 @@ +#ifndef COMPONENTS_ESM4_RECORDS_H +#define COMPONENTS_ESM4_RECORDS_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif