From 3494e17b7ce0d0287dd1c534e6f071f0bf9b5310 Mon Sep 17 00:00:00 2001 From: greye Date: Mon, 1 Oct 2012 00:51:54 +0400 Subject: [PATCH] wipe record superclass --- components/esm/defs.hpp | 49 ++++++++++++++++++++++++++++++++++ components/esm/esmcommon.hpp | 2 ++ components/esm/loadacti.hpp | 5 +++- components/esm/loadalch.hpp | 5 +++- components/esm/loadappa.hpp | 6 ++++- components/esm/loadarmo.hpp | 5 ++-- components/esm/loadbody.hpp | 5 +++- components/esm/loadbook.hpp | 5 +++- components/esm/loadbsgn.hpp | 4 ++- components/esm/loadcell.hpp | 5 +++- components/esm/loadclas.hpp | 6 +++-- components/esm/loadclot.hpp | 4 ++- components/esm/loadcont.hpp | 4 ++- components/esm/loadcrea.hpp | 4 ++- components/esm/loadcrec.hpp | 5 ++-- components/esm/loaddial.hpp | 5 +++- components/esm/loaddoor.hpp | 5 ++-- components/esm/loadench.hpp | 5 +++- components/esm/loadfact.hpp | 5 ++-- components/esm/loadglob.hpp | 4 ++- components/esm/loadgmst.hpp | 5 +++- components/esm/loadinfo.hpp | 4 ++- components/esm/loadingr.hpp | 6 +++-- components/esm/loadland.hpp | 5 +++- components/esm/loadlevlist.hpp | 5 ++-- components/esm/loadligh.hpp | 5 ++-- components/esm/loadlocks.hpp | 5 +++- components/esm/loadltex.hpp | 5 ++-- components/esm/loadmgef.hpp | 5 ++-- components/esm/loadmisc.hpp | 5 ++-- components/esm/loadnpc.hpp | 5 +++- components/esm/loadnpcc.hpp | 5 ++-- components/esm/loadpgrd.hpp | 5 ++-- components/esm/loadrace.hpp | 5 +++- components/esm/loadregn.hpp | 4 ++- components/esm/loadscpt.hpp | 4 ++- components/esm/loadskil.hpp | 4 ++- components/esm/loadsndg.hpp | 5 ++-- components/esm/loadsoun.hpp | 5 ++-- components/esm/loadspel.hpp | 4 ++- components/esm/loadsscr.hpp | 5 ++-- components/esm/loadstat.hpp | 5 ++-- components/esm/loadweap.hpp | 5 ++-- components/esm/record.hpp | 26 ------------------ components/esm/records.hpp | 2 +- 45 files changed, 191 insertions(+), 86 deletions(-) diff --git a/components/esm/defs.hpp b/components/esm/defs.hpp index 0a8f95108..aa870f925 100644 --- a/components/esm/defs.hpp +++ b/components/esm/defs.hpp @@ -46,5 +46,54 @@ struct Position }; #pragma pack(pop) +enum RecNameInts +{ + REC_ACTI = 0x49544341, + REC_ALCH = 0x48434c41, + REC_APPA = 0x41505041, + REC_ARMO = 0x4f4d5241, + REC_BODY = 0x59444f42, + REC_BOOK = 0x4b4f4f42, + REC_BSGN = 0x4e475342, + REC_CELL = 0x4c4c4543, + REC_CLAS = 0x53414c43, + REC_CLOT = 0x544f4c43, + REC_CNTC = 0x43544e43, + REC_CONT = 0x544e4f43, + REC_CREA = 0x41455243, + REC_CREC = 0x43455243, + REC_DIAL = 0x4c414944, + REC_DOOR = 0x524f4f44, + REC_ENCH = 0x48434e45, + REC_FACT = 0x54434146, + REC_GLOB = 0x424f4c47, + REC_GMST = 0x54534d47, + REC_INFO = 0x4f464e49, + REC_INGR = 0x52474e49, + REC_LAND = 0x444e414c, + REC_LEVC = 0x4356454c, + REC_LEVI = 0x4956454c, + REC_LIGH = 0x4847494c, + REC_LOCK = 0x4b434f4c, + REC_LTEX = 0x5845544c, + REC_MGEF = 0x4645474d, + REC_MISC = 0x4353494d, + REC_NPC_ = 0x5f43504e, + REC_NPCC = 0x4343504e, + REC_PGRD = 0x44524750, + REC_PROB = 0x424f5250, + REC_RACE = 0x45434152, + REC_REGN = 0x4e474552, + REC_REPA = 0x41504552, + REC_SCPT = 0x54504353, + REC_SKIL = 0x4c494b53, + REC_SNDG = 0x47444e53, + REC_SOUN = 0x4e554f53, + REC_SPEL = 0x4c455053, + REC_SSCR = 0x52435353, + REC_STAT = 0x54415453, + REC_WEAP = 0x50414557 +}; + } #endif diff --git a/components/esm/esmcommon.hpp b/components/esm/esmcommon.hpp index eb16e3768..e0c5c08af 100644 --- a/components/esm/esmcommon.hpp +++ b/components/esm/esmcommon.hpp @@ -1,6 +1,8 @@ #ifndef OPENMW_ESM_COMMON_H #define OPENMW_ESM_COMMON_H +#include + #include #include diff --git a/components/esm/loadacti.hpp b/components/esm/loadacti.hpp index 64cf1db6f..86c2f44c4 100644 --- a/components/esm/loadacti.hpp +++ b/components/esm/loadacti.hpp @@ -1,11 +1,14 @@ #ifndef OPENMW_ESM_ACTI_H #define OPENMW_ESM_ACTI_H -#include "record.hpp" +#include namespace ESM { +class ESMReader; +class ESMWriter; + struct Activator { std::string mName, mScript, mModel; diff --git a/components/esm/loadalch.hpp b/components/esm/loadalch.hpp index 1367b9927..1e571ac40 100644 --- a/components/esm/loadalch.hpp +++ b/components/esm/loadalch.hpp @@ -3,11 +3,14 @@ #include -#include "record.hpp" #include "effectlist.hpp" namespace ESM { + +class ESMReader; +class ESMWriter; + /* * Alchemy item (potions) */ diff --git a/components/esm/loadappa.hpp b/components/esm/loadappa.hpp index b3d37cf75..101c39f41 100644 --- a/components/esm/loadappa.hpp +++ b/components/esm/loadappa.hpp @@ -1,10 +1,14 @@ #ifndef OPENMW_ESM_APPA_H #define OPENMW_ESM_APPA_H -#include "record.hpp" +#include namespace ESM { + +class ESMReader; +class ESMWriter; + /* * Alchemist apparatus */ diff --git a/components/esm/loadarmo.hpp b/components/esm/loadarmo.hpp index 04616c9ea..57c9ccf12 100644 --- a/components/esm/loadarmo.hpp +++ b/components/esm/loadarmo.hpp @@ -4,11 +4,12 @@ #include #include -#include "record.hpp" - namespace ESM { +class ESMReader; +class ESMWriter; + enum PartReferenceType { PRT_Head = 0, diff --git a/components/esm/loadbody.hpp b/components/esm/loadbody.hpp index 66d555029..8a05d9924 100644 --- a/components/esm/loadbody.hpp +++ b/components/esm/loadbody.hpp @@ -1,11 +1,14 @@ #ifndef OPENMW_ESM_BODY_H #define OPENMW_ESM_BODY_H -#include "record.hpp" +#include namespace ESM { +class ESMReader; +class ESMWriter; + struct BodyPart { enum MeshPart diff --git a/components/esm/loadbook.hpp b/components/esm/loadbook.hpp index 9f937ee4b..22201abed 100644 --- a/components/esm/loadbook.hpp +++ b/components/esm/loadbook.hpp @@ -1,7 +1,7 @@ #ifndef OPENMW_ESM_BOOK_H #define OPENMW_ESM_BOOK_H -#include "record.hpp" +#include namespace ESM { @@ -9,6 +9,9 @@ namespace ESM * Books, magic scrolls, notes and so on */ +class ESMReader; +class ESMWriter; + struct Book { struct BKDTstruct diff --git a/components/esm/loadbsgn.hpp b/components/esm/loadbsgn.hpp index 7733cb42f..ac4050878 100644 --- a/components/esm/loadbsgn.hpp +++ b/components/esm/loadbsgn.hpp @@ -3,12 +3,14 @@ #include -#include "record.hpp" #include "spelllist.hpp" namespace ESM { +class ESMReader; +class ESMWriter; + struct BirthSign { std::string mName, mDescription, mTexture; diff --git a/components/esm/loadcell.hpp b/components/esm/loadcell.hpp index 6773235a7..fbd7c0456 100644 --- a/components/esm/loadcell.hpp +++ b/components/esm/loadcell.hpp @@ -4,11 +4,14 @@ #include #include "esmcommon.hpp" -#include "record.hpp" #include "defs.hpp" namespace ESM { + +class ESMReader; +class ESMWriter; + /* Cell reference. This represents ONE object (of many) inside the cell. The cell references are not loaded as part of the normal loading process, but are rather loaded later on demand when we are diff --git a/components/esm/loadclas.hpp b/components/esm/loadclas.hpp index 3897aabed..0311002b8 100644 --- a/components/esm/loadclas.hpp +++ b/components/esm/loadclas.hpp @@ -3,10 +3,12 @@ #include -#include "record.hpp" - namespace ESM { + +class ESMReader; +class ESMWriter; + /* * Character class definitions */ diff --git a/components/esm/loadclot.hpp b/components/esm/loadclot.hpp index 7fc59fdbd..df64c87d3 100644 --- a/components/esm/loadclot.hpp +++ b/components/esm/loadclot.hpp @@ -3,12 +3,14 @@ #include -#include "record.hpp" #include "loadarmo.hpp" namespace ESM { +class ESMReader; +class ESMWriter; + /* * Clothing */ diff --git a/components/esm/loadcont.hpp b/components/esm/loadcont.hpp index d3a89a503..eb1f64d6f 100644 --- a/components/esm/loadcont.hpp +++ b/components/esm/loadcont.hpp @@ -4,12 +4,14 @@ #include #include -#include "record.hpp" #include "esmcommon.hpp" namespace ESM { +class ESMReader; +class ESMWriter; + /* * Container definition */ diff --git a/components/esm/loadcrea.hpp b/components/esm/loadcrea.hpp index e1b1e9310..1c93d995a 100644 --- a/components/esm/loadcrea.hpp +++ b/components/esm/loadcrea.hpp @@ -3,7 +3,6 @@ #include -#include "record.hpp" #include "loadcont.hpp" #include "spelllist.hpp" #include "aipackage.hpp" @@ -11,6 +10,9 @@ namespace ESM { +class ESMReader; +class ESMWriter; + /* * Creature definition * diff --git a/components/esm/loadcrec.hpp b/components/esm/loadcrec.hpp index 0609ea37f..a95656f63 100644 --- a/components/esm/loadcrec.hpp +++ b/components/esm/loadcrec.hpp @@ -1,13 +1,14 @@ #ifndef OPENMW_ESM_CREC_H #define OPENMW_ESM_CREC_H -#include "record.hpp" - // TODO create implementation files and remove this one #include "esmreader.hpp" namespace ESM { +class ESMReader; +class ESMWriter; + /* These two are only used in save games. They are not decoded yet. */ diff --git a/components/esm/loaddial.hpp b/components/esm/loaddial.hpp index d561b9d76..078c78811 100644 --- a/components/esm/loaddial.hpp +++ b/components/esm/loaddial.hpp @@ -1,14 +1,17 @@ #ifndef OPENMW_ESM_DIAL_H #define OPENMW_ESM_DIAL_H +#include #include -#include "record.hpp" #include "loadinfo.hpp" namespace ESM { +class ESMReader; +class ESMWriter; + /* * Dialogue topic and journal entries. The actual data is contained in * the INFO records following the DIAL. diff --git a/components/esm/loaddoor.hpp b/components/esm/loaddoor.hpp index 337c81328..5c0af52e4 100644 --- a/components/esm/loaddoor.hpp +++ b/components/esm/loaddoor.hpp @@ -3,11 +3,12 @@ #include -#include "record.hpp" - namespace ESM { +class ESMReader; +class ESMWriter; + struct Door { std::string mName, mModel, mScript, mOpenSound, mCloseSound; diff --git a/components/esm/loadench.hpp b/components/esm/loadench.hpp index 2894df393..d89549322 100644 --- a/components/esm/loadench.hpp +++ b/components/esm/loadench.hpp @@ -1,11 +1,14 @@ #ifndef OPENMW_ESM_ENCH_H #define OPENMW_ESM_ENCH_H -#include "record.hpp" #include "effectlist.hpp" namespace ESM { + +class ESMReader; +class ESMWriter; + /* * Enchantments */ diff --git a/components/esm/loadfact.hpp b/components/esm/loadfact.hpp index 50c2b42ba..49898b1cf 100644 --- a/components/esm/loadfact.hpp +++ b/components/esm/loadfact.hpp @@ -4,11 +4,12 @@ #include #include -#include "record.hpp" - namespace ESM { +class ESMReader; +class ESMWriter; + /* * Faction definitions */ diff --git a/components/esm/loadglob.hpp b/components/esm/loadglob.hpp index 0147afded..b85af74bc 100644 --- a/components/esm/loadglob.hpp +++ b/components/esm/loadglob.hpp @@ -1,12 +1,14 @@ #ifndef OPENMW_ESM_GLOB_H #define OPENMW_ESM_GLOB_H -#include "record.hpp" #include "defs.hpp" namespace ESM { +class ESMReader; +class ESMWriter; + /* * Global script variables */ diff --git a/components/esm/loadgmst.hpp b/components/esm/loadgmst.hpp index 8435899f5..a3471598c 100644 --- a/components/esm/loadgmst.hpp +++ b/components/esm/loadgmst.hpp @@ -3,11 +3,14 @@ #include -#include "record.hpp" #include "defs.hpp" namespace ESM { + +class ESMReader; +class ESMWriter; + /* * Game setting, with automatic cleaning of "dirty" entries. * diff --git a/components/esm/loadinfo.hpp b/components/esm/loadinfo.hpp index 83d5fe6b4..f04fe862e 100644 --- a/components/esm/loadinfo.hpp +++ b/components/esm/loadinfo.hpp @@ -4,12 +4,14 @@ #include #include -#include "record.hpp" #include "defs.hpp" namespace ESM { +class ESMReader; +class ESMWriter; + // NOT DONE /* diff --git a/components/esm/loadingr.hpp b/components/esm/loadingr.hpp index 3f0423e1c..cd63cf39a 100644 --- a/components/esm/loadingr.hpp +++ b/components/esm/loadingr.hpp @@ -3,10 +3,12 @@ #include -#include "record.hpp" - namespace ESM { + +class ESMReader; +class ESMWriter; + /* * Alchemy ingredient */ diff --git a/components/esm/loadland.hpp b/components/esm/loadland.hpp index 9f85bfb00..5bc439c96 100644 --- a/components/esm/loadland.hpp +++ b/components/esm/loadland.hpp @@ -3,11 +3,14 @@ #include -#include "record.hpp" #include "esmcommon.hpp" namespace ESM { + +class ESMReader; +class ESMWriter; + /* * Landscape data. */ diff --git a/components/esm/loadlevlist.hpp b/components/esm/loadlevlist.hpp index f39ddd4c2..72b4af92f 100644 --- a/components/esm/loadlevlist.hpp +++ b/components/esm/loadlevlist.hpp @@ -4,11 +4,12 @@ #include #include -#include "record.hpp" - namespace ESM { +class ESMReader; +class ESMWriter; + /* * Leveled lists. Since these have identical layout, I only bothered * to implement it once. diff --git a/components/esm/loadligh.hpp b/components/esm/loadligh.hpp index febbe4a5c..c425af6b3 100644 --- a/components/esm/loadligh.hpp +++ b/components/esm/loadligh.hpp @@ -3,11 +3,12 @@ #include -#include "record.hpp" - namespace ESM { +class ESMReader; +class ESMWriter; + /* * Lights. Includes static light sources and also carryable candles * and torches. diff --git a/components/esm/loadlocks.hpp b/components/esm/loadlocks.hpp index e3a486086..72d375cbb 100644 --- a/components/esm/loadlocks.hpp +++ b/components/esm/loadlocks.hpp @@ -1,11 +1,14 @@ #ifndef OPENMW_ESM_LOCKS_H #define OPENMW_ESM_LOCKS_H -#include "record.hpp" +#include namespace ESM { +class ESMReader; +class ESMWriter; + /* * This file covers lockpicks (LOCK), probes (PROB) and armor repair * items (REPA). These have nearly identical data structures. diff --git a/components/esm/loadltex.hpp b/components/esm/loadltex.hpp index 34aea8314..6e6d987d4 100644 --- a/components/esm/loadltex.hpp +++ b/components/esm/loadltex.hpp @@ -3,11 +3,12 @@ #include -#include "record.hpp" - namespace ESM { +class ESMReader; +class ESMWriter; + /* * Texture used for texturing landscape. * diff --git a/components/esm/loadmgef.hpp b/components/esm/loadmgef.hpp index 1ca7382b0..861f66be0 100644 --- a/components/esm/loadmgef.hpp +++ b/components/esm/loadmgef.hpp @@ -3,11 +3,12 @@ #include -#include "record.hpp" - namespace ESM { +class ESMReader; +class ESMWriter; + struct MagicEffect { enum Flags diff --git a/components/esm/loadmisc.hpp b/components/esm/loadmisc.hpp index f40ac9b79..1a34e6504 100644 --- a/components/esm/loadmisc.hpp +++ b/components/esm/loadmisc.hpp @@ -3,11 +3,12 @@ #include -#include "record.hpp" - namespace ESM { +class ESMReader; +class ESMWriter; + /* * Misc inventory items, basically things that have no use but can be * carried, bought and sold. It also includes keys. diff --git a/components/esm/loadnpc.hpp b/components/esm/loadnpc.hpp index 42a8a70bd..ee9ef6b0b 100644 --- a/components/esm/loadnpc.hpp +++ b/components/esm/loadnpc.hpp @@ -5,12 +5,15 @@ #include #include "defs.hpp" -#include "record.hpp" #include "loadcont.hpp" #include "aipackage.hpp" #include "spelllist.hpp" namespace ESM { + +class ESMReader; +class ESMWriter; + /* * NPC definition */ diff --git a/components/esm/loadnpcc.hpp b/components/esm/loadnpcc.hpp index a056dc701..3da14655f 100644 --- a/components/esm/loadnpcc.hpp +++ b/components/esm/loadnpcc.hpp @@ -1,13 +1,14 @@ #ifndef OPENMW_ESM_NPCC_H #define OPENMW_ESM_NPCC_H -#include "record.hpp" - // TODO: create implementation files to remove this #include "esmreader.hpp" namespace ESM { +class ESMReader; +class ESMWriter; + /* * NPC change information (found in savegame files only). We can't * read these yet. diff --git a/components/esm/loadpgrd.hpp b/components/esm/loadpgrd.hpp index 039812040..c3f50fc4d 100644 --- a/components/esm/loadpgrd.hpp +++ b/components/esm/loadpgrd.hpp @@ -4,11 +4,12 @@ #include #include -#include "record.hpp" - namespace ESM { +class ESMReader; +class ESMWriter; + /* * Path grid. */ diff --git a/components/esm/loadrace.hpp b/components/esm/loadrace.hpp index ae12eec14..42b2c91a7 100644 --- a/components/esm/loadrace.hpp +++ b/components/esm/loadrace.hpp @@ -3,11 +3,14 @@ #include -#include "record.hpp" #include "spelllist.hpp" namespace ESM { + +class ESMReader; +class ESMWriter; + /* * Race definition */ diff --git a/components/esm/loadregn.hpp b/components/esm/loadregn.hpp index 568d096fe..fd0863b5b 100644 --- a/components/esm/loadregn.hpp +++ b/components/esm/loadregn.hpp @@ -4,12 +4,14 @@ #include #include -#include "record.hpp" #include "esmcommon.hpp" namespace ESM { +class ESMReader; +class ESMWriter; + /* * Region data */ diff --git a/components/esm/loadscpt.hpp b/components/esm/loadscpt.hpp index 9c8acd81f..db8f85057 100644 --- a/components/esm/loadscpt.hpp +++ b/components/esm/loadscpt.hpp @@ -4,12 +4,14 @@ #include #include -#include "record.hpp" #include "esmcommon.hpp" namespace ESM { +class ESMReader; +class ESMWriter; + /* * Script definitions */ diff --git a/components/esm/loadskil.hpp b/components/esm/loadskil.hpp index 56ea07929..05bac717b 100644 --- a/components/esm/loadskil.hpp +++ b/components/esm/loadskil.hpp @@ -5,11 +5,13 @@ #include -#include "record.hpp" #include "defs.hpp" namespace ESM { +class ESMReader; +class ESMWriter; + /* * Skill information * diff --git a/components/esm/loadsndg.hpp b/components/esm/loadsndg.hpp index 22d42dc2f..dadfbd239 100644 --- a/components/esm/loadsndg.hpp +++ b/components/esm/loadsndg.hpp @@ -3,11 +3,12 @@ #include -#include "record.hpp" - namespace ESM { +class ESMReader; +class ESMWriter; + /* * Sound generator. This describes the sounds a creature make. */ diff --git a/components/esm/loadsoun.hpp b/components/esm/loadsoun.hpp index 73ee5b22f..5443c6cb9 100644 --- a/components/esm/loadsoun.hpp +++ b/components/esm/loadsoun.hpp @@ -3,11 +3,12 @@ #include -#include "record.hpp" - namespace ESM { +class ESMReader; +class ESMWriter; + struct SOUNstruct { unsigned char mVolume, mMinRange, mMaxRange; diff --git a/components/esm/loadspel.hpp b/components/esm/loadspel.hpp index d96a12a4e..5ad184126 100644 --- a/components/esm/loadspel.hpp +++ b/components/esm/loadspel.hpp @@ -3,12 +3,14 @@ #include -#include "record.hpp" #include "effectlist.hpp" namespace ESM { +class ESMReader; +class ESMWriter; + struct Spell { enum SpellType diff --git a/components/esm/loadsscr.hpp b/components/esm/loadsscr.hpp index 758847f21..d180bfcff 100644 --- a/components/esm/loadsscr.hpp +++ b/components/esm/loadsscr.hpp @@ -3,11 +3,12 @@ #include -#include "record.hpp" - namespace ESM { +class ESMReader; +class ESMWriter; + /* Startup script. I think this is simply a 'main' script that is run from the begining. The SSCR records contain a DATA identifier which diff --git a/components/esm/loadstat.hpp b/components/esm/loadstat.hpp index 45a43082d..ba35fa718 100644 --- a/components/esm/loadstat.hpp +++ b/components/esm/loadstat.hpp @@ -3,10 +3,11 @@ #include -#include "record.hpp" - namespace ESM { +class ESMReader; +class ESMWriter; + /* * Definition of static object. * diff --git a/components/esm/loadweap.hpp b/components/esm/loadweap.hpp index 724c96c88..341a2c86e 100644 --- a/components/esm/loadweap.hpp +++ b/components/esm/loadweap.hpp @@ -3,11 +3,12 @@ #include -#include "record.hpp" - namespace ESM { +class ESMReader; +class ESMWriter; + /* * Weapon definition */ diff --git a/components/esm/record.hpp b/components/esm/record.hpp index 3e5330681..a8c1643e6 100644 --- a/components/esm/record.hpp +++ b/components/esm/record.hpp @@ -1,8 +1,6 @@ #ifndef OPENMW_ESM_RECORD_H #define OPENMW_ESM_RECORD_H -#include - namespace ESM { @@ -55,30 +53,6 @@ enum RecNameInts REC_WEAP = 0x50414557 }; -class ESMReader; -class ESMWriter; - -class Record -{ -public: - Record() {} - virtual ~Record() {} - - virtual void load(ESMReader& esm) = 0; - virtual void save(ESMWriter& esm) = 0; - - std::string getId() const { return mId; } - void setId(const std::string& in) { mId = in; } - - int getFlags() const { return (mFlags & 0x1 ? 0x00002000 : 0) | (mFlags & 0x2 ? 0x00000400 : 0); } - void setFlags(int in) { mFlags = (in & 0x00002000 ? 0x1 : 0) | (in & 0x00000400 ? 0x2 : 0); } - - virtual int getName() = 0; - -protected: - std::string mId; - char mFlags; -}; } diff --git a/components/esm/records.hpp b/components/esm/records.hpp index 97b7cb4a7..0662c797c 100644 --- a/components/esm/records.hpp +++ b/components/esm/records.hpp @@ -1,7 +1,7 @@ #ifndef OPENMW_ESM_RECORDS_H #define OPENMW_ESM_RECORDS_H -#include "record.hpp" +#include "defs.hpp" #include "loadacti.hpp" #include "loadalch.hpp" #include "loadappa.hpp"