aboutsummaryrefslogtreecommitdiff
path: root/js/lib/rdge/materials/fly-material.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib/rdge/materials/fly-material.js')
-rw-r--r--js/lib/rdge/materials/fly-material.js21
1 files changed, 12 insertions, 9 deletions
diff --git a/js/lib/rdge/materials/fly-material.js b/js/lib/rdge/materials/fly-material.js
index 712a38ac..ca38cc83 100644
--- a/js/lib/rdge/materials/fly-material.js
+++ b/js/lib/rdge/materials/fly-material.js
@@ -30,18 +30,21 @@ var FlyMaterial = function FlyMaterial() {
30 // Methods 30 // Methods
31 /////////////////////////////////////////////////////////////////////// 31 ///////////////////////////////////////////////////////////////////////
32 // duplcate method requirde 32 // duplcate method requirde
33 this.dup = function( world ) { 33 this.dup = function( world )
34 // allocate a new uber material 34 {
35 var newMat = new FlyMaterial(); 35 // get the current values;
36 var propNames = [], propValues = [], propTypes = [], propLabels = [];
37 this.getAllProperties(propNames, propValues, propTypes, propLabels);
38
39 // allocate a new material
40 var newMat = new FlyMaterial();
36 41
37 // copy over the current values; 42 // copy over the current values;
38 var propNames = [], propValues = [], propTypes = [], propLabels = []; 43 var n = propNames.length;
39 this.getAllProperties( propNames, propValues, propTypes, propLabels); 44 for (var i = 0; i < n; i++)
40 var n = propNames.length; 45 newMat.setProperty(propNames[i], propValues[i]);
41 for (var i=0; i<n; i++)
42 newMat.setProperty( propNames[i], propValues[i] );
43 46
44 return newMat; 47 return newMat;
45 }; 48 };
46 49
47 this.init = function( world ) { 50 this.init = function( world ) {