OpenTTD Source: src/screenshot.h Source File

OpenTTD Source 13.1

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
13 void InitializeScreenshotFormats();
14
15 const char *GetCurrentScreenshotExtension();
16
18 enum ScreenshotType {
19 SC_VIEWPORT,
20 SC_CRASHLOG,
21 SC_ZOOMEDIN,
22 SC_DEFAULTZOOM,
23 SC_WORLD,
24 SC_HEIGHTMAP,
25 SC_MINIMAP,
26 };
27
28 void SetupScreenshotViewport(ScreenshotType t, struct Viewport *vp, uint32 width = 0, uint32 height = 0);
29 bool MakeHeightmapScreenshot(const char *filename);
30 void MakeScreenshotWithConfirm(ScreenshotType t);
31 bool MakeScreenshot(ScreenshotType t, std::string name, uint32 width = 0, uint32 height = 0);
32 bool MakeMinimapWorldScreenshot();
33
34 extern std::string _screenshot_format_name;
35 extern uint _num_screenshot_formats;
36 extern uint _cur_screenshot_format;
37 extern char _full_screenshot_name[MAX_PATH];
38
39 #endif /* SCREENSHOT_H */
ScreenshotType
ScreenshotType
Type of requested screenshot.
Definition: screenshot.h:18
MakeMinimapWorldScreenshot
bool MakeMinimapWorldScreenshot()
Make a minimap screenshot.
Definition: screenshot.cpp:1031
SC_HEIGHTMAP
@ SC_HEIGHTMAP
Heightmap of the world.
Definition: screenshot.h:24
SC_ZOOMEDIN
@ SC_ZOOMEDIN
Fully zoomed in screenshot of the visible area.
Definition: screenshot.h:21
MakeScreenshotWithConfirm
void MakeScreenshotWithConfirm(ScreenshotType t)
Make a screenshot.
Definition: screenshot.cpp:886
_screenshot_format_name
std::string _screenshot_format_name
Extension of the current screenshot format (corresponds with _cur_screenshot_format).
Definition: screenshot.cpp:39
InitializeScreenshotFormats
void InitializeScreenshotFormats()
Initialize screenshot format information on startup, with _screenshot_format_name filled from the loa...
Definition: screenshot.cpp:585
Viewport
Data structure for viewport, display of a part of the world.
Definition: viewport_type.h:22
MakeHeightmapScreenshot
bool MakeHeightmapScreenshot(const char *filename)
Make a heightmap of the current map.
Definition: screenshot.cpp:848
_num_screenshot_formats
uint _num_screenshot_formats
Number of available screenshot formats.
Definition: screenshot.cpp:40
MakeScreenshot
bool MakeScreenshot(ScreenshotType t, std::string name, uint32 width=0, uint32 height=0)
Schedule making a screenshot.
Definition: screenshot.cpp:990
_cur_screenshot_format
uint _cur_screenshot_format
Index of the currently selected screenshot format in _screenshot_formats.
Definition: screenshot.cpp:41
SC_WORLD
@ SC_WORLD
World screenshot.
Definition: screenshot.h:23
SC_DEFAULTZOOM
@ SC_DEFAULTZOOM
Zoomed to default zoom level screenshot of the visible area.
Definition: screenshot.h:22
SetupScreenshotViewport
void SetupScreenshotViewport(ScreenshotType t, struct Viewport *vp, uint32 width=0, uint32 height=0)
Configure a Viewport for rendering (a part of) the map into a screenshot.
Definition: screenshot.cpp:728
SC_VIEWPORT
@ SC_VIEWPORT
Screenshot of viewport.
Definition: screenshot.h:19
SC_CRASHLOG
@ SC_CRASHLOG
Raw screenshot from blitter buffer.
Definition: screenshot.h:20
_full_screenshot_name
char _full_screenshot_name[MAX_PATH]
Pathname of the screenshot file.
Definition: screenshot.cpp:43
SC_MINIMAP
@ SC_MINIMAP
Minimap screenshot.
Definition: screenshot.h:25
GetCurrentScreenshotExtension
const char * GetCurrentScreenshotExtension()
Get filename extension of current screenshot file format.
Definition: screenshot.cpp:579