Changeset - r15265:520036c6c104
[Not reviewed]
master
0 2 0
alberth - 14 years ago 2010-05-30 13:16:51
alberth@openttd.org
(svn r19910) -Doc: Doxygen additions.
2 files changed with 22 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/settings.cpp
Show inline comments
 
@@ -1455,62 +1455,82 @@ void SaveToConfig()
 
	ini->RemoveGroup("gameopt");
 

	
 
	HandleSettingDescs(ini, IniSaveSettings, IniSaveSettingList);
 
	GRFSaveConfig(ini, "newgrf", _grfconfig_newgame);
 
	GRFSaveConfig(ini, "newgrf-static", _grfconfig_static);
 
	NewsDisplaySaveConfig(ini, "news_display");
 
	AISaveConfig(ini, "ai_players");
 
	SaveVersionInConfig(ini);
 
	ini->SaveToDisk(_config_file);
 
	delete ini;
 
}
 

	
 
/**
 
 * Get the list of known NewGrf presets.
 
 * @param list[inout] Pointer to list for storing the preset names.
 
 */
 
void GetGRFPresetList(GRFPresetList *list)
 
{
 
	list->Clear();
 

	
 
	IniFile *ini = IniLoadConfig();
 
	IniGroup *group;
 
	for (group = ini->group; group != NULL; group = group->next) {
 
		if (strncmp(group->name, "preset-", 7) == 0) {
 
			*list->Append() = strdup(group->name + 7);
 
		}
 
	}
 

	
 
	delete ini;
 
}
 

	
 
/**
 
 * Load a NewGRF configuration by preset-name.
 
 * @param config_name Name of the preset.
 
 * @return NewGRF configuration.
 
 * @see GetGRFPresetList
 
 */
 
GRFConfig *LoadGRFPresetFromConfig(const char *config_name)
 
{
 
	char *section = (char*)alloca(strlen(config_name) + 8);
 
	sprintf(section, "preset-%s", config_name);
 

	
 
	IniFile *ini = IniLoadConfig();
 
	GRFConfig *config = GRFLoadConfig(ini, section, false);
 
	delete ini;
 

	
 
	return config;
 
}
 

	
 
/**
 
 * Save a NewGRF configuration with a preset name.
 
 * @param config_name Name of the preset.
 
 * @param config      NewGRF configuration to save.
 
 * @see GetGRFPresetList
 
 */
 
void SaveGRFPresetToConfig(const char *config_name, GRFConfig *config)
 
{
 
	char *section = (char*)alloca(strlen(config_name) + 8);
 
	sprintf(section, "preset-%s", config_name);
 

	
 
	IniFile *ini = IniLoadConfig();
 
	GRFSaveConfig(ini, section, config);
 
	ini->SaveToDisk(_config_file);
 
	delete ini;
 
}
 

	
 
/**
 
 * Delete a NewGRF configuration by preset name.
 
 * @param config_name Name of the preset.
 
 */
 
void DeleteGRFPresetFromConfig(const char *config_name)
 
{
 
	char *section = (char*)alloca(strlen(config_name) + 8);
 
	sprintf(section, "preset-%s", config_name);
 

	
 
	IniFile *ini = IniLoadConfig();
 
	ini->RemoveGroup(section);
 
	ini->SaveToDisk(_config_file);
 
	delete ini;
 
}
 

	
 
static const SettingDesc *GetSettingDescription(uint index)
src/window.cpp
Show inline comments
 
@@ -47,26 +47,26 @@ Window *_z_back_window  = NULL;
 
 * Window that currently has focus. - The main purpose is to generate
 
 * FocusLost events, not to give next window in z-order focus when a
 
 * window is closed.
 
 */
 
Window *_focused_window;
 

	
 
Point _cursorpos_drag_start;
 

	
 
int _scrollbar_start_pos;
 
int _scrollbar_size;
 
byte _scroller_click_timeout;
 

	
 
bool _scrolling_scrollbar;
 
bool _scrolling_viewport;
 
bool _scrolling_scrollbar; ///< A scrollbar is being scrolled with the mouse.
 
bool _scrolling_viewport;  ///< A viewport is being scrolled with the mouse.
 

	
 
SpecialMouseMode _special_mouse_mode; ///< Mode of the mouse.
 

	
 
/** Window description constructor. */
 
WindowDesc::WindowDesc(WindowPosition def_pos, int16 def_width, int16 def_height,
 
			WindowClass window_class, WindowClass parent_class, uint32 flags,
 
			const NWidgetPart *nwid_parts, int16 nwid_length) :
 
	default_pos(def_pos),
 
	default_width(def_width),
 
	default_height(def_height),
 
	cls(window_class),
 
	parent_cls(parent_class),
0 comments (0 inline, 0 general)