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;
 }
Ejemplo n.º 2
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;
 }
Ejemplo n.º 3
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;
 }
Ejemplo n.º 4
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;
 }
Ejemplo n.º 5
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;
 }
Ejemplo 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;
 }