diff options
author | hwc487 | 2012-04-26 16:40:05 -0700 |
---|---|---|
committer | hwc487 | 2012-04-26 16:40:05 -0700 |
commit | 5a1965bf2ed9a54601ca16fd67555335c510ce08 (patch) | |
tree | 7fa2419c8a194e7b0265b58f0f4d10d02a0d66f4 /js/lib/rdge/materials/pulse-material.js | |
parent | ee07f71e9e6c9219e02738c77fb038bece2e03b6 (diff) | |
download | ninja-5a1965bf2ed9a54601ca16fd67555335c510ce08.tar.gz |
Update materials to the new texture model.
Create local world for deleted source canvases
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 ) { |