(svn r23384) -Remove: no longer allow a binary to be without AI support; the parts some compilers failed at, are integrated in other parts of the code now too

This commit is contained in:
truebrain 2011-12-01 12:03:34 +00:00
parent fa07d61b84
commit bf803e40cc
23 changed files with 33 additions and 198 deletions

View File

@ -195,7 +195,7 @@ EXPAND_ONLY_PREDEF = YES
SEARCH_INCLUDES = YES SEARCH_INCLUDES = YES
INCLUDE_PATH = INCLUDE_PATH =
INCLUDE_FILE_PATTERNS = 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 = EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES SKIP_FUNCTION_MACROS = YES
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------

View File

@ -54,7 +54,6 @@ set_default() {
enable_lto="0" enable_lto="0"
enable_dedicated="0" enable_dedicated="0"
enable_network="1" enable_network="1"
enable_ai="1"
enable_static="1" enable_static="1"
enable_translator="0" enable_translator="0"
enable_unicode="1" enable_unicode="1"
@ -128,7 +127,6 @@ set_default() {
enable_lto enable_lto
enable_dedicated enable_dedicated
enable_network enable_network
enable_ai
enable_static enable_static
enable_translator enable_translator
enable_unicode enable_unicode
@ -286,9 +284,6 @@ detect_params() {
--enable-network) enable_network="2";; --enable-network) enable_network="2";;
--enable-network=*) enable_network="$optarg";; --enable-network=*) enable_network="$optarg";;
--disable-network) enable_network="0";; --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";; --disable-static) enable_static="0";;
--enable-static) enable_static="2";; --enable-static) enable_static="2";;
--enable-static=*) enable_static="$optarg";; --enable-static=*) enable_static="$optarg";;
@ -743,13 +738,8 @@ check_params() {
log 1 "checking network... disabled" log 1 "checking network... disabled"
fi fi
if [ "$enable_ai" != "0" ]; then log 1 "checking squirrel... found"
log 1 "checking ai... found" SCRIPT_SRC_DIR="$ROOT_DIR/src/3rdparty/squirrel/include"
SCRIPT_SRC_DIR="$ROOT_DIR/src/3rdparty/squirrel/include"
else
log 1 "checking ai... disabled"
SCRIPT_SRC_DIR=""
fi
if [ "$enable_translator" != "0" ]; then if [ "$enable_translator" != "0" ]; then
log 1 "checking translator... debug" log 1 "checking translator... debug"
@ -1586,9 +1576,7 @@ make_cflags_and_ldflags() {
if [ "$cpu_type" = "64" ] && [ "$enable_universal" = "0" ]; then if [ "$cpu_type" = "64" ] && [ "$enable_universal" = "0" ]; then
CFLAGS="$CFLAGS -D_SQ64" CFLAGS="$CFLAGS -D_SQ64"
fi fi
if [ "$enable_ai" != "0" ]; then CFLAGS="$CFLAGS -I$SCRIPT_SRC_DIR"
CFLAGS="$CFLAGS -I$SCRIPT_SRC_DIR -DENABLE_AI"
fi
if [ -n "$png_config" ]; then if [ -n "$png_config" ]; then
CFLAGS="$CFLAGS -DWITH_PNG" CFLAGS="$CFLAGS -DWITH_PNG"

View File

@ -102,7 +102,7 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed> <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers> <OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <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> <StringPooling>true</StringPooling>
<ExceptionHandling>Sync</ExceptionHandling> <ExceptionHandling>Sync</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -156,7 +156,7 @@
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <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> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader> <PrecompiledHeader>
@ -204,7 +204,7 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed> <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers> <OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <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> <StringPooling>true</StringPooling>
<ExceptionHandling>Sync</ExceptionHandling> <ExceptionHandling>Sync</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -256,7 +256,7 @@
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <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> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader> <PrecompiledHeader>

View File

@ -102,7 +102,7 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed> <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers> <OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <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> <StringPooling>true</StringPooling>
<ExceptionHandling>Sync</ExceptionHandling> <ExceptionHandling>Sync</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -156,7 +156,7 @@
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <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> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader> <PrecompiledHeader>
@ -204,7 +204,7 @@
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed> <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers> <OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <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> <StringPooling>true</StringPooling>
<ExceptionHandling>Sync</ExceptionHandling> <ExceptionHandling>Sync</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -256,7 +256,7 @@
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <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> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader> <PrecompiledHeader>

View File

@ -52,7 +52,7 @@
FavorSizeOrSpeed="2" FavorSizeOrSpeed="2"
OmitFramePointers="true" OmitFramePointers="true"
AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" 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=\&quot;OpenTTD\&quot;;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=\&quot;OpenTTD\&quot;;WITH_ASSERT"
StringPooling="true" StringPooling="true"
ExceptionHandling="1" ExceptionHandling="1"
RuntimeLibrary="0" RuntimeLibrary="0"
@ -156,7 +156,7 @@
AdditionalOptions="/MP" AdditionalOptions="/MP"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" 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=\&quot;OpenTTD\&quot;" 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=\&quot;OpenTTD\&quot;"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="1"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
@ -257,7 +257,7 @@
FavorSizeOrSpeed="2" FavorSizeOrSpeed="2"
OmitFramePointers="true" OmitFramePointers="true"
AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" 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=\&quot;OpenTTD\&quot;;_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=\&quot;OpenTTD\&quot;;_SQ64;WITH_ASSERT"
StringPooling="true" StringPooling="true"
ExceptionHandling="1" ExceptionHandling="1"
RuntimeLibrary="0" RuntimeLibrary="0"
@ -362,7 +362,7 @@
AdditionalOptions="/MP" AdditionalOptions="/MP"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" 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=\&quot;OpenTTD\&quot;;_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=\&quot;OpenTTD\&quot;;_SQ64"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="1"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"

View File

@ -52,7 +52,7 @@
FavorSizeOrSpeed="2" FavorSizeOrSpeed="2"
OmitFramePointers="true" OmitFramePointers="true"
AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" 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=\&quot;OpenTTD\&quot;;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=\&quot;OpenTTD\&quot;;WITH_ASSERT"
StringPooling="true" StringPooling="true"
ExceptionHandling="1" ExceptionHandling="1"
RuntimeLibrary="0" RuntimeLibrary="0"
@ -156,7 +156,7 @@
AdditionalOptions="/MP" AdditionalOptions="/MP"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" 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=\&quot;OpenTTD\&quot;" 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=\&quot;OpenTTD\&quot;"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="1"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
@ -257,7 +257,7 @@
FavorSizeOrSpeed="2" FavorSizeOrSpeed="2"
OmitFramePointers="true" OmitFramePointers="true"
AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" 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=\&quot;OpenTTD\&quot;;_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=\&quot;OpenTTD\&quot;;_SQ64;WITH_ASSERT"
StringPooling="true" StringPooling="true"
ExceptionHandling="1" ExceptionHandling="1"
RuntimeLibrary="0" RuntimeLibrary="0"
@ -362,7 +362,7 @@
AdditionalOptions="/MP" AdditionalOptions="/MP"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" 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=\&quot;OpenTTD\&quot;;_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=\&quot;OpenTTD\&quot;;_SQ64"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="1"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"

View File

@ -53,7 +53,7 @@
FavorSizeOrSpeed="2" FavorSizeOrSpeed="2"
OmitFramePointers="true" OmitFramePointers="true"
AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" 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=\&quot;OpenTTD\&quot;;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=\&quot;OpenTTD\&quot;;WITH_ASSERT"
StringPooling="true" StringPooling="true"
ExceptionHandling="1" ExceptionHandling="1"
RuntimeLibrary="0" RuntimeLibrary="0"
@ -155,7 +155,7 @@
AdditionalOptions="/MP" AdditionalOptions="/MP"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" 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=\&quot;OpenTTD\&quot;" 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=\&quot;OpenTTD\&quot;"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="1"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
@ -255,7 +255,7 @@
FavorSizeOrSpeed="2" FavorSizeOrSpeed="2"
OmitFramePointers="true" OmitFramePointers="true"
AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" 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=\&quot;OpenTTD\&quot;;_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=\&quot;OpenTTD\&quot;;_SQ64;WITH_ASSERT"
StringPooling="true" StringPooling="true"
ExceptionHandling="1" ExceptionHandling="1"
RuntimeLibrary="0" RuntimeLibrary="0"
@ -359,7 +359,7 @@
AdditionalOptions="/MP" AdditionalOptions="/MP"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" 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=\&quot;OpenTTD\&quot;;_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=\&quot;OpenTTD\&quot;;_SQ64"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="1"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"

View File

@ -53,7 +53,7 @@
FavorSizeOrSpeed="2" FavorSizeOrSpeed="2"
OmitFramePointers="true" OmitFramePointers="true"
AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" 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=\&quot;OpenTTD\&quot;;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=\&quot;OpenTTD\&quot;;WITH_ASSERT"
StringPooling="true" StringPooling="true"
ExceptionHandling="1" ExceptionHandling="1"
RuntimeLibrary="0" RuntimeLibrary="0"
@ -155,7 +155,7 @@
AdditionalOptions="/MP" AdditionalOptions="/MP"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" 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=\&quot;OpenTTD\&quot;" 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=\&quot;OpenTTD\&quot;"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="1"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
@ -255,7 +255,7 @@
FavorSizeOrSpeed="2" FavorSizeOrSpeed="2"
OmitFramePointers="true" OmitFramePointers="true"
AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" 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=\&quot;OpenTTD\&quot;;_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=\&quot;OpenTTD\&quot;;_SQ64;WITH_ASSERT"
StringPooling="true" StringPooling="true"
ExceptionHandling="1" ExceptionHandling="1"
RuntimeLibrary="0" RuntimeLibrary="0"
@ -359,7 +359,7 @@
AdditionalOptions="/MP" AdditionalOptions="/MP"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include" 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=\&quot;OpenTTD\&quot;;_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=\&quot;OpenTTD\&quot;;_SQ64"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="1"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"

View File

@ -551,7 +551,6 @@ table/water_land.h
3rdparty/md5/md5.cpp 3rdparty/md5/md5.cpp
3rdparty/md5/md5.h 3rdparty/md5/md5.h
#if AI
# Script # Script
script/script_config.cpp script/script_config.cpp
script/script_config.hpp script/script_config.hpp
@ -738,7 +737,6 @@ script/api/script_vehicle.cpp
script/api/script_vehiclelist.cpp script/api/script_vehiclelist.cpp
script/api/script_waypoint.cpp script/api/script_waypoint.cpp
script/api/script_waypointlist.cpp script/api/script_waypointlist.cpp
#end
# Blitters # Blitters
#if DEDICATED #if DEDICATED

View File

@ -12,7 +12,6 @@
#ifndef AI_HPP #ifndef AI_HPP
#define AI_HPP #define AI_HPP
#ifdef ENABLE_AI
#include "../script/api/script_event_types.hpp" #include "../script/api/script_event_types.hpp"
#include "../date_type.h" #include "../date_type.h"
#include "../core/string_compare_type.hpp" #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 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 */ #endif /* AI_HPP */

View File

@ -14,22 +14,9 @@
#include "../company_type.h" #include "../company_type.h"
#ifdef ENABLE_AI
void ShowAIDebugWindow(CompanyID show_company = INVALID_COMPANY); void ShowAIDebugWindow(CompanyID show_company = INVALID_COMPANY);
void ShowAIConfigWindow(); void ShowAIConfigWindow();
void ShowAIDebugWindowIfAIError(); void ShowAIDebugWindowIfAIError();
void InitializeAIGui(); 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 */ #endif /* AI_GUI_HPP */

View File

@ -12,8 +12,6 @@
#ifndef AI_INFO_HPP #ifndef AI_INFO_HPP
#define AI_INFO_HPP #define AI_INFO_HPP
#ifdef ENABLE_AI
#include "../script/script_info.hpp" #include "../script/script_info.hpp"
#include "../script/script_config.hpp" #include "../script/script_config.hpp"
@ -84,5 +82,4 @@ private:
const char *category; ///< The category this library is in. const char *category; ///< The category this library is in.
}; };
#endif /* ENABLE_AI */
#endif /* AI_INFO_HPP */ #endif /* AI_INFO_HPP */

View File

@ -572,7 +572,6 @@ void StartupCompanies()
_next_competitor_start = 0; _next_competitor_start = 0;
} }
#ifdef ENABLE_AI
/** Start a new competitor company if possible. */ /** Start a new competitor company if possible. */
static void MaybeStartNewCompany() static void MaybeStartNewCompany()
{ {
@ -594,7 +593,6 @@ static void MaybeStartNewCompany()
DoCommandP(0, 1 | INVALID_COMPANY << 16, 0, CMD_COMPANY_CTRL); DoCommandP(0, 1 | INVALID_COMPANY << 16, 0, CMD_COMPANY_CTRL);
} }
} }
#endif /* ENABLE_AI */
/** Initialize the pool of companies. */ /** Initialize the pool of companies. */
void InitializeCompanies() void InitializeCompanies()
@ -693,7 +691,6 @@ void OnTick_Companies()
if (c->bankrupt_asked != 0) HandleBankruptcyTakeover(c); if (c->bankrupt_asked != 0) HandleBankruptcyTakeover(c);
} }
#ifdef ENABLE_AI
if (_next_competitor_start == 0) { if (_next_competitor_start == 0) {
_next_competitor_start = AI::GetStartNextTime() * DAY_TICKS; _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) { if (AI::CanStartNew() && _game_mode != GM_MENU && --_next_competitor_start == 0) {
MaybeStartNewCompany(); MaybeStartNewCompany();
} }
#endif /* ENABLE_AI */
_cur_company_tick_index = (_cur_company_tick_index + 1) % MAX_COMPANIES; _cur_company_tick_index = (_cur_company_tick_index + 1) % MAX_COMPANIES;
} }

View File

@ -1069,7 +1069,6 @@ DEF_CONSOLE_CMD(ConRestart)
return true; return true;
} }
#ifdef ENABLE_AI
/** /**
* Print a text buffer line by line to the console. Lines are seperated by '\n'. * Print a text buffer line by line to the console. Lines are seperated by '\n'.
* @param buf The buffer to print. * @param buf The buffer to print.
@ -1255,7 +1254,6 @@ DEF_CONSOLE_CMD(ConRescanAI)
return true; return true;
} }
#endif /* ENABLE_AI */
DEF_CONSOLE_CMD(ConRescanNewGRF) DEF_CONSOLE_CMD(ConRescanNewGRF)
{ {
@ -1892,14 +1890,12 @@ void IConsoleStdLibRegister()
IConsoleAliasRegister("list_patches", "list_settings %+"); IConsoleAliasRegister("list_patches", "list_settings %+");
IConsoleAliasRegister("developer", "setting developer %+"); IConsoleAliasRegister("developer", "setting developer %+");
#ifdef ENABLE_AI
IConsoleCmdRegister("list_ai_libs", ConListAILibs); IConsoleCmdRegister("list_ai_libs", ConListAILibs);
IConsoleCmdRegister("list_ai", ConListAI); IConsoleCmdRegister("list_ai", ConListAI);
IConsoleCmdRegister("reload_ai", ConReloadAI); IConsoleCmdRegister("reload_ai", ConReloadAI);
IConsoleCmdRegister("rescan_ai", ConRescanAI); IConsoleCmdRegister("rescan_ai", ConRescanAI);
IConsoleCmdRegister("start_ai", ConStartAI); IConsoleCmdRegister("start_ai", ConStartAI);
IConsoleCmdRegister("stop_ai", ConStopAI); IConsoleCmdRegister("stop_ai", ConStopAI);
#endif /* ENABLE_AI */
/* networking functions */ /* networking functions */
#ifdef ENABLE_NETWORK #ifdef ENABLE_NETWORK

View File

@ -151,9 +151,7 @@ char *CrashLog::LogConfiguration(char *buffer, const char *last) const
if (c->ai_info == NULL) { if (c->ai_info == NULL) {
buffer += seprintf(buffer, last, " %2i: Human\n", (int)c->index); buffer += seprintf(buffer, last, " %2i: Human\n", (int)c->index);
} else { } else {
#ifdef ENABLE_AI
buffer += seprintf(buffer, last, " %2i: %s (v%d)\n", (int)c->index, c->ai_info->GetName(), c->ai_info->GetVersion()); 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"); buffer += seprintf(buffer, last, "\n");

View File

@ -3412,9 +3412,6 @@ STR_AI_DEBUG_CONTINUE :{BLACK}Continue
STR_AI_DEBUG_CONTINUE_TOOLTIP :{BLACK}Unpause and continue the AI 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_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_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_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 STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW}AI Debug window is only available for the server

View File

@ -39,11 +39,7 @@ static CommandCallback * const _callback_table[] = {
/* 0x0F */ CcPlaySound1E, /* 0x0F */ CcPlaySound1E,
/* 0x10 */ CcStation, /* 0x10 */ CcStation,
/* 0x11 */ CcTerraform, /* 0x11 */ CcTerraform,
#ifdef ENABLE_AI
/* 0x12 */ CcAI, /* 0x12 */ CcAI,
#else
/* 0x12 */ NULL,
#endif /* ENABLE_AI */
/* 0x13 */ CcCloneVehicle, /* 0x13 */ CcCloneVehicle,
/* 0x14 */ CcGiveMoney, /* 0x14 */ CcGiveMoney,
/* 0x15 */ CcCreateGroup, /* 0x15 */ CcCreateGroup,

View File

@ -180,10 +180,8 @@ void ClientNetworkContentSocketHandler::RequestContentList(ContentType type)
this->RequestContentList(CONTENT_TYPE_BASE_SOUNDS); this->RequestContentList(CONTENT_TYPE_BASE_SOUNDS);
this->RequestContentList(CONTENT_TYPE_SCENARIO); this->RequestContentList(CONTENT_TYPE_SCENARIO);
this->RequestContentList(CONTENT_TYPE_HEIGHTMAP); this->RequestContentList(CONTENT_TYPE_HEIGHTMAP);
#ifdef ENABLE_AI
this->RequestContentList(CONTENT_TYPE_AI); this->RequestContentList(CONTENT_TYPE_AI);
this->RequestContentList(CONTENT_TYPE_AI_LIBRARY); this->RequestContentList(CONTENT_TYPE_AI_LIBRARY);
#endif /* ENABLE_AI */
this->RequestContentList(CONTENT_TYPE_NEWGRF); this->RequestContentList(CONTENT_TYPE_NEWGRF);
return; return;
} }

View File

@ -342,27 +342,23 @@ static void LoadIntroGame(bool load_newgrfs = true)
void MakeNewgameSettingsLive() void MakeNewgameSettingsLive()
{ {
#ifdef ENABLE_AI
for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) { for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) {
if (_settings_game.ai_config[c] != NULL) { if (_settings_game.ai_config[c] != NULL) {
delete _settings_game.ai_config[c]; delete _settings_game.ai_config[c];
} }
} }
#endif /* ENABLE_AI */
/* Copy newgame settings to active settings. /* Copy newgame settings to active settings.
* Also initialise old settings needed for savegame conversion. */ * Also initialise old settings needed for savegame conversion. */
_settings_game = _settings_newgame; _settings_game = _settings_newgame;
_old_vds = _settings_client.company.vehicle; _old_vds = _settings_client.company.vehicle;
#ifdef ENABLE_AI
for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) { for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) {
_settings_game.ai_config[c] = NULL; _settings_game.ai_config[c] = NULL;
if (_settings_newgame.ai_config[c] != NULL) { if (_settings_newgame.ai_config[c] != NULL) {
_settings_game.ai_config[c] = new AIConfig(_settings_newgame.ai_config[c]); _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. */ /** Callback structure of statements to be executed after the NewGRF scan. */

View File

@ -15,6 +15,11 @@
#include "saveload.h" #include "saveload.h"
#include "../string_func.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 char _ai_saveload_name[64];
static int _ai_saveload_version; static int _ai_saveload_version;
static char _ai_saveload_settings[1024]; static char _ai_saveload_settings[1024];
@ -28,12 +33,6 @@ static const SaveLoad _ai_company[] = {
SLE_END() 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) static void SaveReal_AIPL(int *index_ptr)
{ {
CompanyID index = (CompanyID)*index_ptr; CompanyID index = (CompanyID)*index_ptr;
@ -125,80 +124,3 @@ static void Save_AIPL()
extern const ChunkHandler _ai_chunk_handlers[] = { extern const ChunkHandler _ai_chunk_handlers[] = {
{ 'AIPL', Save_AIPL, Load_AIPL, NULL, NULL, CH_ARRAY | CH_LAST}, { '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 */

View File

@ -327,9 +327,7 @@ static bool MakePNGImage(const char *name, ScreenshotCallback *callb, void *user
if (c->ai_info == NULL) { if (c->ai_info == NULL) {
p += seprintf(p, lastof(buf), "%2i: Human\n", (int)c->index); p += seprintf(p, lastof(buf), "%2i: Human\n", (int)c->index);
} else { } 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()); 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"); text[1].key = const_cast<char *>("Description");

View File

@ -1044,9 +1044,7 @@ static bool DifficultyNoiseChange(int32 i)
static bool MaxNoAIsChange(int32 i) static bool MaxNoAIsChange(int32 i)
{ {
if (GetGameSettings().difficulty.max_no_competitors != 0 && if (GetGameSettings().difficulty.max_no_competitors != 0 &&
#ifdef ENABLE_AI
AI::GetInfoList()->size() == 0 && AI::GetInfoList()->size() == 0 &&
#endif /* ENABLE_AI */
(!_networking || _network_server)) { (!_networking || _network_server)) {
ShowErrorMessage(STR_WARNING_NO_SUITABLE_AI, INVALID_STRING_ID, WL_CRITICAL); 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) static void AILoadConfig(IniFile *ini, const char *grpname)
{ {
#ifdef ENABLE_AI
IniGroup *group = ini->GetGroup(grpname); IniGroup *group = ini->GetGroup(grpname);
IniItem *item; IniItem *item;
@ -1339,7 +1336,6 @@ static void AILoadConfig(IniFile *ini, const char *grpname)
} }
if (item->value != NULL) config->StringToSettings(item->value); 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) static void AISaveConfig(IniFile *ini, const char *grpname)
{ {
#ifdef ENABLE_AI
IniGroup *group = ini->GetGroup(grpname); IniGroup *group = ini->GetGroup(grpname);
if (group == NULL) return; if (group == NULL) return;
@ -1457,7 +1452,6 @@ static void AISaveConfig(IniFile *ini, const char *grpname)
IniItem *item = new IniItem(group, name, strlen(name)); IniItem *item = new IniItem(group, name, strlen(name));
item->SetValue(value); item->SetValue(value);
} }
#endif /* ENABLE_AI */
} }
/** /**

View File

@ -738,9 +738,7 @@ public:
this->InvalidateData(); this->InvalidateData();
if (widget / 3 == 0 && if (widget / 3 == 0 &&
#ifdef ENABLE_AI
AI::GetInfoList()->size() == 0 && AI::GetInfoList()->size() == 0 &&
#endif /* ENABLE_AI */
this->opt_mod_temp.difficulty.max_no_competitors != 0) { this->opt_mod_temp.difficulty.max_no_competitors != 0) {
ShowErrorMessage(STR_WARNING_NO_SUITABLE_AI, INVALID_STRING_ID, WL_CRITICAL); ShowErrorMessage(STR_WARNING_NO_SUITABLE_AI, INVALID_STRING_ID, WL_CRITICAL);
} }