Index: src/screenshot.cpp =================================================================== --- src/screenshot.cpp (Revision 20914) +++ src/screenshot.cpp (Arbeitskopie) @@ -25,6 +25,8 @@ #include "gui.h" #include "window_gui.h" #include "window_func.h" +#include "tile_map.h" +#include "tile_type.h" #include "table/strings.h" @@ -637,14 +639,26 @@ ViewPort vp; const ScreenshotFormat *sf; + /* Find out the height at point (0,0) - we need this for ensuring + * that even a high mountain at (0,0) is completely on the + * screenshot. Note: A mountain at any other tile can never be + * that high that its peak will be painted at a smaller y + * coordinate. */ + int heightAtZeroZero = TileHeight(TileXY(0, 0)); + + /* Add some extra pixels for the case that something high is at (0,0). + * TODO: 200 is just some guess, if you know an exact + * upper bound for that, please insert it instead of the 200. */ + int pixelsHighAtZeroZero = heightAtZeroZero * TILE_HEIGHT + 200; + vp.zoom = ZOOM_LVL_WORLD_SCREENSHOT; vp.left = 0; vp.top = 0; vp.virtual_left = -(int)MapMaxX() * TILE_PIXELS; - vp.virtual_top = 0; + vp.virtual_top = -pixelsHighAtZeroZero; vp.virtual_width = (MapMaxX() + MapMaxY()) * TILE_PIXELS; vp.width = vp.virtual_width; - vp.virtual_height = (MapMaxX() + MapMaxY()) * TILE_PIXELS >> 1; + vp.virtual_height = (MapMaxX() + MapMaxY()) * (TILE_PIXELS >> 1) + pixelsHighAtZeroZero; vp.height = vp.virtual_height; sf = _screenshot_formats + _cur_screenshot_format;