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.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/js/lib/rdge/texture.js b/js/lib/rdge/texture.js
index dc0da247..0d58de1b 100644
--- a/js/lib/rdge/texture.js
+++ b/js/lib/rdge/texture.js
@@ -44,7 +44,7 @@ function Texture( dstWorld, texMapName, wrap, mips )
44 this._texture; 44 this._texture;
45 45
46 // the canvas generating the texture map (if there is one) 46 // the canvas generating the texture map (if there is one)
47 this._srcCanvas; 47 this._srcCanvas;
48 this._srcWorld; 48 this._srcWorld;
49 49
50 // texture attributes 50 // texture attributes
@@ -52,7 +52,7 @@ function Texture( dstWorld, texMapName, wrap, mips )
52 this._texMapName = texMapName.slice(); 52 this._texMapName = texMapName.slice();
53 else 53 else
54 this._srcCanvas = texMapName; 54 this._srcCanvas = texMapName;
55 55
56 56
57 // set default values for wrap and mips 57 // set default values for wrap and mips
58 if (wrap === undefined) 58 if (wrap === undefined)
@@ -64,7 +64,7 @@ function Texture( dstWorld, texMapName, wrap, mips )
64 64
65 // cache whether or not the source is animated 65 // cache whether or not the source is animated
66 this._isAnimated = false; 66 this._isAnimated = false;
67 67
68 // the destination world that will use the texture map 68 // the destination world that will use the texture map
69 this._dstWorld = dstWorld; 69 this._dstWorld = dstWorld;
70 70
@@ -121,7 +121,7 @@ function Texture( dstWorld, texMapName, wrap, mips )
121 } 121 }
122 else 122 else
123 { 123 {
124 this.loadFromFile(); 124 this.loadFromFile();
125 } 125 }
126 } 126 }
127 127
@@ -218,7 +218,7 @@ function Texture( dstWorld, texMapName, wrap, mips )
218 this.loadFromCanvas = function() 218 this.loadFromCanvas = function()
219 { 219 {
220 var NJUtils = require("js/lib/NJUtils").NJUtils; 220 var NJUtils = require("js/lib/NJUtils").NJUtils;
221 221
222 var srcCanvas = this._srcCanvas; 222 var srcCanvas = this._srcCanvas;
223 var wrap = this._wrap; 223 var wrap = this._wrap;
224 var mips = this._mips; 224 var mips = this._mips;
@@ -308,12 +308,12 @@ function Texture( dstWorld, texMapName, wrap, mips )
308 308
309 return tex; 309 return tex;
310 } 310 }
311 311
312 this.isPowerOfTwo = function(x) 312 this.isPowerOfTwo = function(x)
313 { 313 {
314 return (x & (x - 1)) == 0; 314 return (x & (x - 1)) == 0;
315 } 315 }
316 316
317 this.nextHighestPowerOfTwo = function(x) 317 this.nextHighestPowerOfTwo = function(x)
318 { 318 {
319 --x; 319 --x;
@@ -322,7 +322,7 @@ function Texture( dstWorld, texMapName, wrap, mips )
322 } 322 }
323 return x + 1; 323 return x + 1;
324 } 324 }
325 325
326 this.nextLowerPowerOfTwo = function(x) 326 this.nextLowerPowerOfTwo = function(x)
327 { 327 {
328 return this.nextHighestPowerOfTwo(x) >> 1; 328 return this.nextHighestPowerOfTwo(x) >> 1;
@@ -332,7 +332,7 @@ function Texture( dstWorld, texMapName, wrap, mips )
332 { 332 {
333 if (elt.id && elt.id === id) 333 if (elt.id && elt.id === id)
334 return elt; 334 return elt;
335 335
336 if (elt.children) 336 if (elt.children)
337 { 337 {
338 var nKids = elt.children.length; 338 var nKids = elt.children.length;