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
 
@@ -1461,12 +1461,16 @@ void SaveToConfig()
 
	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;
 
@@ -1476,35 +1480,51 @@ void GetGRFPresetList(GRFPresetList *lis
 
		}
 
	}
 

	
 
	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();
src/window.cpp
Show inline comments
 
@@ -53,14 +53,14 @@ 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,
0 comments (0 inline, 0 general)