public static GfxTestFunc ToGfxTestFunc(this PICATestFunc TestFunc) { //Too much to ask to use the same values the GPU use? //Really hate to convert between those stupid inconsistent enumerations. switch (TestFunc) { case PICATestFunc.Never: return(GfxTestFunc.Never); case PICATestFunc.Always: return(GfxTestFunc.Always); case PICATestFunc.Less: return(GfxTestFunc.Less); case PICATestFunc.Lequal: return(GfxTestFunc.Lequal); case PICATestFunc.Equal: return(GfxTestFunc.Equal); case PICATestFunc.Gequal: return(GfxTestFunc.Gequal); case PICATestFunc.Greater: return(GfxTestFunc.Greater); case PICATestFunc.Notequal: return(GfxTestFunc.Notequal); default: throw new ArgumentException($"Invalid PICA Test Function {TestFunc}!"); } }
public PICAAlphaTest(uint Param) { Enabled = (Param & 1) != 0; Function = (PICATestFunc)((Param >> 4) & 7); Reference = (byte)(Param >> 8); }
public PICAStencilTest(uint Param) { Enabled = (Param & 1) != 0; Function = (PICATestFunc)((Param >> 4) & 7); BufferMask = (byte)(Param >> 8); Reference = (byte)(Param >> 16); Mask = (byte)(Param >> 24); }
public PICADepthColorMask(uint Param) { Enabled = (Param & 1) != 0; DepthFunc = (PICATestFunc)((Param >> 4) & 7); RedWrite = (Param & 0x0100) != 0; GreenWrite = (Param & 0x0200) != 0; BlueWrite = (Param & 0x0400) != 0; AlphaWrite = (Param & 0x0800) != 0; DepthWrite = (Param & 0x1000) != 0; }
public MTDepthStencil(BinaryReader Reader) { byte DepthStencilTest = Reader.ReadByte(); DepthTest = (DepthStencilTest & 1) != 0; DepthWrite = (DepthStencilTest & 2) != 0; DepthFunc = ((MTTestFunction)((DepthStencilTest >> 2) & 7)).ToPICATestFunc(); StencilFunc = ((MTTestFunction)((DepthStencilTest >> 5) & 7)).ToPICATestFunc(); StencilRef = Reader.ReadSByte(); Reader.ReadUInt16(); Reader.ReadUInt16(); Reader.ReadUInt16(); }
private static AlphaFunction ConvertAlphaFunction(PICATestFunc func) { switch (func) { case PICATestFunc.Always: return(AlphaFunction.Always); case PICATestFunc.Equal: return(AlphaFunction.Equal); case PICATestFunc.Gequal: return(AlphaFunction.Gequal); case PICATestFunc.Greater: return(AlphaFunction.Greater); case PICATestFunc.Lequal: return(AlphaFunction.Lequal); case PICATestFunc.Less: return(AlphaFunction.Less); case PICATestFunc.Never: return(AlphaFunction.Never); case PICATestFunc.Notequal: return(AlphaFunction.Notequal); default: return(AlphaFunction.Always); } }
public static All ToFunction(this PICATestFunc Func) { switch (Func) { case PICATestFunc.Never: return(All.Never); case PICATestFunc.Always: return(All.Always); case PICATestFunc.Equal: return(All.Equal); case PICATestFunc.Notequal: return(All.Notequal); case PICATestFunc.Less: return(All.Less); case PICATestFunc.Lequal: return(All.Lequal); case PICATestFunc.Greater: return(All.Greater); case PICATestFunc.Gequal: return(All.Gequal); default: throw new ArgumentException("Invalid function!"); } }
public static DepthFunction ToDepthFunction(this PICATestFunc Func) { return((DepthFunction)ToFunction(Func)); }
public static StencilFunction ToStencilFunction(this PICATestFunc Func) { return((StencilFunction)ToFunction(Func)); }
public static AlphaFunction ToAlphaFunction(this PICATestFunc Func) { return((AlphaFunction)ToFunction(Func)); }