Changeset - r15519:60d357105db2
[Not reviewed]
master
0 6 0
rubidium - 14 years ago 2010-07-19 17:11:09
rubidium@openttd.org
(svn r20188) -Codechange: unVARDEF the _[config|log|highscore]_file variables and move them to a more logical location
6 files changed with 9 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/dedicated.cpp
Show inline comments
 
@@ -2,24 +2,26 @@
 

	
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file dedicated.cpp Forking support for dedicated servers. */
 

	
 
#include "stdafx.h"
 

	
 
char *_log_file; ///< File to reroute output of a forked OpenTTD to
 

	
 
#ifdef ENABLE_NETWORK
 

	
 
#if defined(UNIX) && !defined(__MORPHOS__)
 

	
 
#include "variables.h"
 

	
 
#include <unistd.h>
 

	
 
#if (defined(SUNOS) && !defined(_LP64) && !defined(_I32LPx)) || defined(__HAIKU__)
 
/* Solaris has, in certain situation, pid_t defined as long, while in other
 
 *  cases it has it defined as int... this handles all cases nicely.
 
 * Haiku has also defined pid_t as a long.
src/fileio.cpp
Show inline comments
 
@@ -47,24 +47,28 @@ struct Fio {
 
	char *shortnames[MAX_FILE_SLOTS];      ///< array of short names for spriteloader's use
 
#if defined(LIMITED_FDS)
 
	uint open_handles;                     ///< current amount of open handles
 
	uint usage_count[MAX_FILE_SLOTS];      ///< count how many times this file has been opened
 
#endif /* LIMITED_FDS */
 
};
 

	
 
static Fio _fio;
 

	
 
/** Whether the working directory should be scanned. */
 
static bool _do_scan_working_directory = true;
 

	
 
extern char *_config_file;
 
extern char *_highscore_file;
 
extern char *_log_file;
 

	
 
/* Get current position in file */
 
size_t FioGetPos()
 
{
 
	return _fio.pos + (_fio.buffer - _fio.buffer_end);
 
}
 

	
 
const char *FioGetFilename(uint8 slot)
 
{
 
	return _fio.shortnames[slot];
 
}
 

	
 
void FioSeekTo(size_t pos, int mode)
src/highscore.cpp
Show inline comments
 
@@ -13,24 +13,25 @@
 
#include "highscore.h"
 
#include "company_base.h"
 
#include "company_func.h"
 
#include "cheat_func.h"
 
#include "string_func.h"
 
#include "strings_func.h"
 
#include "table/strings.h"
 
#include "core/sort_func.hpp"
 
#include "variables.h"
 
#include "debug.h"
 

	
 
HighScore _highscore_table[5][5]; // 4 difficulty-settings (+ network); top 5
 
char *_highscore_file; ///< The file to store the highscore data in.
 

	
 
static const StringID _endgame_perf_titles[] = {
 
	STR_HIGHSCORE_PERFORMANCE_TITLE_BUSINESSMAN,
 
	STR_HIGHSCORE_PERFORMANCE_TITLE_BUSINESSMAN,
 
	STR_HIGHSCORE_PERFORMANCE_TITLE_BUSINESSMAN,
 
	STR_HIGHSCORE_PERFORMANCE_TITLE_BUSINESSMAN,
 
	STR_HIGHSCORE_PERFORMANCE_TITLE_BUSINESSMAN,
 
	STR_HIGHSCORE_PERFORMANCE_TITLE_ENTREPRENEUR,
 
	STR_HIGHSCORE_PERFORMANCE_TITLE_ENTREPRENEUR,
 
	STR_HIGHSCORE_PERFORMANCE_TITLE_INDUSTRIALIST,
 
	STR_HIGHSCORE_PERFORMANCE_TITLE_INDUSTRIALIST,
 
	STR_HIGHSCORE_PERFORMANCE_TITLE_CAPITALIST,
src/openttd.cpp
Show inline comments
 
@@ -82,24 +82,25 @@ StringID _switch_mode_errorstr;
 
void CallLandscapeTick();
 
void IncreaseDate();
 
void DoPaletteAnimations();
 
void MusicLoop();
 
void ResetMusic();
 
void ProcessAsyncSaveFinish();
 
void CallWindowTickEvent();
 

	
 
extern void SetDifficultyLevel(int mode, DifficultySettings *gm_opt);
 
extern Company *DoStartupNewCompany(bool is_ai, CompanyID company = INVALID_COMPANY);
 
extern void ShowOSErrorBox(const char *buf, bool system);
 
extern bool _dedicated_forks;
 
extern char *_config_file;
 

	
 
/**
 
 * Error handling for fatal user errors.
 
 * @param s the string to print.
 
 * @note Does NEVER return.
 
 */
 
void CDECL usererror(const char *s, ...)
 
{
 
	va_list va;
 
	char buf[512];
 

	
 
	va_start(va, s);
src/settings.cpp
Show inline comments
 
@@ -68,24 +68,25 @@
 
#include "fios.h"
 

	
 
#include "void_map.h"
 
#include "station_base.h"
 

	
 
#include "table/strings.h"
 
#include "table/settings.h"
 

	
 
ClientSettings _settings_client;
 
GameSettings _settings_game;
 
GameSettings _settings_newgame;
 
VehicleDefaultSettings _old_vds; ///< Used for loading default vehicles settings from old savegames
 
char *_config_file; ///< Configuration file of OpenTTD
 

	
 
typedef void SettingDescProc(IniFile *ini, const SettingDesc *desc, const char *grpname, void *object);
 
typedef void SettingDescProcList(IniFile *ini, const char *grpname, StringList *list);
 

	
 
static bool IsSignedVarMemType(VarType vt);
 

	
 
/**
 
 * Groups in openttd.cfg that are actually lists.
 
 */
 
static const char * const _list_group_names[] = {
 
	"bans",
 
	"newgrf",
src/variables.h
Show inline comments
 
@@ -15,17 +15,13 @@
 
#ifndef VARDEF
 
#define VARDEF extern
 
#endif
 

	
 
/* Amount of game ticks */
 
VARDEF uint16 _tick_counter;
 

	
 
VARDEF byte _display_opt;
 

	
 
/* IN/OUT parameters to commands */
 
VARDEF bool _generating_world;
 

	
 
VARDEF char *_config_file;
 
VARDEF char *_highscore_file;
 
VARDEF char *_log_file;
 

	
 
#endif /* VARIABLES_H */
0 comments (0 inline, 0 general)