Browse Source

Merge branch 'master' into threaded-resource-load

Lasse Öörni 11 years ago
parent
commit
9bee27f0bd
1 changed files with 1 additions and 5 deletions
  1. 1 5
      Source/Engine/Graphics/Octree.cpp

+ 1 - 5
Source/Engine/Graphics/Octree.cpp

@@ -75,11 +75,7 @@ void UpdateDrawablesWork(const WorkItem* item, unsigned threadIndex)
     {
     {
         Drawable* drawable = *start;
         Drawable* drawable = *start;
         if (drawable)
         if (drawable)
-        {
             drawable->Update(frame);
             drawable->Update(frame);
-            // Ask for an updated world bounding box from the drawable already here to calculate them multithreaded
-            drawable->GetWorldBoundingBox();
-        }
         ++start;
         ++start;
     }
     }
 }
 }
@@ -412,7 +408,7 @@ void Octree::Update(const FrameInfo& frame)
         scene->BeginThreadedUpdate();
         scene->BeginThreadedUpdate();
         
         
         int numWorkItems = queue->GetNumThreads() + 1; // Worker threads + main thread
         int numWorkItems = queue->GetNumThreads() + 1; // Worker threads + main thread
-        int drawablesPerItem = drawableUpdates_.Size() / numWorkItems;
+        int drawablesPerItem = Max((int)(drawableUpdates_.Size() / numWorkItems), 1);
         
         
         PODVector<Drawable*>::Iterator start = drawableUpdates_.Begin();
         PODVector<Drawable*>::Iterator start = drawableUpdates_.Begin();
         // Create a work item for each thread
         // Create a work item for each thread