mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-02 11:58:10 -05:00
Added a new test to webgl: making giant canvases.
This commit is contained in:
parent
d5542ffbbc
commit
5551c622fa
1 changed files with 31 additions and 1 deletions
|
@ -473,6 +473,35 @@ class WebGLDemoView extends RootView
|
||||||
|
|
||||||
# 20% CPU
|
# 20% CPU
|
||||||
|
|
||||||
|
testGiantCanvas: ->
|
||||||
|
builder = new createjs.SpriteSheetBuilder()
|
||||||
|
|
||||||
|
# mess with these
|
||||||
|
builder.maxWidth = 4096
|
||||||
|
builder.maxHeight = 4096
|
||||||
|
scale = 3.9
|
||||||
|
duplicates = 100
|
||||||
|
|
||||||
|
frames = []
|
||||||
|
|
||||||
|
createClass = (frame) ->
|
||||||
|
class Stub
|
||||||
|
constructor: ->
|
||||||
|
sprite = new createjs.Sprite(sheet, frame)
|
||||||
|
sprite.stop()
|
||||||
|
return sprite
|
||||||
|
|
||||||
|
for name, klass of librarianLib
|
||||||
|
continue if name is 'Librarian_SideWalk_JSCC'
|
||||||
|
instance = new klass()
|
||||||
|
builder.addFrame(instance, instance.nominalBounds, scale) for i in _.range(duplicates)
|
||||||
|
librarianLib[name] = createClass(frames.length)
|
||||||
|
frames.push frames.length
|
||||||
|
|
||||||
|
sheet = builder.build()
|
||||||
|
$('body').attr('class', '').empty().css('background', 'white').append($(sheet._images))
|
||||||
|
for image, index in sheet._images
|
||||||
|
console.log "Sheet ##{index}: #{$(image).attr('width')}x#{$(image).attr('height')}"
|
||||||
|
|
||||||
afterRender: ->
|
afterRender: ->
|
||||||
# @testMovieClipWithRasterizedSpriteChildren()
|
# @testMovieClipWithRasterizedSpriteChildren()
|
||||||
|
@ -485,7 +514,8 @@ class WebGLDemoView extends RootView
|
||||||
# @testAnimateManyRasteredWaterfalls()
|
# @testAnimateManyRasteredWaterfalls()
|
||||||
# @testManualMovieClipUpdating()
|
# @testManualMovieClipUpdating()
|
||||||
# @testManyWaterfallsWithManualAnimation()
|
# @testManyWaterfallsWithManualAnimation()
|
||||||
@testLibrarianHorde()
|
# @testLibrarianHorde()
|
||||||
|
@testGiantCanvas()
|
||||||
|
|
||||||
module.exports = ->
|
module.exports = ->
|
||||||
v = new WebGLDemoView()
|
v = new WebGLDemoView()
|
||||||
|
|
Loading…
Reference in a new issue