Browse Source

- Fixed bad master sprite-batch Id when clearing the SpriteBatch. Thanks https://github.com/Alpha-Kand

MelvMay-GG 12 years ago
parent
commit
6f7be91
1 changed files with 2 additions and 2 deletions
  1. 2 2
      engine/source/2d/core/SpriteBatch.cc

+ 2 - 2
engine/source/2d/core/SpriteBatch.cc

@@ -31,7 +31,7 @@
 //------------------------------------------------------------------------------
 
 SpriteBatch::SpriteBatch() :
-    mMasterBatchId( 1 ),
+    mMasterBatchId( 0 ),
     mSelectedSprite( NULL ),
     mBatchSortMode( SceneRenderQueue::RENDER_SORT_OFF ),
     mDefaultSpriteStride( 1.0f, 1.0f),
@@ -931,7 +931,7 @@ SpriteBatchItem* SpriteBatch::createSprite( void )
     PROFILE_SCOPE(SpriteBatch_CreateSprite);
 
     // Allocate batch Id.
-    const U32 batchId = mMasterBatchId++;
+    const U32 batchId = ++mMasterBatchId;
 
     // Create sprite batch item,
     SpriteBatchItem* pSpriteBatchItem = SpriteBatchItemFactory.createObject();