forked from mirror/openmw-tes3mp
Get rid of duplicate function, fix flag checking
This commit is contained in:
parent
d27071f06a
commit
11eae16645
3 changed files with 6 additions and 16 deletions
|
@ -108,7 +108,7 @@ namespace CSMWorld
|
||||||
throw std::runtime_error("invalid land map LOD data");
|
throw std::runtime_error("invalid land map LOD data");
|
||||||
|
|
||||||
Land copy = record.get();
|
Land copy = record.get();
|
||||||
copy.setDataLoaded(Land::DATA_WNAM);
|
copy.add(Land::DATA_WNAM);
|
||||||
|
|
||||||
for (int i = 0; i < values.size(); ++i)
|
for (int i = 0; i < values.size(); ++i)
|
||||||
{
|
{
|
||||||
|
@ -155,7 +155,7 @@ namespace CSMWorld
|
||||||
throw std::runtime_error("invalid land normals data");
|
throw std::runtime_error("invalid land normals data");
|
||||||
|
|
||||||
Land copy = record.get();
|
Land copy = record.get();
|
||||||
copy.setDataLoaded(Land::DATA_VNML);
|
copy.add(Land::DATA_VNML);
|
||||||
|
|
||||||
for (int i = 0; i < values.size(); ++i)
|
for (int i = 0; i < values.size(); ++i)
|
||||||
{
|
{
|
||||||
|
@ -202,7 +202,7 @@ namespace CSMWorld
|
||||||
throw std::runtime_error("invalid land heights data");
|
throw std::runtime_error("invalid land heights data");
|
||||||
|
|
||||||
Land copy = record.get();
|
Land copy = record.get();
|
||||||
copy.setDataLoaded(Land::DATA_VHGT);
|
copy.add(Land::DATA_VHGT);
|
||||||
|
|
||||||
for (int i = 0; i < values.size(); ++i)
|
for (int i = 0; i < values.size(); ++i)
|
||||||
{
|
{
|
||||||
|
@ -249,7 +249,7 @@ namespace CSMWorld
|
||||||
throw std::runtime_error("invalid land colours data");
|
throw std::runtime_error("invalid land colours data");
|
||||||
|
|
||||||
Land copy = record.get();
|
Land copy = record.get();
|
||||||
copy.setDataLoaded(Land::DATA_VCLR);
|
copy.add(Land::DATA_VCLR);
|
||||||
|
|
||||||
for (int i = 0; i < values.size(); ++i)
|
for (int i = 0; i < values.size(); ++i)
|
||||||
{
|
{
|
||||||
|
@ -296,7 +296,7 @@ namespace CSMWorld
|
||||||
throw std::runtime_error("invalid land textures data");
|
throw std::runtime_error("invalid land textures data");
|
||||||
|
|
||||||
Land copy = record.get();
|
Land copy = record.get();
|
||||||
copy.setDataLoaded(Land::DATA_VTEX);
|
copy.add(Land::DATA_VTEX);
|
||||||
|
|
||||||
for (int i = 0; i < values.size(); ++i)
|
for (int i = 0; i < values.size(); ++i)
|
||||||
{
|
{
|
||||||
|
|
|
@ -315,16 +315,7 @@ namespace ESM
|
||||||
|
|
||||||
bool Land::isDataLoaded(int flags) const
|
bool Land::isDataLoaded(int flags) const
|
||||||
{
|
{
|
||||||
return mLandData && (mLandData->mDataLoaded & flags) == (flags & mDataTypes);
|
return mLandData && (mLandData->mDataLoaded & flags) == flags;
|
||||||
}
|
|
||||||
|
|
||||||
void Land::setDataLoaded(int flags)
|
|
||||||
{
|
|
||||||
if (!mLandData)
|
|
||||||
mLandData = new LandData;
|
|
||||||
|
|
||||||
mDataTypes |= flags;
|
|
||||||
mLandData->mDataLoaded |= flags;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Land::Land (const Land& land)
|
Land::Land (const Land& land)
|
||||||
|
|
|
@ -132,7 +132,6 @@ struct Land
|
||||||
void unloadData() const;
|
void unloadData() const;
|
||||||
|
|
||||||
/// Check if given data type is loaded
|
/// Check if given data type is loaded
|
||||||
/// @note We only check data types that *can* be loaded (present in mDataTypes)
|
|
||||||
bool isDataLoaded(int flags) const;
|
bool isDataLoaded(int flags) const;
|
||||||
|
|
||||||
/// Sets the flags and creates a LandData if needed
|
/// Sets the flags and creates a LandData if needed
|
||||||
|
|
Loading…
Reference in a new issue