diff options
author | Jonathan Duran | 2012-06-19 08:40:26 -0700 |
---|---|---|
committer | Jonathan Duran | 2012-06-19 08:40:26 -0700 |
commit | 6f25a2e70079de6bcbb8c3411ddef88c2ed1ea39 (patch) | |
tree | 253e5f6dd5923218e3155f78fa67ff3e43de0ebc | |
parent | b51c9448bc187f9bfa3ab39c366657ec2bb9e2fb (diff) | |
parent | 483ad57efcd6475776f580c3af5b60e6deeaf781 (diff) | |
download | ninja-6f25a2e70079de6bcbb8c3411ddef88c2ed1ea39.tar.gz |
Merge branch 'refs/heads/NINJAmaster' into TimelineUber
94 files changed, 5166 insertions, 4240 deletions
diff --git a/assets/canvas-runtime.js b/assets/canvas-runtime.js index 6268f0bb..13b36540 100644 --- a/assets/canvas-runtime.js +++ b/assets/canvas-runtime.js | |||
@@ -56,60 +56,64 @@ NinjaCvsRt.initWebGl = function (rootElement, directory, data) { | |||
56 | /////////////////////////////////////////////////////////////////////// | 56 | /////////////////////////////////////////////////////////////////////// |
57 | NinjaCvsRt.CanvasDataManager = Object.create(Object.prototype, { | 57 | NinjaCvsRt.CanvasDataManager = Object.create(Object.prototype, { |
58 | 58 | ||
59 | loadGLData: { | 59 | loadGLData: { |
60 | value: function(root, valueArray, assetPath) { | 60 | value: function(root, valueArray, assetPath) { |
61 | if (assetPath) | 61 | if (assetPath) |
62 | this._assetPath = assetPath.slice(); | 62 | this._assetPath = assetPath.slice(); |
63 | 63 | ||
64 | var value = valueArray; | 64 | var value = valueArray; |
65 | var nWorlds = value.length; | 65 | var nWorlds = value.length; |
66 | for (var i=0; i<nWorlds; i++) | 66 | for (var i=0; i<nWorlds; i++) |
67 | { | 67 | { |
68 | var importStr = value[i]; | 68 | var importStr = value[i]; |
69 | 69 | ||
70 | // there should be some version information in | 70 | // there should be some version information in |
71 | // the form of 'v0.0;' Pull that off. (the trailing ';' should | 71 | // the form of 'v0.0;' Pull that off. (the trailing ';' should |
72 | // be in the first 24 characters). | 72 | // be in the first 24 characters). |
73 | var index = importStr.indexOf( ';' ); | 73 | var index = importStr.indexOf( ';' ); |
74 | if ((importStr[0] === 'v') && (index < 24)) | 74 | if ((importStr[0] === 'v') && (index < 24)) |
75 | { | 75 | { |
76 | // JSON format. pull off the version info | 76 | // JSON format. pull off the version info |
77 | importStr = importStr.substr( index+1 ); | 77 | importStr = importStr.substr( index+1 ); |
78 | 78 | ||
79 | var jObj = JSON.parse( importStr ); | 79 | var jObj = JSON.parse( importStr ); |
80 | var id = jObj.id; | 80 | var id = jObj.id; |
81 | if (id) | 81 | if (id) |
82 | { | 82 | { |
83 | var canvas = this.findCanvasWithID( id, root ); | 83 | var canvas = this.findCanvasWithID( id, root ); |
84 | if (canvas) | 84 | if (canvas) |
85 | { | 85 | { |
86 | // new NinjaCvsRt.GLRuntime( canvas, jObj, assetPath ); | 86 | // new NinjaCvsRt.GLRuntime( canvas, jObj, assetPath ); |
87 | var glRt = Object.create(NinjaCvsRt.GLRuntime, {}); | 87 | var glRt = Object.create(NinjaCvsRt.GLRuntime, {}); |
88 | glRt.renderWorld(canvas, jObj, this._assetPath); | 88 | glRt.renderWorld(canvas, jObj, this._assetPath); |
89 | } | 89 | } |
90 | } | 90 | else |
91 | } | 91 | { |
92 | } | 92 | console.log( "***** COULD NOT FIND CANVAS WITH ID " + id + " *****" ); |
93 | } | 93 | } |
94 | }, | 94 | } |
95 | 95 | } | |
96 | findCanvasWithID: { | 96 | } |
97 | value: function(id, elt) { | 97 | } |
98 | var cid = elt.getAttribute( "data-RDGE-id" ); | 98 | }, |
99 | if (cid == id) return elt; | 99 | |
100 | 100 | findCanvasWithID: { | |
101 | if (elt.children) | 101 | value: function(id, elt) { |
102 | { |