|
OpenTTD Source
1.10.0-RC1
|
Functions to make screenshots. More...
Go to the source code of this file.
Enumerations | |
| enum | ScreenshotType { SC_VIEWPORT, SC_CRASHLOG, SC_ZOOMEDIN, SC_DEFAULTZOOM, SC_WORLD, SC_HEIGHTMAP, SC_MINIMAP } |
| Type of requested screenshot. More... | |
Functions | |
| void | InitializeScreenshotFormats () |
| Initialize screenshot format information on startup, with _screenshot_format_name filled from the loadsave code. More... | |
| const char * | GetCurrentScreenshotExtension () |
| Get filename extension of current screenshot file format. More... | |
| void | SetupScreenshotViewport (ScreenshotType t, struct ViewPort *vp) |
| Configure a ViewPort for rendering (a part of) the map into a screenshot. More... | |
| bool | MakeHeightmapScreenshot (const char *filename) |
| Make a heightmap of the current map. More... | |
| bool | MakeScreenshot (ScreenshotType t, const char *name) |
| Make an actual screenshot. More... | |
| bool | MakeMinimapWorldScreenshot () |
| Make a minimap screenshot. | |
Variables | |
| char | _screenshot_format_name [8] |
| Extension of the current screenshot format (corresponds with _cur_screenshot_format). | |
| uint | _num_screenshot_formats |
| Number of available screenshot formats. | |
| uint | _cur_screenshot_format |
| Index of the currently selected screenshot format in _screenshot_formats. | |
| char | _full_screenshot_name [MAX_PATH] |
| Pathname of the screenshot file. | |
Functions to make screenshots.
Definition in file screenshot.h.
| enum ScreenshotType |
Type of requested screenshot.
Definition at line 18 of file screenshot.h.
| const char* GetCurrentScreenshotExtension | ( | ) |
Get filename extension of current screenshot file format.
Definition at line 574 of file screenshot.cpp.
References _cur_screenshot_format, and ScreenshotFormat::extension.
Referenced by FiosMakeHeightmapName().
| void InitializeScreenshotFormats | ( | ) |
Initialize screenshot format information on startup, with _screenshot_format_name filled from the loadsave code.
Definition at line 580 of file screenshot.cpp.
References _cur_screenshot_format, _num_screenshot_formats, _screenshot_format_name, ScreenshotFormat::extension, and lengthof.
| bool MakeHeightmapScreenshot | ( | const char * | filename | ) |
Make a heightmap of the current map.
| filename | Filename to use for saving. |
Definition at line 821 of file screenshot.cpp.
References _cur_screenshot_format, Colour::a, HeightmapCallback(), lengthof, MapSizeX(), MapSizeY(), and ScreenshotFormat::proc.
| bool MakeScreenshot | ( | ScreenshotType | t, |
| const char * | name | ||
| ) |
Make an actual screenshot.
| t | the type of screenshot to make. |
| name | the name to give to the screenshot. |
Definition at line 840 of file screenshot.cpp.
References SC_VIEWPORT.
Referenced by MenuClickScreenshot(), ScreenshotWindow::ScreenshotConfirmationCallback(), and ScreenshotConfirmCallback().
| void SetupScreenshotViewport | ( | ScreenshotType | t, |
| ViewPort * | vp | ||
| ) |
Configure a ViewPort for rendering (a part of) the map into a screenshot.
| t | Screenshot type | |
| [out] | vp | Result viewport |
Definition at line 713 of file screenshot.cpp.
References FindWindowById(), ViewPort::left, SC_CRASHLOG, SC_VIEWPORT, ViewPort::top, Window::viewport, ViewPort::virtual_height, ViewPort::virtual_left, ViewPort::virtual_top, ViewPort::virtual_width, WC_MAIN_WINDOW, and ViewPort::width.
Referenced by MakeLargeWorldScreenshot(), MenuClickScreenshot(), and ScreenshotWindow::TakeScreenshot().