public Material() { MaterialColors = new Color?[2] { new Color(1, 1, 1, 1), null }; ChannelControls = new ChannelControl?[4]; IndTexEntry = new IndirectTexturing(); AmbientColors = new Color?[2] { new Color(50f / 255f, 50f / 255f, 50f / 255f, 50f / 255f), null }; LightingColors = new Color?[8]; TexCoord1Gens = new TexCoordGen?[8]; PostTexCoordGens = new TexCoordGen?[8]; TexMatrix1 = new TexMatrix?[10]; PostTexMatrix = new TexMatrix?[20]; TextureIndices = new int[8] { -1, -1, -1, -1, -1, -1, -1, -1 }; TextureNames = new string[8] { "", "", "", "", "", "", "", "" }; KonstColors = new Color?[4]; KonstColors[0] = new Color(1, 1, 1, 1); ColorSels = new KonstColorSel[16]; AlphaSels = new KonstAlphaSel[16]; TevOrders = new TevOrder?[16]; TevOrders[0] = new TevOrder(TexCoordId.TexCoord0, TexMapId.TexMap0, GXColorChannelId.Color0); TevColors = new Color?[16]; TevColors[0] = new Color(1, 1, 1, 1); TevStages = new TevStage?[16]; SwapModes = new TevSwapMode?[16]; SwapModes[0] = new TevSwapMode(0, 0); SwapTables = new TevSwapModeTable?[16]; SwapTables[0] = new TevSwapModeTable(0, 1, 2, 3); AlphCompare = new AlphaCompare(CompareType.Greater, 127, AlphaOp.And, CompareType.Always, 0); ZMode = new ZMode(true, CompareType.LEqual, true); BMode = new BlendMode(Enums.BlendMode.Blend, BlendModeControl.SrcAlpha, BlendModeControl.InverseSrcAlpha, LogicOp.NoOp); NBTScale = new NBTScale(0, Vector3.Zero); FogInfo = new Fog(0, false, 0, 0, 0, 0, 0, new Color(0, 0, 0, 0), new float[10]); }
public void AddTevOrder(TexCoordId coordId, TexMapId mapId, GXColorChannelId colorChanId) { for (int i = 0; i < 8; i++) { if (TevOrders[i] == null) { TevOrders[i] = new TevOrder(coordId, mapId, colorChanId); break; } if (i == 9) { throw new Exception($"TevOrder array for material \"{ Name }\" is full!"); } } }