1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 15:45:33 +00:00

Switch to a constexpr for FourCC constant

Add static asssert on wrong size
This commit is contained in:
duncanspumpkin 2022-03-07 16:05:24 +00:00
parent 8a182c130a
commit 3a117cac22
47 changed files with 323 additions and 323 deletions

View file

@ -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<unsigned int, std::shared_ptr<Converter> > converters;
converters[ESM::REC_GLOB] = std::shared_ptr<Converter>(new ConvertGlobal());

View file

@ -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 <int a, int b, int c, int d>
struct FourCC
{
static constexpr unsigned int value = (((((d << 8) | c) << 8) | b) << 8) | a;
};
template<std::size_t len>
constexpr unsigned int fourCC(const char(&name)[len]) {
static_assert(len == 5, "Constant must be 4 characters long. (Plus null terminator)");
return static_cast<unsigned char>(name[0]) | (static_cast<unsigned char>(name[1]) << 8) | (static_cast<unsigned char>(name[2]) << 16) | (static_cast<unsigned char>(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
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<'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_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")
};
}

View file

@ -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")
};

View file

@ -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;

View file

@ -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:

View file

@ -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:

View file

@ -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:

View file

@ -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:

View file

@ -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:

View file

@ -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:

View file

@ -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;

View file

@ -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:

View file

@ -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:

View file

@ -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<float>(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:

View file

@ -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:

View file

@ -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:

View file

@ -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:

View file

@ -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);

View file

@ -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();

View file

@ -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:

View file

@ -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:

View file

@ -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;

View file

@ -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;

View file

@ -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:

View file

@ -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<int>(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;

View file

@ -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);

View file

@ -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:

View file

@ -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:

View file

@ -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:

View file

@ -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:

View file

@ -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:

View file

@ -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:

View file

@ -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();

View file

@ -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:

View file

@ -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:

View file

@ -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;

View file

@ -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:

View file

@ -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:

View file

@ -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:

View file

@ -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:

View file

@ -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;

View file

@ -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);

View file

@ -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;

View file

@ -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:

View file

@ -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:

View file

@ -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())

View file

@ -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 <typename T, bool orDefault = false>
struct GetValue