mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 07:36:41 +00:00
Promoted references to a top level record internally.
Note: This does not change the structure of the ESX format.
This commit is contained in:
parent
2d894fde57
commit
1e60ad3cd6
5 changed files with 52 additions and 1 deletions
|
@ -24,7 +24,7 @@ opencs_units (model/world
|
||||||
|
|
||||||
opencs_units_noqt (model/world
|
opencs_units_noqt (model/world
|
||||||
universalid data record idcollection commands columnbase scriptcontext cell refidcollection
|
universalid data record idcollection commands columnbase scriptcontext cell refidcollection
|
||||||
refidadapter refiddata refidadapterimp
|
refidadapter refiddata refidadapterimp ref
|
||||||
)
|
)
|
||||||
|
|
||||||
opencs_hdrs_noqt (model/world
|
opencs_hdrs_noqt (model/world
|
||||||
|
|
|
@ -17,4 +17,9 @@ void CSMWorld::Cell::load (ESM::ESMReader &esm)
|
||||||
|
|
||||||
mId = stream.str();
|
mId = stream.str();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSMWorld::Cell::addRef (const std::string& id)
|
||||||
|
{
|
||||||
|
mRefs.push_back (std::make_pair (id, false));
|
||||||
}
|
}
|
|
@ -1,6 +1,9 @@
|
||||||
#ifndef CSM_WOLRD_CELL_H
|
#ifndef CSM_WOLRD_CELL_H
|
||||||
#define CSM_WOLRD_CELL_H
|
#define CSM_WOLRD_CELL_H
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include <components/esm/loadcell.hpp>
|
#include <components/esm/loadcell.hpp>
|
||||||
|
|
||||||
namespace CSMWorld
|
namespace CSMWorld
|
||||||
|
@ -9,8 +12,12 @@ namespace CSMWorld
|
||||||
struct Cell : public ESM::Cell
|
struct Cell : public ESM::Cell
|
||||||
{
|
{
|
||||||
std::string mId;
|
std::string mId;
|
||||||
|
std::vector<std::pair<std::string, bool> > mRefs; // ID, modified
|
||||||
|
std::vector<std::string> mDeletedRefs;
|
||||||
|
|
||||||
void load (ESM::ESMReader &esm);
|
void load (ESM::ESMReader &esm);
|
||||||
|
|
||||||
|
void addRef (const std::string& id);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
14
apps/opencs/model/world/ref.cpp
Normal file
14
apps/opencs/model/world/ref.cpp
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
|
||||||
|
#include "ref.hpp"
|
||||||
|
|
||||||
|
#include "cell.hpp"
|
||||||
|
|
||||||
|
void CSMWorld::CellRef::load (ESM::ESMReader &esm, Cell& cell, const std::string& id)
|
||||||
|
{
|
||||||
|
mId = id;
|
||||||
|
|
||||||
|
cell.getNextRef (esm, *this);
|
||||||
|
|
||||||
|
if (!mDeleted)
|
||||||
|
cell.addRef (mId);
|
||||||
|
}
|
25
apps/opencs/model/world/ref.hpp
Normal file
25
apps/opencs/model/world/ref.hpp
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
#ifndef CSM_WOLRD_REF_H
|
||||||
|
#define CSM_WOLRD_REF_H
|
||||||
|
|
||||||
|
#include <components/esm/cellref.hpp>
|
||||||
|
|
||||||
|
namespace ESM
|
||||||
|
{
|
||||||
|
class ESMReader;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace CSMWorld
|
||||||
|
{
|
||||||
|
class Cell;
|
||||||
|
|
||||||
|
/// \brief Wrapper for CellRef sub record
|
||||||
|
struct CellRef : public ESM::CellRef
|
||||||
|
{
|
||||||
|
std::string mId;
|
||||||
|
|
||||||
|
void load (ESM::ESMReader &esm, Cell& cell, const std::string& id);
|
||||||
|
///< Load cell ref and register it with \a cell.
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in a new issue