Merge branch 'master' of https://github.com/codecombat/codecombat
This commit is contained in:
commit
fabf607b6a
5 changed files with 10 additions and 6 deletions
|
@ -8,6 +8,9 @@ CocoView = require 'views/kinds/CocoView'
|
||||||
|
|
||||||
marked.setOptions {gfm: true, sanitize: true, smartLists: true, breaks: false}
|
marked.setOptions {gfm: true, sanitize: true, smartLists: true, breaks: false}
|
||||||
|
|
||||||
|
# TODO, add C-style macro constants like this?
|
||||||
|
window.SPRITE_RESOLUTION_FACTOR = 4
|
||||||
|
|
||||||
# Prevent Ctrl/Cmd + [ / ], P, S
|
# Prevent Ctrl/Cmd + [ / ], P, S
|
||||||
ctrlDefaultPrevented = [219, 221, 80, 83]
|
ctrlDefaultPrevented = [219, 221, 80, 83]
|
||||||
preventBackspace = (event) ->
|
preventBackspace = (event) ->
|
||||||
|
|
|
@ -201,7 +201,7 @@ module.exports = class LevelLoader extends CocoClass
|
||||||
# queue.loadFile('/file/'+f)
|
# queue.loadFile('/file/'+f)
|
||||||
@grabThangTypeTeams() unless @thangTypeTeams
|
@grabThangTypeTeams() unless @thangTypeTeams
|
||||||
for team in @thangTypeTeams[thangType.get('original')] ? [null]
|
for team in @thangTypeTeams[thangType.get('original')] ? [null]
|
||||||
spriteOptions = {resolutionFactor: 4, async: false}
|
spriteOptions = {resolutionFactor: SPRITE_RESOLUTION_FACTOR, async: false}
|
||||||
if thangType.get('kind') is 'Floor'
|
if thangType.get('kind') is 'Floor'
|
||||||
spriteOptions.resolutionFactor = 2
|
spriteOptions.resolutionFactor = 2
|
||||||
if team and color = @teamConfigs[team]?.color
|
if team and color = @teamConfigs[team]?.color
|
||||||
|
|
|
@ -24,7 +24,7 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
|
||||||
ranges: null
|
ranges: null
|
||||||
|
|
||||||
options:
|
options:
|
||||||
resolutionFactor: 4
|
resolutionFactor: SPRITE_RESOLUTION_FACTOR
|
||||||
groundLayer: null
|
groundLayer: null
|
||||||
textLayer: null
|
textLayer: null
|
||||||
floatingLayer: null
|
floatingLayer: null
|
||||||
|
|
|
@ -150,7 +150,7 @@ module.exports = class SpriteBoss extends CocoClass
|
||||||
thangType ?= _.find @options.thangTypes, (m) -> return m.get('name') is thang.spriteName
|
thangType ?= _.find @options.thangTypes, (m) -> return m.get('name') is thang.spriteName
|
||||||
|
|
||||||
options = @createSpriteOptions thang: thang
|
options = @createSpriteOptions thang: thang
|
||||||
options.resolutionFactor = if thangType.get('kind') is 'Floor' then 2 else 4
|
options.resolutionFactor = if thangType.get('kind') is 'Floor' then 2 else SPRITE_RESOLUTION_FACTOR
|
||||||
sprite = new CocoSprite thangType, options
|
sprite = new CocoSprite thangType, options
|
||||||
@addSprite sprite, null, layer
|
@addSprite sprite, null, layer
|
||||||
sprite.setDebug @debug
|
sprite.setDebug @debug
|
||||||
|
@ -213,8 +213,9 @@ module.exports = class SpriteBoss extends CocoClass
|
||||||
@spriteLayers["Obstacle"].uncache() if @spriteLayers["Obstacle"].cacheID # might have changed sizes
|
@spriteLayers["Obstacle"].uncache() if @spriteLayers["Obstacle"].cacheID # might have changed sizes
|
||||||
@spriteLayers["Obstacle"].cache()
|
@spriteLayers["Obstacle"].cache()
|
||||||
# test performance of doing land layer, too, to see if it's faster
|
# test performance of doing land layer, too, to see if it's faster
|
||||||
#@spriteLayers["Land"].uncache() if @spriteLayers["Land"].cacheID # might have changed sizes
|
# @spriteLayers["Land"].uncache() if @spriteLayers["Land"].cacheID # might have changed sizes
|
||||||
#@spriteLayers["Land"].cache()
|
# @spriteLayers["Land"].cache()
|
||||||
|
# I don't notice much difference - Scott
|
||||||
@cached = true
|
@cached = true
|
||||||
|
|
||||||
spriteFor: (thangID) -> @sprites[thangID]
|
spriteFor: (thangID) -> @sprites[thangID]
|
||||||
|
|
|
@ -53,7 +53,7 @@ module.exports = class ThangType extends CocoModel
|
||||||
fillOptions: (options) ->
|
fillOptions: (options) ->
|
||||||
options ?= {}
|
options ?= {}
|
||||||
options = _.clone options
|
options = _.clone options
|
||||||
options.resolutionFactor ?= 4
|
options.resolutionFactor ?= SPRITE_RESOLUTION_FACTOR
|
||||||
options.async ?= false
|
options.async ?= false
|
||||||
options
|
options
|
||||||
|
|
||||||
|
|
Reference in a new issue