diff options
author | Nivesh Rajbhandari | 2012-03-13 13:05:16 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-03-13 13:05:16 -0700 |
commit | e19376c54eedd1f1c457ba405b2f110be376a559 (patch) | |
tree | d48c090f71ed2cd6bd6ce38ff68c36ab69299985 /js/lib/rdge/materials/pulse-material.js | |
parent | 970c2e63aa8ec3f70df2bf073cedb9e3b7617755 (diff) | |
parent | f56b8cf4d3316d250c0f0045fb78f0dbd5c56e94 (diff) | |
download | ninja-e19376c54eedd1f1c457ba405b2f110be376a559.tar.gz |
Merge branch 'refs/heads/ninja-internal' into WebGLFixes
Diffstat (limited to 'js/lib/rdge/materials/pulse-material.js')
-rw-r--r-- | js/lib/rdge/materials/pulse-material.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/js/lib/rdge/materials/pulse-material.js b/js/lib/rdge/materials/pulse-material.js index 63cab2f4..81db36c6 100644 --- a/js/lib/rdge/materials/pulse-material.js +++ b/js/lib/rdge/materials/pulse-material.js | |||
@@ -101,7 +101,7 @@ var PulseMaterial = function PulseMaterial() { | |||
101 | this._shader.init(); | 101 | this._shader.init(); |
102 | 102 | ||
103 | // set up the material node | 103 | // set up the material node |
104 | this._materialNode = createMaterialNode("pulseMaterial"); | 104 | this._materialNode = createMaterialNode("pulseMaterial" + "_" + world.generateUniqueNodeID()); |
105 | this._materialNode.setShader(this._shader); | 105 | this._materialNode.setShader(this._shader); |
106 | 106 | ||
107 | this._time = 0; | 107 | this._time = 0; |
@@ -178,6 +178,13 @@ var PulseMaterial = function PulseMaterial() { | |||
178 | // every material needs the base type and instance name | 178 | // every material needs the base type and instance name |
179 | var exportStr = "material: " + this.getShaderName() + "\n"; | 179 | var exportStr = "material: " + this.getShaderName() + "\n"; |
180 | exportStr += "name: " + this.getName() + "\n"; | 180 | exportStr += "name: " + this.getName() + "\n"; |
181 | |||
182 | var world = this.getWorld(); | ||
183 | if (!world) | ||
184 | throw new Error( "no world in material.export, " + this.getName() ); | ||
185 | |||
186 | var texMapName = this._propValues[this._propNames[0]]; | ||
187 | exportStr += "texture: " +texMapName + "\n"; | ||
181 | 188 | ||
182 | // every material needs to terminate like this | 189 | // every material needs to terminate like this |
183 | exportStr += "endMaterial\n"; | 190 | exportStr += "endMaterial\n"; |
@@ -193,6 +200,8 @@ var PulseMaterial = function PulseMaterial() { | |||
193 | 200 | ||
194 | var rtnStr; | 201 | var rtnStr; |
195 | try { | 202 | try { |
203 | this._propValues[this._propNames[0]] = pu.nextValue( "texture: " ); | ||
204 | |||
196 | var endKey = "endMaterial\n"; | 205 | var endKey = "endMaterial\n"; |
197 | var index = importStr.indexOf( endKey ); | 206 | var index = importStr.indexOf( endKey ); |
198 | index += endKey.length; | 207 | index += endKey.length; |