Browse Source

Fix Renderer2D.

PrimitiveWaste 11 years ago
parent
commit
28eea597dd
1 changed files with 2 additions and 0 deletions
  1. 2 0
      Source/Engine/Urho2D/Renderer2D.cpp

+ 2 - 0
Source/Engine/Urho2D/Renderer2D.cpp

@@ -69,12 +69,14 @@ void Renderer2D::RegisterObject(Context* context)
 void Renderer2D::UpdateBatches(const FrameInfo& frame)
 void Renderer2D::UpdateBatches(const FrameInfo& frame)
 {
 {
     unsigned count = batches_.Size();
     unsigned count = batches_.Size();
+    bool hasShaderParameters = HasShaderParameters();
 
 
     // Update non-thread critical parts of the source batches
     // Update non-thread critical parts of the source batches
     for (unsigned i = 0; i < count; ++i)
     for (unsigned i = 0; i < count; ++i)
     {
     {
         batches_[i].distance_ = 10.0f + (count - i) * 0.001f;
         batches_[i].distance_ = 10.0f + (count - i) * 0.001f;
         batches_[i].worldTransform_ = &Matrix3x4::IDENTITY;
         batches_[i].worldTransform_ = &Matrix3x4::IDENTITY;
+        batches_[i].shaderParameters_ = hasShaderParameters ? &shaderParameters_ : 0;
     }
     }
 }
 }