private static Bitmap RenderColorBmp(TerrainTile[,] tiles)
 {
     int w = tiles.GetLength(0);
     int h = tiles.GetLength(1);
     Bitmap bmp = new Bitmap(w, h);
     BitmapBuffer buff = new BitmapBuffer(bmp);
     buff.Lock();
     for (int y = 0; y < w; y++)
         for (int x = 0; x < h; x++)
             buff[x, y] = TileTypes.color[tiles[x, y].TileId];
     buff.Unlock();
     return bmp;
 }
Esempio n. 2
0
        private static Bitmap RenderColorBmp(TerrainTile[,] tiles)
        {
            var w    = tiles.GetLength(0);
            var h    = tiles.GetLength(1);
            var bmp  = new Bitmap(w, h);
            var buff = new BitmapBuffer(bmp);

            buff.Lock();
            for (var y = 0; y < w; y++)
            {
                for (var x = 0; x < h; x++)
                {
                    buff[x, y] = TileTypes.color[tiles[x, y].TileId];
                }
            }
            buff.Unlock();
            return(bmp);
        }
Esempio n. 3
0
        private static Bitmap RenderTerrainBmp(TerrainTile[,] tiles)
        {
            int          w    = tiles.GetLength(0);
            int          h    = tiles.GetLength(1);
            Bitmap       bmp  = new Bitmap(w, h);
            BitmapBuffer buff = new BitmapBuffer(bmp);

            buff.Lock();
            for (int y = 0; y < w; y++)
            {
                for (int x = 0; x < h; x++)
                {
                    buff[x, y] = TileTypes.terrainColor[tiles[x, y].Terrain];
                }
            }
            buff.Unlock();
            return(bmp);
        }
Esempio n. 4
0
        static Bitmap RenderColorBmp(TerrainTile[,] tiles)
        {
            int          w    = tiles.GetLength(0);
            int          h    = tiles.GetLength(1);
            Bitmap       bmp  = new Bitmap(w, h);
            BitmapBuffer buff = new BitmapBuffer(bmp);

            buff.Lock();
            for (int y = 0; y < w; y++)
            {
                for (int x = 0; x < h; x++)
                {
                    buff[x, y] = GetColor(tiles[x, y]);
                }
            }
            buff.Unlock();
            return(bmp);
        }
Esempio n. 5
0
        private static Bitmap RenderNoiseBmp(int w, int h)
        {
            var bmp  = new Bitmap(w, h);
            var buff = new BitmapBuffer(bmp);

            buff.Lock();
            var noise = new Noise(Environment.TickCount);

            for (var y = 0; y < w; y++)
            {
                for (var x = 0; x < h; x++)
                {
                    uint color = 0x00ffffff;
                    color     |= (uint)(noise.GetNoise(x / (double)w * 2, y / (double)h * 2, 0) * 255) << 24;
                    buff[x, y] = color;
                }
            }
            buff.Unlock();
            return(bmp);
        }
Esempio n. 6
0
        private static Bitmap RenderEvalBmp(TerrainTile[,] tiles)
        {
            var w    = tiles.GetLength(0);
            var h    = tiles.GetLength(1);
            var bmp  = new Bitmap(w, h);
            var buff = new BitmapBuffer(bmp);

            buff.Lock();
            for (var y = 0; y < w; y++)
            {
                for (var x = 0; x < h; x++)
                {
                    uint color = 0x00ffffff;
                    color     |= (uint)((byte)(tiles[x, y].Elevation * 255) << 24);
                    buff[x, y] = color;
                }
            }
            buff.Unlock();
            return(bmp);
        }
Esempio n. 7
0
        private static Bitmap RenderMoistBmp(TerrainTile[,] tiles)
        {
            int          w    = tiles.GetLength(0);
            int          h    = tiles.GetLength(1);
            Bitmap       bmp  = new Bitmap(w, h);
            BitmapBuffer buff = new BitmapBuffer(bmp);

            buff.Lock();
            for (int y = 0; y < w; y++)
            {
                for (int x = 0; x < h; x++)
                {
                    uint color = 0x00ffffff;
                    color     |= (uint)(tiles[x, y].Moisture * 255) << 24;
                    buff[x, y] = color;
                }
            }
            buff.Unlock();
            return(bmp);
        }
Esempio n. 8
0
 static Bitmap RenderColorBmp(TerrainTile[,] tiles)
 {
     int w = tiles.GetLength(0);
     int h = tiles.GetLength(1);
     Bitmap bmp = new Bitmap(w, h);
     BitmapBuffer buff = new BitmapBuffer(bmp);
     buff.Lock();
     for (int y = 0; y < w; y++)
         for (int x = 0; x < h; x++)
         {
             buff[x, y] = GetColor(tiles[x, y]);
         }
     buff.Unlock();
     return bmp;
 }
Esempio n. 9
0
 static Bitmap RenderNoiseBmp(int w, int h)
 {
     Bitmap bmp = new Bitmap(w, h);
     BitmapBuffer buff = new BitmapBuffer(bmp);
     buff.Lock();
     var noise = new Noise(Environment.TickCount);
     for (int y = 0; y < w; y++)
         for (int x = 0; x < h; x++)
         {
             uint color = 0x00ffffff;
             color |= (uint)(noise.GetNoise(x / (double)w * 2, y / (double)h * 2, 0) * 255) << 24;
             buff[x, y] = color;
         }
     buff.Unlock();
     return bmp;
 }
Esempio n. 10
0
 static Bitmap RenderMoistBmp(TerrainTile[,] tiles)
 {
     int w = tiles.GetLength(0);
     int h = tiles.GetLength(1);
     Bitmap bmp = new Bitmap(w, h);
     BitmapBuffer buff = new BitmapBuffer(bmp);
     buff.Lock();
     for (int y = 0; y < w; y++)
         for (int x = 0; x < h; x++)
         {
             uint color = 0x00ffffff;
             color |= (uint)(tiles[x, y].Moisture * 255) << 24;
             buff[x, y] = color;
         }
     buff.Unlock();
     return bmp;
 }
Esempio n. 11
0
 private static Bitmap RenderColorBmp(TerrainTile[,] tiles)
 {
     var w = tiles.GetLength(0);
     var h = tiles.GetLength(1);
     var bmp = new Bitmap(w, h);
     var buff = new BitmapBuffer(bmp);
     buff.Lock();
     for (var y = 0; y < w; y++)
         for (var x = 0; x < h; x++)
         {
             buff[x, y] = GetColor(tiles[x, y]);
         }
     buff.Unlock();
     return bmp;
 }
Esempio n. 12
0
 private static Bitmap RenderEvalBmp(TerrainTile[,] tiles)
 {
     var w = tiles.GetLength(0);
     var h = tiles.GetLength(1);
     var bmp = new Bitmap(w, h);
     var buff = new BitmapBuffer(bmp);
     buff.Lock();
     for (var y = 0; y < w; y++)
         for (var x = 0; x < h; x++)
         {
             uint color = 0x00ffffff;
             color |= (uint) ((byte) (tiles[x, y].Elevation*255) << 24);
             buff[x, y] = color;
         }
     buff.Unlock();
     return bmp;
 }