1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-03 20:09:40 +00:00

Fix C4459 msvc warning

declaration of 'navMeshVersion' hides global declaration
This commit is contained in:
elsid 2022-07-01 14:25:23 +02:00
parent 2d6e048d88
commit 8544aa481c
No known key found for this signature in database
GPG key ID: 4DE04C198CBA7625
4 changed files with 7 additions and 7 deletions

View file

@ -150,7 +150,7 @@ namespace
serialize(mSettings.mRecast, mAgentBounds, *recastMesh, objects)); serialize(mSettings.mRecast, mAgentBounds, *recastMesh, objects));
ASSERT_TRUE(tile.has_value()); ASSERT_TRUE(tile.has_value());
EXPECT_EQ(tile->mTileId, 1); EXPECT_EQ(tile->mTileId, 1);
EXPECT_EQ(tile->mVersion, navMeshVersion); EXPECT_EQ(tile->mVersion, navMeshFormatVersion);
} }
TEST_F(DetourNavigatorAsyncNavMeshUpdaterTest, post_when_writing_to_db_disabled_should_not_write_tiles) TEST_F(DetourNavigatorAsyncNavMeshUpdaterTest, post_when_writing_to_db_disabled_should_not_write_tiles)

View file

@ -92,7 +92,7 @@ namespace DetourNavigator
{ {
if (db == nullptr) if (db == nullptr)
return nullptr; return nullptr;
return std::make_unique<DbWorker>(updater, std::move(db), TileVersion(navMeshVersion), return std::make_unique<DbWorker>(updater, std::move(db), TileVersion(navMeshFormatVersion),
settings.mRecast, settings.mWriteToNavMeshDb); settings.mRecast, settings.mWriteToNavMeshDb);
} }
@ -483,7 +483,7 @@ namespace DetourNavigator
std::unique_ptr<PreparedNavMeshData> preparedNavMeshData; std::unique_ptr<PreparedNavMeshData> preparedNavMeshData;
bool generatedNavMeshData = false; bool generatedNavMeshData = false;
if (job.mCachedTileData.has_value() && job.mCachedTileData->mVersion == navMeshVersion) if (job.mCachedTileData.has_value() && job.mCachedTileData->mVersion == navMeshFormatVersion)
{ {
preparedNavMeshData = std::make_unique<PreparedNavMeshData>(); preparedNavMeshData = std::make_unique<PreparedNavMeshData>();
if (deserialize(job.mCachedTileData->mData, *preparedNavMeshData)) if (deserialize(job.mCachedTileData->mData, *preparedNavMeshData))

View file

@ -73,7 +73,7 @@ namespace DetourNavigator
std::vector<std::byte> input = serialize(mSettings.mRecast, mAgentBounds, *recastMesh, objects); std::vector<std::byte> input = serialize(mSettings.mRecast, mAgentBounds, *recastMesh, objects);
const std::optional<NavMeshTileInfo> info = consumer->find(mWorldspace, mTilePosition, input); const std::optional<NavMeshTileInfo> info = consumer->find(mWorldspace, mTilePosition, input);
if (info.has_value() && info->mVersion == navMeshVersion) if (info.has_value() && info->mVersion == navMeshFormatVersion)
{ {
consumer->identity(mWorldspace, mTilePosition, info->mTileId); consumer->identity(mWorldspace, mTilePosition, info->mTileId);
ignore.mConsumer = nullptr; ignore.mConsumer = nullptr;
@ -86,9 +86,9 @@ namespace DetourNavigator
return; return;
if (info.has_value()) if (info.has_value())
consumer->update(mWorldspace, mTilePosition, info->mTileId, navMeshVersion, *data); consumer->update(mWorldspace, mTilePosition, info->mTileId, navMeshFormatVersion, *data);
else else
consumer->insert(mWorldspace, mTilePosition, navMeshVersion, input, *data); consumer->insert(mWorldspace, mTilePosition, navMeshFormatVersion, input, *data);
ignore.mConsumer = nullptr; ignore.mConsumer = nullptr;
} }

View file

@ -53,7 +53,7 @@ namespace DetourNavigator
std::uint64_t mMaxDbFileSize = 0; std::uint64_t mMaxDbFileSize = 0;
}; };
inline constexpr std::int64_t navMeshVersion = 2; inline constexpr std::int64_t navMeshFormatVersion = 2;
RecastSettings makeRecastSettingsFromSettingsManager(); RecastSettings makeRecastSettingsFromSettingsManager();