mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-19 20:53:52 +00:00
Move condLoad to unnamed namespace
This commit is contained in:
parent
dad0cb3349
commit
07599d0bb0
2 changed files with 14 additions and 18 deletions
|
@ -22,6 +22,20 @@ namespace ESM
|
||||||
for (int x2 = 0; x2 < 4; x2++)
|
for (int x2 = 0; x2 < 4; x2++)
|
||||||
out[(y1 * 4 + y2) * 16 + (x1 * 4 + x2)] = in[readPos++];
|
out[(y1 * 4 + y2) * 16 + (x1 * 4 + x2)] = in[readPos++];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Loads data and marks it as loaded. Return true if data is actually loaded from reader, false otherwise
|
||||||
|
// including the case when data is already loaded.
|
||||||
|
bool condLoad(ESMReader& reader, int flags, int& targetFlags, int dataFlag, void* ptr, unsigned int size)
|
||||||
|
{
|
||||||
|
if ((targetFlags & dataFlag) == 0 && (flags & dataFlag) != 0)
|
||||||
|
{
|
||||||
|
reader.getHExact(ptr, size);
|
||||||
|
targetFlags |= dataFlag;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
reader.skipHSubSize(size);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Land::~Land()
|
Land::~Land()
|
||||||
|
@ -311,19 +325,6 @@ namespace ESM
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Land::condLoad(
|
|
||||||
ESMReader& reader, int flags, int& targetFlags, int dataFlag, void* ptr, unsigned int size) const
|
|
||||||
{
|
|
||||||
if ((targetFlags & dataFlag) == 0 && (flags & dataFlag) != 0)
|
|
||||||
{
|
|
||||||
reader.getHExact(ptr, size);
|
|
||||||
targetFlags |= dataFlag;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
reader.skipHSubSize(size);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Land::isDataLoaded(int flags) const
|
bool Land::isDataLoaded(int flags) const
|
||||||
{
|
{
|
||||||
return mLandData && (mLandData->mDataLoaded & flags) == flags;
|
return mLandData && (mLandData->mDataLoaded & flags) == flags;
|
||||||
|
|
|
@ -161,11 +161,6 @@ namespace ESM
|
||||||
void add(int flags);
|
void add(int flags);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// Loads data and marks it as loaded
|
|
||||||
/// \return true if data is actually loaded from file, false otherwise
|
|
||||||
/// including the case when data is already loaded
|
|
||||||
bool condLoad(ESMReader& reader, int flags, int& targetFlags, int dataFlag, void* ptr, unsigned int size) const;
|
|
||||||
|
|
||||||
mutable LandData* mLandData = nullptr;
|
mutable LandData* mLandData = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue