Skip to content

Commit

Permalink
Copy the block context not the block context array
Browse files Browse the repository at this point in the history
  • Loading branch information
Thayer J Andrews committed Mar 2, 2015
1 parent a5f961a commit a9579db
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions cocos2d/CCEffectStack.m
Expand Up @@ -339,18 +339,16 @@ + (CCEffectImpl *)stitchEffects:(NSArray*)stitchList startIndex:(int)startIndex
// Copy the begin and update blocks from the input passes into the new pass.
for (CCEffectRenderPass *pass in effectImpl.renderPasses)
{
NSMutableArray *beginBlocks = [pass.beginBlocks copy];
NSMutableArray *updateBlocks = [pass.updateBlocks copy];

// Update the uniform translation table in the new pass's begin blocks
for (CCEffectRenderPassBeginBlockContext *blockContext in beginBlocks)
for (CCEffectRenderPassBeginBlockContext *blockContext in pass.beginBlocks)
{
blockContext.uniformTranslationTable = utt;
CCEffectRenderPassBeginBlockContext *newContext = [blockContext copy];
newContext.uniformTranslationTable = utt;
[allBeginBlocks addObject:newContext];
}

// Add the blocks to the list of all blocks for the new pass.
[allBeginBlocks addObjectsFromArray:beginBlocks];
[allUpdateBlocks addObjectsFromArray:updateBlocks];
// Copy the update blocks
[allUpdateBlocks addObjectsFromArray:[pass.updateBlocks copy]];
}
}

Expand Down

0 comments on commit a9579db

Please sign in to comment.