diff --git a/src/game-lib-a.js b/src/game-lib-a.js index 2a2fe48..945bc16 100644 --- a/src/game-lib-a.js +++ b/src/game-lib-a.js @@ -58,4 +58,4 @@ console.log("Loading editor library..."); //#endif // This gets injected by gulp -console.log("Compiled at", __DATE__); +console.log("GameLib compiled at", __DATE__); diff --git a/src/game-lib-api-texture.js b/src/game-lib-api-texture.js index 84fc105..7202518 100644 --- a/src/game-lib-api-texture.js +++ b/src/game-lib-api-texture.js @@ -66,87 +66,87 @@ GameLib.D3.API.Texture = function( } this.imagePath = imagePath; - if (typeof wrapS == 'undefined') { + if (GameLib.D3.Utils.UndefinedOrNull(wrapS)) { wrapS = GameLib.D3.Texture.TYPE_REPEAT_WRAPPING; } this.wrapS = wrapS; - if (typeof wrapT == 'undefined') { + if (GameLib.D3.Utils.UndefinedOrNull(wrapT)) { wrapT = GameLib.D3.Texture.TYPE_REPEAT_WRAPPING; } this.wrapT = wrapT; - if (typeof repeat == 'undefined') { + if (GameLib.D3.Utils.UndefinedOrNull(repeat)) { repeat = new GameLib.D3.API.Vector2(1, 1); } this.repeat = repeat; - if (typeof data == 'undefined') { + if (GameLib.D3.Utils.UndefinedOrNull(data)) { data = null; } this.data = data; - if (typeof format == 'undefined') { + if (GameLib.D3.Utils.UndefinedOrNull(format)) { format = GameLib.D3.Texture.TYPE_RGBA_FORMAT; } this.format = format; - if (typeof mapping == 'undefined') { + if (GameLib.D3.Utils.UndefinedOrNull(mapping)) { mapping = GameLib.D3.Texture.TYPE_UV_MAPPING; } this.mapping = mapping; - if (typeof magFilter == 'undefined') { + if (GameLib.D3.Utils.UndefinedOrNull(magFilter)) { magFilter = GameLib.D3.Texture.TYPE_LINEAR_FILTER; } this.magFilter = magFilter; - if (typeof minFilter == 'undefined') { + if (GameLib.D3.Utils.UndefinedOrNull(minFilter)) { minFilter = GameLib.D3.Texture.TYPE_LINEAR_MIPMAP_LINEAR_FILTER; } this.minFilter = minFilter; - if (typeof textureType == 'undefined') { + if (GameLib.D3.Utils.UndefinedOrNull(textureType)) { textureType = GameLib.D3.Texture.TYPE_UNSIGNED_BYTE; } this.textureType = textureType; - if (typeof anisotropy == 'undefined') { + if (GameLib.D3.Utils.UndefinedOrNull(anisotropy)) { anisotropy = 1; } this.anisotropy = anisotropy; - if (typeof offset == 'undefined') { + if (GameLib.D3.Utils.UndefinedOrNull(offset)) { offset = new GameLib.D3.API.Vector2(0, 0); } this.offset = offset; - if (typeof generateMipmaps == 'undefined') { + if (GameLib.D3.Utils.UndefinedOrNull(generateMipmaps)) { generateMipmaps = true; } this.generateMipmaps = generateMipmaps; - if (typeof flipY == 'undefined') { + if (GameLib.D3.Utils.UndefinedOrNull(flipY)) { flipY = true; } this.flipY = flipY; - if (typeof mipmaps == 'undefined') { + if (GameLib.D3.Utils.UndefinedOrNull(mipmaps)) { mipmaps = []; } this.mipmaps = mipmaps; - if (typeof unpackAlignment == 'undefined') { + if (GameLib.D3.Utils.UndefinedOrNull(unpackAlignment)) { unpackAlignment = 4; } this.unpackAlignment = unpackAlignment; - if (typeof premultiplyAlpha == 'undefined') { + if (GameLib.D3.Utils.UndefinedOrNull(premultiplyAlpha)) { premultiplyAlpha = false; } this.premultiplyAlpha = premultiplyAlpha; - if (typeof encoding == 'undefined') { + if (GameLib.D3.Utils.UndefinedOrNull(encoding)) { encoding = GameLib.D3.Texture.TYPE_LINEAR_ENCODING; } this.encoding = encoding; diff --git a/src/game-lib-light.js b/src/game-lib-light.js index a942e7e..ee2d65f 100644 --- a/src/game-lib-light.js +++ b/src/game-lib-light.js @@ -118,15 +118,24 @@ GameLib.D3.Light.prototype.createInstance = function(update) { instance.name = this.name; - instance.position.copy(this.position.instance); + instance.position.x = this.position.x; + instance.position.y = this.position.y; + instance.position.z = this.position.z; - instance.scale.copy(this.scale.instance); + instance.scale.x = this.scale.x; + instance.scale.y = this.scale.y; + instance.scale.z = this.scale.z; - if (instance.target) { - instance.target.position.copy(this.targetPosition.instance); - } + if (instance.target) { + instance.target.position.x = this.targetPosition.x; + instance.target.position.y = this.targetPosition.y; + instance.target.position.z = this.targetPosition.z; + } - instance.quaternion.copy(this.quaternion.instance); + instance.quaternion.x = this.quaternion.x; + instance.quaternion.y = this.quaternion.y; + instance.quaternion.z = this.quaternion.z; + instance.quaternion.w = this.quaternion.w; instance.intensity = this.intensity; diff --git a/src/game-lib-texture.js b/src/game-lib-texture.js index 9818e74..da5ecff 100644 --- a/src/game-lib-texture.js +++ b/src/game-lib-texture.js @@ -155,6 +155,12 @@ GameLib.D3.Texture.prototype.createInstance = function(update) { if (update) { instance = this.instance; + instance.mapping = this.mapping; + instance.wrapS = this.wrapS; + instance.wrapT = this.wrapT; + instance.magFilter = this.magFilter; + instance.minFilter = this.minFilter; + instance.anisotropy = this.anisotropy; } else { instance = new this.graphics.instance.Texture( this.imageInstance, @@ -172,12 +178,14 @@ GameLib.D3.Texture.prototype.createInstance = function(update) { instance.name = this.name; instance.flipY = this.flipY; instance.encoding = this.encoding; - instance.flipY = this.flipY; - instance.offset.copy(this.offset.instance); - instance.repeat.copy(this.repeat.instance); + instance.offset.x = this.offset.x; + instance.offset.y = this.offset.y; + instance.repeat.x = this.repeat.x; + instance.repeat.y = this.repeat.y; instance.mipmaps = this.mipmaps; instance.unpackAlignment = this.unpackAlignment; instance.premultiplyAlpha = this.premultiplyAlpha; + instance.textureType = this.textureType; instance.needsUpdate = true; return instance;