mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-01-21 22:53:19 +00:00
(svn r2710) Simplify dedicated server code a bit and don't compile it at all, if network support ist disabled
This commit is contained in:
parent
f60b122a68
commit
84f78ea44a
21
dedicated.c
21
dedicated.c
@ -1,32 +1,17 @@
|
|||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "openttd.h"
|
|
||||||
|
|
||||||
#ifdef ENABLE_NETWORK
|
#ifdef ENABLE_NETWORK
|
||||||
|
|
||||||
|
#if defined(UNIX) && !defined(__MORPHOS__)
|
||||||
|
|
||||||
|
#include "openttd.h"
|
||||||
#include "variables.h"
|
#include "variables.h"
|
||||||
|
|
||||||
#ifdef __OS2__
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef UNIX
|
|
||||||
# include <sys/types.h>
|
|
||||||
# include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __MORPHOS__
|
|
||||||
/* Voids the fork, option will be disabled for MorphOS build anyway, because
|
|
||||||
* MorphOS doesn't support forking (could only implemented with lots of code
|
|
||||||
* changes here). */
|
|
||||||
int fork(void) { return -1; }
|
|
||||||
int dup2(int oldd, int newd) { return -1; }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef UNIX
|
|
||||||
/* We want to fork our dedicated server */
|
|
||||||
void DedicatedFork(void)
|
void DedicatedFork(void)
|
||||||
{
|
{
|
||||||
/* Fork the program */
|
/* Fork the program */
|
||||||
|
2
os2.c
2
os2.c
@ -437,7 +437,9 @@ const DriverDesc _video_driver_descs[] = {
|
|||||||
#if defined(WITH_SDL)
|
#if defined(WITH_SDL)
|
||||||
{ "sdl", "SDL Video Driver", &_sdl_video_driver, 1},
|
{ "sdl", "SDL Video Driver", &_sdl_video_driver, 1},
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef ENABLE_NETWORK
|
||||||
{ "dedicated", "Dedicated Video Driver", &_dedicated_video_driver, 0},
|
{ "dedicated", "Dedicated Video Driver", &_dedicated_video_driver, 0},
|
||||||
|
#endif
|
||||||
{ NULL, NULL, NULL, 0}
|
{ NULL, NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
2
unix.c
2
unix.c
@ -378,7 +378,9 @@ const DriverDesc _video_driver_descs[] = {
|
|||||||
#if defined(WITH_SDL)
|
#if defined(WITH_SDL)
|
||||||
{ "sdl", "SDL Video Driver", &_sdl_video_driver, 1},
|
{ "sdl", "SDL Video Driver", &_sdl_video_driver, 1},
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef ENABLE_NETWORK
|
||||||
{ "dedicated", "Dedicated Video Driver", &_dedicated_video_driver, 0},
|
{ "dedicated", "Dedicated Video Driver", &_dedicated_video_driver, 0},
|
||||||
|
#endif
|
||||||
{ NULL, NULL, NULL, 0}
|
{ NULL, NULL, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
#include "../stdafx.h"
|
#include "../stdafx.h"
|
||||||
#include "../openttd.h"
|
|
||||||
#include "dedicated_v.h"
|
|
||||||
|
|
||||||
#ifdef ENABLE_NETWORK
|
#ifdef ENABLE_NETWORK
|
||||||
|
|
||||||
|
#include "../openttd.h"
|
||||||
#include "../debug.h"
|
#include "../debug.h"
|
||||||
#include "../functions.h"
|
#include "../functions.h"
|
||||||
#include "../gfx.h"
|
#include "../gfx.h"
|
||||||
@ -14,6 +13,7 @@
|
|||||||
#include "../command.h"
|
#include "../command.h"
|
||||||
#include "../console.h"
|
#include "../console.h"
|
||||||
#include "../variables.h"
|
#include "../variables.h"
|
||||||
|
#include "dedicated_v.h"
|
||||||
|
|
||||||
#ifdef __OS2__
|
#ifdef __OS2__
|
||||||
# include <sys/time.h> /* gettimeofday */
|
# include <sys/time.h> /* gettimeofday */
|
||||||
@ -281,23 +281,6 @@ static int DedicatedVideoMainLoop(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
static const char *DedicatedVideoStart(const char * const *parm)
|
|
||||||
{
|
|
||||||
DEBUG(misc, 0) ("OpenTTD compiled without network support, exiting.");
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void DedicatedVideoStop(void) {}
|
|
||||||
static void DedicatedVideoMakeDirty(int left, int top, int width, int height) {}
|
|
||||||
static bool DedicatedVideoChangeRes(int w, int h) { return false; }
|
|
||||||
static void DedicatedVideoFullScreen(bool fs) {}
|
|
||||||
static int DedicatedVideoMainLoop(void) { return ML_QUIT; }
|
|
||||||
|
|
||||||
#endif /* ENABLE_NETWORK */
|
|
||||||
|
|
||||||
const HalVideoDriver _dedicated_video_driver = {
|
const HalVideoDriver _dedicated_video_driver = {
|
||||||
DedicatedVideoStart,
|
DedicatedVideoStart,
|
||||||
DedicatedVideoStop,
|
DedicatedVideoStop,
|
||||||
@ -306,3 +289,5 @@ const HalVideoDriver _dedicated_video_driver = {
|
|||||||
DedicatedVideoChangeRes,
|
DedicatedVideoChangeRes,
|
||||||
DedicatedVideoFullScreen,
|
DedicatedVideoFullScreen,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif /* ENABLE_NETWORK */
|
||||||
|
2
win32.c
2
win32.c
@ -942,7 +942,9 @@ const DriverDesc _video_driver_descs[] = {
|
|||||||
{"sdl", "SDL Video Driver", &_sdl_video_driver, 1},
|
{"sdl", "SDL Video Driver", &_sdl_video_driver, 1},
|
||||||
#endif
|
#endif
|
||||||
{"win32", "Win32 GDI Video Driver", &_win32_video_driver, Windows_NT3_51},
|
{"win32", "Win32 GDI Video Driver", &_win32_video_driver, Windows_NT3_51},
|
||||||
|
#ifdef ENABLE_NETWORK
|
||||||
{ "dedicated", "Dedicated Video Driver", &_dedicated_video_driver, 0},
|
{ "dedicated", "Dedicated Video Driver", &_dedicated_video_driver, 0},
|
||||||
|
#endif
|
||||||
{ NULL, NULL, NULL, 0 }
|
{ NULL, NULL, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user