openttd.c
branch0.5
changeset 5429 a1f3d6573141
parent 5428 ef4e98d1a511
child 5442 427c81cfd6f6
equal deleted inserted replaced
5428:ef4e98d1a511 5429:a1f3d6573141
   139 	p = strecpy(p,
   139 	p = strecpy(p,
   140 		"\n"
   140 		"\n"
   141 		"\n"
   141 		"\n"
   142 		"Command line options:\n"
   142 		"Command line options:\n"
   143 		"  -v drv              = Set video driver (see below)\n"
   143 		"  -v drv              = Set video driver (see below)\n"
   144 		"  -s drv              = Set sound driver (see below)\n"
   144 		"  -s drv              = Set sound driver (see below) (param bufsize,hz)\n"
   145 		"  -m drv              = Set music driver (see below)\n"
   145 		"  -m drv              = Set music driver (see below)\n"
   146 		"  -r res              = Set resolution (for instance 800x600)\n"
   146 		"  -r res              = Set resolution (for instance 800x600)\n"
   147 		"  -h                  = Display this help text\n"
   147 		"  -h                  = Display this help text\n"
   148 		"  -t year             = Set starting year\n"
   148 		"  -t year             = Set starting year\n"
   149 		"  -d [[fac=]lvl[,...]]= Debug mode\n"
   149 		"  -d [[fac=]lvl[,...]]= Debug mode\n"
   324 int ttd_main(int argc, char *argv[])
   324 int ttd_main(int argc, char *argv[])
   325 {
   325 {
   326 	MyGetOptData mgo;
   326 	MyGetOptData mgo;
   327 	int i;
   327 	int i;
   328 	const char *optformat;
   328 	const char *optformat;
   329 	char musicdriver[16], sounddriver[16], videodriver[16];
   329 	char musicdriver[32], sounddriver[32], videodriver[32];
   330 	int resolution[2] = {0,0};
   330 	int resolution[2] = {0,0};
   331 	Year startyear = INVALID_YEAR;
   331 	Year startyear = INVALID_YEAR;
   332 	uint generation_seed = GENERATE_NEW_SEED;
   332 	uint generation_seed = GENERATE_NEW_SEED;
   333 	bool dedicated = false;
   333 	bool dedicated = false;
   334 	bool network   = false;
   334 	bool network   = false;
   335 	char *network_conn = NULL;
   335 	char *network_conn = NULL;
   336 
   336 
   337 	musicdriver[0] = sounddriver[0] = videodriver[0] = 0;
   337 	musicdriver[0] = sounddriver[0] = videodriver[0] = '\0';
   338 
   338 
   339 	_game_mode = GM_MENU;
   339 	_game_mode = GM_MENU;
   340 	_switch_mode = SM_MENU;
   340 	_switch_mode = SM_MENU;
   341 	_switch_mode_errorstr = INVALID_STRING_ID;
   341 	_switch_mode_errorstr = INVALID_STRING_ID;
   342 	_dedicated_forks = false;
   342 	_dedicated_forks = false;
   408 	LoadFromConfig();
   408 	LoadFromConfig();
   409 	CheckConfig();
   409 	CheckConfig();
   410 	LoadFromHighScore();
   410 	LoadFromHighScore();
   411 
   411 
   412 	// override config?
   412 	// override config?
   413 	if (musicdriver[0]) ttd_strlcpy(_ini_musicdriver, musicdriver, sizeof(_ini_musicdriver));
   413 	if (musicdriver[0] != '\0') ttd_strlcpy(_ini_musicdriver, musicdriver, sizeof(_ini_musicdriver));
   414 	if (sounddriver[0]) ttd_strlcpy(_ini_sounddriver, sounddriver, sizeof(_ini_sounddriver));
   414 	if (sounddriver[0] != '\0') ttd_strlcpy(_ini_sounddriver, sounddriver, sizeof(_ini_sounddriver));
   415 	if (videodriver[0]) ttd_strlcpy(_ini_videodriver, videodriver, sizeof(_ini_videodriver));
   415 	if (videodriver[0] != '\0') ttd_strlcpy(_ini_videodriver, videodriver, sizeof(_ini_videodriver));
   416 	if (resolution[0]) { _cur_resolution[0] = resolution[0]; _cur_resolution[1] = resolution[1]; }
   416 	if (resolution[0] != 0) { _cur_resolution[0] = resolution[0]; _cur_resolution[1] = resolution[1]; }
   417 	if (startyear != INVALID_YEAR) _patches_newgame.starting_year = startyear;
   417 	if (startyear != INVALID_YEAR) _patches_newgame.starting_year = startyear;
   418 	if (generation_seed != GENERATE_NEW_SEED) _patches_newgame.generation_seed = generation_seed;
   418 	if (generation_seed != GENERATE_NEW_SEED) _patches_newgame.generation_seed = generation_seed;
   419 
   419 
   420 	if (_dedicated_forks && !dedicated) _dedicated_forks = false;
   420 	if (_dedicated_forks && !dedicated) _dedicated_forks = false;
   421 
   421