Move condLoad to unnamed namespace

macos_ci_fix
elsid 1 year ago
parent dad0cb3349
commit 07599d0bb0
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -22,6 +22,20 @@ namespace ESM
for (int x2 = 0; x2 < 4; x2++)
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()
@ -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
{
return mLandData && (mLandData->mDataLoaded & flags) == flags;

@ -161,11 +161,6 @@ namespace ESM
void add(int flags);
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;
};

Loading…
Cancel
Save