Skip to content

Commit

Permalink
Dedicated mode is determined by build config
Browse files Browse the repository at this point in the history
Removed the command line option '-dedicated', as the build config now
determines whether we are running a server or not.
  • Loading branch information
skyjake committed Dec 21, 2012
1 parent e0f6972 commit fdb514d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
11 changes: 10 additions & 1 deletion doomsday/engine/src/dd_init.cpp
Expand Up @@ -122,10 +122,15 @@ int main(int argc, char** argv)
bool useGUI = true;
#endif

#ifdef __SERVER__
// The server is always running in the background without a UI.
useGUI = false;
#endif

// Are we running in novideo mode?
for(int i = 1; i < argc; ++i)
{
if(!stricmp(argv[i], "-novideo") || !stricmp(argv[i], "-dedicated"))
if(!stricmp(argv[i], "-novideo"))
{
// Console mode.
useGUI = false;
Expand Down Expand Up @@ -155,6 +160,7 @@ int main(int argc, char** argv)
de2LegacyCore = LegacyCore_New(&dengApp);
LegacyCore_SetTerminateFunc(handleLegacyCoreTerminate);

#ifdef __CLIENT__
if(useGUI)
{
// Config needs DisplayMode, so let's initialize it before the configuration.
Expand All @@ -165,11 +171,13 @@ int main(int argc, char** argv)
* this is handled automatically.
*/
}
#endif

dengApp.initSubsystems();

Libdeng_Init();

#ifdef __CLIENT__
if(useGUI)
{
// Check for updates automatically.
Expand All @@ -184,6 +192,7 @@ int main(int argc, char** argv)
checkForUpdates->setMenuRole(QAction::ApplicationSpecificRole);
#endif
}
#endif

// Initialize.
#if WIN32
Expand Down
6 changes: 6 additions & 0 deletions doomsday/engine/src/dd_main.cpp
Expand Up @@ -1634,6 +1634,12 @@ int DD_EarlyInit(void)
// Determine the requested degree of verbosity.
verbose = CommandLine_Exists("-verbose");

#ifdef __SERVER__
isDedicated = true;
#else
isDedicated = false;
#endif

// Bring the console online as soon as we can.
DD_ConsoleInit();

Expand Down
4 changes: 0 additions & 4 deletions doomsday/engine/src/unix/dd_uinit.c
Expand Up @@ -172,10 +172,6 @@ boolean DD_Unix_Init(void)

DD_InitCommandLine();

// First order of business: are we running in dedicated mode?
isDedicated = CommandLine_Check("-dedicated");
novideo = CommandLine_Check("-novideo") || isDedicated;

Library_Init();

// Determine our basedir and other global paths.
Expand Down
6 changes: 2 additions & 4 deletions doomsday/engine/src/windows/dd_winit.c
Expand Up @@ -255,10 +255,6 @@ boolean DD_Win32_Init(void)
// Prepare the command line arguments.
DD_InitCommandLine();

// First order of business: are we running in dedicated mode?
isDedicated = CommandLine_Check("-dedicated");
novideo = CommandLine_Check("-novideo") || isDedicated;

Library_Init();

// Determine our basedir and other global paths.
Expand All @@ -279,13 +275,15 @@ boolean DD_Win32_Init(void)

Plug_LoadAll();

#ifdef __CLIENT__
// No Windows system keys?
if(CommandLine_Check("-nowsk"))
{
// Disable Alt-Tab, Alt-Esc, Ctrl-Alt-Del. A bit of a hack...
SystemParametersInfo(SPI_SETSCREENSAVERRUNNING, TRUE, 0, 0);
Con_Message("Windows system keys disabled.\n");
}
#endif

return !failed;
}
Expand Down

0 comments on commit fdb514d

Please sign in to comment.