From 136d274d54c9171253270c906a902742b3386e8e Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Mon, 22 Aug 2016 11:45:37 -0700 Subject: [PATCH] Render from partially-completed prerendered spritesheet correctly, fix #3641 --- app/lib/surface/LayerAdapter.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/lib/surface/LayerAdapter.coffee b/app/lib/surface/LayerAdapter.coffee index 52569ac7f..a7b379754 100644 --- a/app/lib/surface/LayerAdapter.coffee +++ b/app/lib/surface/LayerAdapter.coffee @@ -358,6 +358,9 @@ module.exports = LayerAdapter = class LayerAdapter extends CocoClass prerenderedSpriteSheet = thangType.getPrerenderedSpriteSheet(colorConfig, 'segmented') if prerenderedSpriteSheet and not prerenderedSpriteSheet.loadedImage return + else if prerenderedSpriteSheet + animations = prerenderedSpriteSheet.spriteSheet._animations + renderedActions = _.zipObject(animations, _.times(animations.length, -> true)) containersToRender = thangType.getContainersForActions(actionNames) #console.log 'render segmented', thangType.get('name'), actionNames, colorConfig, 'because we do not have prerendered sprite sheet?', prerenderedSpriteSheet spriteBuilder = new SpriteBuilder(thangType, {colorConfig: colorConfig}) @@ -367,7 +370,7 @@ module.exports = LayerAdapter = class LayerAdapter extends CocoClass container = new createjs.Sprite(@spriteSheet) container.gotoAndStop(containerKey) frame = spriteSheetBuilder.addFrame(container) - else if prerenderedSpriteSheet + else if prerenderedSpriteSheet and renderedActions[containerGlobalName] container = new createjs.Sprite(prerenderedSpriteSheet.spriteSheet) container.gotoAndStop(containerGlobalName) scale = @resolutionFactor / (prerenderedSpriteSheet.get('resolutionFactor') or 1)