Fixed State.renderToTexture setting.

This commit is contained in:
Richard Davey 2017-02-07 22:00:55 +00:00
parent b0e2018c73
commit a877cdaa02
5 changed files with 9 additions and 7 deletions

View file

@ -1,4 +1,4 @@
var CHECKSUM = { var CHECKSUM = {
build: '2c3243e0-ed7f-11e6-a825-abeab037992f' build: 'd2813a20-ed80-11e6-9112-31e669c80df9'
}; };
module.exports = CHECKSUM; module.exports = CHECKSUM;

View file

@ -67,7 +67,7 @@ BaseLoader.prototype = {
start: function () start: function ()
{ {
console.log(this.state.settings.key, 'BaseLoader start. Files to load:', this.list.size); console.log(this.state.settings.key, ' - BaseLoader start. Files to load:', this.list.size);
if (!this.isReady()) if (!this.isReady())
{ {
@ -247,7 +247,7 @@ BaseLoader.prototype = {
processComplete: function () processComplete: function ()
{ {
console.log(this.state.settings.key, 'Loader Complete. Loaded:', this.storage.size, 'Failed:', this.failed.size); console.log(this.state.settings.key, ' - Loader Complete. Loaded:', this.storage.size, 'Failed:', this.failed.size);
this.list.clear(); this.list.clear();
this.inflight.clear(); this.inflight.clear();

View file

@ -149,6 +149,7 @@ CanvasRenderer.prototype = {
var ctx = state.sys.context; var ctx = state.sys.context;
var settings = state.sys.settings; var settings = state.sys.settings;
var scissor = (camera.x !== 0 || camera.y !== 0 || camera.width !== ctx.canvas.width || camera.height !== ctx.canvas.height); var scissor = (camera.x !== 0 || camera.y !== 0 || camera.width !== ctx.canvas.width || camera.height !== ctx.canvas.height);
this.currentContext = ctx; this.currentContext = ctx;
ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.setTransform(1, 0, 0, 1, 0, 0);

View file

@ -280,7 +280,7 @@ StateManager.prototype = {
createStateDisplay: function (state) createStateDisplay: function (state)
{ {
console.log('createStateDisplay', state.settings.key); // console.log('createStateDisplay', state.settings.key);
var settings = state.sys.settings; var settings = state.sys.settings;
@ -295,7 +295,7 @@ StateManager.prototype = {
{ {
if (settings.renderToTexture) if (settings.renderToTexture)
{ {
console.log('renderToTexture'); // console.log('renderToTexture', width, height);
state.sys.canvas = CanvasPool.create(state, width, height); state.sys.canvas = CanvasPool.create(state, width, height);
state.sys.context = GetContext(state.sys.canvas); state.sys.context = GetContext(state.sys.canvas);
@ -307,7 +307,7 @@ StateManager.prototype = {
} }
else else
{ {
console.log('using game canvas'); // console.log('using game canvas');
state.sys.mask = new Rectangle(0, 0, width, height); state.sys.mask = new Rectangle(0, 0, width, height);
state.sys.canvas = this.game.canvas; state.sys.canvas = this.game.canvas;
state.sys.context = this.game.context; state.sys.context = this.game.context;
@ -317,7 +317,6 @@ StateManager.prototype = {
{ {
// state.sys.fbo = this.game.renderer.createFBO(state, x, y, width, height); // state.sys.fbo = this.game.renderer.createFBO(state, x, y, width, height);
} }
}, },
getState: function (key) getState: function (key)

View file

@ -27,6 +27,8 @@ var Systems = function (state, config)
this.x = this.settings.x; this.x = this.settings.x;
this.y = this.settings.y; this.y = this.settings.y;
this.width = this.settings.width;
this.height = this.settings.height;
this.mask = null; this.mask = null;
this.canvas; this.canvas;