public override void AddTexture(string texture) { Console.WriteLine("TextureMaps AddTexture"); int index = ParentLayout.AddTexture(texture); TextureRef textureRef = new TextureRef(); textureRef.ID = (short)index; textureRef.Name = texture; TextureMaps = TextureMaps.AddToArray(textureRef); TextureTransforms = TextureTransforms.AddToArray(new BxlytTextureTransform()); }
public override void AddTexture(string texture) { int index = ParentLayout.AddTexture(texture); TextureRef textureRef = new TextureRef(); textureRef.ID = (short)index; textureRef.Name = texture; TextureMaps = TextureMaps.AddToArray(textureRef); TexCoordGens.Add(new TexCoordGenEntry() { Type = TexCoordGenTypes.GX_TG_MTX2x4, MatrixSource = TexCoordGenMatrixSource.GX_DTTMTX9 + (TexCoordGens.Count * 4), Source = TexCoordGenSource.GX_TG_TEX0 }); TextureTransforms = TextureTransforms.AddToArray(new BxlytTextureTransform()); }
public override void RemoveTexture(int index) { base.RemoveTexture(index); if (TexCoordGens.Count > index) { TexCoordGens.RemoveAt(index); } if (IndirectTexTransforms.Count > index) { IndirectTexTransforms.RemoveAt(index); } if (TextureTransforms.Length > index) { TextureTransforms = TextureTransforms.RemoveAt(index); } RemoveTexCoordSources(index); Console.WriteLine($"TexCoordGens {TexCoordGens.Count}"); Console.WriteLine($"TextureMaps {TextureMaps.Length}"); Console.WriteLine($"TextureTransforms {TextureTransforms.Length}"); Console.WriteLine($"IndirectTexTransforms {IndirectTexTransforms.Count}"); }