class Dosbox.Module
constructor: (options) ->
@elCanvas = options.canvas
@canvas = @elCanvas[0]
preRun: []
postRun: []
totalDependencies: 0
Wrapper for emscripten module that also holds canvas element
Usage:
new Dosbox.Module({canvas: canvas});
Constructor arguments:
class Dosbox.Module
constructor: (options) ->
@elCanvas = options.canvas
@canvas = @elCanvas[0]
preRun: []
postRun: []
totalDependencies: 0
SDL_numSimultaneouslyQueuedBuffers: 1
print: (text) ->
text = Array::slice.call(arguments).join(' ')
console?.log? text
printErr: (text) ->
text = Array::slice.call(arguments).join(' ')
console?.error? text
setStatus: (text) ->
console?.log? text
monitorRunDependencies: (left) ->
@totalDependencies = Math.max(@totalDependencies, left)
status =
if left
"Preparing... (#{@totalDependencies - left}/#{@totalDependencies})"
else
'All downloads complete.'
Module.setStatus status