Changeset - r24283:3273428ca0a4
[Not reviewed]
master
0 1 0
Abdurrahmaan Iqbal - 4 years ago 2020-06-23 14:20:02
abdurrahmaaniqbal@hotmail.com
Fix #8232: 'Huge screenshot' warning being shown incorrectly
1 file changed with 8 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/screenshot.cpp
Show inline comments
 
@@ -854,11 +854,16 @@ void MakeScreenshotWithConfirm(Screensho
 
{
 
	ViewPort vp;
 
	SetupScreenshotViewport(t, &vp);
 
	if ((uint64)vp.width * (uint64)vp.height > 8192 * 8192) {
 

	
 
	bool heightmap_or_minimap = t == SC_HEIGHTMAP || t == SC_MINIMAP;
 
	uint64_t width = (heightmap_or_minimap ? MapSizeX() : vp.width);
 
	uint64_t height = (heightmap_or_minimap ? MapSizeY() : vp.height);
 

	
 
	if (width * height > 8192 * 8192) {
 
		/* Ask for confirmation */
 
		_confirmed_screenshot_type = t;
 
		SetDParam(0, vp.width);
 
		SetDParam(1, vp.height);
 
		SetDParam(0, width);
 
		SetDParam(1, height);
 
		ShowQuery(STR_WARNING_SCREENSHOT_SIZE_CAPTION, STR_WARNING_SCREENSHOT_SIZE_MESSAGE, nullptr, ScreenshotConfirmationCallback);
 
	} else {
 
		/* Less than 64M pixels, just do it */
0 comments (0 inline, 0 general)