screenshot.h File Reference

Functions to make screenshots. More...

Go to the source code of this file.

Enumerations

enum  ScreenshotType { SC_VIEWPORT, SC_RAW, SC_ZOOMEDIN, SC_WORLD }
 

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.
void SetScreenshotFormat (uint i)
 Set the screenshot format to use.
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.

Detailed Description

Functions to make screenshots.

Definition in file screenshot.h.


Enumeration Type Documentation

Type of requested screenshot.

Enumerator:
SC_VIEWPORT 

Screenshot of viewport.

SC_RAW 

Raw screenshot from blitter buffer.

SC_ZOOMEDIN 

Zoomed in screenshot of the visible area.

SC_WORLD 

World screenshot.

Definition at line 21 of file screenshot.h.


Function Documentation

const char* GetScreenshotFormatDesc ( int  i  ) 

Give descriptive name of the screenshot format.

Parameters:
i Number of the screenshot format.
Returns:
String constant describing the format.

Definition at line 597 of file screenshot.cpp.

References ScreenshotFormat::name.

Referenced by FormatString().

void InitializeScreenshotFormats (  ) 

Initialize screenshot format information on startup, with _screenshot_format_name filled from the loadsave code.

Definition at line 579 of file screenshot.cpp.

References _cur_screenshot_format, _num_screenshot_formats, _screenshot_format_name, and lengthof.

bool MakeScreenshot ( ScreenshotType  t,
const char *  name 
)

Make an actual screenshot.

Parameters:
t the type of screenshot to make.
name the name to give to the screenshot.
Returns:
true iff the screenshow was made successfully

Definition at line 774 of file screenshot.cpp.

References _screenshot_name, DrawDirtyBlocks(), INVALID_STRING_ID, lastof, MakeSmallScreenshot(), MakeWorldScreenshot(), MakeZoomedInScreenshot(), SC_RAW, SC_VIEWPORT, SC_WORLD, SC_ZOOMEDIN, SetDParamStr(), ShowErrorMessage(), strecpy(), WL_ERROR, and WL_WARNING.

Referenced by CrashLog::WriteScreenshot().

void SetScreenshotFormat ( uint  i  ) 

Set the screenshot format to use.

Parameters:
i Number of the format.

Definition at line 606 of file screenshot.cpp.

References _cur_screenshot_format, _num_screenshot_formats, _screenshot_format_name, lastof, and strecpy().

Referenced by GameOptionsWindow::OnDropdownSelect().


Generated on Fri May 27 04:20:02 2011 for OpenTTD by  doxygen 1.6.1