Esempio n. 1
0
 public void InitFromImage(TileSet tset, Bitmap bm)
 {
     Color[] aclrTile = new Color[m_sizTile.Width * m_sizTile.Height];
     for (int ty = 0; ty < m_cty; ty++)
     {
         for (int tx = 0; tx < m_ctx; tx++)
         {
             TileSet.ExtractTilePixels(bm, tx, ty, m_sizTile, ref aclrTile);
             int index = tset.FindTileIndex(aclrTile);
             if (index == -1)
             {
                 throw new Exception("Couldn't find tile index!");
             }
             m_aiTile[ty, tx] = index;
         }
     }
 }