Browse Source

Fix typo and unnecessary expansion of the terrain update region.

Lasse Öörni 10 years ago
parent
commit
f13a6a338f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Source/Urho3D/Graphics/Terrain.cpp

+ 2 - 2
Source/Urho3D/Graphics/Terrain.cpp

@@ -59,7 +59,7 @@ inline void GrowUpdateRegion(IntRect& updateRegion, int x, int y)
     if (updateRegion.left_ < 0)
     if (updateRegion.left_ < 0)
     {
     {
         updateRegion.left_ = updateRegion.right_ = x;
         updateRegion.left_ = updateRegion.right_ = x;
-        updateRegion.top_ = updateRegion.bottom_ + y;
+        updateRegion.top_ = updateRegion.bottom_ = y;
     }
     }
     else
     else
     {
     {
@@ -762,7 +762,7 @@ void Terrain::CreateGeometry()
         // If updating a region of the heightmap, check which patches change
         // If updating a region of the heightmap, check which patches change
         if (!updateAll)
         if (!updateAll)
         {
         {
-            int lodExpand = 1 << numLodLevels_;
+            int lodExpand = 1 << (numLodLevels_ - 1);
             // Expand the right & bottom 1 pixel more, as patches share vertices at the edge
             // Expand the right & bottom 1 pixel more, as patches share vertices at the edge
             updateRegion.left_ -= lodExpand;
             updateRegion.left_ -= lodExpand;
             updateRegion.right_ += lodExpand + 1;
             updateRegion.right_ += lodExpand + 1;