diff options
Diffstat (limited to 'js/lib/rdge/materials/pulse-material.js')
-rw-r--r-- | js/lib/rdge/materials/pulse-material.js | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/js/lib/rdge/materials/pulse-material.js b/js/lib/rdge/materials/pulse-material.js index eedccf71..bb8833b4 100644 --- a/js/lib/rdge/materials/pulse-material.js +++ b/js/lib/rdge/materials/pulse-material.js | |||
@@ -81,18 +81,19 @@ var PulseMaterial = function PulseMaterial() | |||
81 | // save the world | 81 | // save the world |
82 | if (world) this.setWorld( world ); | 82 | if (world) this.setWorld( world ); |
83 | 83 | ||
84 | // allocate a new uber material | 84 | // get the current values; |
85 | var newMat = new PulseMaterial(); | 85 | var propNames = [], propValues = [], propTypes = [], propLabels = []; |
86 | this.getAllProperties(propNames, propValues, propTypes, propLabels); | ||
87 | |||
88 | // allocate a new material | ||
89 | var newMat = new PulseMaterial(); | ||
86 | 90 | ||
87 | // copy over the current values; | 91 | // copy over the current values; |
88 | var propNames = [], propValues = [], propTypes = [], propLabels = []; | 92 | var n = propNames.length; |
89 | this.getAllProperties( propNames, propValues, propTypes, propLabels); | 93 | for (var i = 0; i < n; i++) |
90 | var n = propNames.length; | 94 | newMat.setProperty(propNames[i], propValues[i]); |
91 | for (var i=0; i<n; i++) { | ||
92 | newMat.setProperty( propNames[i], propValues[i] ); | ||
93 | } | ||
94 | 95 | ||
95 | return newMat; | 96 | return newMat; |
96 | }; | 97 | }; |
97 | 98 | ||
98 | this.init = function( world ) { | 99 | this.init = function( world ) { |