mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-25 16:43:33 +00:00
- Minor code cleanup
This commit is contained in:
parent
a8e02779b2
commit
713d324eeb
@ -143,7 +143,7 @@ namespace MWRender
|
|||||||
std::map<uint16_t, int> indexes;
|
std::map<uint16_t, int> indexes;
|
||||||
initTerrainTextures(&terrainData, cellX, cellY,
|
initTerrainTextures(&terrainData, cellX, cellY,
|
||||||
x * numTextures, y * numTextures,
|
x * numTextures, y * numTextures,
|
||||||
numTextures, indexes, land->plugin);
|
numTextures, indexes, land->mPlugin);
|
||||||
|
|
||||||
if (mTerrainGroup.getTerrain(terrainX, terrainY) == NULL)
|
if (mTerrainGroup.getTerrain(terrainX, terrainY) == NULL)
|
||||||
{
|
{
|
||||||
|
@ -98,7 +98,10 @@ namespace MWWorld
|
|||||||
/// A list of container references. These references do not track their mRefnumber.
|
/// A list of container references. These references do not track their mRefnumber.
|
||||||
/// Otherwise, taking 1 of 20 instances of an object would produce multiple objects
|
/// Otherwise, taking 1 of 20 instances of an object would produce multiple objects
|
||||||
/// with the same reference.
|
/// with the same reference.
|
||||||
// TODO: Check how Morrowind does this! Maybe auto-generate references on drop.
|
/// Unfortunately, this also means that we need a different STL container.
|
||||||
|
/// (cells use CellRefList, where refs can be located according to their refnumner,
|
||||||
|
/// which uses a map; container items do not make use of the refnumber, so we
|
||||||
|
/// can't use a map with refnumber keys.)
|
||||||
template <typename X>
|
template <typename X>
|
||||||
struct ContainerRefList
|
struct ContainerRefList
|
||||||
{
|
{
|
||||||
|
@ -28,8 +28,8 @@ void ESMStore::load(ESM::ESMReader &esm)
|
|||||||
ESM::Dialogue *dialogue = 0;
|
ESM::Dialogue *dialogue = 0;
|
||||||
|
|
||||||
// Cache parent esX files by tracking their indices in the global list of
|
// Cache parent esX files by tracking their indices in the global list of
|
||||||
// all files/readers used by the engine. This will greaty help to accelerate
|
// all files/readers used by the engine. This will greaty accelerate
|
||||||
// parsing of reference IDs.
|
// refnumber mangling, as required for handling moved references.
|
||||||
int index = ~0;
|
int index = ~0;
|
||||||
const ESM::ESMReader::MasterList &masters = esm.getMasters();
|
const ESM::ESMReader::MasterList &masters = esm.getMasters();
|
||||||
std::vector<ESM::ESMReader> *allPlugins = esm.getGlobalReaderList();
|
std::vector<ESM::ESMReader> *allPlugins = esm.getGlobalReaderList();
|
||||||
@ -122,7 +122,6 @@ void ESMStore::load(ESM::ESMReader &esm)
|
|||||||
cout << *it << " ";
|
cout << *it << " ";
|
||||||
cout << endl;
|
cout << endl;
|
||||||
*/
|
*/
|
||||||
//setUp();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ESMStore::setUp()
|
void ESMStore::setUp()
|
||||||
|
@ -80,9 +80,9 @@ public:
|
|||||||
// terrain palette, but ESMReader does not pass a reference to the correct plugin
|
// terrain palette, but ESMReader does not pass a reference to the correct plugin
|
||||||
// to the individual load() methods. This hack allows to pass this reference
|
// to the individual load() methods. This hack allows to pass this reference
|
||||||
// indirectly to the load() method.
|
// indirectly to the load() method.
|
||||||
int idx;
|
int mIdx;
|
||||||
void setIndex(const int index) {idx = index; mCtx.index = index;}
|
void setIndex(const int index) {mIdx = index; mCtx.index = index;}
|
||||||
const int getIndex() {return idx;}
|
const int getIndex() {return mIdx;}
|
||||||
|
|
||||||
void setGlobalReaderList(std::vector<ESMReader> *list) {mGlobalReaderList = list;}
|
void setGlobalReaderList(std::vector<ESMReader> *list) {mGlobalReaderList = list;}
|
||||||
std::vector<ESMReader> *getGlobalReaderList() {return mGlobalReaderList;}
|
std::vector<ESMReader> *getGlobalReaderList() {return mGlobalReaderList;}
|
||||||
|
@ -81,7 +81,7 @@ Land::~Land()
|
|||||||
void Land::load(ESMReader &esm)
|
void Land::load(ESMReader &esm)
|
||||||
{
|
{
|
||||||
mEsm = &esm;
|
mEsm = &esm;
|
||||||
plugin = mEsm->getIndex();
|
mPlugin = mEsm->getIndex();
|
||||||
|
|
||||||
// Get the grid location
|
// Get the grid location
|
||||||
esm.getSubNameIs("INTV");
|
esm.getSubNameIs("INTV");
|
||||||
|
@ -23,7 +23,7 @@ struct Land
|
|||||||
int mFlags; // Only first four bits seem to be used, don't know what
|
int mFlags; // Only first four bits seem to be used, don't know what
|
||||||
// they mean.
|
// they mean.
|
||||||
int mX, mY; // Map coordinates.
|
int mX, mY; // Map coordinates.
|
||||||
int plugin; // Plugin index, used to reference the correct material palette.
|
int mPlugin; // Plugin index, used to reference the correct material palette.
|
||||||
|
|
||||||
// File context. This allows the ESM reader to be 'reset' to this
|
// File context. This allows the ESM reader to be 'reset' to this
|
||||||
// location later when we are ready to load the full data set.
|
// location later when we are ready to load the full data set.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user