diff options
Diffstat (limited to 'js/lib/rdge/materials/keleidoscope-material.js')
-rw-r--r-- | js/lib/rdge/materials/keleidoscope-material.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/js/lib/rdge/materials/keleidoscope-material.js b/js/lib/rdge/materials/keleidoscope-material.js index db325eaa..e9f1b10e 100644 --- a/js/lib/rdge/materials/keleidoscope-material.js +++ b/js/lib/rdge/materials/keleidoscope-material.js | |||
@@ -38,17 +38,19 @@ var KeleidoscopeMaterial = function KeleidoscopeMaterial() { | |||
38 | /////////////////////////////////////////////////////////////////////// | 38 | /////////////////////////////////////////////////////////////////////// |
39 | // duplcate method requirde | 39 | // duplcate method requirde |
40 | this.dup = function( world ) { | 40 | this.dup = function( world ) { |
41 | // allocate a new uber material | 41 | // get the current values; |
42 | var newMat = new KeleidoscopeMaterial(); | 42 | var propNames = [], propValues = [], propTypes = [], propLabels = []; |
43 | this.getAllProperties(propNames, propValues, propTypes, propLabels); | ||
44 | |||
45 | // allocate a new material | ||
46 | var newMat = new KeleidoscopeMaterial(); | ||
43 | 47 | ||
44 | // copy over the current values; | 48 | // copy over the current values; |
45 | var propNames = [], propValues = [], propTypes = [], propLabels = []; | 49 | var n = propNames.length; |
46 | this.getAllProperties( propNames, propValues, propTypes, propLabels); | 50 | for (var i = 0; i < n; i++) |
47 | var n = propNames.length; | 51 | newMat.setProperty(propNames[i], propValues[i]); |
48 | for (var i=0; i<n; i++) | ||
49 | newMat.setProperty( propNames[i], propValues[i] ); | ||
50 | 52 | ||
51 | return newMat; | 53 | return newMat; |
52 | }; | 54 | }; |
53 | 55 | ||
54 | this.init = function( world ) { | 56 | this.init = function( world ) { |