mirror of https://github.com/OpenTTD/OpenTTD
(svn r1910) Move two variables out of variables.h which are only used locally
parent
50ac80cb4c
commit
f55bde6ee4
|
@ -49,8 +49,8 @@ static void *_dedicated_video_mem;
|
||||||
void DedicatedFork(void)
|
void DedicatedFork(void)
|
||||||
{
|
{
|
||||||
/* Fork the program */
|
/* Fork the program */
|
||||||
_dedicated_pid = fork();
|
pid_t pid = fork();
|
||||||
switch (_dedicated_pid) {
|
switch (pid) {
|
||||||
case -1:
|
case -1:
|
||||||
perror("Unable to fork");
|
perror("Unable to fork");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -76,7 +76,7 @@ void DedicatedFork(void)
|
||||||
default:
|
default:
|
||||||
// We're the parent
|
// We're the parent
|
||||||
printf("Loading dedicated server...\n");
|
printf("Loading dedicated server...\n");
|
||||||
printf(" - Forked to background with pid %d\n", _dedicated_pid);
|
printf(" - Forked to background with pid %d\n", pid);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
8
ttd.c
8
ttd.c
|
@ -491,13 +491,15 @@ int ttd_main(int argc, char* argv[])
|
||||||
char musicdriver[16], sounddriver[16], videodriver[16];
|
char musicdriver[16], sounddriver[16], videodriver[16];
|
||||||
int resolution[2] = {0,0};
|
int resolution[2] = {0,0};
|
||||||
uint startdate = -1;
|
uint startdate = -1;
|
||||||
|
bool dedicated;
|
||||||
|
|
||||||
musicdriver[0] = sounddriver[0] = videodriver[0] = 0;
|
musicdriver[0] = sounddriver[0] = videodriver[0] = 0;
|
||||||
|
|
||||||
_game_mode = GM_MENU;
|
_game_mode = GM_MENU;
|
||||||
_switch_mode = SM_MENU;
|
_switch_mode = SM_MENU;
|
||||||
_switch_mode_errorstr = INVALID_STRING_ID;
|
_switch_mode_errorstr = INVALID_STRING_ID;
|
||||||
_dedicated_forks = false;
|
_dedicated_forks = false;
|
||||||
_dedicated_enabled = false;
|
dedicated = false;
|
||||||
|
|
||||||
// The last param of the following function means this:
|
// The last param of the following function means this:
|
||||||
// a letter means: it accepts that param (e.g.: -h)
|
// a letter means: it accepts that param (e.g.: -h)
|
||||||
|
@ -519,7 +521,7 @@ int ttd_main(int argc, char* argv[])
|
||||||
sprintf(musicdriver,"null");
|
sprintf(musicdriver,"null");
|
||||||
sprintf(sounddriver,"null");
|
sprintf(sounddriver,"null");
|
||||||
sprintf(videodriver,"dedicated");
|
sprintf(videodriver,"dedicated");
|
||||||
_dedicated_enabled = true;
|
dedicated = true;
|
||||||
} break;
|
} break;
|
||||||
case 'f': {
|
case 'f': {
|
||||||
_dedicated_forks = true;
|
_dedicated_forks = true;
|
||||||
|
@ -590,7 +592,7 @@ int ttd_main(int argc, char* argv[])
|
||||||
if (resolution[0]) { _cur_resolution[0] = resolution[0]; _cur_resolution[1] = resolution[1]; }
|
if (resolution[0]) { _cur_resolution[0] = resolution[0]; _cur_resolution[1] = resolution[1]; }
|
||||||
if (startdate != (uint)-1) _patches.starting_date = startdate;
|
if (startdate != (uint)-1) _patches.starting_date = startdate;
|
||||||
|
|
||||||
if (_dedicated_forks && !_dedicated_enabled)
|
if (_dedicated_forks && !dedicated)
|
||||||
_dedicated_forks = false;
|
_dedicated_forks = false;
|
||||||
|
|
||||||
// enumerate language files
|
// enumerate language files
|
||||||
|
|
|
@ -449,9 +449,5 @@ VARDEF byte _railtype_selected_in_replace_gui;
|
||||||
|
|
||||||
/* Forking stuff */
|
/* Forking stuff */
|
||||||
VARDEF bool _dedicated_forks;
|
VARDEF bool _dedicated_forks;
|
||||||
VARDEF bool _dedicated_enabled;
|
|
||||||
#ifdef UNIX
|
|
||||||
VARDEF pid_t _dedicated_pid;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* VARIABLES_H */
|
#endif /* VARIABLES_H */
|
||||||
|
|
Loading…
Reference in New Issue