OpenTTD Source  20241108-master-g80f628063a
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 <http://www.gnu.org/licenses/>.
6  */
7 
10 #ifndef SCREENSHOT_H
11 #define SCREENSHOT_H
12 
14 
15 const char *GetCurrentScreenshotExtension();
16 
26 };
27 
28 void SetupScreenshotViewport(ScreenshotType t, struct Viewport *vp, uint32_t width = 0, uint32_t height = 0);
29 bool MakeHeightmapScreenshot(const char *filename);
31 bool MakeScreenshot(ScreenshotType t, std::string name, uint32_t width = 0, uint32_t height = 0);
33 
34 extern std::string _screenshot_format_name;
35 extern std::string _full_screenshot_path;
36 
37 #endif /* SCREENSHOT_H */
void MakeScreenshotWithConfirm(ScreenshotType t)
Make a screenshot.
Definition: screenshot.cpp:847
const char * GetCurrentScreenshotExtension()
Get filename extension of current screenshot file format.
Definition: screenshot.cpp:554
std::string _screenshot_format_name
Extension of the current screenshot format (corresponds with #_cur_screenshot_format).
Definition: screenshot.cpp:40
bool MakeHeightmapScreenshot(const char *filename)
Make a heightmap of the current map.
Definition: screenshot.cpp:811
void InitializeScreenshotFormats()
Initialize screenshot format information on startup, with _screenshot_format_name filled from the loa...
Definition: screenshot.cpp:560
bool MakeMinimapWorldScreenshot()
Make a minimap screenshot.
Definition: screenshot.cpp:990
bool MakeScreenshot(ScreenshotType t, std::string name, uint32_t width=0, uint32_t height=0)
Schedule making a screenshot.
Definition: screenshot.cpp:949
std::string _full_screenshot_path
Pathname of the screenshot file.
Definition: screenshot.cpp:42
ScreenshotType
Type of requested screenshot.
Definition: screenshot.h:18
@ SC_VIEWPORT
Screenshot of viewport.
Definition: screenshot.h:19
@ SC_CRASHLOG
Raw screenshot from blitter buffer.
Definition: screenshot.h:20
@ SC_ZOOMEDIN
Fully zoomed in screenshot of the visible area.
Definition: screenshot.h:21
@ SC_HEIGHTMAP
Heightmap of the world.
Definition: screenshot.h:24
@ SC_WORLD
World screenshot.
Definition: screenshot.h:23
@ SC_MINIMAP
Minimap screenshot.
Definition: screenshot.h:25
@ SC_DEFAULTZOOM
Zoomed to default zoom level screenshot of the visible area.
Definition: screenshot.h:22
void SetupScreenshotViewport(ScreenshotType t, struct Viewport *vp, uint32_t width=0, uint32_t height=0)
Configure a Viewport for rendering (a part of) the map into a screenshot.
Definition: screenshot.cpp:694
Data structure for viewport, display of a part of the world.
Definition: viewport_type.h:22