1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-21 09:39:56 +00:00

Make the sRedcordId constexpr

This commit is contained in:
jvoisin 2022-06-04 16:07:59 +02:00
parent 33c66e3d5e
commit 6c71071083
88 changed files with 147 additions and 163 deletions

View File

@ -2,13 +2,10 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int DebugProfile::sRecordId = REC_DBGP;
void DebugProfile::load (ESMReader& esm, bool &isDeleted) void DebugProfile::load (ESMReader& esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string> #include <string>
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
class ESMReader; class ESMReader;
@ -10,7 +12,8 @@ namespace ESM
struct DebugProfile struct DebugProfile
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_DBGP;
enum Flags enum Flags
{ {

View File

@ -2,13 +2,10 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int Filter::sRecordId = REC_FILT;
void Filter::load (ESMReader& esm, bool &isDeleted) void Filter::load (ESMReader& esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -2,6 +2,7 @@
#define COMPONENTS_ESM_FILTER_H #define COMPONENTS_ESM_FILTER_H
#include <string> #include <string>
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -10,7 +11,8 @@ namespace ESM
struct Filter struct Filter
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_FILT;
unsigned int mRecordFlags; unsigned int mRecordFlags;
std::string mId; std::string mId;

View File

@ -2,13 +2,10 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int GlobalMap::sRecordId = REC_GMAP;
void GlobalMap::load (ESMReader &esm) void GlobalMap::load (ESMReader &esm)
{ {
esm.getHNT(mBounds, "BNDS"); esm.getHNT(mBounds, "BNDS");

View File

@ -4,6 +4,8 @@
#include <vector> #include <vector>
#include <set> #include <set>
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
class ESMReader; class ESMReader;
@ -14,7 +16,8 @@ namespace ESM
///< \brief An image containing the explored areas on the global map. ///< \brief An image containing the explored areas on the global map.
struct GlobalMap struct GlobalMap
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_GMAP;
// The minimum and maximum cell coordinates // The minimum and maximum cell coordinates
struct Bounds struct Bounds

View File

@ -6,8 +6,6 @@
namespace ESM namespace ESM
{ {
unsigned int Activator::sRecordId = REC_ACTI;
void Activator::load(ESMReader &esm, bool &isDeleted) void Activator::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -2,6 +2,7 @@
#define OPENMW_ESM_ACTI_H #define OPENMW_ESM_ACTI_H
#include <string> #include <string>
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -11,7 +12,8 @@ class ESMWriter;
struct Activator struct Activator
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_ACTI;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Activator"; } static std::string_view getRecordType() { return "Activator"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int Potion::sRecordId = REC_ALCH;
void Potion::load(ESMReader &esm, bool &isDeleted) void Potion::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -4,6 +4,7 @@
#include <string> #include <string>
#include "effectlist.hpp" #include "effectlist.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -17,7 +18,8 @@ class ESMWriter;
struct Potion struct Potion
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_ALCH;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Potion"; } static std::string_view getRecordType() { return "Potion"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int Apparatus::sRecordId = REC_APPA;
void Apparatus::load(ESMReader &esm, bool &isDeleted) void Apparatus::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string> #include <string>
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -15,7 +17,8 @@ class ESMWriter;
struct Apparatus struct Apparatus
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_APPA;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Apparatus"; } static std::string_view getRecordType() { return "Apparatus"; }

View File

@ -36,8 +36,6 @@ namespace ESM
} }
} }
unsigned int Armor::sRecordId = REC_ARMO;
void Armor::load(ESMReader &esm, bool &isDeleted) void Armor::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -4,6 +4,8 @@
#include <vector> #include <vector>
#include <string> #include <string>
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -65,7 +67,8 @@ struct PartReferenceList
struct Armor struct Armor
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_ARMO;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Armor"; } static std::string_view getRecordType() { return "Armor"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int BodyPart::sRecordId = REC_BODY;
void BodyPart::load(ESMReader &esm, bool &isDeleted) void BodyPart::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -2,6 +2,7 @@
#define OPENMW_ESM_BODY_H #define OPENMW_ESM_BODY_H
#include <string> #include <string>
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -11,7 +12,8 @@ class ESMWriter;
struct BodyPart struct BodyPart
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_BODY;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "BodyPart"; } static std::string_view getRecordType() { return "BodyPart"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int Book::sRecordId = REC_BOOK;
void Book::load(ESMReader &esm, bool &isDeleted) void Book::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -2,6 +2,7 @@
#define OPENMW_ESM_BOOK_H #define OPENMW_ESM_BOOK_H
#include <string> #include <string>
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -14,7 +15,8 @@ class ESMWriter;
struct Book struct Book
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_BOOK;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Book"; } static std::string_view getRecordType() { return "Book"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int BirthSign::sRecordId = REC_BSGN;
void BirthSign::load(ESMReader &esm, bool &isDeleted) void BirthSign::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -4,6 +4,7 @@
#include <string> #include <string>
#include "spelllist.hpp" #include "spelllist.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -13,7 +14,8 @@ class ESMWriter;
struct BirthSign struct BirthSign
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_BSGN;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "BirthSign"; } static std::string_view getRecordType() { return "BirthSign"; }

View File

@ -9,7 +9,6 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
#include "cellid.hpp" #include "cellid.hpp"
namespace ESM namespace ESM
@ -41,8 +40,6 @@ namespace
namespace ESM namespace ESM
{ {
unsigned int Cell::sRecordId = REC_CELL;
// Some overloaded compare operators. // Some overloaded compare operators.
bool operator== (const MovedCellRef& ref, const RefNum& refNum) bool operator== (const MovedCellRef& ref, const RefNum& refNum)
{ {

View File

@ -63,7 +63,8 @@ struct CellRefTrackerPredicate
*/ */
struct Cell struct Cell
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_CELL;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Cell"; } static std::string_view getRecordType() { return "Cell"; }

View File

@ -8,8 +8,6 @@
namespace ESM namespace ESM
{ {
unsigned int Class::sRecordId = REC_CLAS;
const Class::Specialization Class::sSpecializationIds[3] = { const Class::Specialization Class::sSpecializationIds[3] = {
Class::Combat, Class::Combat,
Class::Magic, Class::Magic,

View File

@ -3,6 +3,8 @@
#include <string> #include <string>
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -17,7 +19,8 @@ class ESMWriter;
// class // class
struct Class struct Class
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_CLAS;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Class"; } static std::string_view getRecordType() { return "Class"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int Clothing::sRecordId = REC_CLOT;
void Clothing::load(ESMReader &esm, bool &isDeleted) void Clothing::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -4,6 +4,7 @@
#include <string> #include <string>
#include "loadarmo.hpp" #include "loadarmo.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -17,7 +18,8 @@ class ESMWriter;
struct Clothing struct Clothing
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_CLOT;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Clothing"; } static std::string_view getRecordType() { return "Clothing"; }

View File

@ -27,8 +27,6 @@ namespace ESM
} }
} }
unsigned int Container::sRecordId = REC_CONT;
void Container::load(ESMReader &esm, bool &isDeleted) void Container::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -5,6 +5,7 @@
#include <vector> #include <vector>
#include "components/esm/esmcommon.hpp" #include "components/esm/esmcommon.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -35,7 +36,8 @@ struct InventoryList
struct Container struct Container
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_CONT;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Container"; } static std::string_view getRecordType() { return "Container"; }

View File

@ -4,13 +4,10 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int Creature::sRecordId = REC_CREA;
void Creature::load(ESMReader &esm, bool &isDeleted) void Creature::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -8,6 +8,8 @@
#include "aipackage.hpp" #include "aipackage.hpp"
#include "transport.hpp" #include "transport.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -21,7 +23,8 @@ class ESMWriter;
struct Creature struct Creature
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_CREA;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Creature"; } static std::string_view getRecordType() { return "Creature"; }

View File

@ -4,11 +4,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int Dialogue::sRecordId = REC_DIAL;
void Dialogue::load(ESMReader &esm, bool &isDeleted) void Dialogue::load(ESMReader &esm, bool &isDeleted)
{ {

View File

@ -5,6 +5,7 @@
#include <list> #include <list>
#include <map> #include <map>
#include "components/esm/defs.hpp"
#include "loadinfo.hpp" #include "loadinfo.hpp"
namespace ESM namespace ESM
@ -20,7 +21,7 @@ class ESMWriter;
struct Dialogue struct Dialogue
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_DIAL;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Dialogue"; } static std::string_view getRecordType() { return "Dialogue"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int Door::sRecordId = REC_DOOR;
void Door::load(ESMReader &esm, bool &isDeleted) void Door::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string> #include <string>
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -11,7 +13,8 @@ class ESMWriter;
struct Door struct Door
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_DOOR;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Door"; } static std::string_view getRecordType() { return "Door"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int Enchantment::sRecordId = REC_ENCH;
void Enchantment::load(ESMReader &esm, bool &isDeleted) void Enchantment::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -3,6 +3,7 @@
#include <string> #include <string>
#include "components/esm/defs.hpp"
#include "effectlist.hpp" #include "effectlist.hpp"
namespace ESM namespace ESM
@ -17,7 +18,8 @@ class ESMWriter;
struct Enchantment struct Enchantment
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_ENCH;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Enchantment"; } static std::string_view getRecordType() { return "Enchantment"; }

View File

@ -4,12 +4,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int Faction::sRecordId = REC_FACT;
int& Faction::FADTstruct::getSkill (int index, bool ignored) int& Faction::FADTstruct::getSkill (int index, bool ignored)
{ {
if (index<0 || index>=7) if (index<0 || index>=7)

View File

@ -4,6 +4,8 @@
#include <string> #include <string>
#include <map> #include <map>
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -30,7 +32,8 @@ struct RankData
struct Faction struct Faction
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_FACT;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Faction"; } static std::string_view getRecordType() { return "Faction"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int Global::sRecordId = REC_GLOB;
void Global::load (ESMReader &esm, bool &isDeleted) void Global::load (ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -5,6 +5,8 @@
#include "variant.hpp" #include "variant.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -17,7 +19,8 @@ class ESMWriter;
struct Global struct Global
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_GLOB;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Global"; } static std::string_view getRecordType() { return "Global"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int GameSetting::sRecordId = REC_GMST;
void GameSetting::load (ESMReader &esm, bool &isDeleted) void GameSetting::load (ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; // GameSetting record can't be deleted now (may be changed in the future) isDeleted = false; // GameSetting record can't be deleted now (may be changed in the future)

View File

@ -5,6 +5,8 @@
#include "variant.hpp" #include "variant.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -18,7 +20,8 @@ class ESMWriter;
struct GameSetting struct GameSetting
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_GMST;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "GameSetting"; } static std::string_view getRecordType() { return "GameSetting"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int DialInfo::sRecordId = REC_INFO;
void DialInfo::load(ESMReader &esm, bool &isDeleted) void DialInfo::load(ESMReader &esm, bool &isDeleted)
{ {
mId = esm.getHNString("INAM"); mId = esm.getHNString("INAM");

View File

@ -20,7 +20,8 @@ class ESMWriter;
struct DialInfo struct DialInfo
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_INFO;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "DialInfo"; } static std::string_view getRecordType() { return "DialInfo"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int Ingredient::sRecordId = REC_INGR;
void Ingredient::load(ESMReader &esm, bool &isDeleted) void Ingredient::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string> #include <string>
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -15,7 +17,8 @@ class ESMWriter;
struct Ingredient struct Ingredient
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_INGR;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Ingredient"; } static std::string_view getRecordType() { return "Ingredient"; }

View File

@ -9,8 +9,6 @@
namespace ESM namespace ESM
{ {
unsigned int Land::sRecordId = REC_LAND;
Land::Land() Land::Land()
: mFlags(0) : mFlags(0)
, mX(0) , mX(0)

View File

@ -5,6 +5,7 @@
#include <components/misc/constants.hpp> #include <components/misc/constants.hpp>
#include "components/esm/defs.hpp"
#include "components/esm/esmcommon.hpp" #include "components/esm/esmcommon.hpp"
namespace ESM namespace ESM
@ -19,7 +20,8 @@ class ESMWriter;
struct Land struct Land
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_LAND;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Land"; } static std::string_view getRecordType() { return "Land"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int Light::sRecordId = REC_LIGH;
void Light::load(ESMReader &esm, bool &isDeleted) void Light::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string> #include <string>
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -16,7 +18,8 @@ class ESMWriter;
struct Light struct Light
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_LIGH;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Light"; } static std::string_view getRecordType() { return "Light"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int Lockpick::sRecordId = REC_LOCK;
void Lockpick::load(ESMReader &esm, bool &isDeleted) void Lockpick::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string> #include <string>
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -11,7 +13,8 @@ class ESMWriter;
struct Lockpick struct Lockpick
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_LOCK;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Lockpick"; } static std::string_view getRecordType() { return "Lockpick"; }

View File

@ -6,8 +6,6 @@
namespace ESM namespace ESM
{ {
unsigned int LandTexture::sRecordId = REC_LTEX;
void LandTexture::load(ESMReader &esm, bool &isDeleted) void LandTexture::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string> #include <string>
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -18,7 +20,8 @@ class ESMWriter;
struct LandTexture struct LandTexture
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_LTEX;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "LandTexture"; } static std::string_view getRecordType() { return "LandTexture"; }

View File

@ -187,8 +187,6 @@ namespace
namespace ESM namespace ESM
{ {
unsigned int MagicEffect::sRecordId = REC_MGEF;
void MagicEffect::load(ESMReader &esm, bool &isDeleted) void MagicEffect::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; // MagicEffect record can't be deleted now (may be changed in the future) isDeleted = false; // MagicEffect record can't be deleted now (may be changed in the future)

View File

@ -5,6 +5,8 @@
#include <string_view> #include <string_view>
#include <map> #include <map>
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -13,7 +15,8 @@ class ESMWriter;
struct MagicEffect struct MagicEffect
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_MGEF;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "MagicEffect"; } static std::string_view getRecordType() { return "MagicEffect"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int Miscellaneous::sRecordId = REC_MISC;
void Miscellaneous::load(ESMReader &esm, bool &isDeleted) void Miscellaneous::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string> #include <string>
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -16,7 +18,8 @@ class ESMWriter;
struct Miscellaneous struct Miscellaneous
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_MISC;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Miscellaneous"; } static std::string_view getRecordType() { return "Miscellaneous"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int NPC::sRecordId = REC_NPC_;
void NPC::load(ESMReader &esm, bool &isDeleted) void NPC::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -23,7 +23,8 @@ class ESMWriter;
struct NPC struct NPC
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_NPC_;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "NPC"; } static std::string_view getRecordType() { return "NPC"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int Pathgrid::sRecordId = REC_PGRD;
Pathgrid::Point& Pathgrid::Point::operator=(const float rhs[3]) Pathgrid::Point& Pathgrid::Point::operator=(const float rhs[3])
{ {
mX = static_cast<int>(rhs[0]); mX = static_cast<int>(rhs[0]);

View File

@ -4,6 +4,8 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -15,7 +17,8 @@ class ESMWriter;
*/ */
struct Pathgrid struct Pathgrid
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_PGRD;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Pathgrid"; } static std::string_view getRecordType() { return "Pathgrid"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int Probe::sRecordId = REC_PROB;
void Probe::load(ESMReader &esm, bool &isDeleted) void Probe::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string> #include <string>
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -11,7 +13,8 @@ class ESMWriter;
struct Probe struct Probe
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_PROB;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Probe"; } static std::string_view getRecordType() { return "Probe"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int Race::sRecordId = REC_RACE;
int Race::MaleFemale::getValue (bool male) const int Race::MaleFemale::getValue (bool male) const
{ {
return male ? mMale : mFemale; return male ? mMale : mFemale;

View File

@ -4,6 +4,7 @@
#include <string> #include <string>
#include "spelllist.hpp" #include "spelllist.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -17,7 +18,8 @@ class ESMWriter;
struct Race struct Race
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_RACE;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Race"; } static std::string_view getRecordType() { return "Race"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int Region::sRecordId = REC_REGN;
void Region::load(ESMReader &esm, bool &isDeleted) void Region::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -4,6 +4,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "components/esm/defs.hpp"
#include "components/esm/esmcommon.hpp" #include "components/esm/esmcommon.hpp"
namespace ESM namespace ESM
@ -18,7 +19,8 @@ class ESMWriter;
struct Region struct Region
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_REGN;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Region"; } static std::string_view getRecordType() { return "Region"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int Repair::sRecordId = REC_REPA;
void Repair::load(ESMReader &esm, bool &isDeleted) void Repair::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string> #include <string>
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -11,7 +13,8 @@ class ESMWriter;
struct Repair struct Repair
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_REPA;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Repair"; } static std::string_view getRecordType() { return "Repair"; }

View File

@ -6,12 +6,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int Script::sRecordId = REC_SCPT;
void Script::loadSCVR(ESMReader &esm) void Script::loadSCVR(ESMReader &esm)
{ {
int s = mData.mStringTableSize; int s = mData.mStringTableSize;

View File

@ -4,6 +4,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "components/esm/defs.hpp"
#include "components/esm/esmcommon.hpp" #include "components/esm/esmcommon.hpp"
namespace ESM namespace ESM
@ -19,7 +20,8 @@ class ESMWriter;
class Script class Script
{ {
public: public:
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_SCPT;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Script"; } static std::string_view getRecordType() { return "Script"; }

View File

@ -125,8 +125,6 @@ namespace ESM
HandToHand HandToHand
}}; }};
unsigned int Skill::sRecordId = REC_SKIL;
void Skill::load(ESMReader &esm, bool &isDeleted) void Skill::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; // Skill record can't be deleted now (may be changed in the future) isDeleted = false; // Skill record can't be deleted now (may be changed in the future)

View File

@ -19,7 +19,8 @@ class ESMWriter;
struct Skill struct Skill
{ {
static unsigned int sRecordId;
constexpr static unsigned int sRecordId = REC_SKIL;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Skill"; } static std::string_view getRecordType() { return "Skill"; }

View File

@ -6,8 +6,6 @@
namespace ESM namespace ESM
{ {
unsigned int SoundGenerator::sRecordId = REC_SNDG;
void SoundGenerator::load(ESMReader &esm, bool &isDeleted) void SoundGenerator::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string> #include <string>
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -15,7 +17,8 @@ class ESMWriter;
struct SoundGenerator struct SoundGenerator
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_SNDG;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "SoundGenerator"; } static std::string_view getRecordType() { return "SoundGenerator"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int Sound::sRecordId = REC_SOUN;
void Sound::load(ESMReader &esm, bool &isDeleted) void Sound::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string> #include <string>
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -16,7 +18,8 @@ struct SOUNstruct
struct Sound struct Sound
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_SOUN;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Sound"; } static std::string_view getRecordType() { return "Sound"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int Spell::sRecordId = REC_SPEL;
void Spell::load(ESMReader &esm, bool &isDeleted) void Spell::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -4,6 +4,7 @@
#include <string> #include <string>
#include "effectlist.hpp" #include "effectlist.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -13,7 +14,8 @@ class ESMWriter;
struct Spell struct Spell
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_SPEL;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Spell"; } static std::string_view getRecordType() { return "Spell"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int StartScript::sRecordId = REC_SSCR;
void StartScript::load(ESMReader &esm, bool &isDeleted) void StartScript::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string> #include <string>
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -19,7 +21,8 @@ class ESMWriter;
struct StartScript struct StartScript
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_SSCR;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "StartScript"; } static std::string_view getRecordType() { return "StartScript"; }

View File

@ -2,12 +2,9 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
unsigned int Static::sRecordId = REC_STAT;
void Static::load(ESMReader &esm, bool &isDeleted) void Static::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -3,6 +3,8 @@
#include <string> #include <string>
#include "components/esm/defs.hpp"
namespace ESM namespace ESM
{ {
@ -23,7 +25,8 @@ class ESMWriter;
struct Static struct Static
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_STAT;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Static"; } static std::string_view getRecordType() { return "Static"; }

View File

@ -6,8 +6,6 @@
namespace ESM namespace ESM
{ {
unsigned int Weapon::sRecordId = REC_WEAP;
void Weapon::load(ESMReader &esm, bool &isDeleted) void Weapon::load(ESMReader &esm, bool &isDeleted)
{ {
isDeleted = false; isDeleted = false;

View File

@ -17,7 +17,8 @@ class ESMWriter;
struct Weapon struct Weapon
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_WEAP;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Weapon"; } static std::string_view getRecordType() { return "Weapon"; }

View File

@ -6,7 +6,6 @@
namespace ESM namespace ESM
{ {
unsigned int SavedGame::sRecordId = REC_SAVE;
int SavedGame::sCurrentFormat = 21; int SavedGame::sCurrentFormat = 21;
void SavedGame::load (ESMReader &esm) void SavedGame::load (ESMReader &esm)

View File

@ -15,7 +15,7 @@ namespace ESM
struct SavedGame struct SavedGame
{ {
static unsigned int sRecordId; constexpr static unsigned int sRecordId = REC_SAVE;
static int sCurrentFormat; static int sCurrentFormat;