Loading

Paste #pljn58nl0

  1. Index: src/heightmap.cpp
  2. ===================================================================
  3. --- src/heightmap.cpp   (revision 26981)
  4. +++ src/heightmap.cpp   (working copy)
  5. @@ -364,16 +364,16 @@
  6.                 assert(img_row < img_height);
  7.                 assert(img_col < img_width);
  8.  
  9. -               /* The height in 1/255ths. */
  10. +               /* The height in 1/256ths. */
  11.                 uint heightmap_height = map[img_row * img_width + img_col];
  12.  
  13. -               /* The height in 1/255ths of the maximum height. */
  14. -               heightmap_height *= _settings_game.construction.max_heightlevel;
  15. +               /* The height in 1/256ths of the maximum height. */
  16. +               heightmap_height *= (1 + _settings_game.construction.max_heightlevel);
  17.  
  18.                 /* Scaling should not alter the coastline, thus values in the interval ]0..1] result in a heightlevel of 1 */
  19. -               if (IsInsideMM(heightmap_height, 1, UINT8_MAX)) heightmap_height = UINT8_MAX;
  20. +               if (IsInsideMM(heightmap_height, 1, 256)) heightmap_height = 256;
  21.  
  22. -               SetTileHeight(tile, heightmap_height / UINT8_MAX);
  23. +               SetTileHeight(tile, heightmap_height / 256);
  24.             }
  25.             /* Only clear the tiles within the map area. */
  26.             if (IsInnerTile(tile)) {
  27. Index: src/screenshot.cpp
  28. ===================================================================
  29. --- src/screenshot.cpp  (revision 26981)
  30. +++ src/screenshot.cpp  (working copy)
  31. @@ -783,7 +783,7 @@
  32.     while (n > 0) {
  33.         TileIndex ti = TileXY(MapMaxX(), y);
  34.         for (uint x = MapMaxX(); true; x--) {
  35. -           *buf = 16 * TileHeight(ti);
  36. +           *buf = 256 * TileHeight(ti) / (1 + _settings_game.construction.max_heightlevel);
  37.             buf++;
  38.             if (x == 0) break;
  39.             ti = TILE_ADDXY(ti, -1, 0);
  40.  

Comments