private static PixelFormat GetPixelFormat(Tm2.GsPSM psm) { switch (psm) { case Tm2.GsPSM.GS_PSMT8: return(PixelFormat.Indexed8); case Tm2.GsPSM.GS_PSMT4: return(PixelFormat.Indexed4); default: throw new NotSupportedException($"GsPSM format {psm} not supported"); } }
internal Texture( int width, int height, PixelFormat pixelFormat, Tm2.GsPSM uploadPixelFormat, byte[] data, byte[] palette, TextureAddressMode textureAddressMode, int cbp, int csa) { Size = new Size(width, height); PixelFormat = pixelFormat; _uploadPixelFormat = uploadPixelFormat; _data = data; _palette = palette; TextureAddressMode = textureAddressMode; _cbp = cbp; _csa = csa; }