From e4e8821902dde4ef085a7ca66fe3c934f1ef53bd Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 12 Mar 2017 20:17:16 +0100 Subject: [PATCH] Refactor update of lodFlags --- components/terrain/quadtreeworld.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/terrain/quadtreeworld.cpp b/components/terrain/quadtreeworld.cpp index 236c5310f..dfcf20509 100644 --- a/components/terrain/quadtreeworld.cpp +++ b/components/terrain/quadtreeworld.cpp @@ -318,15 +318,16 @@ void loadRenderingNode(ViewData::Entry& entry, ViewData* vd, ChunkManager* chunk int ourLod = Log2(int(entry.mNode->getSize())); unsigned int lodFlags = getLodFlags(entry.mNode, ourLod, vd); if (lodFlags != entry.mLodFlags) + { entry.mRenderingNode = NULL; + entry.mLodFlags = lodFlags; + } } if (!entry.mRenderingNode) { int ourLod = Log2(int(entry.mNode->getSize())); - unsigned int lodFlags = getLodFlags(entry.mNode, ourLod, vd); - entry.mRenderingNode = chunkManager->getChunk(entry.mNode->getSize(), entry.mNode->getCenter(), ourLod, lodFlags); - entry.mLodFlags = lodFlags; + entry.mRenderingNode = chunkManager->getChunk(entry.mNode->getSize(), entry.mNode->getCenter(), ourLod, entry.mLodFlags); } }