Skip to content

Commit 8529cb9

Browse files
committed
Resolution fix work in progress
1 parent 5db0580 commit 8529cb9

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

src/renderer/webgl/WebGLRenderer.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@ var WebGLRenderer = new Class({
3737
pixelArt: game.config.pixelArt,
3838
backgroundColor: game.config.backgroundColor,
3939
contextCreation: contextCreationConfig,
40-
resolution: game.config.resolution
40+
resolution: game.config.resolution,
41+
autoResize: game.config.autoResize
4142
};
4243
this.game = game;
4344
this.type = CONST.WEBGL;
44-
this.width = game.config.width * game.config.resolution;
45-
this.height = game.config.height * game.config.resolution;
45+
this.width = game.config.width;
46+
this.height = game.config.height;
4647
this.canvas = game.canvas;
4748
this.lostContextCallbacks = [];
4849
this.restoredContextCallbacks = [];
4950
this.blendModes = [];
5051
this.nativeTextures = [];
5152
this.contextLost = false;
52-
this.autoResize = false;
5353
this.pipelines = null;
5454
this.snapshotState = {
5555
callback: null,
@@ -148,23 +148,24 @@ var WebGLRenderer = new Class({
148148
this.addPipeline('Light2D', new ForwardDiffuseLightPipeline(this.game, gl, this));
149149

150150
this.setBlendMode(CONST.BlendModes.NORMAL);
151-
this.resize(this.width, this.height, config.resolution);
151+
this.resize(this.width, this.height);
152152

153153
return this;
154154
},
155155

156-
resize: function (width, height, resolution)
156+
resize: function (width, height)
157157
{
158158
var gl = this.gl;
159159
var pipelines = this.pipelines;
160+
var resolution = this.config.resolution;
160161

161162
this.width = width * resolution;
162163
this.height = height * resolution;
163164

164165
this.canvas.width = this.width;
165166
this.canvas.height = this.height;
166167

167-
if (this.autoResize)
168+
//if (this.config.autoResize)
168169
{
169170
this.canvas.style.width = (this.width / resolution) + 'px';
170171
this.canvas.style.height = (this.height / resolution) + 'px';
@@ -177,6 +178,7 @@ var WebGLRenderer = new Class({
177178
{
178179
pipelines[pipelineName].resize(width, height, resolution);
179180
}
181+
180182

181183
return this;
182184
},

src/renderer/webgl/pipelines/TextureTintPipeline.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ var TextureTintPipeline = new Class({
7474
{
7575
WebGLPipeline.prototype.resize.call(this, width, height, resolution);
7676
this.projOrtho(0, this.width, this.height, 0, -1000.0, 1000.0);
77-
77+
this.viewScale(resolution, resolution, 1.0);
78+
this.modelScale(resolution, resolution, 1.0);
7879
return this;
7980
},
8081

0 commit comments

Comments
 (0)