Get rid of duplicate function, fix flag checking

new-script-api
Kyle Cooley 7 years ago
parent d27071f06a
commit 11eae16645

@ -108,7 +108,7 @@ namespace CSMWorld
throw std::runtime_error("invalid land map LOD data");
Land copy = record.get();
copy.setDataLoaded(Land::DATA_WNAM);
copy.add(Land::DATA_WNAM);
for (int i = 0; i < values.size(); ++i)
{
@ -155,7 +155,7 @@ namespace CSMWorld
throw std::runtime_error("invalid land normals data");
Land copy = record.get();
copy.setDataLoaded(Land::DATA_VNML);
copy.add(Land::DATA_VNML);
for (int i = 0; i < values.size(); ++i)
{
@ -202,7 +202,7 @@ namespace CSMWorld
throw std::runtime_error("invalid land heights data");
Land copy = record.get();
copy.setDataLoaded(Land::DATA_VHGT);
copy.add(Land::DATA_VHGT);
for (int i = 0; i < values.size(); ++i)
{
@ -249,7 +249,7 @@ namespace CSMWorld
throw std::runtime_error("invalid land colours data");
Land copy = record.get();
copy.setDataLoaded(Land::DATA_VCLR);
copy.add(Land::DATA_VCLR);
for (int i = 0; i < values.size(); ++i)
{
@ -296,7 +296,7 @@ namespace CSMWorld
throw std::runtime_error("invalid land textures data");
Land copy = record.get();
copy.setDataLoaded(Land::DATA_VTEX);
copy.add(Land::DATA_VTEX);
for (int i = 0; i < values.size(); ++i)
{

@ -315,16 +315,7 @@ namespace ESM
bool Land::isDataLoaded(int flags) const
{
return mLandData && (mLandData->mDataLoaded & flags) == (flags & mDataTypes);
}
void Land::setDataLoaded(int flags)
{
if (!mLandData)
mLandData = new LandData;
mDataTypes |= flags;
mLandData->mDataLoaded |= flags;
return mLandData && (mLandData->mDataLoaded & flags) == flags;
}
Land::Land (const Land& land)

@ -132,7 +132,6 @@ struct Land
void unloadData() const;
/// 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;
/// Sets the flags and creates a LandData if needed

Loading…
Cancel
Save