diff --git a/src/game-lib-scene.js b/src/game-lib-scene.js index f8d71ef..a838638 100644 --- a/src/game-lib-scene.js +++ b/src/game-lib-scene.js @@ -160,6 +160,7 @@ GameLib.D3.Scene.prototype.loadTexture = function(url) { this.textureLoader.load( url, function onLoad(textureInstance){ + textureInstance.myUrl = url; defer.resolve(textureInstance); }, function onProgress(xhr){ @@ -216,7 +217,7 @@ GameLib.D3.Scene.prototype.loadTextures = function(urls, onLoadedCallback) { var filename = gameLibTexture.image.filename; - if (instanceTexture.image.src.match(new RegExp(filename + '$'))) { + if (instanceTexture.myUrl.match(new RegExp(filename + '$'))) { instanceMaterial[instanceMapId] = new this.graphics.instance.Texture( instanceTexture.image, gameLibTexture.mapping,