From 84332ab81c1b445195f1d9be8bbeae0725c8e758 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 6 Mar 2012 10:58:25 -0800 Subject: Squashed commit of preload-fix into Master - Requiring all the previously pre-loaded files - RDGE, Codemirror and gl-matrix are not included via a script tag. Signed-off-by: Valerio Virgillito --- .../backup-delete/MaterialsLibrary.js | 230 +++++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100755 js/helper-classes/backup-delete/MaterialsLibrary.js (limited to 'js/helper-classes/backup-delete/MaterialsLibrary.js') diff --git a/js/helper-classes/backup-delete/MaterialsLibrary.js b/js/helper-classes/backup-delete/MaterialsLibrary.js new file mode 100755 index 00000000..8f55f2bc --- /dev/null +++ b/js/helper-classes/backup-delete/MaterialsLibrary.js @@ -0,0 +1,230 @@ +/* +This file contains proprietary software owned by Motorola Mobility, Inc.
+No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ +/////////////////////////////////////////////////////////////////////// +// Class MaterialsLibrary +// Contains an array of GLMaterials. +/////////////////////////////////////////////////////////////////////// +var MaterialsLibrary = Object.create(Object.prototype, { + + _materials : { value: [], writable: true, enumerable: true, configurable: true }, + + materials : { + get: function() { + return this._materials; + } + }, + + addMaterial: { + value: function (material) + { + this._materials.push(material); + } + }, + + addMaterialAt: { + value: function (material, index) + { + this._materials.splice(index, 0, material); + } + }, + + removeMaterialAt: { + value: function (index) + { + return this._materials.splice(index, 1); + } + }, + + removeMaterial: { + value: function (materialName) + { + var index = this.getIndexOfMaterial(materialName); + if(index !== -1) + { + return this.removeMaterialAt(index); + } + } + }, + + getMaterialAt: { + value: function (index) + { + return this._materials[index]; + } + }, + + getMaterial: { + value: function (materialName) + { + var index = this.getIndexOfMaterial(materialName); + if(index !== -1) + { + return this._materials[index]; + } + } + }, + + getIndexOfMaterial: { + value: function (materialName) + { + var len = this._materials.length; + for(var i=0; i