From 6b6fa1ec7d39057ce937f090b2965c09f1930070 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Wed, 21 Mar 2012 04:03:38 -0700 Subject: Clear RDGE when an element is deleted and before registering the context. --- js/helper-classes/RDGE/rdge-compiled.js | 6 +++--- js/helper-classes/RDGE/src/core/script/engine.js | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'js/helper-classes') diff --git a/js/helper-classes/RDGE/rdge-compiled.js b/js/helper-classes/RDGE/rdge-compiled.js index d1040d73..caf58147 100755 --- a/js/helper-classes/RDGE/rdge-compiled.js +++ b/js/helper-classes/RDGE/rdge-compiled.js @@ -235,15 +235,15 @@ input.onMouseMove=function(a){for(var b=0,f=input.eventHandlers.length;b0?this.stateTop-1:0;this.stateStack[this.stateTop]&&this.stateStack[this.stateTop].ReInit()};this.PopAll=function(){for(;this.stateStack[this.stateTop]!=null;)this.PopState()};this.tick=function(a){this.stateStack[this.stateTop]!=null&&(this.stateStack[this.stateTop].Update(a),this.stateStack[this.stateTop].Resize(),this.stateStack[this.stateTop].Draw())}};g_enableBenchmarks=!0; function Engine(){this._assetPath="assets/";this.sceneMap=[];this.stateTop=void 0;this.lastWindowWidth=window.innerWidth;this.lastWindowHeight=window.innerHeight;this.lightManager=this.defaultContext=null;clearColor=[0,0,0,0];panelObjectManager=new objectManager;this.initializeComplete=!1;this.RDGECanvas=null;this.canvasToRendererMap={};this.canvasNameToStateStack={};this.canvasCtxList=[];invalidObj=/([()]|function)/;isValidObj=function(a){return invalidObj.test(a)?(window.console.error("invalid object name passed to RDGE, "+ a+" - looks like a function"),!1):!0};contextDef=function(){this.startUpState=this.ctxStateManager=this.renderer=this.id=null;this.sceneGraphMap=[];this.currentScene=null;this.getScene=function(){return this.sceneGraphMap[this.currentScene]};this.debug={frameCounter:0,mat4CallCount:0}};this.ctxMan=contextManager=new objectManager;contextManager.currentCtx=null;contextManager._addObject=contextManager.addObject;contextManager.contextMap={};contextManager.addObject=function(a){this.contextMap[a.id]= -a;return this._addObject(a)};contextManager.start=function(){for(var a=this.objects.length,b=0;b=0&&(f=a.substr(b+7),f=this._assetPath+f);return f}} +a;return this._addObject(a)};contextManager.start=function(){for(var a=this.objects.length,b=0;b=0&&(f=a.substr(b+7),f=this._assetPath+f);return f}} Engine.prototype.init=function(a,b,f){this.GlInit(f);globalParamFuncSet=function(a){this.data=a.data;this.type=a.type;this.set=function(a){for(var b=this.data?this.data.length:0,f=0;f