aboutsummaryrefslogtreecommitdiff
path: root/js/lib/rdge/materials/bump-metal-material.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib/rdge/materials/bump-metal-material.js')
-rwxr-xr-xjs/lib/rdge/materials/bump-metal-material.js54
1 files changed, 0 insertions, 54 deletions
diff --git a/js/lib/rdge/materials/bump-metal-material.js b/js/lib/rdge/materials/bump-metal-material.js
index d764de66..27d5793c 100755
--- a/js/lib/rdge/materials/bump-metal-material.js
+++ b/js/lib/rdge/materials/bump-metal-material.js
@@ -193,60 +193,6 @@ var BumpMetalMaterial = function BumpMetalMaterial() {
193 193
194 return; 194 return;
195 }; 195 };
196
197 this.export = function()
198 {
199 // every material needs the base type and instance name
200 var exportStr = "material: " + this.getShaderName() + "\n";
201 exportStr += "name: " + this.getName() + "\n";
202
203 var world = this.getWorld();
204 if (!world)
205 throw new Error( "no world in material.export, " + this.getName() );
206
207 exportStr += "lightDiff: " + this.getLightDiff() + "\n";
208 exportStr += "diffuseTexture: " + this.getDiffuseTexture() + "\n";
209 exportStr += "specularTexture: " + this.getSpecularTexture() + "\n";
210 exportStr += "normalMap: " + this.getNormalTexture() + "\n";
211
212 // every material needs to terminate like this
213 exportStr += "endMaterial\n";
214
215 return exportStr;
216 };
217
218 this.import = function( importStr )
219 {
220 var pu = new MaterialParser( importStr );
221 var material = pu.nextValue( "material: " );
222 if (material != this.getShaderName()) throw new Error( "ill-formed material" );
223 this.setName( pu.nextValue( "name: ") );
224
225 var rtnStr;
226 try
227 {
228 var lightDiff = eval( "[" + pu.nextValue( "lightDiff: " ) + "]" ),
229 dt = pu.nextValue( "diffuseTexture: " ),
230 st = pu.nextValue( "specularTexture: " ),
231 nt = pu.nextValue( "normalMap: " );
232
233 this.setProperty( "lightDiff", lightDiff);
234 this.setProperty( "diffuseTexture", dt );
235 this.setProperty( "specularTexture", st );
236 this.setProperty( "normalMap", nt );
237
238 var endKey = "endMaterial\n";
239 var index = importStr.indexOf( endKey );
240 index += endKey.length;
241 rtnStr = importStr.substr( index );
242 }
243 catch (e)
244 {
245 throw new Error( "could not import material: " + importStr );
246 }
247
248 return rtnStr;
249 };
250}; 196};
251 197
252/////////////////////////////////////////////////////////////////////////////////////// 198///////////////////////////////////////////////////////////////////////////////////////