summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2014-04-27 15:13:46 +0000
committerfrosch <frosch@openttd.org>2014-04-27 15:13:46 +0000
commitebd2d3ccef7babead511b133d78654ea2ca38343 (patch)
tree3ddb28b9e1aecc0f048679e0d55f2a25349f29cd
parent08660e6ea6c2741e92dd92095be6b233910f4eb7 (diff)
downloadopenttd-ebd2d3ccef7babead511b133d78654ea2ca38343.tar.xz
(svn r26525) -Remove: Screenshot format setting from GUI.
-rw-r--r--src/lang/english.txt3
-rw-r--r--src/screenshot.cpp39
-rw-r--r--src/screenshot.h3
-rw-r--r--src/script/api/game/game_window.hpp.sq1
-rw-r--r--src/script/api/script_window.hpp1
-rw-r--r--src/settings_gui.cpp23
-rw-r--r--src/strings.cpp7
-rw-r--r--src/strings_type.h4
-rw-r--r--src/widgets/settings_widget.h1
9 files changed, 5 insertions, 77 deletions
diff --git a/src/lang/english.txt b/src/lang/english.txt
index 84a9b800d..8848710d1 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -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_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_TOOLTIP :{BLACK}Select the base graphics set to use
STR_GAME_OPTIONS_BASE_GRF_STATUS :{RED}{NUM} missing/corrupted file{P "" s}
diff --git a/src/screenshot.cpp b/src/screenshot.cpp
index 6882e0905..4921378f8 100644
--- a/src/screenshot.cpp
+++ b/src/screenshot.cpp
@@ -64,10 +64,8 @@ typedef bool ScreenshotHandlerProc(const char *name, ScreenshotCallback *callb,
/** Screenshot format information. */
struct ScreenshotFormat {
- const char *name; ///< Name of the format.
const char *extension; ///< File extension.
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. */
static const ScreenshotFormat _screenshot_formats[] = {
#if defined(WITH_PNG)
- {"PNG", "png", &MakePNGImage, true},
+ {"png", &MakePNGImage},
#endif
- {"BMP", "bmp", &MakeBMPImage, true},
- {"PCX", "pcx", &MakePCXImage, false},
+ {"bmp", &MakeBMPImage},
+ {"pcx", &MakePCXImage},
};
/** Get filename extension of current screenshot file format. */
@@ -600,37 +598,6 @@ void InitializeScreenshotFormats()
}
/**
- * 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.
* @see ScreenshotCallback
*/
diff --git a/src/screenshot.h b/src/screenshot.h
index 7456a09de..ee03d8aff 100644
--- a/src/screenshot.h
+++ b/src/screenshot.h
@@ -14,9 +14,6 @@
void InitializeScreenshotFormats();
-const char *GetScreenshotFormatDesc(int i);
-bool GetScreenshotFormatSupports_32bpp(int i);
-void SetScreenshotFormat(uint i);
const char *GetCurrentScreenshotExtension();
/** Type of requested screenshot */
diff --git a/src/script/api/game/game_window.hpp.sq b/src/script/api/game/game_window.hpp.sq
index 0439a3a97..32ad862a7 100644
--- a/src/script/api/game/game_window.hpp.sq
+++ b/src/script/api/game/game_window.hpp.sq
@@ -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_RESOLUTION_DROPDOWN, "WID_GO_RESOLUTION_DROPDOWN");
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_STATUS, "WID_GO_BASE_GRF_STATUS");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_GO_BASE_GRF_TEXTFILE, "WID_GO_BASE_GRF_TEXTFILE");
diff --git a/src/script/api/script_window.hpp b/src/script/api/script_window.hpp
index d7f3879af..f58ea0229 100644
--- a/src/script/api/script_window.hpp
+++ b/src/script/api/script_window.hpp
@@ -2104,7 +2104,6 @@ public:
WID_GO_LANG_DROPDOWN = ::WID_GO_LANG_DROPDOWN, ///< Language dropdown.
WID_GO_RESOLUTION_DROPDOWN = ::WID_GO_RESOLUTION_DROPDOWN, ///< Dropdown for the resolution.
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_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).
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index fc3360a59..5d4a659f9 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -15,7 +15,6 @@
#include "settings_gui.h"
#include "textbuf_gui.h"
#include "command_func.h"
-#include "screenshot.h"
#include "network/network.h"
#include "town.h"
#include "settings_internal.h"
@@ -274,15 +273,6 @@ struct GameOptionsWindow : Window {
}
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:
list = BuiltSetDropDownList<BaseGraphics>(selected_index);
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_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_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_STATUS: SetDParam(0, BaseGraphics::GetUsedSet()->GetNumInvalid()); break;
case WID_GO_BASE_SFX_DROPDOWN: SetDParamStr(0, BaseSounds::GetUsedSet()->name); break;
@@ -512,11 +501,6 @@ struct GameOptionsWindow : Window {
}
break;
- case WID_GO_SCREENSHOT_DROPDOWN: // Change screenshot format
- SetScreenshotFormat(index);
- this->SetDirty();
- break;
-
case WID_GO_BASE_GRF_DROPDOWN:
this->SetMediaSet<BaseGraphics>(index);
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(NWID_HORIZONTAL), SetPIP(10, 10, 10),
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_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(),
@@ -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_DROPDOWN, COLOUR_GREY, WID_GO_LANG_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_RAW_STRING, STR_GAME_OPTIONS_LANGUAGE_TOOLTIP), SetFill(1, 0),
EndContainer(),
- NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_SCREENSHOT_FORMAT, 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_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(NWID_SPACER), SetMinimalSize(0, 0), SetFill(0, 1),
EndContainer(),
diff --git a/src/strings.cpp b/src/strings.cpp
index e69c6cf1c..fb74a3f23 100644
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -13,7 +13,6 @@
#include "currency.h"
#include "station_base.h"
#include "town.h"
-#include "screenshot.h"
#include "waypoint_base.h"
#include "depot_base.h"
#include "industry.h"
@@ -1682,12 +1681,6 @@ static char *GetSpecialNameString(char *buff, int ind, StringParameters *args, c
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();
}
diff --git a/src/strings_type.h b/src/strings_type.h
index 35f22e5fc..c6eebd54d 100644
--- a/src/strings_type.h
+++ b/src/strings_type.h
@@ -69,10 +69,6 @@ enum SpecialStrings {
/* reserve 32 strings for various screen resolutions */
SPECSTR_RESOLUTION_START = SPECSTR_LANGUAGE_END + 1,
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 */
diff --git a/src/widgets/settings_widget.h b/src/widgets/settings_widget.h
index 6f045a2a2..a9015b1ee 100644
--- a/src/widgets/settings_widget.h
+++ b/src/widgets/settings_widget.h
@@ -23,7 +23,6 @@ enum GameOptionsWidgets {
WID_GO_LANG_DROPDOWN, ///< Language dropdown.
WID_GO_RESOLUTION_DROPDOWN, ///< Dropdown for the resolution.
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_STATUS, ///< Info about missing files etc.
WID_GO_BASE_GRF_TEXTFILE, ///< Open base GRF readme, changelog (+1) or license (+2).