internal static int PixelWidth(GraphicTileMode Mode) { switch (Mode) { case GraphicTileMode.COMMODORE_MULTICOLOR: return(2); } return(1); }
public GraphicTile(int Width, int Height, GraphicTileMode Mode, ColorSettings Color) { this.Width = Width; this.Height = Height; this.Mode = Mode; Colors = Color; Data = new ByteBuffer((uint)Lookup.NumBytes(Width, Height, Mode)); Image = new GR.Image.MemoryImage(Width, Height, GR.Drawing.PixelFormat.Format32bppRgb); }
public GraphicTile(GraphicTile OtherTile) { Width = OtherTile.Width; Height = OtherTile.Height; Mode = OtherTile.Mode; Colors = OtherTile.Colors; CustomColor = OtherTile.CustomColor; TransparentColorIndex = OtherTile.TransparentColorIndex; Data = new ByteBuffer(OtherTile.Data); Image = new GR.Image.MemoryImage(OtherTile.Image); }
internal static int CharacterHeightInPixel(GraphicTileMode Mode) { switch (Mode) { case GraphicTileMode.MEGA65_NCM: case GraphicTileMode.MEGA65_FCM_256_COLORS: case GraphicTileMode.COMMODORE_HIRES: case GraphicTileMode.COMMODORE_ECM: case GraphicTileMode.COMMODORE_MULTICOLOR: return(8); default: Debug.Log("Lookup.CharacterHeightInPixel - unsupported mode " + Mode); return(0); } }
internal static SpriteMode SpriteModeFromTileMode(GraphicTileMode Mode) { switch (Mode) { case GraphicTileMode.COMMODORE_ECM: case GraphicTileMode.COMMODORE_HIRES: default: return(SpriteMode.COMMODORE_24_X_21_HIRES); case GraphicTileMode.COMMODORE_MULTICOLOR: return(SpriteMode.COMMODORE_24_X_21_MULTICOLOR); case GraphicTileMode.MEGA65_FCM_16_COLORS: case GraphicTileMode.MEGA65_FCM_256_COLORS: return(SpriteMode.MEGA65_16_X_21_16_COLORS); } }
internal static bool HasCustomPalette(GraphicTileMode Mode) { switch (Mode) { case GraphicTileMode.COMMODORE_ECM: case GraphicTileMode.COMMODORE_HIRES: case GraphicTileMode.COMMODORE_MULTICOLOR: return(false); case GraphicTileMode.MEGA65_FCM_16_COLORS: case GraphicTileMode.MEGA65_FCM_256_COLORS: return(true); default: Debug.Log("HasCustomPalette unsupported Mode " + Mode); return(false); } }
internal static int NumBytes(int Width, int Height, GraphicTileMode Mode) { switch (Mode) { case GraphicTileMode.COMMODORE_ECM: case GraphicTileMode.COMMODORE_HIRES: case GraphicTileMode.COMMODORE_MULTICOLOR: return(((Width + 7) / 8) * Height); case GraphicTileMode.MEGA65_FCM_16_COLORS: return(((Width + 1) / 2) * Height); case GraphicTileMode.MEGA65_FCM_256_COLORS: return(Width * Height); default: Debug.Log("Lookup.NumBytes unsupported mode " + Mode); return(0); } }