diff options
author | hwc487 | 2012-03-05 16:33:51 -0800 |
---|---|---|
committer | hwc487 | 2012-03-05 16:33:51 -0800 |
commit | 232784ffafe834f75a46ca7fc311e8ca2ff5eec9 (patch) | |
tree | c4571d35f51153b218a6a17c7897225a2659cacb /js/helper-classes | |
parent | ec10bf44c711e9c552780d2cd9ac0baef21de445 (diff) | |
download | ninja-232784ffafe834f75a46ca7fc311e8ca2ff5eec9.tar.gz |
Corrections for canvas file IO
Diffstat (limited to 'js/helper-classes')
4 files changed, 9 insertions, 47 deletions
diff --git a/js/helper-classes/RDGE/Materials/PulseMaterial.js b/js/helper-classes/RDGE/Materials/PulseMaterial.js index b0fbd998..e55798b7 100644 --- a/js/helper-classes/RDGE/Materials/PulseMaterial.js +++ b/js/helper-classes/RDGE/Materials/PulseMaterial.js | |||
@@ -187,7 +187,7 @@ function PulseMaterial() | |||
187 | exportStr += "name: " + this.getName() + "\n"; | 187 | exportStr += "name: " + this.getName() + "\n"; |
188 | 188 | ||
189 | var texMapName = this._propValues[this._propNames[0]]; | 189 | var texMapName = this._propValues[this._propNames[0]]; |
190 | exportStr += "texture: " + texMapName; | 190 | exportStr += "texture: " + texMapName + "\n"; |
191 | 191 | ||
192 | // every material needs to terminate like this | 192 | // every material needs to terminate like this |
193 | exportStr += "endMaterial\n"; | 193 | exportStr += "endMaterial\n"; |
diff --git a/js/helper-classes/RDGE/runtime/CanvasDataManager.js b/js/helper-classes/RDGE/runtime/CanvasDataManager.js index 46d944a1..efbfe4db 100644 --- a/js/helper-classes/RDGE/runtime/CanvasDataManager.js +++ b/js/helper-classes/RDGE/runtime/CanvasDataManager.js | |||
@@ -12,7 +12,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
12 | /////////////////////////////////////////////////////////////////////// | 12 | /////////////////////////////////////////////////////////////////////// |
13 | function CanvasDataManager() | 13 | function CanvasDataManager() |
14 | { | 14 | { |
15 | this.loadGLData = function(root, valueArray) | 15 | this.loadGLData = function(root, valueArray, NinjaUtils) |
16 | { | 16 | { |
17 | var value = valueArray; | 17 | var value = valueArray; |
18 | var nWorlds = value.length; | 18 | var nWorlds = value.length; |
@@ -29,32 +29,7 @@ function CanvasDataManager() | |||
29 | var canvas = this.findCanvasWithID( id, root ); | 29 | var canvas = this.findCanvasWithID( id, root ); |
30 | if (canvas) | 30 | if (canvas) |
31 | { | 31 | { |
32 | //var loadForAuthoring = true; | 32 | var rt = new GLRuntime( canvas, importStr ); |
33 | var index = importStr.indexOf( "scenedata: " ); | ||
34 | //if (index >= 0) loadForAuthoring = false; | ||
35 | var loadForAuthoring = false; | ||
36 | |||
37 | if (loadForAuthoring) | ||
38 | { | ||
39 | if (!canvas.elementModel) | ||
40 | { | ||
41 | NJUtils.makeElementModel(canvas, "Canvas", "shape", true); | ||
42 | } | ||
43 | |||
44 | if (canvas.elementModel) | ||
45 | { | ||
46 | if (canvas.elementModel.shapeModel.GLWorld) | ||
47 | canvas.elementModel.shapeModel.GLWorld.clearTree(); | ||
48 | |||
49 | var world = new GLWorld( canvas ); | ||
50 | canvas.elementModel.shapeModel.GLWorld = world; | ||
51 | world.import( importStr ); | ||
52 | } | ||
53 | } | ||
54 | else | ||
55 | { | ||
56 | var rt = new GLRuntime( canvas, importStr ); | ||
57 | } | ||
58 | } | 33 | } |
59 | } | 34 | } |
60 | } | 35 | } |
diff --git a/js/helper-classes/RDGE/runtime/RuntimeGeomObj.js b/js/helper-classes/RDGE/runtime/RuntimeGeomObj.js index 253154f9..fd5bf3aa 100644 --- a/js/helper-classes/RDGE/runtime/RuntimeGeomObj.js +++ b/js/helper-classes/RDGE/runtime/RuntimeGeomObj.js | |||
@@ -83,7 +83,9 @@ function RuntimeGeomObj() | |||
83 | case "radialGradient": mat = new RuntimeRadialGradientMaterial(); break; | 83 | case "radialGradient": mat = new RuntimeRadialGradientMaterial(); break; |
84 | case "linearGradient": mat = new RuntimeLinearGradientMaterial(); break; | 84 | case "linearGradient": mat = new RuntimeLinearGradientMaterial(); break; |
85 | case "bumpMetal": mat = new RuntimeBumpMetalMaterial(); break; | 85 | case "bumpMetal": mat = new RuntimeBumpMetalMaterial(); break; |
86 | case "uber": mat = new RuntimeUberMaterial(); break; | ||
86 | 87 | ||
88 | case "deform": | ||
87 | case "water": | 89 | case "water": |
88 | case "tunnel": | 90 | case "tunnel": |
89 | case "reliefTunnel": | 91 | case "reliefTunnel": |
@@ -94,6 +96,7 @@ function RuntimeGeomObj() | |||
94 | case "mandel": | 96 | case "mandel": |
95 | case "star": | 97 | case "star": |
96 | case "zinvert": | 98 | case "zinvert": |
99 | case "keleidoscope": | ||
97 | case "pulse": mat = new RuntimePulseMaterial(); break; | 100 | case "pulse": mat = new RuntimePulseMaterial(); break; |
98 | 101 | ||
99 | default: | 102 | default: |
diff --git a/js/helper-classes/RDGE/runtime/RuntimeMaterial.js b/js/helper-classes/RDGE/runtime/RuntimeMaterial.js index ceabbaa5..0f10cfbe 100644 --- a/js/helper-classes/RDGE/runtime/RuntimeMaterial.js +++ b/js/helper-classes/RDGE/runtime/RuntimeMaterial.js | |||
@@ -274,26 +274,10 @@ function RuntimeBumpMetalMaterial() | |||
274 | } | 274 | } |
275 | } | 275 | } |
276 | } | 276 | } |
277 | |||
278 | /* | ||
279 | this.update = function( time ) | ||
280 | { | ||
281 | var material = this._materialNode; | ||
282 | if (material) | ||
283 | { | ||
284 | var technique = material.shaderProgram.default; | ||
285 | var renderer = g_Engine.getContext().renderer; | ||
286 | if (renderer && technique) | ||
287 | { | ||
288 | if (this._shader && this._shader.default) | ||
289 | this._shader.default.u_time.set( [this._time] ); | ||
290 | this._time += this._dTime; | ||
291 | if (this._time > 200.0) this._time = 0.0; | ||
292 | } | ||
293 | } | ||
294 | } | ||
295 | */ | ||
296 | } | 277 | } |
297 | 278 | ||
279 | function RuntimeUberMaterial() | ||
280 | { | ||
281 | } | ||
298 | 282 | ||
299 | 283 | ||