diff --git a/src/game-lib-image.js b/src/game-lib-image.js index bb1b5a4..af0b9a2 100644 --- a/src/game-lib-image.js +++ b/src/game-lib-image.js @@ -4,30 +4,30 @@ * @returns {Function} * @constructor */ -GameLib.D3.ImageFactory = function (graphics) { +GameLib.D3.ImageFactory = function (graphics, baseUrl) { graphics.isNotThreeThrow(); var promiseList = {}; - return function(url, progressCallback) { + return function(imagePath, progressCallback) { - if (!url) { - console.log('Attempted to download bad URL : ' + url); - throw new Error('Bad URL : ' + url); + if (!imagePath) { + console.log('Attempted to download bad URL : ' + imagePath); + throw new Error('Bad URL : ' + imagePath); } - if (promiseList[url]) { - return promiseList[url]; + if (promiseList[imagePath]) { + return promiseList[imagePath]; } var defer = Q.defer(); - promiseList[url] = defer.promise; + promiseList[imagePath] = defer.promise; - GameLib.D3.ImageFactory.LoadImage(graphics, url, defer, progressCallback); + GameLib.D3.ImageFactory.LoadImage(graphics, baseUrl + imagePath, defer, progressCallback); - return promiseList[url]; + return promiseList[imagePath]; } }; diff --git a/src/game-lib-scene.js b/src/game-lib-scene.js index 8b6a19c..63c9468 100644 --- a/src/game-lib-scene.js +++ b/src/game-lib-scene.js @@ -219,7 +219,7 @@ GameLib.D3.Scene.LoadScene = function( var shapes = []; - var imageFactory = GameLib.D3.ImageFactory(graphics); + var imageFactory = GameLib.D3.ImageFactory(graphics, uploadUrl); if (scene.worlds && scene.worlds.length > 0) { console.warn('Implement physics worlds code here'); @@ -648,7 +648,9 @@ GameLib.D3.Scene.prototype.render = function( deltaTime, renderer ) { - renderer.render(this.instance, this.cameras[this.activeCameraIndex].instance); + if(this.sceneCamera) { + renderer.render(this.instance, this.sceneCamera); + } }; /**