diff --git a/apps/essimporter/importer.cpp b/apps/essimporter/importer.cpp index 710c2e9ab2..9931385f8c 100644 --- a/apps/essimporter/importer.cpp +++ b/apps/essimporter/importer.cpp @@ -263,14 +263,14 @@ namespace ESSImport const ESM::Header& header = esm.getHeader(); context.mPlayerCellName = header.mGameData.mCurrentCell.toString(); - const unsigned int recREFR = ESM::FourCC<'R','E','F','R'>::value; - const unsigned int recPCDT = ESM::FourCC<'P','C','D','T'>::value; - const unsigned int recFMAP = ESM::FourCC<'F','M','A','P'>::value; - const unsigned int recKLST = ESM::FourCC<'K','L','S','T'>::value; - const unsigned int recSTLN = ESM::FourCC<'S','T','L','N'>::value; - const unsigned int recGAME = ESM::FourCC<'G','A','M','E'>::value; - const unsigned int recJOUR = ESM::FourCC<'J','O','U','R'>::value; - const unsigned int recSPLM = ESM::FourCC<'S','P','L','M'>::value; + const unsigned int recREFR = ESM::fourCC("REFR"); + const unsigned int recPCDT = ESM::fourCC("PCDT"); + const unsigned int recFMAP = ESM::fourCC("FMAP"); + const unsigned int recKLST = ESM::fourCC("KLST"); + const unsigned int recSTLN = ESM::fourCC("STLN"); + const unsigned int recGAME = ESM::fourCC("GAME"); + const unsigned int recJOUR = ESM::fourCC("JOUR"); + const unsigned int recSPLM = ESM::fourCC("SPLM"); std::map > converters; converters[ESM::REC_GLOB] = std::shared_ptr(new ConvertGlobal()); diff --git a/components/esm/defs.hpp b/components/esm/defs.hpp index a7d2f44dd7..f587fc6690 100644 --- a/components/esm/defs.hpp +++ b/components/esm/defs.hpp @@ -61,7 +61,7 @@ struct Position friend inline bool operator<(const Position& l, const Position& r) { - const auto tuple = [] (const Position& v) { return std::tuple(v.asVec3(), v.asRotationVec3()); }; + const auto tuple = [](const Position& v) { return std::tuple(v.asVec3(), v.asRotationVec3()); }; return tuple(l) < tuple(r); } }; @@ -86,100 +86,100 @@ bool inline operator!= (const Position& left, const Position& right) noexcept left.rot[2] != right.rot[2]; } -template -struct FourCC -{ - static constexpr unsigned int value = (((((d << 8) | c) << 8) | b) << 8) | a; -}; +template +constexpr unsigned int fourCC(const char(&name)[len]) { + static_assert(len == 5, "Constant must be 4 characters long. (Plus null terminator)"); + return static_cast(name[0]) | (static_cast(name[1]) << 8) | (static_cast(name[2]) << 16) | (static_cast(name[3]) << 24); +} enum RecNameInts : unsigned int { // format 0 / legacy - REC_ACTI = FourCC<'A','C','T','I'>::value, - REC_ALCH = FourCC<'A','L','C','H'>::value, - REC_APPA = FourCC<'A','P','P','A'>::value, - REC_ARMO = FourCC<'A','R','M','O'>::value, - REC_BODY = FourCC<'B','O','D','Y'>::value, - REC_BOOK = FourCC<'B','O','O','K'>::value, - REC_BSGN = FourCC<'B','S','G','N'>::value, - REC_CELL = FourCC<'C','E','L','L'>::value, - REC_CLAS = FourCC<'C','L','A','S'>::value, - REC_CLOT = FourCC<'C','L','O','T'>::value, - REC_CNTC = FourCC<'C','N','T','C'>::value, - REC_CONT = FourCC<'C','O','N','T'>::value, - REC_CREA = FourCC<'C','R','E','A'>::value, - REC_CREC = FourCC<'C','R','E','C'>::value, - REC_DIAL = FourCC<'D','I','A','L'>::value, - REC_DOOR = FourCC<'D','O','O','R'>::value, - REC_ENCH = FourCC<'E','N','C','H'>::value, - REC_FACT = FourCC<'F','A','C','T'>::value, - REC_GLOB = FourCC<'G','L','O','B'>::value, - REC_GMST = FourCC<'G','M','S','T'>::value, - REC_INFO = FourCC<'I','N','F','O'>::value, - REC_INGR = FourCC<'I','N','G','R'>::value, - REC_LAND = FourCC<'L','A','N','D'>::value, - REC_LEVC = FourCC<'L','E','V','C'>::value, - REC_LEVI = FourCC<'L','E','V','I'>::value, - REC_LIGH = FourCC<'L','I','G','H'>::value, - REC_LOCK = FourCC<'L','O','C','K'>::value, - REC_LTEX = FourCC<'L','T','E','X'>::value, - REC_MGEF = FourCC<'M','G','E','F'>::value, - REC_MISC = FourCC<'M','I','S','C'>::value, - REC_NPC_ = FourCC<'N','P','C','_'>::value, - REC_NPCC = FourCC<'N','P','C','C'>::value, - REC_PGRD = FourCC<'P','G','R','D'>::value, - REC_PROB = FourCC<'P','R','O','B'>::value, - REC_RACE = FourCC<'R','A','C','E'>::value, - REC_REGN = FourCC<'R','E','G','N'>::value, - REC_REPA = FourCC<'R','E','P','A'>::value, - REC_SCPT = FourCC<'S','C','P','T'>::value, - REC_SKIL = FourCC<'S','K','I','L'>::value, - REC_SNDG = FourCC<'S','N','D','G'>::value, - REC_SOUN = FourCC<'S','O','U','N'>::value, - REC_SPEL = FourCC<'S','P','E','L'>::value, - REC_SSCR = FourCC<'S','S','C','R'>::value, - REC_STAT = FourCC<'S','T','A','T'>::value, - REC_WEAP = FourCC<'W','E','A','P'>::value, + REC_ACTI = fourCC("ACTI"), + REC_ALCH = fourCC("ALCH"), + REC_APPA = fourCC("APPA"), + REC_ARMO = fourCC("ARMO"), + REC_BODY = fourCC("BODY"), + REC_BOOK = fourCC("BOOK"), + REC_BSGN = fourCC("BSGN"), + REC_CELL = fourCC("CELL"), + REC_CLAS = fourCC("CLAS"), + REC_CLOT = fourCC("CLOT"), + REC_CNTC = fourCC("CNTC"), + REC_CONT = fourCC("CONT"), + REC_CREA = fourCC("CREA"), + REC_CREC = fourCC("CREC"), + REC_DIAL = fourCC("DIAL"), + REC_DOOR = fourCC("DOOR"), + REC_ENCH = fourCC("ENCH"), + REC_FACT = fourCC("FACT"), + REC_GLOB = fourCC("GLOB"), + REC_GMST = fourCC("GMST"), + REC_INFO = fourCC("INFO"), + REC_INGR = fourCC("INGR"), + REC_LAND = fourCC("LAND"), + REC_LEVC = fourCC("LEVC"), + REC_LEVI = fourCC("LEVI"), + REC_LIGH = fourCC("LIGH"), + REC_LOCK = fourCC("LOCK"), + REC_LTEX = fourCC("LTEX"), + REC_MGEF = fourCC("MGEF"), + REC_MISC = fourCC("MISC"), + REC_NPC_ = fourCC("NPC_"), + REC_NPCC = fourCC("NPCC"), + REC_PGRD = fourCC("PGRD"), + REC_PROB = fourCC("PROB"), + REC_RACE = fourCC("RACE"), + REC_REGN = fourCC("REGN"), + REC_REPA = fourCC("REPA"), + REC_SCPT = fourCC("SCPT"), + REC_SKIL = fourCC("SKIL"), + REC_SNDG = fourCC("SNDG"), + REC_SOUN = fourCC("SOUN"), + REC_SPEL = fourCC("SPEL"), + REC_SSCR = fourCC("SSCR"), + REC_STAT = fourCC("STAT"), + REC_WEAP = fourCC("WEAP"), // format 0 - saved games - REC_SAVE = FourCC<'S','A','V','E'>::value, - REC_JOUR_LEGACY = FourCC<0xa4,'U','O','R'>::value, // "\xa4UOR", rather than "JOUR", little oversight when magic numbers were - // calculated by hand, needs to be supported for older files now - REC_JOUR = FourCC<'J','O','U','R'>::value, - REC_QUES = FourCC<'Q','U','E','S'>::value, - REC_GSCR = FourCC<'G','S','C','R'>::value, - REC_PLAY = FourCC<'P','L','A','Y'>::value, - REC_CSTA = FourCC<'C','S','T','A'>::value, - REC_GMAP = FourCC<'G','M','A','P'>::value, - REC_DIAS = FourCC<'D','I','A','S'>::value, - REC_WTHR = FourCC<'W','T','H','R'>::value, - REC_KEYS = FourCC<'K','E','Y','S'>::value, - REC_DYNA = FourCC<'D','Y','N','A'>::value, - REC_ASPL = FourCC<'A','S','P','L'>::value, - REC_ACTC = FourCC<'A','C','T','C'>::value, - REC_MPRJ = FourCC<'M','P','R','J'>::value, - REC_PROJ = FourCC<'P','R','O','J'>::value, - REC_DCOU = FourCC<'D','C','O','U'>::value, - REC_MARK = FourCC<'M','A','R','K'>::value, - REC_ENAB = FourCC<'E','N','A','B'>::value, - REC_CAM_ = FourCC<'C','A','M','_'>::value, - REC_STLN = FourCC<'S','T','L','N'>::value, - REC_INPU = FourCC<'I','N','P','U'>::value, + REC_SAVE = fourCC("SAVE"), + REC_JOUR_LEGACY = fourCC("\xa4UOR"), // "\xa4UOR", rather than "JOUR", little oversight when magic numbers were + // calculated by hand, needs to be supported for older files now + REC_JOUR = fourCC("JOUR"), + REC_QUES = fourCC("QUES"), + REC_GSCR = fourCC("GSCR"), + REC_PLAY = fourCC("PLAY"), + REC_CSTA = fourCC("CSTA"), + REC_GMAP = fourCC("GMAP"), + REC_DIAS = fourCC("DIAS"), + REC_WTHR = fourCC("WTHR"), + REC_KEYS = fourCC("KEYS"), + REC_DYNA = fourCC("DYNA"), + REC_ASPL = fourCC("ASPL"), + REC_ACTC = fourCC("ACTC"), + REC_MPRJ = fourCC("MPRJ"), + REC_PROJ = fourCC("PROJ"), + REC_DCOU = fourCC("DCOU"), + REC_MARK = fourCC("MARK"), + REC_ENAB = fourCC("ENAB"), + REC_CAM_ = fourCC("CAM_"), + REC_STLN = fourCC("STLN"), + REC_INPU = fourCC("INPU"), // format 1 - REC_FILT = FourCC<'F','I','L','T'>::value, - REC_DBGP = FourCC<'D','B','G','P'>::value, ///< only used in project files - REC_LUAL = FourCC<'L','U','A','L'>::value, // LuaScriptsCfg + REC_FILT = fourCC("FILT"), + REC_DBGP = fourCC("DBGP"), ///< only used in project files + REC_LUAL = fourCC("LUAL"), // LuaScriptsCfg // format 16 - Lua scripts in saved games - REC_LUAM = FourCC<'L','U','A','M'>::value, // LuaManager data + REC_LUAM = fourCC("LUAM"), // LuaManager data }; /// Common subrecords enum SubRecNameInts { - SREC_DELE = ESM::FourCC<'D','E','L','E'>::value, - SREC_NAME = ESM::FourCC<'N','A','M','E'>::value + SREC_DELE = ESM::fourCC("DELE"), + SREC_NAME = ESM::fourCC("NAME") }; } diff --git a/components/esm3/aisequence.hpp b/components/esm3/aisequence.hpp index 3dcecc1cb0..412c7401bf 100644 --- a/components/esm3/aisequence.hpp +++ b/components/esm3/aisequence.hpp @@ -22,13 +22,13 @@ namespace ESM enum AiPackages { - Ai_Wander = ESM::FourCC<'W','A','N','D'>::value, - Ai_Travel = ESM::FourCC<'T','R','A','V'>::value, - Ai_Escort = ESM::FourCC<'E','S','C','O'>::value, - Ai_Follow = ESM::FourCC<'F','O','L','L'>::value, - Ai_Activate = ESM::FourCC<'A','C','T','I'>::value, - Ai_Combat = ESM::FourCC<'C','O','M','B'>::value, - Ai_Pursue = ESM::FourCC<'P','U','R','S'>::value + Ai_Wander = ESM::fourCC("WAND"), + Ai_Travel = ESM::fourCC("TRAV"), + Ai_Escort = ESM::fourCC("ESCO"), + Ai_Follow = ESM::fourCC("FOLL"), + Ai_Activate = ESM::fourCC("ACTI"), + Ai_Combat = ESM::fourCC("COMB"), + Ai_Pursue = ESM::fourCC("PURS") }; diff --git a/components/esm3/cellref.cpp b/components/esm3/cellref.cpp index 8487b3c0f0..1a0320d823 100644 --- a/components/esm3/cellref.cpp +++ b/components/esm3/cellref.cpp @@ -63,57 +63,57 @@ void ESM::CellRef::loadData(ESMReader &esm, bool &isDeleted) esm.getSubName(); switch (esm.retSubName().toInt()) { - case ESM::FourCC<'U','N','A','M'>::value: + case ESM::fourCC("UNAM"): esm.getHT(mReferenceBlocked); break; - case ESM::FourCC<'X','S','C','L'>::value: + case ESM::fourCC("XSCL"): esm.getHT(mScale); mScale = std::clamp(mScale, 0.5f, 2.0f); break; - case ESM::FourCC<'A','N','A','M'>::value: + case ESM::fourCC("ANAM"): mOwner = esm.getHString(); break; - case ESM::FourCC<'B','N','A','M'>::value: + case ESM::fourCC("BNAM"): mGlobalVariable = esm.getHString(); break; - case ESM::FourCC<'X','S','O','L'>::value: + case ESM::fourCC("XSOL"): mSoul = esm.getHString(); break; - case ESM::FourCC<'C','N','A','M'>::value: + case ESM::fourCC("CNAM"): mFaction = esm.getHString(); break; - case ESM::FourCC<'I','N','D','X'>::value: + case ESM::fourCC("INDX"): esm.getHT(mFactionRank); break; - case ESM::FourCC<'X','C','H','G'>::value: + case ESM::fourCC("XCHG"): esm.getHT(mEnchantmentCharge); break; - case ESM::FourCC<'I','N','T','V'>::value: + case ESM::fourCC("INTV"): esm.getHT(mChargeInt); break; - case ESM::FourCC<'N','A','M','9'>::value: + case ESM::fourCC("NAM9"): esm.getHT(mGoldValue); break; - case ESM::FourCC<'D','O','D','T'>::value: + case ESM::fourCC("DODT"): esm.getHT(mDoorDest); mTeleport = true; break; - case ESM::FourCC<'D','N','A','M'>::value: + case ESM::fourCC("DNAM"): mDestCell = esm.getHString(); break; - case ESM::FourCC<'F','L','T','V'>::value: + case ESM::fourCC("FLTV"): esm.getHT(mLockLevel); break; - case ESM::FourCC<'K','N','A','M'>::value: + case ESM::fourCC("KNAM"): mKey = esm.getHString(); break; - case ESM::FourCC<'T','N','A','M'>::value: + case ESM::fourCC("TNAM"): mTrap = esm.getHString(); break; - case ESM::FourCC<'D','A','T','A'>::value: + case ESM::fourCC("DATA"): esm.getHT(mPos, 24); break; - case ESM::FourCC<'N','A','M','0'>::value: + case ESM::fourCC("NAM0"): { esm.skipHSub(); break; diff --git a/components/esm3/debugprofile.cpp b/components/esm3/debugprofile.cpp index f862d4a289..87c3bd13ba 100644 --- a/components/esm3/debugprofile.cpp +++ b/components/esm3/debugprofile.cpp @@ -19,13 +19,13 @@ void ESM::DebugProfile::load (ESMReader& esm, bool &isDeleted) case ESM::SREC_NAME: mId = esm.getHString(); break; - case ESM::FourCC<'D','E','S','C'>::value: + case ESM::fourCC("DESC"): mDescription = esm.getHString(); break; - case ESM::FourCC<'S','C','R','P'>::value: + case ESM::fourCC("SCRP"): mScriptText = esm.getHString(); break; - case ESM::FourCC<'F','L','A','G'>::value: + case ESM::fourCC("FLAG"): esm.getHT(mFlags); break; case ESM::SREC_DELE: diff --git a/components/esm3/filter.cpp b/components/esm3/filter.cpp index 03fa4ba278..a031e0f608 100644 --- a/components/esm3/filter.cpp +++ b/components/esm3/filter.cpp @@ -20,10 +20,10 @@ void ESM::Filter::load (ESMReader& esm, bool &isDeleted) case ESM::SREC_NAME: mId = esm.getHString(); break; - case ESM::FourCC<'F','I','L','T'>::value: + case ESM::fourCC("FILT"): mFilter = esm.getHString(); break; - case ESM::FourCC<'D','E','S','C'>::value: + case ESM::fourCC("DESC"): mDescription = esm.getHString(); break; case ESM::SREC_DELE: diff --git a/components/esm3/loadacti.cpp b/components/esm3/loadacti.cpp index c4aa9cb6b8..d57ef44be2 100644 --- a/components/esm3/loadacti.cpp +++ b/components/esm3/loadacti.cpp @@ -23,13 +23,13 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'M','O','D','L'>::value: + case ESM::fourCC("MODL"): mModel = esm.getHString(); break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): mName = esm.getHString(); break; - case ESM::FourCC<'S','C','R','I'>::value: + case ESM::fourCC("SCRI"): mScript = esm.getHString(); break; case ESM::SREC_DELE: diff --git a/components/esm3/loadalch.cpp b/components/esm3/loadalch.cpp index 618e116cce..1aacfc8976 100644 --- a/components/esm3/loadalch.cpp +++ b/components/esm3/loadalch.cpp @@ -26,23 +26,23 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'M','O','D','L'>::value: + case ESM::fourCC("MODL"): mModel = esm.getHString(); break; - case ESM::FourCC<'T','E','X','T'>::value: // not ITEX here for some reason + case ESM::fourCC("TEXT"): // not ITEX here for some reason mIcon = esm.getHString(); break; - case ESM::FourCC<'S','C','R','I'>::value: + case ESM::fourCC("SCRI"): mScript = esm.getHString(); break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): mName = esm.getHString(); break; - case ESM::FourCC<'A','L','D','T'>::value: + case ESM::fourCC("ALDT"): esm.getHT(mData, 12); hasData = true; break; - case ESM::FourCC<'E','N','A','M'>::value: + case ESM::fourCC("ENAM"): mEffects.add(esm); break; case ESM::SREC_DELE: diff --git a/components/esm3/loadappa.cpp b/components/esm3/loadappa.cpp index 13ba0fbb42..f29e5bf4f9 100644 --- a/components/esm3/loadappa.cpp +++ b/components/esm3/loadappa.cpp @@ -24,20 +24,20 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'M','O','D','L'>::value: + case ESM::fourCC("MODL"): mModel = esm.getHString(); break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): mName = esm.getHString(); break; - case ESM::FourCC<'A','A','D','T'>::value: + case ESM::fourCC("AADT"): esm.getHT(mData); hasData = true; break; - case ESM::FourCC<'S','C','R','I'>::value: + case ESM::fourCC("SCRI"): mScript = esm.getHString(); break; - case ESM::FourCC<'I','T','E','X'>::value: + case ESM::fourCC("ITEX"): mIcon = esm.getHString(); break; case ESM::SREC_DELE: diff --git a/components/esm3/loadarmo.cpp b/components/esm3/loadarmo.cpp index 9c5164f8a6..b476e930a8 100644 --- a/components/esm3/loadarmo.cpp +++ b/components/esm3/loadarmo.cpp @@ -56,26 +56,26 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'M','O','D','L'>::value: + case ESM::fourCC("MODL"): mModel = esm.getHString(); break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): mName = esm.getHString(); break; - case ESM::FourCC<'A','O','D','T'>::value: + case ESM::fourCC("AODT"): esm.getHT(mData, 24); hasData = true; break; - case ESM::FourCC<'S','C','R','I'>::value: + case ESM::fourCC("SCRI"): mScript = esm.getHString(); break; - case ESM::FourCC<'I','T','E','X'>::value: + case ESM::fourCC("ITEX"): mIcon = esm.getHString(); break; - case ESM::FourCC<'E','N','A','M'>::value: + case ESM::fourCC("ENAM"): mEnchant = esm.getHString(); break; - case ESM::FourCC<'I','N','D','X'>::value: + case ESM::fourCC("INDX"): mParts.add(esm); break; case ESM::SREC_DELE: diff --git a/components/esm3/loadbody.cpp b/components/esm3/loadbody.cpp index 1098941c25..148e80d94c 100644 --- a/components/esm3/loadbody.cpp +++ b/components/esm3/loadbody.cpp @@ -24,13 +24,13 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'M','O','D','L'>::value: + case ESM::fourCC("MODL"): mModel = esm.getHString(); break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): mRace = esm.getHString(); break; - case ESM::FourCC<'B','Y','D','T'>::value: + case ESM::fourCC("BYDT"): esm.getHT(mData, 4); hasData = true; break; diff --git a/components/esm3/loadbook.cpp b/components/esm3/loadbook.cpp index c03046ed9f..72618f3ce8 100644 --- a/components/esm3/loadbook.cpp +++ b/components/esm3/loadbook.cpp @@ -24,26 +24,26 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'M','O','D','L'>::value: + case ESM::fourCC("MODL"): mModel = esm.getHString(); break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): mName = esm.getHString(); break; - case ESM::FourCC<'B','K','D','T'>::value: + case ESM::fourCC("BKDT"): esm.getHT(mData, 20); hasData = true; break; - case ESM::FourCC<'S','C','R','I'>::value: + case ESM::fourCC("SCRI"): mScript = esm.getHString(); break; - case ESM::FourCC<'I','T','E','X'>::value: + case ESM::fourCC("ITEX"): mIcon = esm.getHString(); break; - case ESM::FourCC<'E','N','A','M'>::value: + case ESM::fourCC("ENAM"): mEnchant = esm.getHString(); break; - case ESM::FourCC<'T','E','X','T'>::value: + case ESM::fourCC("TEXT"): mText = esm.getHString(); break; case ESM::SREC_DELE: diff --git a/components/esm3/loadbsgn.cpp b/components/esm3/loadbsgn.cpp index d02fc93914..c894918bb2 100644 --- a/components/esm3/loadbsgn.cpp +++ b/components/esm3/loadbsgn.cpp @@ -25,16 +25,16 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): mName = esm.getHString(); break; - case ESM::FourCC<'T','N','A','M'>::value: + case ESM::fourCC("TNAM"): mTexture = esm.getHString(); break; - case ESM::FourCC<'D','E','S','C'>::value: + case ESM::fourCC("DESC"): mDescription = esm.getHString(); break; - case ESM::FourCC<'N','P','C','S'>::value: + case ESM::fourCC("NPCS"): mPowers.add(esm); break; case ESM::SREC_DELE: diff --git a/components/esm3/loadcell.cpp b/components/esm3/loadcell.cpp index 256be62898..6a4cd6ebf9 100644 --- a/components/esm3/loadcell.cpp +++ b/components/esm3/loadcell.cpp @@ -75,7 +75,7 @@ namespace ESM case ESM::SREC_NAME: mName = esm.getHString(); break; - case ESM::FourCC<'D','A','T','A'>::value: + case ESM::fourCC("DATA"): esm.getHT(mData, 12); hasData = true; break; @@ -119,13 +119,13 @@ namespace ESM esm.getSubName(); switch (esm.retSubName().toInt()) { - case ESM::FourCC<'I','N','T','V'>::value: + case ESM::fourCC("INTV"): int waterl; esm.getHT(waterl); mWater = static_cast(waterl); mWaterInt = true; break; - case ESM::FourCC<'W','H','G','T'>::value: + case ESM::fourCC("WHGT"): float waterLevel; esm.getHT(waterLevel); mWaterInt = false; @@ -138,17 +138,17 @@ namespace ESM else mWater = waterLevel; break; - case ESM::FourCC<'A','M','B','I'>::value: + case ESM::fourCC("AMBI"): esm.getHT(mAmbi); mHasAmbi = true; break; - case ESM::FourCC<'R','G','N','N'>::value: + case ESM::fourCC("RGNN"): mRegion = esm.getHString(); break; - case ESM::FourCC<'N','A','M','5'>::value: + case ESM::fourCC("NAM5"): esm.getHT(mMapColor); break; - case ESM::FourCC<'N','A','M','0'>::value: + case ESM::fourCC("NAM0"): esm.getHT(mRefNumCounter); break; default: diff --git a/components/esm3/loadclas.cpp b/components/esm3/loadclas.cpp index 0bd966e752..ecd43796de 100644 --- a/components/esm3/loadclas.cpp +++ b/components/esm3/loadclas.cpp @@ -54,16 +54,16 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): mName = esm.getHString(); break; - case ESM::FourCC<'C','L','D','T'>::value: + case ESM::fourCC("CLDT"): esm.getHT(mData, 60); if (mData.mIsPlayable > 1) esm.fail("Unknown bool value"); hasData = true; break; - case ESM::FourCC<'D','E','S','C'>::value: + case ESM::fourCC("DESC"): mDescription = esm.getHString(); break; case ESM::SREC_DELE: diff --git a/components/esm3/loadclot.cpp b/components/esm3/loadclot.cpp index 05a895b0f4..1bd5db9655 100644 --- a/components/esm3/loadclot.cpp +++ b/components/esm3/loadclot.cpp @@ -26,26 +26,26 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'M','O','D','L'>::value: + case ESM::fourCC("MODL"): mModel = esm.getHString(); break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): mName = esm.getHString(); break; - case ESM::FourCC<'C','T','D','T'>::value: + case ESM::fourCC("CTDT"): esm.getHT(mData, 12); hasData = true; break; - case ESM::FourCC<'S','C','R','I'>::value: + case ESM::fourCC("SCRI"): mScript = esm.getHString(); break; - case ESM::FourCC<'I','T','E','X'>::value: + case ESM::fourCC("ITEX"): mIcon = esm.getHString(); break; - case ESM::FourCC<'E','N','A','M'>::value: + case ESM::fourCC("ENAM"): mEnchant = esm.getHString(); break; - case ESM::FourCC<'I','N','D','X'>::value: + case ESM::fourCC("INDX"): mParts.add(esm); break; case ESM::SREC_DELE: diff --git a/components/esm3/loadcont.cpp b/components/esm3/loadcont.cpp index 19bb649125..5cbdd80428 100644 --- a/components/esm3/loadcont.cpp +++ b/components/esm3/loadcont.cpp @@ -48,17 +48,17 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'M','O','D','L'>::value: + case ESM::fourCC("MODL"): mModel = esm.getHString(); break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): mName = esm.getHString(); break; - case ESM::FourCC<'C','N','D','T'>::value: + case ESM::fourCC("CNDT"): esm.getHT(mWeight, 4); hasWeight = true; break; - case ESM::FourCC<'F','L','A','G'>::value: + case ESM::fourCC("FLAG"): esm.getHT(mFlags, 4); if (mFlags & 0xf4) esm.fail("Unknown flags"); @@ -66,10 +66,10 @@ namespace ESM esm.fail("Flag 8 not set"); hasFlags = true; break; - case ESM::FourCC<'S','C','R','I'>::value: + case ESM::fourCC("SCRI"): mScript = esm.getHString(); break; - case ESM::FourCC<'N','P','C','O'>::value: + case ESM::fourCC("NPCO"): mInventory.add(esm); break; case ESM::SREC_DELE: diff --git a/components/esm3/loadcrea.cpp b/components/esm3/loadcrea.cpp index 1cec61b3ab..f1203ed39e 100644 --- a/components/esm3/loadcrea.cpp +++ b/components/esm3/loadcrea.cpp @@ -37,43 +37,43 @@ namespace ESM { mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'M','O','D','L'>::value: + case ESM::fourCC("MODL"): mModel = esm.getHString(); break; - case ESM::FourCC<'C','N','A','M'>::value: + case ESM::fourCC("CNAM"): mOriginal = esm.getHString(); break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): mName = esm.getHString(); break; - case ESM::FourCC<'S','C','R','I'>::value: + case ESM::fourCC("SCRI"): mScript = esm.getHString(); break; - case ESM::FourCC<'N','P','D','T'>::value: + case ESM::fourCC("NPDT"): esm.getHT(mData, 96); hasNpdt = true; break; - case ESM::FourCC<'F','L','A','G'>::value: + case ESM::fourCC("FLAG"): int flags; esm.getHT(flags); mFlags = flags & 0xFF; mBloodType = ((flags >> 8) & 0xFF) >> 2; hasFlags = true; break; - case ESM::FourCC<'X','S','C','L'>::value: + case ESM::fourCC("XSCL"): esm.getHT(mScale); break; - case ESM::FourCC<'N','P','C','O'>::value: + case ESM::fourCC("NPCO"): mInventory.add(esm); break; - case ESM::FourCC<'N','P','C','S'>::value: + case ESM::fourCC("NPCS"): mSpells.add(esm); break; - case ESM::FourCC<'A','I','D','T'>::value: + case ESM::fourCC("AIDT"): esm.getHExact(&mAiData, sizeof(mAiData)); break; - case ESM::FourCC<'D','O','D','T'>::value: - case ESM::FourCC<'D','N','A','M'>::value: + case ESM::fourCC("DODT"): + case ESM::fourCC("DNAM"): mTransport.add(esm); break; case AI_Wander: @@ -88,7 +88,7 @@ namespace ESM { esm.skipHSub(); isDeleted = true; break; - case ESM::FourCC<'I','N','D','X'>::value: + case ESM::fourCC("INDX"): // seems to occur only in .ESS files, unsure of purpose int index; esm.getHT(index); diff --git a/components/esm3/loaddial.cpp b/components/esm3/loaddial.cpp index 67696be821..0c985def5b 100644 --- a/components/esm3/loaddial.cpp +++ b/components/esm3/loaddial.cpp @@ -30,7 +30,7 @@ namespace ESM esm.getSubName(); switch (esm.retSubName().toInt()) { - case ESM::FourCC<'D','A','T','A'>::value: + case ESM::fourCC("DATA"): { esm.getSubHeader(); int size = esm.getSubSize(); diff --git a/components/esm3/loaddoor.cpp b/components/esm3/loaddoor.cpp index 48fa0faaf3..e059a1dc05 100644 --- a/components/esm3/loaddoor.cpp +++ b/components/esm3/loaddoor.cpp @@ -23,19 +23,19 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'M','O','D','L'>::value: + case ESM::fourCC("MODL"): mModel = esm.getHString(); break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): mName = esm.getHString(); break; - case ESM::FourCC<'S','C','R','I'>::value: + case ESM::fourCC("SCRI"): mScript = esm.getHString(); break; - case ESM::FourCC<'S','N','A','M'>::value: + case ESM::fourCC("SNAM"): mOpenSound = esm.getHString(); break; - case ESM::FourCC<'A','N','A','M'>::value: + case ESM::fourCC("ANAM"): mCloseSound = esm.getHString(); break; case ESM::SREC_DELE: diff --git a/components/esm3/loadench.cpp b/components/esm3/loadench.cpp index fae0aa211b..2e138444f3 100644 --- a/components/esm3/loadench.cpp +++ b/components/esm3/loadench.cpp @@ -25,11 +25,11 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'E','N','D','T'>::value: + case ESM::fourCC("ENDT"): esm.getHT(mData, 16); hasData = true; break; - case ESM::FourCC<'E','N','A','M'>::value: + case ESM::fourCC("ENAM"): mEffects.add(esm); break; case ESM::SREC_DELE: diff --git a/components/esm3/loadfact.cpp b/components/esm3/loadfact.cpp index 554c30e40e..4d4697d93b 100644 --- a/components/esm3/loadfact.cpp +++ b/components/esm3/loadfact.cpp @@ -47,21 +47,21 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): mName = esm.getHString(); break; - case ESM::FourCC<'R','N','A','M'>::value: + case ESM::fourCC("RNAM"): if (rankCounter >= 10) esm.fail("Rank out of range"); mRanks[rankCounter++] = esm.getHString(); break; - case ESM::FourCC<'F','A','D','T'>::value: + case ESM::fourCC("FADT"): esm.getHT(mData, 240); if (mData.mIsHidden > 1) esm.fail("Unknown flag!"); hasData = true; break; - case ESM::FourCC<'A','N','A','M'>::value: + case ESM::fourCC("ANAM"): { std::string faction = esm.getHString(); int reaction; diff --git a/components/esm3/loadinfo.cpp b/components/esm3/loadinfo.cpp index 5cc1f9a090..0b5030bb82 100644 --- a/components/esm3/loadinfo.cpp +++ b/components/esm3/loadinfo.cpp @@ -25,19 +25,19 @@ namespace ESM esm.getSubName(); switch (esm.retSubName().toInt()) { - case ESM::FourCC<'D','A','T','A'>::value: + case ESM::fourCC("DATA"): esm.getHT(mData, 12); break; - case ESM::FourCC<'O','N','A','M'>::value: + case ESM::fourCC("ONAM"): mActor = esm.getHString(); break; - case ESM::FourCC<'R','N','A','M'>::value: + case ESM::fourCC("RNAM"): mRace = esm.getHString(); break; - case ESM::FourCC<'C','N','A','M'>::value: + case ESM::fourCC("CNAM"): mClass = esm.getHString(); break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): { mFaction = esm.getHString(); if (mFaction == "FFFF") @@ -46,19 +46,19 @@ namespace ESM } break; } - case ESM::FourCC<'A','N','A','M'>::value: + case ESM::fourCC("ANAM"): mCell = esm.getHString(); break; - case ESM::FourCC<'D','N','A','M'>::value: + case ESM::fourCC("DNAM"): mPcFaction = esm.getHString(); break; - case ESM::FourCC<'S','N','A','M'>::value: + case ESM::fourCC("SNAM"): mSound = esm.getHString(); break; case ESM::SREC_NAME: mResponse = esm.getHString(); break; - case ESM::FourCC<'S','C','V','R'>::value: + case ESM::fourCC("SCVR"): { SelectStruct ss; ss.mSelectRule = esm.getHString(); @@ -66,18 +66,18 @@ namespace ESM mSelects.push_back(ss); break; } - case ESM::FourCC<'B','N','A','M'>::value: + case ESM::fourCC("BNAM"): mResultScript = esm.getHString(); break; - case ESM::FourCC<'Q','S','T','N'>::value: + case ESM::fourCC("QSTN"): mQuestStatus = QS_Name; esm.skipRecord(); break; - case ESM::FourCC<'Q','S','T','F'>::value: + case ESM::fourCC("QSTF"): mQuestStatus = QS_Finished; esm.skipRecord(); break; - case ESM::FourCC<'Q','S','T','R'>::value: + case ESM::fourCC("QSTR"): mQuestStatus = QS_Restart; esm.skipRecord(); break; diff --git a/components/esm3/loadingr.cpp b/components/esm3/loadingr.cpp index 652e381881..173e2c5636 100644 --- a/components/esm3/loadingr.cpp +++ b/components/esm3/loadingr.cpp @@ -24,20 +24,20 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'M','O','D','L'>::value: + case ESM::fourCC("MODL"): mModel = esm.getHString(); break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): mName = esm.getHString(); break; - case ESM::FourCC<'I','R','D','T'>::value: + case ESM::fourCC("IRDT"): esm.getHT(mData, 56); hasData = true; break; - case ESM::FourCC<'S','C','R','I'>::value: + case ESM::fourCC("SCRI"): mScript = esm.getHString(); break; - case ESM::FourCC<'I','T','E','X'>::value: + case ESM::fourCC("ITEX"): mIcon = esm.getHString(); break; case ESM::SREC_DELE: diff --git a/components/esm3/loadland.cpp b/components/esm3/loadland.cpp index 24cac7f015..f9563411a3 100644 --- a/components/esm3/loadland.cpp +++ b/components/esm3/loadland.cpp @@ -46,7 +46,7 @@ namespace ESM esm.getSubName(); switch (esm.retSubName().toInt()) { - case ESM::FourCC<'I','N','T','V'>::value: + case ESM::fourCC("INTV"): esm.getSubHeader(); if (esm.getSubSize() != 8) esm.fail("Subrecord size is not equal to 8"); @@ -54,7 +54,7 @@ namespace ESM esm.getT(mY); hasLocation = true; break; - case ESM::FourCC<'D','A','T','A'>::value: + case ESM::fourCC("DATA"): esm.getHT(mFlags); break; case ESM::SREC_DELE: @@ -82,23 +82,23 @@ namespace ESM esm.getSubName(); switch (esm.retSubName().toInt()) { - case ESM::FourCC<'V','N','M','L'>::value: + case ESM::fourCC("VNML"): esm.skipHSub(); mDataTypes |= DATA_VNML; break; - case ESM::FourCC<'V','H','G','T'>::value: + case ESM::fourCC("VHGT"): esm.skipHSub(); mDataTypes |= DATA_VHGT; break; - case ESM::FourCC<'W','N','A','M'>::value: + case ESM::fourCC("WNAM"): esm.getHExact(mWnam, sizeof(mWnam)); mDataTypes |= DATA_WNAM; break; - case ESM::FourCC<'V','C','L','R'>::value: + case ESM::fourCC("VCLR"): esm.skipHSub(); mDataTypes |= DATA_VCLR; break; - case ESM::FourCC<'V','T','E','X'>::value: + case ESM::fourCC("VTEX"): esm.skipHSub(); mDataTypes |= DATA_VTEX; break; diff --git a/components/esm3/loadlevlist.cpp b/components/esm3/loadlevlist.cpp index 2aa209fadb..ace5304152 100644 --- a/components/esm3/loadlevlist.cpp +++ b/components/esm3/loadlevlist.cpp @@ -22,13 +22,13 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'D','A','T','A'>::value: + case ESM::fourCC("DATA"): esm.getHT(mFlags); break; - case ESM::FourCC<'N','N','A','M'>::value: + case ESM::fourCC("NNAM"): esm.getHT(mChanceNone); break; - case ESM::FourCC<'I','N','D','X'>::value: + case ESM::fourCC("INDX"): { int length = 0; esm.getHT(length); diff --git a/components/esm3/loadligh.cpp b/components/esm3/loadligh.cpp index 4e8c41fbb9..94c109e677 100644 --- a/components/esm3/loadligh.cpp +++ b/components/esm3/loadligh.cpp @@ -24,23 +24,23 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'M','O','D','L'>::value: + case ESM::fourCC("MODL"): mModel = esm.getHString(); break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): mName = esm.getHString(); break; - case ESM::FourCC<'I','T','E','X'>::value: + case ESM::fourCC("ITEX"): mIcon = esm.getHString(); break; - case ESM::FourCC<'L','H','D','T'>::value: + case ESM::fourCC("LHDT"): esm.getHT(mData, 24); hasData = true; break; - case ESM::FourCC<'S','C','R','I'>::value: + case ESM::fourCC("SCRI"): mScript = esm.getHString(); break; - case ESM::FourCC<'S','N','A','M'>::value: + case ESM::fourCC("SNAM"): mSound = esm.getHString(); break; case ESM::SREC_DELE: diff --git a/components/esm3/loadlock.cpp b/components/esm3/loadlock.cpp index 10ac680ab5..50d27d4e1a 100644 --- a/components/esm3/loadlock.cpp +++ b/components/esm3/loadlock.cpp @@ -24,20 +24,20 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'M','O','D','L'>::value: + case ESM::fourCC("MODL"): mModel = esm.getHString(); break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): mName = esm.getHString(); break; - case ESM::FourCC<'L','K','D','T'>::value: + case ESM::fourCC("LKDT"): esm.getHT(mData, 16); hasData = true; break; - case ESM::FourCC<'S','C','R','I'>::value: + case ESM::fourCC("SCRI"): mScript = esm.getHString(); break; - case ESM::FourCC<'I','T','E','X'>::value: + case ESM::fourCC("ITEX"): mIcon = esm.getHString(); break; case ESM::SREC_DELE: diff --git a/components/esm3/loadltex.cpp b/components/esm3/loadltex.cpp index 3d01c4fe17..de5eb53e56 100644 --- a/components/esm3/loadltex.cpp +++ b/components/esm3/loadltex.cpp @@ -23,11 +23,11 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'I','N','T','V'>::value: + case ESM::fourCC("INTV"): esm.getHT(mIndex); hasIndex = true; break; - case ESM::FourCC<'D','A','T','A'>::value: + case ESM::fourCC("DATA"): mTexture = esm.getHString(); break; case ESM::SREC_DELE: diff --git a/components/esm3/loadmgef.cpp b/components/esm3/loadmgef.cpp index e86907564c..f15d51def6 100644 --- a/components/esm3/loadmgef.cpp +++ b/components/esm3/loadmgef.cpp @@ -211,37 +211,37 @@ void MagicEffect::load(ESMReader &esm, bool &isDeleted) esm.getSubName(); switch (esm.retSubName().toInt()) { - case ESM::FourCC<'I','T','E','X'>::value: + case ESM::fourCC("ITEX"): mIcon = esm.getHString(); break; - case ESM::FourCC<'P','T','E','X'>::value: + case ESM::fourCC("PTEX"): mParticle = esm.getHString(); break; - case ESM::FourCC<'B','S','N','D'>::value: + case ESM::fourCC("BSND"): mBoltSound = esm.getHString(); break; - case ESM::FourCC<'C','S','N','D'>::value: + case ESM::fourCC("CSND"): mCastSound = esm.getHString(); break; - case ESM::FourCC<'H','S','N','D'>::value: + case ESM::fourCC("HSND"): mHitSound = esm.getHString(); break; - case ESM::FourCC<'A','S','N','D'>::value: + case ESM::fourCC("ASND"): mAreaSound = esm.getHString(); break; - case ESM::FourCC<'C','V','F','X'>::value: + case ESM::fourCC("CVFX"): mCasting = esm.getHString(); break; - case ESM::FourCC<'B','V','F','X'>::value: + case ESM::fourCC("BVFX"): mBolt = esm.getHString(); break; - case ESM::FourCC<'H','V','F','X'>::value: + case ESM::fourCC("HVFX"): mHit = esm.getHString(); break; - case ESM::FourCC<'A','V','F','X'>::value: + case ESM::fourCC("AVFX"): mArea = esm.getHString(); break; - case ESM::FourCC<'D','E','S','C'>::value: + case ESM::fourCC("DESC"): mDescription = esm.getHString(); break; default: diff --git a/components/esm3/loadmisc.cpp b/components/esm3/loadmisc.cpp index 0405382cfd..eee46ac8b0 100644 --- a/components/esm3/loadmisc.cpp +++ b/components/esm3/loadmisc.cpp @@ -24,20 +24,20 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'M','O','D','L'>::value: + case ESM::fourCC("MODL"): mModel = esm.getHString(); break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): mName = esm.getHString(); break; - case ESM::FourCC<'M','C','D','T'>::value: + case ESM::fourCC("MCDT"): esm.getHT(mData, 12); hasData = true; break; - case ESM::FourCC<'S','C','R','I'>::value: + case ESM::fourCC("SCRI"): mScript = esm.getHString(); break; - case ESM::FourCC<'I','T','E','X'>::value: + case ESM::fourCC("ITEX"): mIcon = esm.getHString(); break; case ESM::SREC_DELE: diff --git a/components/esm3/loadnpc.cpp b/components/esm3/loadnpc.cpp index 07ee560b54..338b453a5a 100644 --- a/components/esm3/loadnpc.cpp +++ b/components/esm3/loadnpc.cpp @@ -32,31 +32,31 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'M','O','D','L'>::value: + case ESM::fourCC("MODL"): mModel = esm.getHString(); break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): mName = esm.getHString(); break; - case ESM::FourCC<'R','N','A','M'>::value: + case ESM::fourCC("RNAM"): mRace = esm.getHString(); break; - case ESM::FourCC<'C','N','A','M'>::value: + case ESM::fourCC("CNAM"): mClass = esm.getHString(); break; - case ESM::FourCC<'A','N','A','M'>::value: + case ESM::fourCC("ANAM"): mFaction = esm.getHString(); break; - case ESM::FourCC<'B','N','A','M'>::value: + case ESM::fourCC("BNAM"): mHead = esm.getHString(); break; - case ESM::FourCC<'K','N','A','M'>::value: + case ESM::fourCC("KNAM"): mHair = esm.getHString(); break; - case ESM::FourCC<'S','C','R','I'>::value: + case ESM::fourCC("SCRI"): mScript = esm.getHString(); break; - case ESM::FourCC<'N','P','D','T'>::value: + case ESM::fourCC("NPDT"): hasNpdt = true; esm.getSubHeader(); if (esm.getSubSize() == 52) @@ -83,24 +83,24 @@ namespace ESM else esm.fail("NPC_NPDT must be 12 or 52 bytes long"); break; - case ESM::FourCC<'F','L','A','G'>::value: + case ESM::fourCC("FLAG"): hasFlags = true; int flags; esm.getHT(flags); mFlags = flags & 0xFF; mBloodType = ((flags >> 8) & 0xFF) >> 2; break; - case ESM::FourCC<'N','P','C','S'>::value: + case ESM::fourCC("NPCS"): mSpells.add(esm); break; - case ESM::FourCC<'N','P','C','O'>::value: + case ESM::fourCC("NPCO"): mInventory.add(esm); break; - case ESM::FourCC<'A','I','D','T'>::value: + case ESM::fourCC("AIDT"): esm.getHExact(&mAiData, sizeof(mAiData)); break; - case ESM::FourCC<'D','O','D','T'>::value: - case ESM::FourCC<'D','N','A','M'>::value: + case ESM::fourCC("DODT"): + case ESM::fourCC("DNAM"): mTransport.add(esm); break; case AI_Wander: diff --git a/components/esm3/loadpgrd.cpp b/components/esm3/loadpgrd.cpp index da90018619..9d0f3cf66c 100644 --- a/components/esm3/loadpgrd.cpp +++ b/components/esm3/loadpgrd.cpp @@ -51,11 +51,11 @@ namespace ESM case ESM::SREC_NAME: mCell = esm.getHString(); break; - case ESM::FourCC<'D','A','T','A'>::value: + case ESM::fourCC("DATA"): esm.getHT(mData, 12); hasData = true; break; - case ESM::FourCC<'P','G','R','P'>::value: + case ESM::fourCC("PGRP"): { esm.getSubHeader(); int size = esm.getSubSize(); @@ -76,7 +76,7 @@ namespace ESM } break; } - case ESM::FourCC<'P','G','R','C'>::value: + case ESM::fourCC("PGRC"): { esm.getSubHeader(); int size = esm.getSubSize(); diff --git a/components/esm3/loadprob.cpp b/components/esm3/loadprob.cpp index 644abb6a39..10738c0863 100644 --- a/components/esm3/loadprob.cpp +++ b/components/esm3/loadprob.cpp @@ -24,20 +24,20 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'M','O','D','L'>::value: + case ESM::fourCC("MODL"): mModel = esm.getHString(); break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): mName = esm.getHString(); break; - case ESM::FourCC<'P','B','D','T'>::value: + case ESM::fourCC("PBDT"): esm.getHT(mData, 16); hasData = true; break; - case ESM::FourCC<'S','C','R','I'>::value: + case ESM::fourCC("SCRI"): mScript = esm.getHString(); break; - case ESM::FourCC<'I','T','E','X'>::value: + case ESM::fourCC("ITEX"): mIcon = esm.getHString(); break; case ESM::SREC_DELE: diff --git a/components/esm3/loadrace.cpp b/components/esm3/loadrace.cpp index 092d064cd8..ba0046bc9b 100644 --- a/components/esm3/loadrace.cpp +++ b/components/esm3/loadrace.cpp @@ -36,17 +36,17 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): mName = esm.getHString(); break; - case ESM::FourCC<'R','A','D','T'>::value: + case ESM::fourCC("RADT"): esm.getHT(mData, 140); hasData = true; break; - case ESM::FourCC<'D','E','S','C'>::value: + case ESM::fourCC("DESC"): mDescription = esm.getHString(); break; - case ESM::FourCC<'N','P','C','S'>::value: + case ESM::fourCC("NPCS"): mPowers.add(esm); break; case ESM::SREC_DELE: diff --git a/components/esm3/loadregn.cpp b/components/esm3/loadregn.cpp index 9e8921e939..e2682e644e 100644 --- a/components/esm3/loadregn.cpp +++ b/components/esm3/loadregn.cpp @@ -23,10 +23,10 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): mName = esm.getHString(); break; - case ESM::FourCC<'W','E','A','T'>::value: + case ESM::fourCC("WEAT"): { esm.getSubHeader(); if (esm.getVer() == VER_12) @@ -55,13 +55,13 @@ namespace ESM } break; } - case ESM::FourCC<'B','N','A','M'>::value: + case ESM::fourCC("BNAM"): mSleepList = esm.getHString(); break; - case ESM::FourCC<'C','N','A','M'>::value: + case ESM::fourCC("CNAM"): esm.getHT(mMapColor); break; - case ESM::FourCC<'S','N','A','M'>::value: + case ESM::fourCC("SNAM"): { esm.getSubHeader(); SoundRef sr; diff --git a/components/esm3/loadrepa.cpp b/components/esm3/loadrepa.cpp index f7349256f0..aaf518a1cd 100644 --- a/components/esm3/loadrepa.cpp +++ b/components/esm3/loadrepa.cpp @@ -24,20 +24,20 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'M','O','D','L'>::value: + case ESM::fourCC("MODL"): mModel = esm.getHString(); break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): mName = esm.getHString(); break; - case ESM::FourCC<'R','I','D','T'>::value: + case ESM::fourCC("RIDT"): esm.getHT(mData, 16); hasData = true; break; - case ESM::FourCC<'S','C','R','I'>::value: + case ESM::fourCC("SCRI"): mScript = esm.getHString(); break; - case ESM::FourCC<'I','T','E','X'>::value: + case ESM::fourCC("ITEX"): mIcon = esm.getHString(); break; case ESM::SREC_DELE: diff --git a/components/esm3/loadscpt.cpp b/components/esm3/loadscpt.cpp index a7e59f837e..f226d5f3be 100644 --- a/components/esm3/loadscpt.cpp +++ b/components/esm3/loadscpt.cpp @@ -93,7 +93,7 @@ namespace ESM esm.getSubName(); switch (esm.retSubName().toInt()) { - case ESM::FourCC<'S','C','H','D'>::value: + case ESM::fourCC("SCHD"): { esm.getSubHeader(); mId = esm.getString(32); @@ -102,11 +102,11 @@ namespace ESM hasHeader = true; break; } - case ESM::FourCC<'S','C','V','R'>::value: + case ESM::fourCC("SCVR"): // list of local variables loadSCVR(esm); break; - case ESM::FourCC<'S','C','D','T'>::value: + case ESM::fourCC("SCDT"): { // compiled script esm.getSubHeader(); @@ -125,7 +125,7 @@ namespace ESM esm.getExact(mScriptData.data(), mScriptData.size()); break; } - case ESM::FourCC<'S','C','T','X'>::value: + case ESM::fourCC("SCTX"): mScriptText = esm.getHString(); break; case ESM::SREC_DELE: diff --git a/components/esm3/loadskil.cpp b/components/esm3/loadskil.cpp index 5843b3ddb5..902410fe5a 100644 --- a/components/esm3/loadskil.cpp +++ b/components/esm3/loadskil.cpp @@ -139,15 +139,15 @@ namespace ESM esm.getSubName(); switch (esm.retSubName().toInt()) { - case ESM::FourCC<'I','N','D','X'>::value: + case ESM::fourCC("INDX"): esm.getHT(mIndex); hasIndex = true; break; - case ESM::FourCC<'S','K','D','T'>::value: + case ESM::fourCC("SKDT"): esm.getHT(mData, 24); hasData = true; break; - case ESM::FourCC<'D','E','S','C'>::value: + case ESM::fourCC("DESC"): mDescription = esm.getHString(); break; default: diff --git a/components/esm3/loadsndg.cpp b/components/esm3/loadsndg.cpp index 17423a061b..2f5dea1eb4 100644 --- a/components/esm3/loadsndg.cpp +++ b/components/esm3/loadsndg.cpp @@ -24,14 +24,14 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'D','A','T','A'>::value: + case ESM::fourCC("DATA"): esm.getHT(mType, 4); hasData = true; break; - case ESM::FourCC<'C','N','A','M'>::value: + case ESM::fourCC("CNAM"): mCreature = esm.getHString(); break; - case ESM::FourCC<'S','N','A','M'>::value: + case ESM::fourCC("SNAM"): mSound = esm.getHString(); break; case ESM::SREC_DELE: diff --git a/components/esm3/loadsoun.cpp b/components/esm3/loadsoun.cpp index 109d732da5..453d4eebfc 100644 --- a/components/esm3/loadsoun.cpp +++ b/components/esm3/loadsoun.cpp @@ -24,10 +24,10 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): mSound = esm.getHString(); break; - case ESM::FourCC<'D','A','T','A'>::value: + case ESM::fourCC("DATA"): esm.getHT(mData, 3); hasData = true; break; diff --git a/components/esm3/loadspel.cpp b/components/esm3/loadspel.cpp index d113cdd194..aeed60a1cb 100644 --- a/components/esm3/loadspel.cpp +++ b/components/esm3/loadspel.cpp @@ -26,14 +26,14 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): mName = esm.getHString(); break; - case ESM::FourCC<'S','P','D','T'>::value: + case ESM::fourCC("SPDT"): esm.getHT(mData, 12); hasData = true; break; - case ESM::FourCC<'E','N','A','M'>::value: + case ESM::fourCC("ENAM"): ENAMstruct s; esm.getHT(s, 24); mEffects.mList.push_back(s); diff --git a/components/esm3/loadsscr.cpp b/components/esm3/loadsscr.cpp index 59d6eab58e..03c5b49380 100644 --- a/components/esm3/loadsscr.cpp +++ b/components/esm3/loadsscr.cpp @@ -24,7 +24,7 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'D','A','T','A'>::value: + case ESM::fourCC("DATA"): mData = esm.getHString(); hasData = true; break; diff --git a/components/esm3/loadstat.cpp b/components/esm3/loadstat.cpp index a4941f0895..fd557d37d5 100644 --- a/components/esm3/loadstat.cpp +++ b/components/esm3/loadstat.cpp @@ -25,7 +25,7 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'M','O','D','L'>::value: + case ESM::fourCC("MODL"): mModel = esm.getHString(); break; case ESM::SREC_DELE: diff --git a/components/esm3/loadweap.cpp b/components/esm3/loadweap.cpp index e109096e09..e75ecf7516 100644 --- a/components/esm3/loadweap.cpp +++ b/components/esm3/loadweap.cpp @@ -24,23 +24,23 @@ namespace ESM mId = esm.getHString(); hasName = true; break; - case ESM::FourCC<'M','O','D','L'>::value: + case ESM::fourCC("MODL"): mModel = esm.getHString(); break; - case ESM::FourCC<'F','N','A','M'>::value: + case ESM::fourCC("FNAM"): mName = esm.getHString(); break; - case ESM::FourCC<'W','P','D','T'>::value: + case ESM::fourCC("WPDT"): esm.getHT(mData, 32); hasData = true; break; - case ESM::FourCC<'S','C','R','I'>::value: + case ESM::fourCC("SCRI"): mScript = esm.getHString(); break; - case ESM::FourCC<'I','T','E','X'>::value: + case ESM::fourCC("ITEX"): mIcon = esm.getHString(); break; - case ESM::FourCC<'E','N','A','M'>::value: + case ESM::fourCC("ENAM"): mEnchant = esm.getHString(); break; case ESM::SREC_DELE: diff --git a/components/esm3/transport.cpp b/components/esm3/transport.cpp index 958ef6949a..40f831e748 100644 --- a/components/esm3/transport.cpp +++ b/components/esm3/transport.cpp @@ -10,13 +10,13 @@ namespace ESM void Transport::add(ESMReader &esm) { - if (esm.retSubName().toInt() == ESM::FourCC<'D','O','D','T'>::value) + if (esm.retSubName().toInt() == ESM::fourCC("DODT")) { Dest dodt; esm.getHExact(&dodt.mPos, 24); mList.push_back(dodt); } - else if (esm.retSubName().toInt() == ESM::FourCC<'D','N','A','M'>::value) + else if (esm.retSubName().toInt() == ESM::fourCC("DNAM")) { const std::string name = esm.getHString(); if (mList.empty()) diff --git a/components/esm3/variant.cpp b/components/esm3/variant.cpp index 732d7e7f29..c50581327d 100644 --- a/components/esm3/variant.cpp +++ b/components/esm3/variant.cpp @@ -10,10 +10,10 @@ namespace { - constexpr uint32_t STRV = ESM::FourCC<'S','T','R','V'>::value; - constexpr uint32_t INTV = ESM::FourCC<'I','N','T','V'>::value; - constexpr uint32_t FLTV = ESM::FourCC<'F','L','T','V'>::value; - constexpr uint32_t STTV = ESM::FourCC<'S','T','T','V'>::value; + constexpr uint32_t STRV = ESM::fourCC("STRV"); + constexpr uint32_t INTV = ESM::fourCC("INTV"); + constexpr uint32_t FLTV = ESM::fourCC("FLTV"); + constexpr uint32_t STTV = ESM::fourCC("STTV"); template struct GetValue