aboutsummaryrefslogtreecommitdiff
path: root/js/lib/rdge/materials/linear-gradient-material.js
diff options
context:
space:
mode:
authorJohn Mayhew2012-04-03 13:39:32 -0700
committerJohn Mayhew2012-04-03 13:39:32 -0700
commit18609d375e7aab9cb48c9b3f5b291f85cbd28683 (patch)
treedeca3dc7277c154782f451fbd5b960c3d5c9dba7 /js/lib/rdge/materials/linear-gradient-material.js
parentd5d4dcac78ebf8ba3163a8c7055d783b6397a435 (diff)
downloadninja-18609d375e7aab9cb48c9b3f5b291f85cbd28683.tar.gz
removed old unused import and export functions.
Diffstat (limited to 'js/lib/rdge/materials/linear-gradient-material.js')
-rwxr-xr-xjs/lib/rdge/materials/linear-gradient-material.js63
1 files changed, 0 insertions, 63 deletions
diff --git a/js/lib/rdge/materials/linear-gradient-material.js b/js/lib/rdge/materials/linear-gradient-material.js
index 87e41ad6..51a7430c 100755
--- a/js/lib/rdge/materials/linear-gradient-material.js
+++ b/js/lib/rdge/materials/linear-gradient-material.js
@@ -296,69 +296,6 @@ var LinearGradientMaterial = function LinearGradientMaterial() {
296 throw new Error("could not import material: " + importStr); 296 throw new Error("could not import material: " + importStr);
297 } 297 }
298 }; 298 };
299
300 this.export = function () {
301 // every material needs the base type and instance name
302 var exportStr = "material: " + this.getShaderName() + "\n";
303 exportStr += "name: " + this.getName() + "\n";
304
305 exportStr += "color1: " + this.getColor1() + "\n";
306 exportStr += "color2: " + this.getColor2() + "\n";
307 exportStr += "color3: " + this.getColor3() + "\n";
308 exportStr += "color4: " + this.getColor4() + "\n";
309
310 exportStr += "colorStop1: " + this.getColorStop1() + "\n";
311 exportStr += "colorStop2: " + this.getColorStop2() + "\n";
312 exportStr += "colorStop3: " + this.getColorStop3() + "\n";
313 exportStr += "colorStop4: " + this.getColorStop4() + "\n";
314
315 exportStr += "angle: " + this.getAngle() + "\n";
316
317 // every material needs to terminate like this
318 exportStr += "endMaterial\n";
319
320 return exportStr;
321 };
322
323 this.import = function (importStr) {
324 var pu = new MaterialParser(importStr);
325 var material = pu.nextValue("material: ");
326 if (material != this.getShaderName()) throw new Error("ill-formed material");
327 this.setName(pu.nextValue("name: "));
328
329 var rtnStr;
330 try {
331 var color1 = eval("[" + pu.nextValue("color1: ") + "]"),
332 color2 = eval("[" + pu.nextValue("color2: ") + "]"),
333 color3 = eval("[" + pu.nextValue("color3: ") + "]"),
334 color4 = eval("[" + pu.nextValue("color4: ") + "]"),
335 colorStop1 = Number(pu.nextValue("colorStop1: ")),
336 colorStop2 = Number(pu.nextValue("colorStop2: ")),
337 colorStop3 = Number(pu.nextValue("colorStop3: ")),
338 colorStop4 = Number(pu.nextValue("colorStop4: ")),
339 angle = Number(pu.nextValue("angle: "));
340
341 var endKey = "endMaterial\n";
342 var index = importStr.indexOf(endKey);
343 index += endKey.length;
344 rtnStr = importStr.substr(index);
345
346 this.setProperty("color1", color1);
347 this.setProperty("color2", color2);
348 this.setProperty("color3", color3);
349 this.setProperty("color4", color4);
350 this.setProperty("colorStop1", colorStop1);
351 this.setProperty("colorStop2", colorStop2);
352 this.setProperty("colorStop3", colorStop3);
353 this.setProperty("colorStop4", colorStop4);
354 this.setProperty("angle", angle);
355 }
356 catch (e) {
357 throw new Error("could not import material: " + importStr);
358 }
359
360 return rtnStr;
361 };
362}; 299};
363 300
364/////////////////////////////////////////////////////////////////////////////////////// 301///////////////////////////////////////////////////////////////////////////////////////