aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/lib/rdge/materials/twist-vert-material.js27
1 files changed, 24 insertions, 3 deletions
diff --git a/js/lib/rdge/materials/twist-vert-material.js b/js/lib/rdge/materials/twist-vert-material.js
index 892e975f..b27c0b11 100644
--- a/js/lib/rdge/materials/twist-vert-material.js
+++ b/js/lib/rdge/materials/twist-vert-material.js
@@ -47,7 +47,21 @@ var TwistVertMaterial = function TwistVertMaterial()
47 // Methods 47 // Methods
48 /////////////////////////////////////////////////////////////////////// 48 ///////////////////////////////////////////////////////////////////////
49 // duplcate method requirde 49 // duplcate method requirde
50 this.dup = function () { return new TwistVertMaterial(); }; 50 this.dup = function() {
51 // get the current values;
52 var propNames = [], propValues = [], propTypes = [], propLabels = [];
53 this.getAllProperties(propNames, propValues, propTypes, propLabels);
54
55 // allocate a new material
56 var newMat = new TwistVertMaterial();
57
58 // copy over the current values;
59 var n = propNames.length;
60 for (var i = 0; i < n; i++)
61 newMat.setProperty(propNames[i], propValues[i]);
62
63 return newMat;
64 };
51 65
52 this.init = function (world) 66 this.init = function (world)
53 { 67 {
@@ -162,8 +176,15 @@ var TwistVertMaterial = function TwistVertMaterial()
162 { 176 {
163 case "u_tex0": 177 case "u_tex0":
164 case "u_tex1": 178 case "u_tex1":
165 case "color": this._shader.twistMe[propName].set(propValue); break; 179 break;
166 default: this._shader.twistMe[propName].set([propValue]); break; 180
181 case "color":
182 this._shader.twistMe[propName].set(propValue);
183 break;
184
185 default:
186 this._shader.twistMe[propName].set([propValue]);
187 break;
167 } 188 }
168 } 189 }
169 } 190 }