Changeset - r21424:c0c1ac184dd1
[Not reviewed]
master
0 9 0
frosch - 10 years ago 2014-04-27 15:13:46
frosch@openttd.org
(svn r26525) -Remove: Screenshot format setting from GUI.
9 files changed with 5 insertions and 77 deletions:
0 comments (0 inline, 0 general)
src/lang/english.txt
Show inline comments
 
@@ -954,9 +954,6 @@ STR_GAME_OPTIONS_RESOLUTION             
 
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}
src/screenshot.cpp
Show inline comments
 
@@ -64,10 +64,8 @@ typedef bool ScreenshotHandlerProc(const
 

	
 
/** 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 *nam
 
/** 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
 
 */
src/screenshot.h
Show inline comments
 
@@ -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 */
src/script/api/game/game_window.hpp.sq
Show inline comments
 
@@ -991,7 +991,6 @@ void SQGSWindow_Register(Squirrel *engin
 
	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");
src/script/api/script_window.hpp
Show inline comments
 
@@ -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).
src/settings_gui.cpp
Show inline comments
 
@@ -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_op
 
	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_op
 
				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(),
src/strings.cpp
Show inline comments
 
@@ -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 *
 
		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();
 
}
 

	
src/strings_type.h
Show inline comments
 
@@ -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 */
src/widgets/settings_widget.h
Show inline comments
 
@@ -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).
0 comments (0 inline, 0 general)