From 07599d0bb0d1b77f85034c2542e4d86b1322b51a Mon Sep 17 00:00:00 2001 From: elsid Date: Sat, 12 Aug 2023 13:19:12 +0200 Subject: [PATCH] Move condLoad to unnamed namespace --- components/esm3/loadland.cpp | 27 ++++++++++++++------------- components/esm3/loadland.hpp | 5 ----- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/components/esm3/loadland.cpp b/components/esm3/loadland.cpp index be6c4675e2..dac328eaf4 100644 --- a/components/esm3/loadland.cpp +++ b/components/esm3/loadland.cpp @@ -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; diff --git a/components/esm3/loadland.hpp b/components/esm3/loadland.hpp index 1e722bfdb5..7b57db56f3 100644 --- a/components/esm3/loadland.hpp +++ b/components/esm3/loadland.hpp @@ -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; };