Got rid of potentially unnecessary (and definitely slow) SpriteSheetBuilder _.cloneDeep. Watch out.
This commit is contained in:
parent
aef1bc63ba
commit
97197bd89d
2 changed files with 12 additions and 8 deletions
app/lib
|
@ -99,6 +99,8 @@ module.exports = class LevelLoader extends CocoClass
|
|||
onSupermodelError: ->
|
||||
|
||||
onSupermodelLoadedOne: (e) ->
|
||||
#if e.model instanceof ThangType
|
||||
# console.log "LevelLoader loaded ThangType", e.model.get('name'), "so we should figure out how to build it."
|
||||
@update()
|
||||
|
||||
# Things to do when either the Session or Supermodel load
|
||||
|
@ -171,10 +173,12 @@ module.exports = class LevelLoader extends CocoClass
|
|||
building = thangType.buildSpriteSheet options
|
||||
return unless building
|
||||
console.log 'Building:', thangType.get('name'), options
|
||||
t0 = new Date()
|
||||
@spriteSheetsToBuild += 1
|
||||
thangType.once 'build-complete', =>
|
||||
@spriteSheetsBuilt += 1
|
||||
@notifyProgress()
|
||||
console.log "Built", thangType.get('name'), 'after', ((new Date()) - t0), 'ms'
|
||||
|
||||
# Initial Sound Loading
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
module.exports = class SpriteBuilder
|
||||
constructor: (@thangType, @options) ->
|
||||
@options ?= {}
|
||||
raw = _.cloneDeep(@thangType.get('raw'))
|
||||
raw = @thangType.get('raw')
|
||||
@shapeStore = raw.shapes
|
||||
@containerStore = raw.containers
|
||||
@animationStore = raw.animations
|
||||
|
|
Reference in a new issue