From 9e048d2cf359c305e895fe7c0bebf09016896531 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Fri, 9 Mar 2012 15:11:48 -0800 Subject: remap hard coded strings in rdge internal code. --- js/helper-classes/RDGE/src/core/script/engine.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'js/helper-classes/RDGE/src/core/script/engine.js') diff --git a/js/helper-classes/RDGE/src/core/script/engine.js b/js/helper-classes/RDGE/src/core/script/engine.js index 5bc9305c..f5724665 100755 --- a/js/helper-classes/RDGE/src/core/script/engine.js +++ b/js/helper-classes/RDGE/src/core/script/engine.js @@ -89,6 +89,8 @@ stateManager = function() g_enableBenchmarks = true; function Engine() { + this._assetPath = "assets/"; + // map of scene graphs to names this.sceneMap = []; @@ -228,6 +230,19 @@ function Engine() contextManager.currentCtx = savedCtx; } + + this.remapAssetFolder = function( url ) + { + var searchStr = "assets/"; + var index = url.indexOf( searchStr ); + var rtnPath = url; + if (index >= 0) + { + rtnPath = url.substr( index + searchStr.length ); + rtnPath = this._assetPath + rtnPath; + } + return rtnPath; + } } -- cgit v1.2.3 From fdeed8051c3af538d28ca3bc599121cea483c22c Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 22 Mar 2012 15:47:56 -0700 Subject: Squashed commit of the following GL integration Signed-off-by: Valerio Virgillito --- js/helper-classes/RDGE/src/core/script/engine.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'js/helper-classes/RDGE/src/core/script/engine.js') diff --git a/js/helper-classes/RDGE/src/core/script/engine.js b/js/helper-classes/RDGE/src/core/script/engine.js index f5724665..1341d032 100755 --- a/js/helper-classes/RDGE/src/core/script/engine.js +++ b/js/helper-classes/RDGE/src/core/script/engine.js @@ -214,6 +214,11 @@ function Engine() return contextManager.contextMap[optCanvasID]; } } + + this.clearContext = function( canvasID ) + { + contextManager.contextMap[canvasID] = undefined; + } /* * give the contextID (canvas id) of the context to set @@ -488,7 +493,7 @@ Engine.prototype.registerCanvas = function(canvas, runState) { Engine.prototype.unregisterCanvas = function(canvas) { stat.closePage(canvas.rdgeid + "_fps"); contextManager.removeObject(canvas.rdgeCtxHandle); - + this.clearContext( canvas.rdgeid ); } Engine.prototype.getCanvas = function( id ) -- cgit v1.2.3