From 534881ab3184952023d05c6aa739bc7fcf8da82a Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Thu, 14 Jun 2018 19:43:19 +0200 Subject: [PATCH] removed preprocessor definition for network mode that is always true now --- src/events.c | 2 -- src/game.c | 14 -------------- src/init.c | 2 -- src/libgame/platform.h | 8 -------- src/netserv.c | 10 ++-------- src/network.c | 9 +-------- src/tools.c | 8 -------- 7 files changed, 3 insertions(+), 50 deletions(-) diff --git a/src/events.c b/src/events.c index 7972d1b5..12477eea 100644 --- a/src/events.c +++ b/src/events.c @@ -2222,10 +2222,8 @@ void HandleEventActions() HandleJoystick(); } -#if defined(NETWORK_AVALIABLE) if (network.enabled) HandleNetworking(); -#endif switch (game_status) { diff --git a/src/game.c b/src/game.c index efb18c36..13634a2c 100644 --- a/src/game.c +++ b/src/game.c @@ -3503,11 +3503,9 @@ void InitGame() network_player_action_received = FALSE; -#if defined(NETWORK_AVALIABLE) /* initial null action */ if (network_playing) SendToServer_MovePlayer(MV_NONE); -#endif ZX = ZY = -1; ExitX = ExitY = -1; @@ -11290,14 +11288,12 @@ void StartGameActions(boolean init_network_game, boolean record_tape, if (record_tape) TapeStartRecording(new_random_seed); -#if defined(NETWORK_AVALIABLE) if (init_network_game) { SendToServer_StartPlaying(); return; } -#endif InitGame(); } @@ -11420,10 +11416,8 @@ void GameActionsExt() { /* try to get network player actions in time */ -#if defined(NETWORK_AVALIABLE) /* last chance to get network player actions without main loop delay */ HandleNetworking(); -#endif /* game was quit by network peer */ if (game_status != GAME_MODE_PLAYING) @@ -11469,10 +11463,8 @@ void GameActionsExt() stored_player[i].effective_action = stored_player[i].action; } -#if defined(NETWORK_AVALIABLE) if (network_playing) SendToServer_MovePlayer(summarized_player_action); -#endif // summarize all actions at local players mapped input device position // (this allows using different input devices in single player mode) @@ -14967,11 +14959,9 @@ void RequestQuitGameExt(boolean skip_request, boolean quick_quit, char *message) if (!skip_request) CloseDoor(DOOR_CLOSE_1); -#if defined(NETWORK_AVALIABLE) if (network.enabled) SendToServer_StopPlaying(NETWORK_STOP_BY_PLAYER); else -#endif { if (quick_quit) FadeSkipNextFadeIn(); @@ -15779,12 +15769,10 @@ static void HandleGameButtonsExt(int id, int button) case GAME_CTRL_ID_PANEL_PAUSE: if (network.enabled && game_status == GAME_MODE_PLAYING) { -#if defined(NETWORK_AVALIABLE) if (tape.pausing) SendToServer_ContinuePlaying(); else SendToServer_PausePlaying(); -#endif } else TapeTogglePause(TAPE_TOGGLE_MANUAL); @@ -15801,11 +15789,9 @@ static void HandleGameButtonsExt(int id, int button) } else if (tape.pausing) { -#if defined(NETWORK_AVALIABLE) if (network.enabled) SendToServer_ContinuePlaying(); else -#endif TapeTogglePause(TAPE_TOGGLE_MANUAL | TAPE_TOGGLE_PLAY_PAUSE); } break; diff --git a/src/init.c b/src/init.c index 8dec0277..ffb82594 100644 --- a/src/init.c +++ b/src/init.c @@ -5619,14 +5619,12 @@ void InitNetworkServer() if (!network.enabled) return; -#if defined(NETWORK_AVALIABLE) if (!ConnectToServer(network.server_host, network.server_port)) Error(ERR_EXIT, "cannot connect to network game server"); SendToServer_PlayerName(setup.player_name); SendToServer_ProtocolVersion(); SendToServer_NrWanted(setup.network_player_nr + 1); -#endif } static boolean CheckArtworkConfigForCustomElements(char *filename) diff --git a/src/libgame/platform.h b/src/libgame/platform.h index 2fe3be79..6587f9e3 100644 --- a/src/libgame/platform.h +++ b/src/libgame/platform.h @@ -165,12 +165,4 @@ #endif -/* ========================================================================= */ -/* this should better go into "system.h" or "features.h" (yet to be created) */ -/* ========================================================================= */ - -#if defined(PLATFORM_UNIX) || defined(TARGET_SDL) -#define NETWORK_AVALIABLE -#endif - #endif /* PLATFORM_H */ diff --git a/src/netserv.c b/src/netserv.c index 02a014fd..4fd84610 100644 --- a/src/netserv.c +++ b/src/netserv.c @@ -9,20 +9,16 @@ // netserv.c // ============================================================================ -#include "libgame/platform.h" - -#if defined(NETWORK_AVALIABLE) - #include #include #include #include -#include "main.h" - #include "libgame/libgame.h" #include "netserv.h" +#include "main.h" + static int clients = 0; static int onceonly = 0; @@ -657,5 +653,3 @@ void NetworkServer(int port, int serveronly) } } } - -#endif /* NETWORK_AVALIABLE */ diff --git a/src/network.c b/src/network.c index 742cea57..2bc8f5c4 100644 --- a/src/network.c +++ b/src/network.c @@ -9,19 +9,14 @@ // network.c // ============================================================================ -#include "libgame/platform.h" - -#if defined(NETWORK_AVALIABLE) - #include #include -#include "main.h" - #include "libgame/libgame.h" #include "network.h" #include "netserv.h" +#include "main.h" #include "game.h" #include "tape.h" #include "files.h" @@ -697,5 +692,3 @@ void HandleNetworking() } while (r > 0); } - -#endif /* NETWORK_AVALIABLE */ diff --git a/src/tools.c b/src/tools.c index 7e80c6f8..aac531f0 100644 --- a/src/tools.c +++ b/src/tools.c @@ -4392,13 +4392,11 @@ static boolean RequestDoor(char *text, unsigned int req_state) SetMouseCursor(CURSOR_DEFAULT); -#if defined(NETWORK_AVALIABLE) /* pause network game while waiting for request to answer */ if (network.enabled && game_status == GAME_MODE_PLAYING && req_state & REQUEST_WAIT_FOR_INPUT) SendToServer_PausePlaying(); -#endif old_door_state = GetDoorState(); @@ -4534,13 +4532,11 @@ static boolean RequestDoor(char *text, unsigned int req_state) SetDrawBackgroundMask(REDRAW_FIELD); } -#if defined(NETWORK_AVALIABLE) /* continue network game after request */ if (network.enabled && game_status == GAME_MODE_PLAYING && req_state & REQUEST_WAIT_FOR_INPUT) SendToServer_ContinuePlaying(); -#endif /* restore deactivated drawing when quick-loading level tape recording */ if (tape.playing && tape.deactivate_display) @@ -4562,13 +4558,11 @@ static boolean RequestEnvelope(char *text, unsigned int req_state) SetMouseCursor(CURSOR_DEFAULT); -#if defined(NETWORK_AVALIABLE) /* pause network game while waiting for request to answer */ if (network.enabled && game_status == GAME_MODE_PLAYING && req_state & REQUEST_WAIT_FOR_INPUT) SendToServer_PausePlaying(); -#endif /* simulate releasing mouse button over last gadget, if still pressed */ if (button_status) @@ -4621,13 +4615,11 @@ static boolean RequestEnvelope(char *text, unsigned int req_state) SetDrawBackgroundMask(REDRAW_FIELD); } -#if defined(NETWORK_AVALIABLE) /* continue network game after request */ if (network.enabled && game_status == GAME_MODE_PLAYING && req_state & REQUEST_WAIT_FOR_INPUT) SendToServer_ContinuePlaying(); -#endif /* restore deactivated drawing when quick-loading level tape recording */ if (tape.playing && tape.deactivate_display) -- 2.34.1