コード例 #1
0
ファイル: GFXBox.cs プロジェクト: weierstrass1/Dyzen
 public void GetTiles(string path, TileSize tileSize, BaseTile baseTile)
 {
     try
     {
         byte[,] colors = SnesGraphics.generateGFX("Doom3.bin");
         BehindBitmap   = SnesGraphics.GenerateBitmapFromColorMatrix(colors, zoom, ColorPalette.GetPalette(5));
         this.tileSize  = (int)tileSize;
         Tile[,] tils   = Tile.GenerateTilesFromColorMatrix(colors, tileSize, baseTile);
     }
     catch
     {
         MessageBox.Show("The GFX is invalid. Must be of 4 or 8 Kb (4096 or 8192 bytes).",
                         "Invalid GFX Error",
                         MessageBoxButtons.OK,
                         MessageBoxIcon.Error);
     }
 }
コード例 #2
0
        public virtual void LoadGFX(string path, int position)
        {
            if (position > ImageHeigth)
            {
                throw new Exception("Position is higher than the Image Height.");
            }
            byte[,] colors = SnesGraphics.GenerateGFX(path);

            for (int i = 0; i < colors.GetLength(0) &&
                 i < colorMatrix.GetLength(0); i++)
            {
                for (int j = position, k = 0; k < colors.GetLength(1) &&
                     j < colorMatrix.GetLength(1); j++, k++)
                {
                    colorMatrix[i, j] = colors[i, k];
                }
            }

            generateBehindImage();
        }
コード例 #3
0
 public byte[] GetGFX()
 {
     return(SnesGraphics.GetGFXFromColorMatrix(colorMatrix));
 }
コード例 #4
0
 public void GetGfx()
 {
     Gfx = new SnesGraphics(Properties.Resources.sampleGFX);
 }