OpenTTD Source: src/screenshot.h Source File

OpenTTD Source 15.3

screenshot.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
10#ifndef SCREENSHOT_H
11#define SCREENSHOT_H
12
13std::string_view GetCurrentScreenshotExtension();
14
16 enum ScreenshotType : uint8_t {
17 SC_VIEWPORT,
18 SC_CRASHLOG,
19 SC_ZOOMEDIN,
20 SC_DEFAULTZOOM,
21 SC_WORLD,
22 SC_HEIGHTMAP,
23 SC_MINIMAP,
24};
25
26bool MakeHeightmapScreenshot(std::string_view filename);
27void MakeScreenshotWithConfirm(ScreenshotType t);
28bool MakeScreenshot(ScreenshotType t, const std::string &name, uint32_t width = 0, uint32_t height = 0);
29bool MakeMinimapWorldScreenshot();
30
31extern std::string _screenshot_format_name;
32extern std::string _full_screenshot_path;
33
34#endif /* SCREENSHOT_H */
MakeScreenshotWithConfirm
void MakeScreenshotWithConfirm(ScreenshotType t)
Make a screenshot.
Definition screenshot.cpp:353
_screenshot_format_name
std::string _screenshot_format_name
Extension of the current screenshot format.
Definition screenshot.cpp:39
MakeMinimapWorldScreenshot
bool MakeMinimapWorldScreenshot()
Make a minimap screenshot.
Definition screenshot.cpp:497
GetCurrentScreenshotExtension
std::string_view GetCurrentScreenshotExtension()
Get filename extension of current screenshot file format.
Definition screenshot.cpp:61
ScreenshotType
ScreenshotType
Type of requested screenshot.
Definition screenshot.h:16
SC_VIEWPORT
@ SC_VIEWPORT
Screenshot of viewport.
Definition screenshot.h:17
SC_CRASHLOG
@ SC_CRASHLOG
Raw screenshot from blitter buffer.
Definition screenshot.h:18
SC_ZOOMEDIN
@ SC_ZOOMEDIN
Fully zoomed in screenshot of the visible area.
Definition screenshot.h:19
SC_HEIGHTMAP
@ SC_HEIGHTMAP
Heightmap of the world.
Definition screenshot.h:22
SC_WORLD
@ SC_WORLD
World screenshot.
Definition screenshot.h:21
SC_MINIMAP
@ SC_MINIMAP
Minimap screenshot.
Definition screenshot.h:23
SC_DEFAULTZOOM
@ SC_DEFAULTZOOM
Zoomed to default zoom level screenshot of the visible area.
Definition screenshot.h:20
_full_screenshot_path
std::string _full_screenshot_path
Pathname of the screenshot file.
Definition screenshot.cpp:41
MakeHeightmapScreenshot
bool MakeHeightmapScreenshot(std::string_view filename)
Make a heightmap of the current map.
Definition screenshot.cpp:314
MakeScreenshot
bool MakeScreenshot(ScreenshotType t, const std::string &name, uint32_t width=0, uint32_t height=0)
Schedule making a screenshot.
Definition screenshot.cpp:456