Exemplo n.º 1
0
 internal static int PixelWidth(GraphicTileMode Mode)
 {
     switch (Mode)
     {
     case GraphicTileMode.COMMODORE_MULTICOLOR:
         return(2);
     }
     return(1);
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
        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);
            }
        }
Exemplo n.º 5
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);
            }
        }
Exemplo n.º 6
0
        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);
            }
        }
Exemplo n.º 7
0
        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);
            }
        }