// Tries to add the material to the list public virtual Material AddToList(Material material) { // Check if the material is already in the list if ( //(material.RootBSPTreeNumber == this.material.RootBSPTreeNumber) && (material.textureID == this.material.textureID) && (material.texturePageEffective == this.material.texturePageEffective) && (material.clutValueEffective == this.material.clutValueEffective) && (material.colourEffective == this.material.colourEffective) && (material.textureUsed == this.material.textureUsed) && (material.opacity.Equals(this.material.opacity)) && (material.emissivity.Equals(this.material.emissivity)) && (material.polygonFlagsEffective == this.material.polygonFlagsEffective) && (material.sortPushEffective == this.material.sortPushEffective) && (material.textureAttributesEffective == this.material.textureAttributesEffective) && (material.textureAttributesAEffective == this.material.textureAttributesAEffective) && (material.BSPTreeRootFlagsEffective == this.material.BSPTreeRootFlagsEffective) && (material.BSPTreeParentNodeFlagsEffective == this.material.BSPTreeParentNodeFlagsEffective) && (material.BSPTreeLeafFlagsEffective == this.material.BSPTreeLeafFlagsEffective) && (material.UseAlphaMask == this.material.UseAlphaMask) && (material.blendMode == this.material.blendMode) ) { return(this.material); } //// Check if the material is already in the list //if ((material.textureID == this.material.textureID) && // (material.clutValue == this.material.clutValue) && // (material.texturePage == this.material.texturePage) && // (material.colour == this.material.colour) && // (material.textureUsed == this.material.textureUsed) && // (material.opacity.Equals(this.material.opacity)) && // (material.emissivity.Equals(this.material.emissivity)) && // (material.polygonFlags == this.material.polygonFlags) && // (material.sortPush == this.material.sortPush) && // (material.textureAttributes == this.material.textureAttributes) && // (material.BSPTreeRootFlags == this.material.BSPTreeRootFlags) && // (material.BSPTreeParentNodeFlags == this.material.BSPTreeParentNodeFlags) && // (material.BSPTreeAllParentNodeFlagsORd == this.material.BSPTreeAllParentNodeFlagsORd) && // (material.BSPTreeLeafFlags == this.material.BSPTreeLeafFlags) && // (material.UseAlphaMask == this.material.UseAlphaMask) && // (material.blendMode == this.material.blendMode) // ) //{ // return this.material; //} // Check the rest of the list if (next != null) { return(next.AddToList(material)); } // Add the material to the list _next = new MaterialList(material); return(material); }
// Tries to add the material to the list public virtual Material AddToList(Material material) { // Check if the material is already in the list if ((material.textureID == this.material.textureID) && (material.colour == this.material.colour) && (material.textureUsed == this.material.textureUsed)) { return(this.material); } // Check the rest of the list if (next != null) { return(next.AddToList(material)); } // Add the material to the list _next = new MaterialList(material); return(material); }
public MaterialList(Material material) { this.material = material; _next = null; }