From e065244ac75d1d0f25fd5c75cb58e714a13fe16b Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Wed, 14 Mar 2012 08:59:17 -0700 Subject: Squashed commit of the following: merge master into timeline Signed-off-by: Jonathan Duran --- js/lib/rdge/materials/pulse-material.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'js/lib/rdge/materials/pulse-material.js') 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() { this._shader.init(); // set up the material node - this._materialNode = createMaterialNode("pulseMaterial"); + this._materialNode = createMaterialNode("pulseMaterial" + "_" + world.generateUniqueNodeID()); this._materialNode.setShader(this._shader); this._time = 0; @@ -178,6 +178,13 @@ var PulseMaterial = function PulseMaterial() { // every material needs the base type and instance name var exportStr = "material: " + this.getShaderName() + "\n"; exportStr += "name: " + this.getName() + "\n"; + + var world = this.getWorld(); + if (!world) + throw new Error( "no world in material.export, " + this.getName() ); + + var texMapName = this._propValues[this._propNames[0]]; + exportStr += "texture: " +texMapName + "\n"; // every material needs to terminate like this exportStr += "endMaterial\n"; @@ -193,6 +200,8 @@ var PulseMaterial = function PulseMaterial() { var rtnStr; try { + this._propValues[this._propNames[0]] = pu.nextValue( "texture: " ); + var endKey = "endMaterial\n"; var index = importStr.indexOf( endKey ); index += endKey.length; -- cgit v1.2.3