@@ -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 } ,
0 commit comments