Loading

Paste #pjqo63amv

  1. Index: src/heightmap.cpp
  2. ===================================================================
  3. --- src/heightmap.cpp   (revision 27039)
  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/256ths. */
  10.                 uint heightmap_height = map[img_row * img_width + img_col];
  11.  
  12. -               /* The height in 1/256ths of the maximum height. */
  13. -               heightmap_height *= (1 + _settings_game.construction.max_heightlevel);
  14. +               if (heightmap_height > 0) {
  15. +                   /* 0 is sea level.
  16. +                    * Other grey scales are scaled evenly to the availble height levels > 0.
  17. +                    * (The coastline is independent from the number of height levels) */
  18. +                   heightmap_height = 1 + (heightmap_height - 1) * _settings_game.construction.max_heightlevel / 255;
  19. +               }
  20.  
  21. -               /* Scaling should not alter the coastline, thus values in the interval ]0..1] result in a heightlevel of 1 */
  22. -               if (IsInsideMM(heightmap_height, 1, 256)) heightmap_height = 256;
  23. -
  24. -               SetTileHeight(tile, heightmap_height / 256);
  25. +               SetTileHeight(tile, heightmap_height);
  26.             }
  27.             /* Only clear the tiles within the map area. */
  28.             if (IsInnerTile(tile)) {
  29.  

Comments