aboutsummaryrefslogtreecommitdiff
path: root/js/lib/rdge/texture.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib/rdge/texture.js')
-rw-r--r--js/lib/rdge/texture.js25
1 files changed, 6 insertions, 19 deletions
diff --git a/js/lib/rdge/texture.js b/js/lib/rdge/texture.js
index f1448195..94147852 100644
--- a/js/lib/rdge/texture.js
+++ b/js/lib/rdge/texture.js
@@ -109,14 +109,6 @@ function Texture( dstWorld, texMapName, wrap, mips )
109 break; 109 break;
110 110
111 case notifier.OBJECT_CHANGE: 111 case notifier.OBJECT_CHANGE:
112// this._isAnimated = srcWorld._hasAnimatedMaterials;
113// if (!srcWorld.hasAnimatedMaterials())
114// srcWorld.restartRenderLoop();
115// else if (!dstWorld.hasAnimatedMaterials())
116// {
117// dstWorld.refreshTextures();
118// dstWorld.restartRenderLoop();
119// }
120 break; 112 break;
121 113
122 case notifier.FIRST_RENDER: 114 case notifier.FIRST_RENDER:
@@ -179,21 +171,16 @@ function Texture( dstWorld, texMapName, wrap, mips )
179 var doc = srcCanvas.ownerDocument; 171 var doc = srcCanvas.ownerDocument;
180 this._renderCanvas = doc.createElement("canvas"); 172 this._renderCanvas = doc.createElement("canvas");
181 173
182 // cache whether this is a 2D canvas or 3D canvas 174 this.render();
183// var srcCtx = srcCanvas.getContext("2d");
184// this._is3D = false;
185// if (!srcCtx) this._is3D = true;
186
187 this.rerender();
188 175
189 return tex; 176 return tex;
190 } 177 }
191 178
192 this.rerender = function() 179 this.render = function()
193 { 180 {
194 if (!this._srcCanvas) 181 if (!this._srcCanvas)
195 { 182 {
196 console.log( " no source canvas in GLTexture.rerender" ); 183 console.log( " no source canvas in GLTexture.render" );
197 return; 184 return;
198 } 185 }
199 var srcCanvas = this._srcCanvas; 186 var srcCanvas = this._srcCanvas;
@@ -201,7 +188,7 @@ function Texture( dstWorld, texMapName, wrap, mips )
201 var world = this.getDstWorld(); 188 var world = this.getDstWorld();
202 if (!world) 189 if (!world)
203 { 190 {
204 console.log( "no world in GLTexture.rerender" ); 191 console.log( "no world in GLTexture.render" );
205 return; 192 return;
206 } 193 }
207 var renderer = world.getRenderer(); 194 var renderer = world.getRenderer();
@@ -218,7 +205,7 @@ function Texture( dstWorld, texMapName, wrap, mips )
218 var renderCanvas = this._renderCanvas; 205 var renderCanvas = this._renderCanvas;
219 if (!renderCanvas) 206 if (!renderCanvas)
220 { 207 {
221 console.log( "no render canvas in GLTexture.rerender" ); 208 console.log( "no render canvas in GLTexture.render" );
222 return; 209 return;
223 } 210 }
224 renderCanvas.width = width; 211 renderCanvas.width = width;
@@ -229,7 +216,7 @@ function Texture( dstWorld, texMapName, wrap, mips )
229 var tex = this._texture; 216 var tex = this._texture;
230 if (!tex) 217 if (!tex)
231 { 218 {
232 console.log( "no texture in GLTexture.rerender" ); 219 console.log( "no texture in GLTexture.render" );
233 return; 220 return;
234 } 221 }
235 222