From 5a1965bf2ed9a54601ca16fd67555335c510ce08 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Thu, 26 Apr 2012 16:40:05 -0700 Subject: Update materials to the new texture model. Create local world for deleted source canvases --- js/lib/rdge/materials/bump-metal-material.js | 1 - js/lib/rdge/materials/deform-material.js | 13 ++++++----- js/lib/rdge/materials/flag-material.js | 27 +++++++++++++---------- js/lib/rdge/materials/fly-material.js | 21 ++++++++++-------- js/lib/rdge/materials/julia-material.js | 18 ++++++++------- js/lib/rdge/materials/keleidoscope-material.js | 18 ++++++++------- js/lib/rdge/materials/linear-gradient-material.js | 18 ++++++++++++++- js/lib/rdge/materials/mandel-material.js | 19 ++++++++-------- js/lib/rdge/materials/pulse-material.js | 19 ++++++++-------- js/lib/rdge/materials/radial-blur-material.js | 10 +++++---- js/lib/rdge/materials/relief-tunnel-material.js | 13 ++++++----- js/lib/rdge/materials/square-tunnel-material.js | 13 ++++++----- js/lib/rdge/materials/star-material.js | 13 ++++++----- js/lib/rdge/materials/tunnel-material.js | 13 ++++++----- js/lib/rdge/materials/twist-material.js | 13 ++++++----- js/lib/rdge/materials/uber-material.js | 16 ++++++++------ js/lib/rdge/materials/water-material.js | 10 +++++---- js/lib/rdge/materials/z-invert-material.js | 13 ++++++----- js/lib/rdge/texture.js | 9 ++++++-- 19 files changed, 162 insertions(+), 115 deletions(-) (limited to 'js/lib/rdge') diff --git a/js/lib/rdge/materials/bump-metal-material.js b/js/lib/rdge/materials/bump-metal-material.js index 981edbfd..4bc5dfe8 100755 --- a/js/lib/rdge/materials/bump-metal-material.js +++ b/js/lib/rdge/materials/bump-metal-material.js @@ -22,7 +22,6 @@ var BumpMetalMaterial = function BumpMetalMaterial() { this._lightDiff = [0.3, 0.3, 0.3, 1.0]; this._diffuseTexture = "assets/images/metal.png"; - //this._diffuseTexture = "texture"; this._specularTexture = "assets/images/silver.png"; this._normalTexture = "assets/images/normalMap.png"; diff --git a/js/lib/rdge/materials/deform-material.js b/js/lib/rdge/materials/deform-material.js index a7a0c178..c7f9cadc 100644 --- a/js/lib/rdge/materials/deform-material.js +++ b/js/lib/rdge/materials/deform-material.js @@ -37,13 +37,16 @@ var DeformMaterial = function DeformMaterial() { // Methods /////////////////////////////////////////////////////////////////////// // duplcate method requirde - this.dup = function (world) { - // allocate a new uber material - var newMat = new DeformMaterial(); - - // copy over the current values; + this.dup = function (world) + { + // get the current values; var propNames = [], propValues = [], propTypes = [], propLabels = []; this.getAllProperties(propNames, propValues, propTypes, propLabels); + + // allocate a new material + var newMat = new DeformMaterial(); + + // copy over the current values; var n = propNames.length; for (var i = 0; i < n; i++) newMat.setProperty(propNames[i], propValues[i]); diff --git a/js/lib/rdge/materials/flag-material.js b/js/lib/rdge/materials/flag-material.js index 8d4d1ee3..312ca1c1 100644 --- a/js/lib/rdge/materials/flag-material.js +++ b/js/lib/rdge/materials/flag-material.js @@ -5,6 +5,7 @@ */ +var Material = require("js/lib/rdge/materials/material").Material; var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial; var Texture = require("js/lib/rdge/texture").Texture; @@ -47,19 +48,21 @@ var FlagMaterial = function FlagMaterial() { // Methods /////////////////////////////////////////////////////////////////////// // duplcate method requirde - this.dup = function( world ) { - // allocate a new uber material - var newMat = new FlagMaterial(); + this.dup = function( world ) + { + // get the current values; + var propNames = [], propValues = [], propTypes = [], propLabels = []; + this.getAllProperties(propNames, propValues, propTypes, propLabels); + + // allocate a new uber material + var newMat = new FlagMaterial(); // copy over the current values; - var propNames = [], propValues = [], propTypes = [], propLabels = []; - this.getAllProperties( propNames, propValues, propTypes, propLabels); - var n = propNames.length; - for (var i=0; i