forked from teamnwah/openmw-tes3coop
load land for non-base content files immediately
This commit is contained in:
parent
4c1906b999
commit
4a9d2038fa
2 changed files with 25 additions and 6 deletions
|
@ -713,7 +713,18 @@ bool CSMWorld::Data::continueLoading (CSMDoc::Stage::Messages& messages)
|
||||||
case ESM::REC_PGRD: mPathgrids.load (*mReader, mBase); break;
|
case ESM::REC_PGRD: mPathgrids.load (*mReader, mBase); break;
|
||||||
|
|
||||||
case ESM::REC_LTEX: mLandTextures.load (*mReader, mBase); break;
|
case ESM::REC_LTEX: mLandTextures.load (*mReader, mBase); break;
|
||||||
case ESM::REC_LAND: mLand.load(*mReader, mBase); break;
|
|
||||||
|
case ESM::REC_LAND:
|
||||||
|
{
|
||||||
|
int index = mLand.load(*mReader, mBase);
|
||||||
|
|
||||||
|
if (index!=-1 && !mBase)
|
||||||
|
mLand.getRecord (index).mModified.mLand->loadData (
|
||||||
|
ESM::Land::DATA_VHGT | ESM::Land::DATA_VNML | ESM::Land::DATA_VCLR |
|
||||||
|
ESM::Land::DATA_VTEX);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case ESM::REC_CELL:
|
case ESM::REC_CELL:
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,12 +15,15 @@ namespace CSMWorld
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
void load (ESM::ESMReader& reader, bool base);
|
/// \return Index of loaded record (-1 if no record was loaded)
|
||||||
|
int load (ESM::ESMReader& reader, bool base);
|
||||||
|
|
||||||
/// \param index Index at which the record can be found.
|
/// \param index Index at which the record can be found.
|
||||||
/// Special values: -2 index unknown, -1 record does not exist yet and therefore
|
/// Special values: -2 index unknown, -1 record does not exist yet and therefore
|
||||||
/// does not have an index
|
/// does not have an index
|
||||||
void load (const ESXRecordT& record, bool base, int index = -2);
|
///
|
||||||
|
/// \return index
|
||||||
|
int load (const ESXRecordT& record, bool base, int index = -2);
|
||||||
|
|
||||||
bool tryDelete (const std::string& id);
|
bool tryDelete (const std::string& id);
|
||||||
///< Try deleting \a id. If the id does not exist or can't be deleted the call is ignored.
|
///< Try deleting \a id. If the id does not exist or can't be deleted the call is ignored.
|
||||||
|
@ -36,7 +39,7 @@ namespace CSMWorld
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename ESXRecordT, typename IdAccessorT>
|
template<typename ESXRecordT, typename IdAccessorT>
|
||||||
void IdCollection<ESXRecordT, IdAccessorT>::load (ESM::ESMReader& reader, bool base)
|
int IdCollection<ESXRecordT, IdAccessorT>::load (ESM::ESMReader& reader, bool base)
|
||||||
{
|
{
|
||||||
std::string id = reader.getHNOString ("NAME");
|
std::string id = reader.getHNOString ("NAME");
|
||||||
|
|
||||||
|
@ -64,6 +67,8 @@ namespace CSMWorld
|
||||||
record.mState = RecordBase::State_Deleted;
|
record.mState = RecordBase::State_Deleted;
|
||||||
this->setRecord (index, record);
|
this->setRecord (index, record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -88,12 +93,12 @@ namespace CSMWorld
|
||||||
index = newIndex;
|
index = newIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
load (record, base, index);
|
return load (record, base, index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename ESXRecordT, typename IdAccessorT>
|
template<typename ESXRecordT, typename IdAccessorT>
|
||||||
void IdCollection<ESXRecordT, IdAccessorT>::load (const ESXRecordT& record, bool base,
|
int IdCollection<ESXRecordT, IdAccessorT>::load (const ESXRecordT& record, bool base,
|
||||||
int index)
|
int index)
|
||||||
{
|
{
|
||||||
if (index==-2)
|
if (index==-2)
|
||||||
|
@ -106,6 +111,7 @@ namespace CSMWorld
|
||||||
record2.mState = base ? RecordBase::State_BaseOnly : RecordBase::State_ModifiedOnly;
|
record2.mState = base ? RecordBase::State_BaseOnly : RecordBase::State_ModifiedOnly;
|
||||||
(base ? record2.mBase : record2.mModified) = record;
|
(base ? record2.mBase : record2.mModified) = record;
|
||||||
|
|
||||||
|
index = this->getSize();
|
||||||
this->appendRecord (record2);
|
this->appendRecord (record2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -120,6 +126,8 @@ namespace CSMWorld
|
||||||
|
|
||||||
this->setRecord (index, record2);
|
this->setRecord (index, record2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename ESXRecordT, typename IdAccessorT>
|
template<typename ESXRecordT, typename IdAccessorT>
|
||||||
|
|
Loading…
Reference in a new issue