diff options
author | Pushkar Joshi | 2012-05-21 08:40:40 -0700 |
---|---|---|
committer | Pushkar Joshi | 2012-05-21 08:40:40 -0700 |
commit | 11cfa9ef2871002b600f1c18f4e06e55a826163c (patch) | |
tree | 381b23b0fa86cdf283a0da7a1b7d532a94e89db4 | |
parent | 4cb3612c9a67f4020d2949b5e5e5d84a90017974 (diff) | |
parent | c37a876b373ddc7cb19277aaeaa6bb2d2d5a50ac (diff) | |
download | ninja-11cfa9ef2871002b600f1c18f4e06e55a826163c.tar.gz |
Merge branch 'master' into pentool
109 files changed, 6368 insertions, 6224 deletions
diff --git a/assets/canvas-runtime.js b/assets/canvas-runtime.js index 104c22cc..eeafaab6 100644 --- a/assets/canvas-runtime.js +++ b/assets/canvas-runtime.js | |||
@@ -17,7 +17,7 @@ NinjaCvsRt.initWebGl = function (rootElement, directory) { | |||
17 | } | 17 | } |
18 | } | 18 | } |
19 | //Creating data manager | 19 | //Creating data manager |
20 | cvsDataMngr = new NinjaCvsRt.CanvasDataManager(); | 20 | cvsDataMngr = Object.create(NinjaCvsRt.CanvasDataManager, {}); |
21 | //Loading data to canvas(es) | 21 | //Loading data to canvas(es) |
22 | cvsDataMngr.loadGLData(rootElement, ninjaWebGlData.data, directory); | 22 | cvsDataMngr.loadGLData(rootElement, ninjaWebGlData.data, directory); |
23 | }; | 23 | }; |
@@ -26,1062 +26,870 @@ NinjaCvsRt.initWebGl = function (rootElement, directory) { | |||
26 | // Class ShapeRuntime | 26 | // Class ShapeRuntime |
27 | // Manages runtime shape display | 27 | // Manages runtime shape display |
28 | /////////////////////////////////////////////////////////////////////// | 28 | /////////////////////////////////////////////////////////////////////// |
29 | NinjaCvsRt.CanvasDataManager = function () | 29 | NinjaCvsRt.CanvasDataManager = Object.create(Object.prototype, { |
30 | { | 30 | |
31 | this.loadGLData = function(root, valueArray, assetPath ) | 31 | loadGLData: { |
32 | { | 32 | value: function(root, valueArray, assetPath) { |
33 | if (assetPath) | 33 | if (assetPath) |
34 | this._assetPath = assetPath.slice(); | 34 | this._assetPath = assetPath.slice(); |
35 | 35 | ||
36 | var value = valueArray; | 36 | var value = valueArray; |
37 | var nWorlds = value.length; | 37 | var nWorlds = value.length; |
38 | for (var i=0; i<nWorlds; i++) | 38 | for (var i=0; i<nWorlds; i++) |
39 | { | 39 | { |
40 | var importStr = value[i]; | 40 | var importStr = value[i]; |
41 | 41 | ||
42 | // there should be some version information in | 42 | // there should be some version information in |
43 | // the form of 'v0.0;' Pull that off. (the trailing ';' should | 43 | // the form of 'v0.0;' Pull that off. (the trailing ';' should |
44 | // be in the first 24 characters). | 44 | // be in the first 24 characters). |
45 | var index = importStr.indexOf( ';' ); | 45 | var index = importStr.indexOf( ';' ); |
46 | if ((importStr[0] === 'v') && (index < 24)) | 46 | if ((importStr[0] === 'v') && (index < 24)) |
47 | { | 47 | { |
48 | // JSON format. pull off the version info | 48 | // JSON format. pull off the version info |
49 | importStr = importStr.substr( index+1 ); | 49 | importStr = importStr.substr( index+1 ); |
50 | 50 | ||
51 | var jObj = JSON.parse( importStr ); | 51 | var jObj = JSON.parse( importStr ); |
52 | var id = jObj.id; | 52 | var id = jObj.id; |
53 | if (id) | 53 | if (id) |
54 | { | 54 | { |
55 | var canvas = this.findCanvasWithID( id, root ); | 55 | var canvas = this.findCanvasWithID( id, root ); |
56 |