Exemplo n.º 1
0
        /// <summary>
        /// Make a copy of the pixel indices, swizzle it, and write it to the stream.
        /// </summary>
        private void WriteIndices(BinaryWriter writer)
        {
            byte[] outIndices;
            switch (RasterInfoStructNode.Tex0Register.TexturePixelFormat)
            {
            case PS2PixelFormat.PSMT8H:
            case PS2PixelFormat.PSMT8:
                PS2PixelFormatHelper.Swizzle8(RasterInfoStructNode.Width, RasterInfoStructNode.Height, mIndices, out outIndices);
                PS2PixelFormatHelper.WritePSMT8(writer, RasterInfoStructNode.Width, RasterInfoStructNode.Height, outIndices);
                break;

            case PS2PixelFormat.PSMT4HL:
            case PS2PixelFormat.PSMT4HH:
            case PS2PixelFormat.PSMT4:
                PS2PixelFormatHelper.Swizzle8(RasterInfoStructNode.Width, RasterInfoStructNode.Height, mIndices, out outIndices);
                PS2PixelFormatHelper.WritePSMT4(writer, RasterInfoStructNode.Width, RasterInfoStructNode.Height, outIndices);
                break;

            default:
                throw new NotImplementedException();
            }
        }