mirror of https://github.com/OpenTTD/OpenTTD
(svn r17937) -Codechange: rename current_screenshot_type to _screenshot_type
parent
b577595d12
commit
be446d6f54
|
@ -775,7 +775,6 @@ void HandleExitGameRequest()
|
||||||
static void ShowScreenshotResult(bool b)
|
static void ShowScreenshotResult(bool b)
|
||||||
{
|
{
|
||||||
if (b) {
|
if (b) {
|
||||||
extern char _screenshot_name[];
|
|
||||||
SetDParamStr(0, _screenshot_name);
|
SetDParamStr(0, _screenshot_name);
|
||||||
ShowErrorMessage(STR_MESSAGE_SCREENSHOT_SUCCESSFULLY, INVALID_STRING_ID, 0, 0);
|
ShowErrorMessage(STR_MESSAGE_SCREENSHOT_SUCCESSFULLY, INVALID_STRING_ID, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -27,7 +27,7 @@ char _screenshot_format_name[8];
|
||||||
uint _num_screenshot_formats;
|
uint _num_screenshot_formats;
|
||||||
uint _cur_screenshot_format;
|
uint _cur_screenshot_format;
|
||||||
char _screenshot_name[128];
|
char _screenshot_name[128];
|
||||||
ScreenshotType current_screenshot_type;
|
static ScreenshotType _screenshot_type;
|
||||||
|
|
||||||
/* called by the ScreenShot proc to generate screenshot lines. */
|
/* called by the ScreenShot proc to generate screenshot lines. */
|
||||||
typedef void ScreenshotCallback(void *userdata, void *buf, uint y, uint pitch, uint n);
|
typedef void ScreenshotCallback(void *userdata, void *buf, uint y, uint pitch, uint n);
|
||||||
|
@ -460,7 +460,7 @@ void InitializeScreenshotFormats()
|
||||||
}
|
}
|
||||||
_cur_screenshot_format = j;
|
_cur_screenshot_format = j;
|
||||||
_num_screenshot_formats = lengthof(_screenshot_formats);
|
_num_screenshot_formats = lengthof(_screenshot_formats);
|
||||||
current_screenshot_type = SC_NONE;
|
_screenshot_type = SC_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *GetScreenshotFormatDesc(int i)
|
const char *GetScreenshotFormatDesc(int i)
|
||||||
|
@ -569,12 +569,12 @@ static char *MakeScreenshotName(const char *ext)
|
||||||
|
|
||||||
void SetScreenshotType(ScreenshotType t)
|
void SetScreenshotType(ScreenshotType t)
|
||||||
{
|
{
|
||||||
current_screenshot_type = t;
|
_screenshot_type = t;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsScreenshotRequested()
|
bool IsScreenshotRequested()
|
||||||
{
|
{
|
||||||
return (current_screenshot_type != SC_NONE);
|
return (_screenshot_type != SC_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool MakeSmallScreenshot()
|
static bool MakeSmallScreenshot()
|
||||||
|
@ -604,14 +604,14 @@ static bool MakeWorldScreenshot()
|
||||||
|
|
||||||
bool MakeScreenshot()
|
bool MakeScreenshot()
|
||||||
{
|
{
|
||||||
switch (current_screenshot_type) {
|
switch (_screenshot_type) {
|
||||||
case SC_VIEWPORT:
|
case SC_VIEWPORT:
|
||||||
UndrawMouseCursor();
|
UndrawMouseCursor();
|
||||||
DrawDirtyBlocks();
|
DrawDirtyBlocks();
|
||||||
current_screenshot_type = SC_NONE;
|
_screenshot_type = SC_NONE;
|
||||||
return MakeSmallScreenshot();
|
return MakeSmallScreenshot();
|
||||||
case SC_WORLD:
|
case SC_WORLD:
|
||||||
current_screenshot_type = SC_NONE;
|
_screenshot_type = SC_NONE;
|
||||||
return MakeWorldScreenshot();
|
return MakeWorldScreenshot();
|
||||||
default: return false;
|
default: return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,5 +30,6 @@ bool IsScreenshotRequested();
|
||||||
extern char _screenshot_format_name[8];
|
extern char _screenshot_format_name[8];
|
||||||
extern uint _num_screenshot_formats;
|
extern uint _num_screenshot_formats;
|
||||||
extern uint _cur_screenshot_format;
|
extern uint _cur_screenshot_format;
|
||||||
|
extern char _screenshot_name[];
|
||||||
|
|
||||||
#endif /* SCREENSHOT_H */
|
#endif /* SCREENSHOT_H */
|
||||||
|
|
Loading…
Reference in New Issue