Functions to make screenshots. More...
Go to the source code of this file.
Enumerations | |
enum | ScreenshotType { SC_VIEWPORT, SC_RAW, SC_ZOOMEDIN, SC_DEFAULTZOOM, SC_WORLD, SC_HEIGHTMAP } |
Type of requested screenshot. More... | |
Functions | |
void | InitializeScreenshotFormats () |
Initialize screenshot format information on startup, with _screenshot_format_name filled from the loadsave code. | |
const char * | GetScreenshotFormatDesc (int i) |
Give descriptive name of the screenshot format. | |
bool | GetScreenshotFormatSupports_32bpp (int i) |
Determine whether a certain screenshot format support 32bpp images. | |
void | SetScreenshotFormat (uint i) |
Set the screenshot format to use. | |
const char * | GetCurrentScreenshotExtension () |
Get filename extension of current screenshot file format. | |
bool | MakeHeightmapScreenshot (const char *filename) |
Make a heightmap of the current map. | |
bool | MakeScreenshot (ScreenshotType t, const char *name) |
Make an actual 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 23 of file screenshot.h.
const char* GetCurrentScreenshotExtension | ( | ) |
Get filename extension of current screenshot file format.
Definition at line 580 of file screenshot.cpp.
References _cur_screenshot_format, and ScreenshotFormat::extension.
Referenced by FiosMakeHeightmapName().
const char* GetScreenshotFormatDesc | ( | int | i | ) |
Give descriptive name of the screenshot format.
i | Number of the screenshot format. |
Definition at line 604 of file screenshot.cpp.
References ScreenshotFormat::name.
Referenced by FormatString().
bool GetScreenshotFormatSupports_32bpp | ( | int | i | ) |
Determine whether a certain screenshot format support 32bpp images.
i | Number of the screenshot format. |
Definition at line 614 of file screenshot.cpp.
References ScreenshotFormat::supports_32bpp.
Referenced by GameOptionsWindow::BuildDropDownList().
void InitializeScreenshotFormats | ( | ) |
Initialize screenshot format information on startup, with _screenshot_format_name filled from the loadsave code.
Definition at line 586 of file screenshot.cpp.
References _cur_screenshot_format, _num_screenshot_formats, _screenshot_format_name, and lengthof.
bool MakeHeightmapScreenshot | ( | const char * | filename | ) |
Make a heightmap of the current map.
filename | Filename to use for saving. |
Definition at line 818 of file screenshot.cpp.
References _cur_screenshot_format, Colour::a, HeightmapCallback(), lengthof, MapSizeX(), MapSizeY(), and ScreenshotFormat::proc.
Referenced by MakeScreenshot().
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 837 of file screenshot.cpp.
References _cur_screenshot_format, _screenshot_name, _settings_client, DrawDirtyBlocks(), ScreenshotFormat::extension, ClientSettings::gui, HEIGHTMAP_NAME, INVALID_STRING_ID, lastof, MakeHeightmapScreenshot(), MakeScreenshotName(), MakeSmallScreenshot(), MakeWorldScreenshot(), MakeZoomedInScreenshot(), SC_DEFAULTZOOM, SC_HEIGHTMAP, SC_RAW, SC_VIEWPORT, SC_WORLD, SC_ZOOMEDIN, SetDParamStr(), ShowErrorMessage(), strecpy(), WL_ERROR, WL_WARNING, ZOOM_LVL_VIEWPORT, and GUISettings::zoom_min.
Referenced by CrashLog::WriteScreenshot().
void SetScreenshotFormat | ( | uint | i | ) |
Set the screenshot format to use.
i | Number of the format. |
Definition at line 623 of file screenshot.cpp.
References _cur_screenshot_format, _num_screenshot_formats, _screenshot_format_name, lastof, and strecpy().
Referenced by GameOptionsWindow::OnDropdownSelect().