Multiple states now rendering together again.

This commit is contained in:
Richard Davey 2017-02-07 00:41:21 +00:00
parent c2657f3d19
commit 63c11faeb2
2 changed files with 38 additions and 10 deletions

View file

@ -1,4 +1,4 @@
var CHECKSUM = {
build: '14193730-ecc8-11e6-9098-0597fdc18cfd'
build: '971b5a80-ecca-11e6-90b6-d3ad81c3e5e2'
};
module.exports = CHECKSUM;

View file

@ -132,12 +132,12 @@ StateManager.prototype = {
autoStart: autoStart
});
console.log('StateManager not yet booted, adding to list', this._pending.length);
// console.log('StateManager not yet booted, adding to list', this._pending.length);
return;
}
console.log('StateManager.add', key, stateConfig, autoStart);
// console.log('StateManager.add', key, stateConfig, autoStart);
key = this.getKey(key, stateConfig);
@ -145,12 +145,12 @@ StateManager.prototype = {
if (stateConfig instanceof State)
{
console.log('StateManager.add from instance', key);
// console.log('StateManager.add from instance', key);
newState = this.createStateFromInstance(key, stateConfig);
}
else if (typeof stateConfig === 'object')
{
console.log('StateManager.add from object', key);
// console.log('StateManager.add from object', key);
stateConfig.key = key;
@ -158,7 +158,7 @@ StateManager.prototype = {
}
else if (typeof stateConfig === 'function')
{
console.log('StateManager.add from function', key);
// console.log('StateManager.add from function', key);
newState = this.createStateFromFunction(key, stateConfig);
}
@ -214,9 +214,6 @@ StateManager.prototype = {
}
else
{
newState.game = this.game;
newState.settings = new Settings(newState, key);
newState.sys = new Systems(newState);
newState.sys.init(this.game);
@ -224,7 +221,38 @@ StateManager.prototype = {
this.createStateDisplay(newState);
// Default required functions
return this.setupCallbacks(newState);
if (!newState.init)
{
newState.init = NOOP;
}
if (!newState.preload)
{
newState.preload = NOOP;
}
if (!newState.create)
{
newState.create = NOOP;
}
if (!newState.shutdown)
{
newState.shutdown = NOOP;
}
if (!newState.update)
{
newState.update = NOOP;
}
if (!newState.render)
{
newState.render = NOOP;
}
return newState;
}
},