summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2019-03-20 17:01:13 +0100
committerPatric Stout <truebrain@openttd.org>2019-03-20 19:24:55 +0100
commite3c639a09f1d2251477f69496120d057dd8320a9 (patch)
tree7d66891ae41db811e1edd13647b05092dca54b5a /src/game
parent72c5f2b3eed77120d86ecf636e07c71eb23b4bd5 (diff)
downloadopenttd-e3c639a09f1d2251477f69496120d057dd8320a9.tar.xz
Remove: ENABLE_NETWORK switch
This switch has been a pain for years. Often disabling broke compilation, as no developer compiles OpenTTD without, neither do any of our official binaries. Additionaly, it has grown so hugely in our codebase, that it clearly shows that the current solution was a poor one. 350+ instances of "#ifdef ENABLE_NETWORK" were in the code, of which only ~30 in the networking code itself. The rest were all around the code to do the right thing, from GUI to NewGRF. A more proper solution would be to stub all the functions, and make sure the rest of the code can simply assume network is available. This was also partially done, and most variables were correct if networking was disabled. Despite that, often the #ifdefs were still used. With the recent removal of DOS, there is also no platform anymore which we support where networking isn't working out-of-the-box. All in all, it is time to remove the ENABLE_NETWORK switch. No replacement is planned, but if you feel we really need this option, we welcome any Pull Request which implements this in a way that doesn't crawl through the code like this diff shows we used to.
Diffstat (limited to 'src/game')
-rw-r--r--src/game/game.hpp2
-rw-r--r--src/game/game_core.cpp4
2 files changed, 0 insertions, 6 deletions
diff --git a/src/game/game.hpp b/src/game/game.hpp
index 329ba5e50..95d9aa0a1 100644
--- a/src/game/game.hpp
+++ b/src/game/game.hpp
@@ -112,11 +112,9 @@ public:
*/
static class GameInstance *GetInstance() { return Game::instance; }
-#if defined(ENABLE_NETWORK)
/** Wrapper function for GameScanner::HasGame */
static bool HasGame(const struct ContentInfo *ci, bool md5sum);
static bool HasGameLibrary(const ContentInfo *ci, bool md5sum);
-#endif
/** Gets the ScriptScanner instance that is used to find Game scripts */
static GameScannerInfo *GetScannerInfo();
/** Gets the ScriptScanner instance that is used to find Game Libraries */
diff --git a/src/game/game_core.cpp b/src/game/game_core.cpp
index 10b079bee..7b05abb40 100644
--- a/src/game/game_core.cpp
+++ b/src/game/game_core.cpp
@@ -257,8 +257,6 @@
return Game::scanner_library->FindLibrary(library, version);
}
-#if defined(ENABLE_NETWORK)
-
/**
* Check whether we have an Game (library) with the exact characteristics as ci.
* @param ci the characteristics to search on (shortname and md5sum)
@@ -275,8 +273,6 @@
return Game::scanner_library->HasScript(ci, md5sum);
}
-#endif /* defined(ENABLE_NETWORK) */
-
/* static */ GameScannerInfo *Game::GetScannerInfo()
{
return Game::scanner_info;