コード例 #1
0
        public TevStage(FileReader reader, BxlytHeader header)
        {
            TexCoord = (TexCoordID)reader.ReadByte();
            Color    = reader.ReadByte();

            ushort tmp16 = reader.ReadUInt16();

            TexMap = (TexMapID)(tmp16 & 0x1ff);
            RasSel = (TevSwapSel)((tmp16 & 0x7ff) >> 9);
            TexSel = (TevSwapSel)(tmp16 >> 11);

            byte tmp8 = reader.ReadByte();

            ColorA           = (ColorArg)(tmp8 & 0xf);
            ColorB           = (ColorArg)(tmp8 >> 4);
            tmp8             = reader.ReadByte();
            ColorC           = (ColorArg)(tmp8 & 0xf);
            ColorD           = (ColorArg)(tmp8 >> 4);
            tmp8             = reader.ReadByte();
            ColorOp          = (TevColorOp)(tmp8 & 0xf);
            ColorBias        = (Bias)((tmp8 & 0x3f) >> 4);
            ColorScale       = (TevScale)(tmp8 >> 6);
            tmp8             = reader.ReadByte();
            ColorClamp       = (tmp8 & 0x1) == 1;
            ColorRegID       = (TevColorRegID)((tmp8 & 0x7) >> 1);
            ColorConstantSel = (TevKColorSel)(tmp8 >> 3);

            tmp8             = reader.ReadByte();
            AlphaA           = (AlphaArg)(tmp8 & 0xf);
            AlphaB           = (AlphaArg)(tmp8 >> 4);
            tmp8             = reader.ReadByte();
            AlphaC           = (AlphaArg)(tmp8 & 0xf);
            AlphaD           = (AlphaArg)(tmp8 >> 4);
            tmp8             = reader.ReadByte();
            AlphaOp          = (TevAlphaOp)(tmp8 & 0xf);
            AlphaBias        = (Bias)((tmp8 & 0x3f) >> 4);
            AlphaScale       = (TevScale)(tmp8 >> 6);
            tmp8             = reader.ReadByte();
            AlphaClamp       = (tmp8 & 0x1) == 1;
            AlphaRegID       = (TevAlphaRegID)((tmp8 & 0x7) >> 1);
            AlphaConstantSel = (TevKAlphaSel)(tmp8 >> 3);

            tmp8             = reader.ReadByte();
            TexID            = (byte)(tmp8 & 0x3);
            tmp8             = reader.ReadByte();
            IndBias          = (Bias)(tmp8 & 0x7);
            Matrix           = (IndTexMtxID)((tmp8 & 0x7F) >> 3);
            tmp8             = reader.ReadByte();
            WrapS            = (IndTexWrap)(tmp8 & 0x7);
            WrapT            = (IndTexWrap)((tmp8 & 0x3F) >> 3);
            tmp8             = reader.ReadByte();
            Format           = (IndTexFormat)(tmp8 & 0x3);
            UsePreviousStage = (byte)((tmp8 & 0x7) >> 2);
            UnmodifiedLOD    = (byte)((tmp8 & 0xF) >> 3);
            Alpha            = (IndTexAlphaSel)((tmp8 & 0x3F) >> 4);
        }
コード例 #2
0
        public TevStage()
        {
            TexCoord = TexCoordID.TexCoord0;
            Color    = 255;
            TexMap   = TexMapID.TexMap0;
            RasSel   = TevSwapSel.Swap0;
            TexSel   = TevSwapSel.Swap0;

            ColorA           = ColorArg.Zero;
            ColorB           = ColorArg.Zero;
            ColorC           = ColorArg.Zero;
            ColorD           = ColorArg.Zero;
            ColorOp          = TevColorOp.Add;
            ColorBias        = Bias.Zero;
            ColorScale       = TevScale.MultiplyBy1;
            ColorClamp       = true;
            ColorRegID       = TevColorRegID.OutputColor;
            ColorConstantSel = TevKColorSel.Constant1_1;

            AlphaA           = AlphaArg.Zero;
            AlphaB           = AlphaArg.Zero;
            AlphaC           = AlphaArg.Zero;
            AlphaD           = AlphaArg.Zero;
            AlphaOp          = TevAlphaOp.Add;
            AlphaBias        = Bias.Zero;
            AlphaScale       = TevScale.MultiplyBy1;
            AlphaClamp       = true;
            AlphaRegID       = TevAlphaRegID.OutputAlpha;
            AlphaConstantSel = TevKAlphaSel.Constant1_1;

            TexID            = 0;
            Format           = IndTexFormat.F_8_Bit_Offsets;
            IndBias          = Bias.Zero;
            Matrix           = IndTexMtxID.Matrix0;
            WrapS            = IndTexWrap.NoWrap;
            WrapT            = IndTexWrap.NoWrap;
            UsePreviousStage = 0;
            UnmodifiedLOD    = 0;
            Alpha            = IndTexAlphaSel.Off;
        }