Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Huge screenshot" warning incorrect for heightmap / minimap screenshots #8232

Closed
James103 opened this issue Jun 21, 2020 · 0 comments · Fixed by #8224
Closed

"Huge screenshot" warning incorrect for heightmap / minimap screenshots #8232

James103 opened this issue Jun 21, 2020 · 0 comments · Fixed by #8224

Comments

@James103
Copy link
Contributor

James103 commented Jun 21, 2020

Version of OpenTTD

1.10.2

Expected result

Unless the map is greater than 67,108,864 tiles total size (8,192 x 8,192), no "Huge screenshot" warning is generated when taking a heightmap or minimap screenshot.

Actual result

Even on a 128x128 map, a "Huge screenshot" warning is still generated when trying to take a heightmap or minimap screenshot. In my case (1080p monitor, maximized windowed mode on Windows 10), the warning says that the screenshot will be 15360 x 8136 pixels when fully zoomed out, even though the actual dimensions of the resulting screenshot is only 128x128 and it only takes a few milliseconds to take the screenshot.

This seems to be caused by the following, which only takes into account the viewport size and not the actual map size and whether the screenshot is a minimap or heightmap screenshot:

ViewPort vp;
SetupScreenshotViewport(st, &vp);
if ((uint64)vp.width * (uint64)vp.height > 8192 * 8192) {

Steps to reproduce

For best results, do the following steps on a monitor resolution of 1080p or higher.

  1. Generate a new map, The size of the map does not matter.
  2. Zoom all the way out.
  3. Open the screenshot menu.
  4. Click "Minimap screenshot" or "Heightmap screenshot".
  5. Look at the warning generated, notice the incorrect dimensions.
  6. Click through the warning.
  7. The output size matches the map size, and not the viewport size scaled by the zoom level.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant