(svn r26525) -Remove: Screenshot format setting from GUI.

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
frosch 10 years ago
parent 08660e6ea6
commit ebd2d3ccef

@ -954,9 +954,6 @@ STR_GAME_OPTIONS_RESOLUTION :{BLACK}Screen r
STR_GAME_OPTIONS_RESOLUTION_TOOLTIP :{BLACK}Select the screen resolution to use STR_GAME_OPTIONS_RESOLUTION_TOOLTIP :{BLACK}Select the screen resolution to use
STR_GAME_OPTIONS_RESOLUTION_OTHER :other STR_GAME_OPTIONS_RESOLUTION_OTHER :other
STR_GAME_OPTIONS_SCREENSHOT_FORMAT :{BLACK}Screenshot format
STR_GAME_OPTIONS_SCREENSHOT_FORMAT_TOOLTIP :{BLACK}Select the screenshot format to use
STR_GAME_OPTIONS_BASE_GRF :{BLACK}Base graphics set STR_GAME_OPTIONS_BASE_GRF :{BLACK}Base graphics set
STR_GAME_OPTIONS_BASE_GRF_TOOLTIP :{BLACK}Select the base graphics set to use STR_GAME_OPTIONS_BASE_GRF_TOOLTIP :{BLACK}Select the base graphics set to use
STR_GAME_OPTIONS_BASE_GRF_STATUS :{RED}{NUM} missing/corrupted file{P "" s} STR_GAME_OPTIONS_BASE_GRF_STATUS :{RED}{NUM} missing/corrupted file{P "" s}

@ -64,10 +64,8 @@ typedef bool ScreenshotHandlerProc(const char *name, ScreenshotCallback *callb,
/** Screenshot format information. */ /** Screenshot format information. */
struct ScreenshotFormat { struct ScreenshotFormat {
const char *name; ///< Name of the format.
const char *extension; ///< File extension. const char *extension; ///< File extension.
ScreenshotHandlerProc *proc; ///< Function for writing the screenshot. ScreenshotHandlerProc *proc; ///< Function for writing the screenshot.
bool supports_32bpp; ///< Does this format support 32bpp images?
}; };
/************************************************* /*************************************************
@ -573,10 +571,10 @@ static bool MakePCXImage(const char *name, ScreenshotCallback *callb, void *user
/** Available screenshot formats. */ /** Available screenshot formats. */
static const ScreenshotFormat _screenshot_formats[] = { static const ScreenshotFormat _screenshot_formats[] = {
#if defined(WITH_PNG) #if defined(WITH_PNG)
{"PNG", "png", &MakePNGImage, true}, {"png", &MakePNGImage},
#endif #endif
{"BMP", "bmp", &MakeBMPImage, true}, {"bmp", &MakeBMPImage},
{"PCX", "pcx", &MakePCXImage, false}, {"pcx", &MakePCXImage},
}; };
/** Get filename extension of current screenshot file format. */ /** Get filename extension of current screenshot file format. */
@ -599,37 +597,6 @@ void InitializeScreenshotFormats()
_num_screenshot_formats = lengthof(_screenshot_formats); _num_screenshot_formats = lengthof(_screenshot_formats);
} }
/**
* Give descriptive name of the screenshot format.
* @param i Number of the screenshot format.
* @return String constant describing the format.
*/
const char *GetScreenshotFormatDesc(int i)
{
return _screenshot_formats[i].name;
}
/**
* Determine whether a certain screenshot format support 32bpp images.
* @param i Number of the screenshot format.
* @return true if 32bpp is supported.
*/
bool GetScreenshotFormatSupports_32bpp(int i)
{
return _screenshot_formats[i].supports_32bpp;
}
/**
* Set the screenshot format to use.
* @param i Number of the format.
*/
void SetScreenshotFormat(uint i)
{
assert(i < _num_screenshot_formats);
_cur_screenshot_format = i;
strecpy(_screenshot_format_name, _screenshot_formats[i].extension, lastof(_screenshot_format_name));
}
/** /**
* Callback of the screenshot generator that dumps the current video buffer. * Callback of the screenshot generator that dumps the current video buffer.
* @see ScreenshotCallback * @see ScreenshotCallback

@ -14,9 +14,6 @@
void InitializeScreenshotFormats(); void InitializeScreenshotFormats();
const char *GetScreenshotFormatDesc(int i);
bool GetScreenshotFormatSupports_32bpp(int i);
void SetScreenshotFormat(uint i);
const char *GetCurrentScreenshotExtension(); const char *GetCurrentScreenshotExtension();
/** Type of requested screenshot */ /** Type of requested screenshot */

@ -991,7 +991,6 @@ void SQGSWindow_Register(Squirrel *engine)
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GO_LANG_DROPDOWN, "WID_GO_LANG_DROPDOWN"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GO_LANG_DROPDOWN, "WID_GO_LANG_DROPDOWN");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GO_RESOLUTION_DROPDOWN, "WID_GO_RESOLUTION_DROPDOWN"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GO_RESOLUTION_DROPDOWN, "WID_GO_RESOLUTION_DROPDOWN");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GO_FULLSCREEN_BUTTON, "WID_GO_FULLSCREEN_BUTTON"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GO_FULLSCREEN_BUTTON, "WID_GO_FULLSCREEN_BUTTON");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GO_SCREENSHOT_DROPDOWN, "WID_GO_SCREENSHOT_DROPDOWN");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GO_BASE_GRF_DROPDOWN, "WID_GO_BASE_GRF_DROPDOWN"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GO_BASE_GRF_DROPDOWN, "WID_GO_BASE_GRF_DROPDOWN");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GO_BASE_GRF_STATUS, "WID_GO_BASE_GRF_STATUS"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GO_BASE_GRF_STATUS, "WID_GO_BASE_GRF_STATUS");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GO_BASE_GRF_TEXTFILE, "WID_GO_BASE_GRF_TEXTFILE"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GO_BASE_GRF_TEXTFILE, "WID_GO_BASE_GRF_TEXTFILE");

@ -2104,7 +2104,6 @@ public:
WID_GO_LANG_DROPDOWN = ::WID_GO_LANG_DROPDOWN, ///< Language dropdown. WID_GO_LANG_DROPDOWN = ::WID_GO_LANG_DROPDOWN, ///< Language dropdown.
WID_GO_RESOLUTION_DROPDOWN = ::WID_GO_RESOLUTION_DROPDOWN, ///< Dropdown for the resolution. WID_GO_RESOLUTION_DROPDOWN = ::WID_GO_RESOLUTION_DROPDOWN, ///< Dropdown for the resolution.
WID_GO_FULLSCREEN_BUTTON = ::WID_GO_FULLSCREEN_BUTTON, ///< Toggle fullscreen. WID_GO_FULLSCREEN_BUTTON = ::WID_GO_FULLSCREEN_BUTTON, ///< Toggle fullscreen.
WID_GO_SCREENSHOT_DROPDOWN = ::WID_GO_SCREENSHOT_DROPDOWN, ///< Select the screenshot type... please use PNG!.
WID_GO_BASE_GRF_DROPDOWN = ::WID_GO_BASE_GRF_DROPDOWN, ///< Use to select a base GRF. WID_GO_BASE_GRF_DROPDOWN = ::WID_GO_BASE_GRF_DROPDOWN, ///< Use to select a base GRF.
WID_GO_BASE_GRF_STATUS = ::WID_GO_BASE_GRF_STATUS, ///< Info about missing files etc. WID_GO_BASE_GRF_STATUS = ::WID_GO_BASE_GRF_STATUS, ///< Info about missing files etc.
WID_GO_BASE_GRF_TEXTFILE = ::WID_GO_BASE_GRF_TEXTFILE, ///< Open base GRF readme, changelog (+1) or license (+2). WID_GO_BASE_GRF_TEXTFILE = ::WID_GO_BASE_GRF_TEXTFILE, ///< Open base GRF readme, changelog (+1) or license (+2).

@ -15,7 +15,6 @@
#include "settings_gui.h" #include "settings_gui.h"
#include "textbuf_gui.h" #include "textbuf_gui.h"
#include "command_func.h" #include "command_func.h"
#include "screenshot.h"
#include "network/network.h" #include "network/network.h"
#include "town.h" #include "town.h"
#include "settings_internal.h" #include "settings_internal.h"
@ -274,15 +273,6 @@ struct GameOptionsWindow : Window {
} }
break; break;
case WID_GO_SCREENSHOT_DROPDOWN: // Setup screenshot format dropdown
list = new DropDownList();
*selected_index = _cur_screenshot_format;
for (uint i = 0; i < _num_screenshot_formats; i++) {
if (!GetScreenshotFormatSupports_32bpp(i) && BlitterFactory::GetCurrentBlitter()->GetScreenDepth() == 32) continue;
*list->Append() = new DropDownListStringItem(SPECSTR_SCREENSHOT_START + i, i, false);
}
break;
case WID_GO_BASE_GRF_DROPDOWN: case WID_GO_BASE_GRF_DROPDOWN:
list = BuiltSetDropDownList<BaseGraphics>(selected_index); list = BuiltSetDropDownList<BaseGraphics>(selected_index);
break; break;
@ -311,7 +301,6 @@ struct GameOptionsWindow : Window {
case WID_GO_AUTOSAVE_DROPDOWN: SetDParam(0, _autosave_dropdown[_settings_client.gui.autosave]); break; case WID_GO_AUTOSAVE_DROPDOWN: SetDParam(0, _autosave_dropdown[_settings_client.gui.autosave]); break;
case WID_GO_LANG_DROPDOWN: SetDParamStr(0, _current_language->own_name); break; case WID_GO_LANG_DROPDOWN: SetDParamStr(0, _current_language->own_name); break;
case WID_GO_RESOLUTION_DROPDOWN: SetDParam(0, GetCurRes() == _num_resolutions ? STR_GAME_OPTIONS_RESOLUTION_OTHER : SPECSTR_RESOLUTION_START + GetCurRes()); break; case WID_GO_RESOLUTION_DROPDOWN: SetDParam(0, GetCurRes() == _num_resolutions ? STR_GAME_OPTIONS_RESOLUTION_OTHER : SPECSTR_RESOLUTION_START + GetCurRes()); break;
case WID_GO_SCREENSHOT_DROPDOWN: SetDParam(0, SPECSTR_SCREENSHOT_START + _cur_screenshot_format); break;
case WID_GO_BASE_GRF_DROPDOWN: SetDParamStr(0, BaseGraphics::GetUsedSet()->name); break; case WID_GO_BASE_GRF_DROPDOWN: SetDParamStr(0, BaseGraphics::GetUsedSet()->name); break;
case WID_GO_BASE_GRF_STATUS: SetDParam(0, BaseGraphics::GetUsedSet()->GetNumInvalid()); break; case WID_GO_BASE_GRF_STATUS: SetDParam(0, BaseGraphics::GetUsedSet()->GetNumInvalid()); break;
case WID_GO_BASE_SFX_DROPDOWN: SetDParamStr(0, BaseSounds::GetUsedSet()->name); break; case WID_GO_BASE_SFX_DROPDOWN: SetDParamStr(0, BaseSounds::GetUsedSet()->name); break;
@ -512,11 +501,6 @@ struct GameOptionsWindow : Window {
} }
break; break;
case WID_GO_SCREENSHOT_DROPDOWN: // Change screenshot format
SetScreenshotFormat(index);
this->SetDirty();
break;
case WID_GO_BASE_GRF_DROPDOWN: case WID_GO_BASE_GRF_DROPDOWN:
this->SetMediaSet<BaseGraphics>(index); this->SetMediaSet<BaseGraphics>(index);
break; break;
@ -563,9 +547,6 @@ static const NWidgetPart _nested_game_options_widgets[] = {
NWidget(WWT_PANEL, COLOUR_GREY, WID_GO_BACKGROUND), SetPIP(6, 6, 10), NWidget(WWT_PANEL, COLOUR_GREY, WID_GO_BACKGROUND), SetPIP(6, 6, 10),
NWidget(NWID_HORIZONTAL), SetPIP(10, 10, 10), NWidget(NWID_HORIZONTAL), SetPIP(10, 10, 10),
NWidget(NWID_VERTICAL), SetPIP(0, 6, 0), NWidget(NWID_VERTICAL), SetPIP(0, 6, 0),
NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME, STR_NULL),
NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_CURRENCY_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP), SetFill(1, 0),
EndContainer(),
NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_ROAD_VEHICLES_FRAME, STR_NULL), NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_ROAD_VEHICLES_FRAME, STR_NULL),
NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_ROADSIDE_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_TOOLTIP), SetFill(1, 0), NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_ROADSIDE_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_ROAD_VEHICLES_DROPDOWN_TOOLTIP), SetFill(1, 0),
EndContainer(), EndContainer(),
@ -588,8 +569,8 @@ static const NWidgetPart _nested_game_options_widgets[] = {
NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_LANGUAGE, STR_NULL), NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_LANGUAGE, STR_NULL),
NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_LANG_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_RAW_STRING, STR_GAME_OPTIONS_LANGUAGE_TOOLTIP), SetFill(1, 0), NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_LANG_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_RAW_STRING, STR_GAME_OPTIONS_LANGUAGE_TOOLTIP), SetFill(1, 0),
EndContainer(), EndContainer(),
NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_SCREENSHOT_FORMAT, STR_NULL), NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME, STR_NULL),
NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_SCREENSHOT_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_SCREENSHOT_FORMAT_TOOLTIP), SetFill(1, 0), NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_CURRENCY_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP), SetFill(1, 0),
EndContainer(), EndContainer(),
NWidget(NWID_SPACER), SetMinimalSize(0, 0), SetFill(0, 1), NWidget(NWID_SPACER), SetMinimalSize(0, 0), SetFill(0, 1),
EndContainer(), EndContainer(),

@ -13,7 +13,6 @@
#include "currency.h" #include "currency.h"
#include "station_base.h" #include "station_base.h"
#include "town.h" #include "town.h"
#include "screenshot.h"
#include "waypoint_base.h" #include "waypoint_base.h"
#include "depot_base.h" #include "depot_base.h"
#include "industry.h" #include "industry.h"
@ -1682,12 +1681,6 @@ static char *GetSpecialNameString(char *buff, int ind, StringParameters *args, c
return buff; return buff;
} }
/* screenshot format name? */
if (IsInsideMM(ind, (SPECSTR_SCREENSHOT_START - 0x70E4), (SPECSTR_SCREENSHOT_END - 0x70E4) + 1)) {
int i = ind - (SPECSTR_SCREENSHOT_START - 0x70E4);
return strecpy(buff, GetScreenshotFormatDesc(i), last);
}
NOT_REACHED(); NOT_REACHED();
} }

@ -69,10 +69,6 @@ enum SpecialStrings {
/* reserve 32 strings for various screen resolutions */ /* reserve 32 strings for various screen resolutions */
SPECSTR_RESOLUTION_START = SPECSTR_LANGUAGE_END + 1, SPECSTR_RESOLUTION_START = SPECSTR_LANGUAGE_END + 1,
SPECSTR_RESOLUTION_END = SPECSTR_RESOLUTION_START + 0x1F, SPECSTR_RESOLUTION_END = SPECSTR_RESOLUTION_START + 0x1F,
/* reserve 32 strings for screenshot formats */
SPECSTR_SCREENSHOT_START = SPECSTR_RESOLUTION_END + 1,
SPECSTR_SCREENSHOT_END = SPECSTR_SCREENSHOT_START + 0x1F,
}; };
#endif /* STRINGS_TYPE_H */ #endif /* STRINGS_TYPE_H */

@ -23,7 +23,6 @@ enum GameOptionsWidgets {
WID_GO_LANG_DROPDOWN, ///< Language dropdown. WID_GO_LANG_DROPDOWN, ///< Language dropdown.
WID_GO_RESOLUTION_DROPDOWN, ///< Dropdown for the resolution. WID_GO_RESOLUTION_DROPDOWN, ///< Dropdown for the resolution.
WID_GO_FULLSCREEN_BUTTON, ///< Toggle fullscreen. WID_GO_FULLSCREEN_BUTTON, ///< Toggle fullscreen.
WID_GO_SCREENSHOT_DROPDOWN, ///< Select the screenshot type... please use PNG!.
WID_GO_BASE_GRF_DROPDOWN, ///< Use to select a base GRF. WID_GO_BASE_GRF_DROPDOWN, ///< Use to select a base GRF.
WID_GO_BASE_GRF_STATUS, ///< Info about missing files etc. WID_GO_BASE_GRF_STATUS, ///< Info about missing files etc.
WID_GO_BASE_GRF_TEXTFILE, ///< Open base GRF readme, changelog (+1) or license (+2). WID_GO_BASE_GRF_TEXTFILE, ///< Open base GRF readme, changelog (+1) or license (+2).

Loading…
Cancel
Save