diff options
-rw-r--r-- | Doxyfile | 2 | ||||
-rw-r--r-- | config.lib | 18 | ||||
-rw-r--r-- | projects/openttd_vs100.vcxproj | 8 | ||||
-rw-r--r-- | projects/openttd_vs100.vcxproj.in | 8 | ||||
-rw-r--r-- | projects/openttd_vs80.vcproj | 8 | ||||
-rw-r--r-- | projects/openttd_vs80.vcproj.in | 8 | ||||
-rw-r--r-- | projects/openttd_vs90.vcproj | 8 | ||||
-rw-r--r-- | projects/openttd_vs90.vcproj.in | 8 | ||||
-rw-r--r-- | source.list | 2 | ||||
-rw-r--r-- | src/ai/ai.hpp | 24 | ||||
-rw-r--r-- | src/ai/ai_gui.hpp | 13 | ||||
-rw-r--r-- | src/ai/ai_info.hpp | 3 | ||||
-rw-r--r-- | src/company_cmd.cpp | 4 | ||||
-rw-r--r-- | src/console_cmds.cpp | 4 | ||||
-rw-r--r-- | src/crashlog.cpp | 2 | ||||
-rw-r--r-- | src/lang/english.txt | 3 | ||||
-rw-r--r-- | src/network/network_command.cpp | 4 | ||||
-rw-r--r-- | src/network/network_content.cpp | 2 | ||||
-rw-r--r-- | src/openttd.cpp | 4 | ||||
-rw-r--r-- | src/saveload/ai_sl.cpp | 88 | ||||
-rw-r--r-- | src/screenshot.cpp | 2 | ||||
-rw-r--r-- | src/settings.cpp | 6 | ||||
-rw-r--r-- | src/settings_gui.cpp | 2 |
23 files changed, 33 insertions, 198 deletions
@@ -195,7 +195,7 @@ EXPAND_ONLY_PREDEF = YES SEARCH_INCLUDES = YES INCLUDE_PATH = INCLUDE_FILE_PATTERNS = -PREDEFINED = ENABLE_NETWORK ENABLE_AI WITH_ZLIB WITH_LZO WITH_LZMA WITH_SDL WITH_PNG WITH_FONTCONFIG WITH_FREETYPE WITH_ICU UNICODE _UNICODE _GNU_SOURCE +PREDEFINED = ENABLE_NETWORK WITH_ZLIB WITH_LZO WITH_LZMA WITH_SDL WITH_PNG WITH_FONTCONFIG WITH_FREETYPE WITH_ICU UNICODE _UNICODE _GNU_SOURCE EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- diff --git a/config.lib b/config.lib index 2c7e0ff78..5507b9c73 100644 --- a/config.lib +++ b/config.lib @@ -54,7 +54,6 @@ set_default() { enable_lto="0" enable_dedicated="0" enable_network="1" - enable_ai="1" enable_static="1" enable_translator="0" enable_unicode="1" @@ -128,7 +127,6 @@ set_default() { enable_lto enable_dedicated enable_network - enable_ai enable_static enable_translator enable_unicode @@ -286,9 +284,6 @@ detect_params() { --enable-network) enable_network="2";; --enable-network=*) enable_network="$optarg";; --disable-network) enable_network="0";; - --enable-ai) enable_ai="2";; - --enable-ai=*) enable_ai="$optarg";; - --disable-ai) enable_ai="0";; --disable-static) enable_static="0";; --enable-static) enable_static="2";; --enable-static=*) enable_static="$optarg";; @@ -743,13 +738,8 @@ check_params() { log 1 "checking network... disabled" fi - if [ "$enable_ai" != "0" ]; then - log 1 "checking ai... found" - SCRIPT_SRC_DIR="$ROOT_DIR/src/3rdparty/squirrel/include" - else - log 1 "checking ai... disabled" - SCRIPT_SRC_DIR="" - fi + log 1 "checking squirrel... found" + SCRIPT_SRC_DIR="$ROOT_DIR/src/3rdparty/squirrel/include" if [ "$enable_translator" != "0" ]; then log 1 "checking translator... debug" @@ -1586,9 +1576,7 @@ make_cflags_and_ldflags() { if [ "$cpu_type" = "64" ] && [ "$enable_universal" = "0" ]; then CFLAGS="$CFLAGS -D_SQ64" fi - if [ "$enable_ai" != "0" ]; then - CFLAGS="$CFLAGS -I$SCRIPT_SRC_DIR -DENABLE_AI" - fi + CFLAGS="$CFLAGS -I$SCRIPT_SRC_DIR" if [ -n "$png_config" ]; then CFLAGS="$CFLAGS -DWITH_PNG" diff --git a/projects/openttd_vs100.vcxproj b/projects/openttd_vs100.vcxproj index e2da3e7c8..8f9e0027c 100644 --- a/projects/openttd_vs100.vcxproj +++ b/projects/openttd_vs100.vcxproj @@ -102,7 +102,7 @@ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed> <OmitFramePointers>true</OmitFramePointers> <AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <ExceptionHandling>Sync</ExceptionHandling> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> @@ -156,7 +156,7 @@ <AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions> <Optimization>Disabled</Optimization> <AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions)</PreprocessorDefinitions> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <PrecompiledHeader> @@ -204,7 +204,7 @@ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed> <OmitFramePointers>true</OmitFramePointers> <AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <ExceptionHandling>Sync</ExceptionHandling> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> @@ -256,7 +256,7 @@ <AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions> <Optimization>Disabled</Optimization> <AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions)</PreprocessorDefinitions> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <PrecompiledHeader> diff --git a/projects/openttd_vs100.vcxproj.in b/projects/openttd_vs100.vcxproj.in index 6f63b725d..54b0063ec 100644 --- a/projects/openttd_vs100.vcxproj.in +++ b/projects/openttd_vs100.vcxproj.in @@ -102,7 +102,7 @@ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed> <OmitFramePointers>true</OmitFramePointers> <AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <ExceptionHandling>Sync</ExceptionHandling> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> @@ -156,7 +156,7 @@ <AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions> <Optimization>Disabled</Optimization> <AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions)</PreprocessorDefinitions> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <PrecompiledHeader> @@ -204,7 +204,7 @@ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed> <OmitFramePointers>true</OmitFramePointers> <AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <ExceptionHandling>Sync</ExceptionHandling> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> @@ -256,7 +256,7 @@ <AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions> <Optimization>Disabled</Optimization> <AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions)</PreprocessorDefinitions> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <PrecompiledHeader> diff --git a/projects/openttd_vs80.vcproj b/projects/openttd_vs80.vcproj index b67deecbc..c51dcb6bb 100644 --- a/projects/openttd_vs80.vcproj +++ b/projects/openttd_vs80.vcproj @@ -52,7 +52,7 @@ FavorSizeOrSpeed="2" OmitFramePointers="true" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT" StringPooling="true" ExceptionHandling="1" RuntimeLibrary="0" @@ -156,7 +156,7 @@ AdditionalOptions="/MP" Optimization="0" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\"" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\"" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" @@ -257,7 +257,7 @@ FavorSizeOrSpeed="2" OmitFramePointers="true" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT" StringPooling="true" ExceptionHandling="1" RuntimeLibrary="0" @@ -362,7 +362,7 @@ AdditionalOptions="/MP" Optimization="0" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" diff --git a/projects/openttd_vs80.vcproj.in b/projects/openttd_vs80.vcproj.in index 025076c75..cbdc4f1fc 100644 --- a/projects/openttd_vs80.vcproj.in +++ b/projects/openttd_vs80.vcproj.in @@ -52,7 +52,7 @@ FavorSizeOrSpeed="2" OmitFramePointers="true" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT" StringPooling="true" ExceptionHandling="1" RuntimeLibrary="0" @@ -156,7 +156,7 @@ AdditionalOptions="/MP" Optimization="0" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\"" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\"" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" @@ -257,7 +257,7 @@ FavorSizeOrSpeed="2" OmitFramePointers="true" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT" StringPooling="true" ExceptionHandling="1" RuntimeLibrary="0" @@ -362,7 +362,7 @@ AdditionalOptions="/MP" Optimization="0" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" diff --git a/projects/openttd_vs90.vcproj b/projects/openttd_vs90.vcproj index 801ade862..56ffab53c 100644 --- a/projects/openttd_vs90.vcproj +++ b/projects/openttd_vs90.vcproj @@ -53,7 +53,7 @@ FavorSizeOrSpeed="2" OmitFramePointers="true" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT" StringPooling="true" ExceptionHandling="1" RuntimeLibrary="0" @@ -155,7 +155,7 @@ AdditionalOptions="/MP" Optimization="0" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\"" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\"" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" @@ -255,7 +255,7 @@ FavorSizeOrSpeed="2" OmitFramePointers="true" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT" StringPooling="true" ExceptionHandling="1" RuntimeLibrary="0" @@ -359,7 +359,7 @@ AdditionalOptions="/MP" Optimization="0" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" diff --git a/projects/openttd_vs90.vcproj.in b/projects/openttd_vs90.vcproj.in index 79ea0bec9..d92d95425 100644 --- a/projects/openttd_vs90.vcproj.in +++ b/projects/openttd_vs90.vcproj.in @@ -53,7 +53,7 @@ FavorSizeOrSpeed="2" OmitFramePointers="true" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";WITH_ASSERT" StringPooling="true" ExceptionHandling="1" RuntimeLibrary="0" @@ -155,7 +155,7 @@ AdditionalOptions="/MP" Optimization="0" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\"" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\"" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" @@ -255,7 +255,7 @@ FavorSizeOrSpeed="2" OmitFramePointers="true" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64;WITH_ASSERT" StringPooling="true" ExceptionHandling="1" RuntimeLibrary="0" @@ -359,7 +359,7 @@ AdditionalOptions="/MP" Optimization="0" AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;ENABLE_AI;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR=\"OpenTTD\";_SQ64" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" diff --git a/source.list b/source.list index ffdda5d1f..3239cf55b 100644 --- a/source.list +++ b/source.list @@ -551,7 +551,6 @@ table/water_land.h 3rdparty/md5/md5.cpp 3rdparty/md5/md5.h -#if AI # Script script/script_config.cpp script/script_config.hpp @@ -738,7 +737,6 @@ script/api/script_vehicle.cpp script/api/script_vehiclelist.cpp script/api/script_waypoint.cpp script/api/script_waypointlist.cpp -#end # Blitters #if DEDICATED diff --git a/src/ai/ai.hpp b/src/ai/ai.hpp index d8647be0c..f0a5eb67b 100644 --- a/src/ai/ai.hpp +++ b/src/ai/ai.hpp @@ -12,7 +12,6 @@ #ifndef AI_HPP #define AI_HPP -#ifdef ENABLE_AI #include "../script/api/script_event_types.hpp" #include "../date_type.h" #include "../core/string_compare_type.hpp" @@ -153,27 +152,4 @@ private: static class AIScannerLibrary *scanner_library; ///< ScriptScanner instance that is used to find AI Libraries }; -#else /* ENABLE_AI */ - -#include "../company_type.h" - -#define NewEvent(cid, event) nop() -#define BroadcastNewEvent(...) nop() - -class AI { -public: - static void StartNew(CompanyID company, bool rerandomise_ai = true) {} - static void Stop(CompanyID company) {} - static void Initialize() {} - static void Uninitialize(bool keepConfig) {} - static void KillAll() {} - static void GameLoop() {} - static bool HasAI(const struct ContentInfo *ci, bool md5sum) { return false; } - static bool HasAILibrary(const struct ContentInfo *ci, bool md5sum) { return false; } - static void Rescan() {} - static char *GetConsoleList(char *p, const char *last, bool newest_only = false) { return p; } - static void nop() { } -}; - -#endif /* ENABLE_AI */ #endif /* AI_HPP */ diff --git a/src/ai/ai_gui.hpp b/src/ai/ai_gui.hpp index 3fe822879..ac8cb4a01 100644 --- a/src/ai/ai_gui.hpp +++ b/src/ai/ai_gui.hpp @@ -14,22 +14,9 @@ #include "../company_type.h" -#ifdef ENABLE_AI void ShowAIDebugWindow(CompanyID show_company = INVALID_COMPANY); void ShowAIConfigWindow(); void ShowAIDebugWindowIfAIError(); void InitializeAIGui(); -#else -#include "../gui.h" -#include "table/strings.h" - -static inline void ShowAIConfigWindow() -{ - ShowErrorMessage(STR_ERROR_NO_AI, STR_ERROR_NO_AI_SUB, WL_INFO); -} -static inline void ShowAIDebugWindow(CompanyID show_company = INVALID_COMPANY) {ShowAIConfigWindow();} -static inline void ShowAIDebugWindowIfAIError() {} -static inline void InitializeAIGui() {} -#endif /* ENABLE_AI */ #endif /* AI_GUI_HPP */ diff --git a/src/ai/ai_info.hpp b/src/ai/ai_info.hpp index 924ddd2e0..c582e70c2 100644 --- a/src/ai/ai_info.hpp +++ b/src/ai/ai_info.hpp @@ -12,8 +12,6 @@ #ifndef AI_INFO_HPP #define AI_INFO_HPP -#ifdef ENABLE_AI - #include "../script/script_info.hpp" #include "../script/script_config.hpp" @@ -84,5 +82,4 @@ private: const char *category; ///< The category this library is in. }; -#endif /* ENABLE_AI */ #endif /* AI_INFO_HPP */ diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp index 2ebd99d66..692431e6e 100644 --- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -572,7 +572,6 @@ void StartupCompanies() _next_competitor_start = 0; } -#ifdef ENABLE_AI /** Start a new competitor company if possible. */ static void MaybeStartNewCompany() { @@ -594,7 +593,6 @@ static void MaybeStartNewCompany() DoCommandP(0, 1 | INVALID_COMPANY << 16, 0, CMD_COMPANY_CTRL); } } -#endif /* ENABLE_AI */ /** Initialize the pool of companies. */ void InitializeCompanies() @@ -693,7 +691,6 @@ void OnTick_Companies() if (c->bankrupt_asked != 0) HandleBankruptcyTakeover(c); } -#ifdef ENABLE_AI if (_next_competitor_start == 0) { _next_competitor_start = AI::GetStartNextTime() * DAY_TICKS; } @@ -701,7 +698,6 @@ void OnTick_Companies() if (AI::CanStartNew() && _game_mode != GM_MENU && --_next_competitor_start == 0) { MaybeStartNewCompany(); } -#endif /* ENABLE_AI */ _cur_company_tick_index = (_cur_company_tick_index + 1) % MAX_COMPANIES; } diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index 4c6a51ba8..6a6404cbc 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -1069,7 +1069,6 @@ DEF_CONSOLE_CMD(ConRestart) return true; } -#ifdef ENABLE_AI /** * Print a text buffer line by line to the console. Lines are seperated by '\n'. * @param buf The buffer to print. @@ -1255,7 +1254,6 @@ DEF_CONSOLE_CMD(ConRescanAI) return true; } -#endif /* ENABLE_AI */ DEF_CONSOLE_CMD(ConRescanNewGRF) { @@ -1892,14 +1890,12 @@ void IConsoleStdLibRegister() IConsoleAliasRegister("list_patches", "list_settings %+"); IConsoleAliasRegister("developer", "setting developer %+"); -#ifdef ENABLE_AI IConsoleCmdRegister("list_ai_libs", ConListAILibs); IConsoleCmdRegister("list_ai", ConListAI); IConsoleCmdRegister("reload_ai", ConReloadAI); IConsoleCmdRegister("rescan_ai", ConRescanAI); IConsoleCmdRegister("start_ai", ConStartAI); IConsoleCmdRegister("stop_ai", ConStopAI); -#endif /* ENABLE_AI */ /* networking functions */ #ifdef ENABLE_NETWORK diff --git a/src/crashlog.cpp b/src/crashlog.cpp index bda4d674f..c5719ad47 100644 --- a/src/crashlog.cpp +++ b/src/crashlog.cpp @@ -151,9 +151,7 @@ char *CrashLog::LogConfiguration(char *buffer, const char *last) const if (c->ai_info == NULL) { buffer += seprintf(buffer, last, " %2i: Human\n", (int)c->index); } else { -#ifdef ENABLE_AI buffer += seprintf(buffer, last, " %2i: %s (v%d)\n", (int)c->index, c->ai_info->GetName(), c->ai_info->GetVersion()); -#endif /* ENABLE_AI */ } } buffer += seprintf(buffer, last, "\n"); diff --git a/src/lang/english.txt b/src/lang/english.txt index 3e33db7ee..28699feeb 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -3412,9 +3412,6 @@ STR_AI_DEBUG_CONTINUE :{BLACK}Continue STR_AI_DEBUG_CONTINUE_TOOLTIP :{BLACK}Unpause and continue the AI STR_AI_DEBUG_SELECT_AI_TOOLTIP :{BLACK}View debug output of this AI -STR_ERROR_NO_AI :{WHITE}OpenTTD is built without AI support... -STR_ERROR_NO_AI_SUB :{WHITE}... no AIs are available! - STR_ERROR_AI_NO_AI_FOUND :No suitable AI found to load.{}This AI is a dummy AI and won't do anything.{}You can download several AIs via the 'Online Content' system STR_ERROR_AI_PLEASE_REPORT_CRASH :{WHITE}One of the running AIs crashed. Please report this to the AI author with a screenshot of the AI Debug Window STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW}AI Debug window is only available for the server diff --git a/src/network/network_command.cpp b/src/network/network_command.cpp index 0e37eeff4..070e810d8 100644 --- a/src/network/network_command.cpp +++ b/src/network/network_command.cpp @@ -39,11 +39,7 @@ static CommandCallback * const _callback_table[] = { /* 0x0F */ CcPlaySound1E, /* 0x10 */ CcStation, /* 0x11 */ CcTerraform, -#ifdef ENABLE_AI /* 0x12 */ CcAI, -#else - /* 0x12 */ NULL, -#endif /* ENABLE_AI */ /* 0x13 */ CcCloneVehicle, /* 0x14 */ CcGiveMoney, /* 0x15 */ CcCreateGroup, diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp index de7087c1e..98c9f171b 100644 --- a/src/network/network_content.cpp +++ b/src/network/network_content.cpp @@ -180,10 +180,8 @@ void ClientNetworkContentSocketHandler::RequestContentList(ContentType type) this->RequestContentList(CONTENT_TYPE_BASE_SOUNDS); this->RequestContentList(CONTENT_TYPE_SCENARIO); this->RequestContentList(CONTENT_TYPE_HEIGHTMAP); -#ifdef ENABLE_AI this->RequestContentList(CONTENT_TYPE_AI); this->RequestContentList(CONTENT_TYPE_AI_LIBRARY); -#endif /* ENABLE_AI */ this->RequestContentList(CONTENT_TYPE_NEWGRF); return; } diff --git a/src/openttd.cpp b/src/openttd.cpp index a0c16f910..d20a2c33a 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -342,27 +342,23 @@ static void LoadIntroGame(bool load_newgrfs = true) void MakeNewgameSettingsLive() { -#ifdef ENABLE_AI for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) { if (_settings_game.ai_config[c] != NULL) { delete _settings_game.ai_config[c]; } } -#endif /* ENABLE_AI */ /* Copy newgame settings to active settings. * Also initialise old settings needed for savegame conversion. */ _settings_game = _settings_newgame; _old_vds = _settings_client.company.vehicle; -#ifdef ENABLE_AI for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) { _settings_game.ai_config[c] = NULL; if (_settings_newgame.ai_config[c] != NULL) { _settings_game.ai_config[c] = new AIConfig(_settings_newgame.ai_config[c]); } } -#endif /* ENABLE_AI */ } /** Callback structure of statements to be executed after the NewGRF scan. */ diff --git a/src/saveload/ai_sl.cpp b/src/saveload/ai_sl.cpp index cfb90c34c..31828be24 100644 --- a/src/saveload/ai_sl.cpp +++ b/src/saveload/ai_sl.cpp @@ -15,6 +15,11 @@ #include "saveload.h" #include "../string_func.h" +#include "../ai/ai.hpp" +#include "../ai/ai_config.hpp" +#include "../network/network.h" +#include "../ai/ai_instance.hpp" + static char _ai_saveload_name[64]; static int _ai_saveload_version; static char _ai_saveload_settings[1024]; @@ -28,12 +33,6 @@ static const SaveLoad _ai_company[] = { SLE_END() }; -#ifdef ENABLE_AI -#include "../ai/ai.hpp" -#include "../ai/ai_config.hpp" -#include "../network/network.h" -#include "../ai/ai_instance.hpp" - static void SaveReal_AIPL(int *index_ptr) { CompanyID index = (CompanyID)*index_ptr; @@ -125,80 +124,3 @@ static void Save_AIPL() extern const ChunkHandler _ai_chunk_handlers[] = { { 'AIPL', Save_AIPL, Load_AIPL, NULL, NULL, CH_ARRAY | CH_LAST}, }; -#else - -/** The type of the data that follows in the savegame. */ -enum SQSaveLoadType { - SQSL_INT = 0x00, ///< The following data is an integer. - SQSL_STRING = 0x01, ///< The following data is an string. - SQSL_ARRAY = 0x02, ///< The following data is an array. - SQSL_TABLE = 0x03, ///< The following data is an table. - SQSL_BOOL = 0x04, ///< The following data is a boolean. - SQSL_NULL = 0x05, ///< A null variable. - SQSL_ARRAY_TABLE_END = 0xFF, ///< Marks the end of an array or table, no data follows. -}; - -static byte _ai_sl_byte; - -static const SaveLoad _ai_byte[] = { - SLEG_VAR(_ai_sl_byte, SLE_UINT8), - SLE_END() -}; - -static bool LoadObjects() -{ - SlObject(NULL, _ai_byte); - switch (_ai_sl_byte) { - case SQSL_INT: { - int value; - SlArray(&value, 1, SLE_INT32); - return true; - } - - case SQSL_STRING: { - SlObject(NULL, _ai_byte); - static char buf[256]; - SlArray(buf, _ai_sl_byte, SLE_CHAR); - return true; - } - - case SQSL_ARRAY: - while (LoadObjects()) { } - return true; - - case SQSL_TABLE: - while (LoadObjects()) { LoadObjects(); } - return true; - - case SQSL_BOOL: - SlObject(NULL, _ai_byte); - return true; - - case SQSL_NULL: - return true; - - case SQSL_ARRAY_TABLE_END: - return false; - - default: SlErrorCorrupt("Invalid AI data type"); - } -} - -static void Load_AIPL() -{ - CompanyID index; - while ((index = (CompanyID)SlIterateArray()) != (CompanyID)-1) { - SlObject(NULL, _ai_company); - - if (!Company::IsValidAiID(index)) continue; - SlObject(NULL, _ai_byte); - /* Check if there was anything saved at all. */ - if (_ai_sl_byte == 0) continue; - LoadObjects(); - } -} - -extern const ChunkHandler _ai_chunk_handlers[] = { - { 'AIPL', NULL, Load_AIPL, NULL, NULL, CH_ARRAY | CH_LAST}, -}; -#endif /* ENABLE_AI */ diff --git a/src/screenshot.cpp b/src/screenshot.cpp index 474c321ee..d5d63d113 100644 --- a/src/screenshot.cpp +++ b/src/screenshot.cpp @@ -327,9 +327,7 @@ static bool MakePNGImage(const char *name, ScreenshotCallback *callb, void *user if (c->ai_info == NULL) { p += seprintf(p, lastof(buf), "%2i: Human\n", (int)c->index); } else { -#ifdef ENABLE_AI p += seprintf(p, lastof(buf), "%2i: %s (v%d)\n", (int)c->index, c->ai_info->GetName(), c->ai_info->GetVersion()); -#endif /* ENABLE_AI */ } } text[1].key = const_cast<char *>("Description"); diff --git a/src/settings.cpp b/src/settings.cpp index ddbf7f583..4082b8dbd 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1044,9 +1044,7 @@ static bool DifficultyNoiseChange(int32 i) static bool MaxNoAIsChange(int32 i) { if (GetGameSettings().difficulty.max_no_competitors != 0 && -#ifdef ENABLE_AI AI::GetInfoList()->size() == 0 && -#endif /* ENABLE_AI */ (!_networking || _network_server)) { ShowErrorMessage(STR_WARNING_NO_SUITABLE_AI, INVALID_STRING_ID, WL_CRITICAL); } @@ -1314,7 +1312,6 @@ static void NewsDisplayLoadConfig(IniFile *ini, const char *grpname) static void AILoadConfig(IniFile *ini, const char *grpname) { -#ifdef ENABLE_AI IniGroup *group = ini->GetGroup(grpname); IniItem *item; @@ -1339,7 +1336,6 @@ static void AILoadConfig(IniFile *ini, const char *grpname) } if (item->value != NULL) config->StringToSettings(item->value); } -#endif /* ENABLE_AI */ } /** @@ -1436,7 +1432,6 @@ static void NewsDisplaySaveConfig(IniFile *ini, const char *grpname) static void AISaveConfig(IniFile *ini, const char *grpname) { -#ifdef ENABLE_AI IniGroup *group = ini->GetGroup(grpname); if (group == NULL) return; @@ -1457,7 +1452,6 @@ static void AISaveConfig(IniFile *ini, const char *grpname) IniItem *item = new IniItem(group, name, strlen(name)); item->SetValue(value); } -#endif /* ENABLE_AI */ } /** diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 019fd3490..47225e2a2 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -738,9 +738,7 @@ public: this->InvalidateData(); if (widget / 3 == 0 && -#ifdef ENABLE_AI AI::GetInfoList()->size() == 0 && -#endif /* ENABLE_AI */ this->opt_mod_temp.difficulty.max_no_competitors != 0) { ShowErrorMessage(STR_WARNING_NO_SUITABLE_AI, INVALID_STRING_ID, WL_CRITICAL); } |