Merge branch 'master' into jgrpp

# Conflicts:
#	src/blitter/32bpp_anim.cpp
#	src/blitter/32bpp_anim.hpp
#	src/blitter/32bpp_anim_sse2.cpp
#	src/blitter/32bpp_base.cpp
#	src/blitter/32bpp_base.hpp
#	src/ground_vehicle.cpp
#	src/linkgraph/linkgraph_gui.h
#	src/main_gui.cpp
#	src/newgrf_house.cpp
#	src/newgrf_house.h
#	src/town_cmd.cpp
#	src/vehicle_base.h
#	src/viewport_gui.cppp
pull/59/head
Jonathan G Rennison 6 years ago
commit 56be293107

@ -77,6 +77,7 @@ set_default() {
enable_builtin_depend="1" enable_builtin_depend="1"
with_makedepend="0" with_makedepend="0"
with_direct_music="1" with_direct_music="1"
with_xaudio2="1"
with_sort="1" with_sort="1"
with_iconv="1" with_iconv="1"
with_midi="" with_midi=""
@ -155,6 +156,7 @@ set_default() {
enable_builtin_depend enable_builtin_depend
with_makedepend with_makedepend
with_direct_music with_direct_music
with_xaudio2
with_sort with_sort
with_iconv with_iconv
with_midi with_midi
@ -417,6 +419,10 @@ detect_params() {
--without-direct-music) with_direct_music="0";; --without-direct-music) with_direct_music="0";;
--with-direct-music=*) with_direct_music="$optarg";; --with-direct-music=*) with_direct_music="$optarg";;
--with-xaudio2) with_xaudio2="2";;
--without-xaudio2) with_xaudio2="0";;
--with-xaudio2=*) with_xaudio2="$optarg";;
--with-sort) with_sort="2";; --with-sort) with_sort="2";;
--without-sort) with_sort="0";; --without-sort) with_sort="0";;
--with-sort=*) with_sort="$optarg";; --with-sort=*) with_sort="$optarg";;
@ -895,6 +901,20 @@ check_params() {
fi fi
fi fi
if [ "$with_xaudio2" != "0" ]; then
if [ "$os" != "MINGW" ] && [ "$os" != "CYGWIN" ]; then
if [ "$with_xaudio2" != "1" ]; then
log 1 "configure: error: xaudio2 is only supported on Win32 targets"
exit 1
fi
with_xaudio2="0"
log 1 "checking xaudio2... not Windows, skipping"
else
check_xaudio2
fi
fi
detect_sort detect_sort
# Suppress language errors when there is a version defined, indicating a release # Suppress language errors when there is a version defined, indicating a release
@ -2074,6 +2094,10 @@ EOL
fi fi
fi fi
if [ "$with_xaudio2" != "0" ]; then
CFLAGS="$CFLAGS -DWITH_XAUDIO2"
fi
if [ -n "$libtimidity_config" ]; then if [ -n "$libtimidity_config" ]; then
CFLAGS="$CFLAGS -DLIBTIMIDITY" CFLAGS="$CFLAGS -DLIBTIMIDITY"
CFLAGS="$CFLAGS `$libtimidity_config --cflags | tr '\n\r' ' '`" CFLAGS="$CFLAGS `$libtimidity_config --cflags | tr '\n\r' ' '`"
@ -2473,6 +2497,35 @@ check_direct_music() {
fi fi
} }
check_xaudio2() {
echo "
#include <windows.h>
#undef NTDDI_VERSION
#undef _WIN32_WINNT
#define NTDDI_VERSION NTDDI_WIN8
#define _WIN32_WINNT _WIN32_WINNT_WIN8
#include <xaudio2.h>
int main(int argc, char *argv[]) { }" > xaudio2.test.c
$cxx_host $CFLAGS xaudio2.test.c -o xaudio2.test 2> /dev/null
res=$?
rm -f xaudio2.test.c xaudio2.test
if [ "$res" != "0" ]; then
if [ "$with_xaudio2" != "1" ]; then
log 1 "configure: error: xaudio2 is not available on this system"
exit 1
fi
with_xaudio2="0"
log 1 "checking xaudio2... not found"
else
log 1 "checking xaudio2... found"
fi
}
check_makedepend() { check_makedepend() {
if [ "$enable_builtin_depend" != "0" ]; then if [ "$enable_builtin_depend" != "0" ]; then
with_makedepend="0" with_makedepend="0"

@ -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_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;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>
@ -162,7 +162,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_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;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>
@ -216,7 +216,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_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;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>
@ -274,7 +274,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_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;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>
@ -716,6 +716,7 @@
<ClInclude Include="..\src\window_func.h" /> <ClInclude Include="..\src\window_func.h" />
<ClInclude Include="..\src\window_gui.h" /> <ClInclude Include="..\src\window_gui.h" />
<ClInclude Include="..\src\window_type.h" /> <ClInclude Include="..\src\window_type.h" />
<ClInclude Include="..\src\sound\xaudio2_s.h" />
<ClInclude Include="..\src\zoom_func.h" /> <ClInclude Include="..\src\zoom_func.h" />
<ClInclude Include="..\src\zoom_type.h" /> <ClInclude Include="..\src\zoom_type.h" />
<ClInclude Include="..\src\zoning.h" /> <ClInclude Include="..\src\zoning.h" />
@ -1352,6 +1353,7 @@
<ClCompile Include="..\src\sound\null_s.cpp" /> <ClCompile Include="..\src\sound\null_s.cpp" />
<ClCompile Include="..\src\sound\sdl_s.cpp" /> <ClCompile Include="..\src\sound\sdl_s.cpp" />
<ClCompile Include="..\src\sound\win32_s.cpp" /> <ClCompile Include="..\src\sound\win32_s.cpp" />
<ClCompile Include="..\src\sound\xaudio2_s.cpp" />
<ClCompile Include="..\src\os\windows\crashlog_win.cpp" /> <ClCompile Include="..\src\os\windows\crashlog_win.cpp" />
<ResourceCompile Include="..\src\os\windows\ottdres.rc" /> <ResourceCompile Include="..\src\os\windows\ottdres.rc" />
<ClCompile Include="..\src\os\windows\win32.cpp" /> <ClCompile Include="..\src\os\windows\win32.cpp" />

@ -1308,6 +1308,9 @@
<ClInclude Include="..\src\window_type.h"> <ClInclude Include="..\src\window_type.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\src\sound\xaudio2_s.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\zoom_func.h"> <ClInclude Include="..\src\zoom_func.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
@ -3216,6 +3219,9 @@
<ClCompile Include="..\src\sound\win32_s.cpp"> <ClCompile Include="..\src\sound\win32_s.cpp">
<Filter>Sound</Filter> <Filter>Sound</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\src\sound\xaudio2_s.cpp">
<Filter>Sound</Filter>
</ClCompile>
<ClCompile Include="..\src\os\windows\crashlog_win.cpp"> <ClCompile Include="..\src\os\windows\crashlog_win.cpp">
<Filter>Windows files</Filter> <Filter>Windows files</Filter>
</ClCompile> </ClCompile>

@ -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_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;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>
@ -162,7 +162,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_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;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>
@ -216,7 +216,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_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;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>
@ -274,7 +274,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_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;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>

@ -105,7 +105,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_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;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>
@ -170,7 +170,7 @@
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<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_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;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>
@ -228,7 +228,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_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;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>
@ -291,7 +291,7 @@
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<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_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;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>
@ -737,6 +737,7 @@
<ClInclude Include="..\src\window_func.h" /> <ClInclude Include="..\src\window_func.h" />
<ClInclude Include="..\src\window_gui.h" /> <ClInclude Include="..\src\window_gui.h" />
<ClInclude Include="..\src\window_type.h" /> <ClInclude Include="..\src\window_type.h" />
<ClInclude Include="..\src\sound\xaudio2_s.h" />
<ClInclude Include="..\src\zoom_func.h" /> <ClInclude Include="..\src\zoom_func.h" />
<ClInclude Include="..\src\zoom_type.h" /> <ClInclude Include="..\src\zoom_type.h" />
<ClInclude Include="..\src\zoning.h" /> <ClInclude Include="..\src\zoning.h" />
@ -1373,6 +1374,7 @@
<ClCompile Include="..\src\sound\null_s.cpp" /> <ClCompile Include="..\src\sound\null_s.cpp" />
<ClCompile Include="..\src\sound\sdl_s.cpp" /> <ClCompile Include="..\src\sound\sdl_s.cpp" />
<ClCompile Include="..\src\sound\win32_s.cpp" /> <ClCompile Include="..\src\sound\win32_s.cpp" />
<ClCompile Include="..\src\sound\xaudio2_s.cpp" />
<ClCompile Include="..\src\os\windows\crashlog_win.cpp" /> <ClCompile Include="..\src\os\windows\crashlog_win.cpp" />
<ResourceCompile Include="..\src\os\windows\ottdres.rc" /> <ResourceCompile Include="..\src\os\windows\ottdres.rc" />
<ClCompile Include="..\src\os\windows\win32.cpp" /> <ClCompile Include="..\src\os\windows\win32.cpp" />

@ -1308,6 +1308,9 @@
<ClInclude Include="..\src\window_type.h"> <ClInclude Include="..\src\window_type.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\src\sound\xaudio2_s.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\zoom_func.h"> <ClInclude Include="..\src\zoom_func.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
@ -3216,6 +3219,9 @@
<ClCompile Include="..\src\sound\win32_s.cpp"> <ClCompile Include="..\src\sound\win32_s.cpp">
<Filter>Sound</Filter> <Filter>Sound</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\src\sound\xaudio2_s.cpp">
<Filter>Sound</Filter>
</ClCompile>
<ClCompile Include="..\src\os\windows\crashlog_win.cpp"> <ClCompile Include="..\src\os\windows\crashlog_win.cpp">
<Filter>Windows files</Filter> <Filter>Windows files</Filter>
</ClCompile> </ClCompile>

@ -105,7 +105,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_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;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>
@ -170,7 +170,7 @@
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<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_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;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>
@ -228,7 +228,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_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;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>
@ -291,7 +291,7 @@
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<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_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;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>

@ -105,7 +105,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_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;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>
@ -170,7 +170,7 @@
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<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_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;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>
@ -228,7 +228,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_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;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>
@ -291,7 +291,7 @@
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<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_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;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>
@ -737,6 +737,7 @@
<ClInclude Include="..\src\window_func.h" /> <ClInclude Include="..\src\window_func.h" />
<ClInclude Include="..\src\window_gui.h" /> <ClInclude Include="..\src\window_gui.h" />
<ClInclude Include="..\src\window_type.h" /> <ClInclude Include="..\src\window_type.h" />
<ClInclude Include="..\src\sound\xaudio2_s.h" />
<ClInclude Include="..\src\zoom_func.h" /> <ClInclude Include="..\src\zoom_func.h" />
<ClInclude Include="..\src\zoom_type.h" /> <ClInclude Include="..\src\zoom_type.h" />
<ClInclude Include="..\src\zoning.h" /> <ClInclude Include="..\src\zoning.h" />
@ -1373,6 +1374,7 @@
<ClCompile Include="..\src\sound\null_s.cpp" /> <ClCompile Include="..\src\sound\null_s.cpp" />
<ClCompile Include="..\src\sound\sdl_s.cpp" /> <ClCompile Include="..\src\sound\sdl_s.cpp" />
<ClCompile Include="..\src\sound\win32_s.cpp" /> <ClCompile Include="..\src\sound\win32_s.cpp" />
<ClCompile Include="..\src\sound\xaudio2_s.cpp" />
<ClCompile Include="..\src\os\windows\crashlog_win.cpp" /> <ClCompile Include="..\src\os\windows\crashlog_win.cpp" />
<ResourceCompile Include="..\src\os\windows\ottdres.rc" /> <ResourceCompile Include="..\src\os\windows\ottdres.rc" />
<ClCompile Include="..\src\os\windows\win32.cpp" /> <ClCompile Include="..\src\os\windows\win32.cpp" />

@ -1308,6 +1308,9 @@
<ClInclude Include="..\src\window_type.h"> <ClInclude Include="..\src\window_type.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\src\sound\xaudio2_s.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\zoom_func.h"> <ClInclude Include="..\src\zoom_func.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
@ -3216,6 +3219,9 @@
<ClCompile Include="..\src\sound\win32_s.cpp"> <ClCompile Include="..\src\sound\win32_s.cpp">
<Filter>Sound</Filter> <Filter>Sound</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\src\sound\xaudio2_s.cpp">
<Filter>Sound</Filter>
</ClCompile>
<ClCompile Include="..\src\os\windows\crashlog_win.cpp"> <ClCompile Include="..\src\os\windows\crashlog_win.cpp">
<Filter>Windows files</Filter> <Filter>Windows files</Filter>
</ClCompile> </ClCompile>

@ -105,7 +105,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_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;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>
@ -170,7 +170,7 @@
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<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_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WIN32_ENABLE_DIRECTMUSIC_SUPPORT;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;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>
@ -228,7 +228,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_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;WITH_ASSERT;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;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>
@ -291,7 +291,7 @@
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<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_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;U_STATIC_IMPLEMENTATION;ENABLE_NETWORK;WITH_PERSONAL_DIR;PERSONAL_DIR="OpenTTD";_SQ64;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WITH_XAUDIO2;WITH_SSE;WITH_ZLIB;WITH_LZO;WITH_LZMA;LZMA_API_STATIC;WITH_PNG;WITH_FREETYPE;WITH_ICU_SORT;WITH_ICU_LAYOUT;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>

@ -2050,6 +2050,10 @@
RelativePath=".\..\src\window_type.h" RelativePath=".\..\src\window_type.h"
> >
</File> </File>
<File
RelativePath=".\..\src\sound\xaudio2_s.h"
>
</File>
<File <File
RelativePath=".\..\src\zoom_func.h" RelativePath=".\..\src\zoom_func.h"
> >
@ -4710,6 +4714,10 @@
RelativePath=".\..\src\sound\win32_s.cpp" RelativePath=".\..\src\sound\win32_s.cpp"
> >
</File> </File>
<File
RelativePath=".\..\src\sound\xaudio2_s.cpp"
>
</File>
</Filter> </Filter>
<Filter <Filter
Name="Windows files" Name="Windows files"

@ -2047,6 +2047,10 @@
RelativePath=".\..\src\window_type.h" RelativePath=".\..\src\window_type.h"
> >
</File> </File>
<File
RelativePath=".\..\src\sound\xaudio2_s.h"
>
</File>
<File <File
RelativePath=".\..\src\zoom_func.h" RelativePath=".\..\src\zoom_func.h"
> >
@ -4707,6 +4711,10 @@
RelativePath=".\..\src\sound\win32_s.cpp" RelativePath=".\..\src\sound\win32_s.cpp"
> >
</File> </File>
<File
RelativePath=".\..\src\sound\xaudio2_s.cpp"
>
</File>
</Filter> </Filter>
<Filter <Filter
Name="Windows files" Name="Windows files"

@ -429,6 +429,7 @@ video/win32_v.h
window_func.h window_func.h
window_gui.h window_gui.h
window_type.h window_type.h
sound/xaudio2_s.h
zoom_func.h zoom_func.h
zoom_type.h zoom_type.h
zoning.h zoning.h
@ -1190,6 +1191,7 @@ sound/null_s.cpp
#end #end
#if WIN32 #if WIN32
sound/win32_s.cpp sound/win32_s.cpp
sound/xaudio2_s.cpp
#end #end
#end #end

@ -91,7 +91,7 @@ struct Aircraft FINAL : public SpecializedVehicle<Aircraft, VEH_AIRCRAFT> {
virtual ~Aircraft() { this->PreDestructor(); } virtual ~Aircraft() { this->PreDestructor(); }
void MarkDirty(); void MarkDirty();
void UpdateDeltaXY(Direction direction); void UpdateDeltaXY();
ExpensesType GetExpenseType(bool income) const { return income ? EXPENSES_AIRCRAFT_INC : EXPENSES_AIRCRAFT_RUN; } ExpensesType GetExpenseType(bool income) const { return income ? EXPENSES_AIRCRAFT_INC : EXPENSES_AIRCRAFT_RUN; }
bool IsPrimaryVehicle() const { return this->IsNormalAircraft(); } bool IsPrimaryVehicle() const { return this->IsNormalAircraft(); }
void GetImage(Direction direction, EngineImageType image_type, VehicleSpriteSeq *result) const; void GetImage(Direction direction, EngineImageType image_type, VehicleSpriteSeq *result) const;

@ -43,7 +43,7 @@
#include "safeguards.h" #include "safeguards.h"
void Aircraft::UpdateDeltaXY(Direction direction) void Aircraft::UpdateDeltaXY()
{ {
this->x_offs = -1; this->x_offs = -1;
this->y_offs = -1; this->y_offs = -1;
@ -307,10 +307,10 @@ CommandCost CmdBuildAircraft(TileIndex tile, DoCommandFlag flags, const Engine *
u->engine_type = e->index; u->engine_type = e->index;
v->subtype = (avi->subtype & AIR_CTOL ? AIR_AIRCRAFT : AIR_HELICOPTER); v->subtype = (avi->subtype & AIR_CTOL ? AIR_AIRCRAFT : AIR_HELICOPTER);
v->UpdateDeltaXY(INVALID_DIR); v->UpdateDeltaXY();
u->subtype = AIR_SHADOW; u->subtype = AIR_SHADOW;
u->UpdateDeltaXY(INVALID_DIR); u->UpdateDeltaXY();
v->reliability = e->reliability; v->reliability = e->reliability;
v->reliability_spd_dec = e->reliability_spd_dec; v->reliability_spd_dec = e->reliability_spd_dec;
@ -373,7 +373,7 @@ CommandCost CmdBuildAircraft(TileIndex tile, DoCommandFlag flags, const Engine *
w->random_bits = VehicleRandomBits(); w->random_bits = VehicleRandomBits();
/* Use rotor's air.state to store the rotor animation frame */ /* Use rotor's air.state to store the rotor animation frame */
w->state = HRS_ROTOR_STOPPED; w->state = HRS_ROTOR_STOPPED;
w->UpdateDeltaXY(INVALID_DIR); w->UpdateDeltaXY();
u->SetNext(w); u->SetNext(w);
w->UpdatePosition(); w->UpdatePosition();
@ -1429,7 +1429,7 @@ static void AircraftEntersTerminal(Aircraft *v)
*/ */
static void AircraftLandAirplane(Aircraft *v) static void AircraftLandAirplane(Aircraft *v)
{ {
v->UpdateDeltaXY(INVALID_DIR); v->UpdateDeltaXY();
if (!PlayVehicleSound(v, VSE_TOUCHDOWN)) { if (!PlayVehicleSound(v, VSE_TOUCHDOWN)) {
SndPlayVehicleFx(SND_17_SKID_PLANE, v); SndPlayVehicleFx(SND_17_SKID_PLANE, v);
@ -1628,7 +1628,7 @@ static void AircraftEventHandler_TakeOff(Aircraft *v, const AirportFTAClass *apc
static void AircraftEventHandler_StartTakeOff(Aircraft *v, const AirportFTAClass *apc) static void AircraftEventHandler_StartTakeOff(Aircraft *v, const AirportFTAClass *apc)
{ {
v->state = ENDTAKEOFF; v->state = ENDTAKEOFF;
v->UpdateDeltaXY(INVALID_DIR); v->UpdateDeltaXY();
} }
static void AircraftEventHandler_EndTakeOff(Aircraft *v, const AirportFTAClass *apc) static void AircraftEventHandler_EndTakeOff(Aircraft *v, const AirportFTAClass *apc)
@ -1641,7 +1641,7 @@ static void AircraftEventHandler_EndTakeOff(Aircraft *v, const AirportFTAClass *
static void AircraftEventHandler_HeliTakeOff(Aircraft *v, const AirportFTAClass *apc) static void AircraftEventHandler_HeliTakeOff(Aircraft *v, const AirportFTAClass *apc)
{ {
v->state = FLYING; v->state = FLYING;
v->UpdateDeltaXY(INVALID_DIR); v->UpdateDeltaXY();
/* get the next position to go to, differs per airport */ /* get the next position to go to, differs per airport */
AircraftNextAirportPos_and_Order(v); AircraftNextAirportPos_and_Order(v);
@ -1707,7 +1707,7 @@ static void AircraftEventHandler_Landing(Aircraft *v, const AirportFTAClass *apc
static void AircraftEventHandler_HeliLanding(Aircraft *v, const AirportFTAClass *apc) static void AircraftEventHandler_HeliLanding(Aircraft *v, const AirportFTAClass *apc)
{ {
v->state = HELIENDLANDING; v->state = HELIENDLANDING;
v->UpdateDeltaXY(INVALID_DIR); v->UpdateDeltaXY();
} }
static void AircraftEventHandler_EndLanding(Aircraft *v, const AirportFTAClass *apc) static void AircraftEventHandler_EndLanding(Aircraft *v, const AirportFTAClass *apc)

@ -152,12 +152,12 @@ static inline uint16 GetVehicleDefaultCapacity(EngineID engine, CargoID *cargo_t
* @param include_initial_cargo_type if true the default cargo type of the vehicle is included; if false only the refit_mask * @param include_initial_cargo_type if true the default cargo type of the vehicle is included; if false only the refit_mask
* @return bit set of CargoIDs * @return bit set of CargoIDs
*/ */
static inline uint32 GetAvailableVehicleCargoTypes(EngineID engine, bool include_initial_cargo_type) static inline CargoTypes GetAvailableVehicleCargoTypes(EngineID engine, bool include_initial_cargo_type)
{ {
const Engine *e = Engine::Get(engine); const Engine *e = Engine::Get(engine);
if (!e->CanCarryCargo()) return 0; if (!e->CanCarryCargo()) return 0;
uint32 cargoes = e->info.refit_mask; CargoTypes cargoes = e->info.refit_mask;
if (include_initial_cargo_type) { if (include_initial_cargo_type) {
SetBit(cargoes, e->GetDefaultCargoType()); SetBit(cargoes, e->GetDefaultCargoType());
@ -202,7 +202,7 @@ CargoArray GetCapacityOfArticulatedParts(EngineID engine)
* @param[out] cargoes Total amount of units that can be transported, summed by cargo. * @param[out] cargoes Total amount of units that can be transported, summed by cargo.
* @param[out] refits Whether a (possibly partial) refit for each cargo is possible. * @param[out] refits Whether a (possibly partial) refit for each cargo is possible.
*/ */
void GetArticulatedVehicleCargoesAndRefits(EngineID engine, CargoArray *cargoes, uint32 *refits) void GetArticulatedVehicleCargoesAndRefits(EngineID engine, CargoArray *cargoes, CargoTypes *refits)
{ {
cargoes->Clear(); cargoes->Clear();
*refits = 0; *refits = 0;
@ -261,12 +261,12 @@ bool IsArticulatedVehicleRefittable(EngineID engine)
* @param union_mask returns bit mask of CargoIDs which are a refit option for at least one articulated part * @param union_mask returns bit mask of CargoIDs which are a refit option for at least one articulated part
* @param intersection_mask returns bit mask of CargoIDs which are a refit option for every articulated part (with default capacity > 0) * @param intersection_mask returns bit mask of CargoIDs which are a refit option for every articulated part (with default capacity > 0)
*/ */
void GetArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type, uint32 *union_mask, uint32 *intersection_mask) void GetArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type, CargoTypes *union_mask, CargoTypes *intersection_mask)
{ {
const Engine *e = Engine::Get(engine); const Engine *e = Engine::Get(engine);
uint32 veh_cargoes = GetAvailableVehicleCargoTypes(engine, include_initial_cargo_type); CargoTypes veh_cargoes = GetAvailableVehicleCargoTypes(engine, include_initial_cargo_type);
*union_mask = veh_cargoes; *union_mask = veh_cargoes;
*intersection_mask = (veh_cargoes != 0) ? veh_cargoes : UINT32_MAX; *intersection_mask = (veh_cargoes != 0) ? veh_cargoes : ALL_CARGOTYPES;
if (!e->IsGroundVehicle()) return; if (!e->IsGroundVehicle()) return;
if (!HasBit(e->info.callback_mask, CBM_VEHICLE_ARTIC_ENGINE)) return; if (!HasBit(e->info.callback_mask, CBM_VEHICLE_ARTIC_ENGINE)) return;
@ -287,9 +287,9 @@ void GetArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type,
* @param include_initial_cargo_type if true the default cargo type of the vehicle is included; if false only the refit_mask * @param include_initial_cargo_type if true the default cargo type of the vehicle is included; if false only the refit_mask
* @return bit mask of CargoIDs which are a refit option for at least one articulated part * @return bit mask of CargoIDs which are a refit option for at least one articulated part
*/ */
uint32 GetUnionOfArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type) CargoTypes GetUnionOfArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type)
{ {
uint32 union_mask, intersection_mask; CargoTypes union_mask, intersection_mask;
GetArticulatedRefitMasks(engine, include_initial_cargo_type, &union_mask, &intersection_mask); GetArticulatedRefitMasks(engine, include_initial_cargo_type, &union_mask, &intersection_mask);
return union_mask; return union_mask;
} }
@ -300,9 +300,9 @@ uint32 GetUnionOfArticulatedRefitMasks(EngineID engine, bool include_initial_car
* @param include_initial_cargo_type if true the default cargo type of the vehicle is included; if false only the refit_mask * @param include_initial_cargo_type if true the default cargo type of the vehicle is included; if false only the refit_mask
* @return bit mask of CargoIDs which are a refit option for every articulated part (with default capacity > 0) * @return bit mask of CargoIDs which are a refit option for every articulated part (with default capacity > 0)
*/ */
uint32 GetIntersectionOfArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type) CargoTypes GetIntersectionOfArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type)
{ {
uint32 union_mask, intersection_mask; CargoTypes union_mask, intersection_mask;
GetArticulatedRefitMasks(engine, include_initial_cargo_type, &union_mask, &intersection_mask); GetArticulatedRefitMasks(engine, include_initial_cargo_type, &union_mask, &intersection_mask);
return intersection_mask; return intersection_mask;
} }
@ -347,16 +347,16 @@ void CheckConsistencyOfArticulatedVehicle(const Vehicle *v)
{ {
const Engine *engine = v->GetEngine(); const Engine *engine = v->GetEngine();
uint32 purchase_refit_union, purchase_refit_intersection; CargoTypes purchase_refit_union, purchase_refit_intersection;
GetArticulatedRefitMasks(v->engine_type, true, &purchase_refit_union, &purchase_refit_intersection); GetArticulatedRefitMasks(v->engine_type, true, &purchase_refit_union, &purchase_refit_intersection);
CargoArray purchase_default_capacity = GetCapacityOfArticulatedParts(v->engine_type); CargoArray purchase_default_capacity = GetCapacityOfArticulatedParts(v->engine_type);
uint32 real_refit_union = 0; CargoTypes real_refit_union = 0;
uint32 real_refit_intersection = UINT_MAX; CargoTypes real_refit_intersection = ALL_CARGOTYPES;
CargoArray real_default_capacity; CargoArray real_default_capacity;
do { do {
uint32 refit_mask = GetAvailableVehicleCargoTypes(v->engine_type, true); CargoTypes refit_mask = GetAvailableVehicleCargoTypes(v->engine_type, true);
real_refit_union |= refit_mask; real_refit_union |= refit_mask;
if (refit_mask != 0) real_refit_intersection &= refit_mask; if (refit_mask != 0) real_refit_intersection &= refit_mask;

@ -20,9 +20,9 @@ uint CountArticulatedParts(EngineID engine_type, bool purchase_window);
void GetArticulatedPartsEngineIDs(EngineID engine_type, bool purchase_window, std::vector<EngineID> &ids); void GetArticulatedPartsEngineIDs(EngineID engine_type, bool purchase_window, std::vector<EngineID> &ids);
CargoArray GetCapacityOfArticulatedParts(EngineID engine); CargoArray GetCapacityOfArticulatedParts(EngineID engine);
void AddArticulatedParts(Vehicle *first); void AddArticulatedParts(Vehicle *first);
void GetArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type, uint32 *union_mask, uint32 *intersection_mask); void GetArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type, CargoTypes *union_mask, CargoTypes *intersection_mask);
uint32 GetUnionOfArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type); CargoTypes GetUnionOfArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type);
uint32 GetIntersectionOfArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type); CargoTypes GetIntersectionOfArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type);
bool IsArticulatedVehicleCarryingDifferentCargoes(const Vehicle *v, CargoID *cargo_type); bool IsArticulatedVehicleCarryingDifferentCargoes(const Vehicle *v, CargoID *cargo_type);
bool IsArticulatedVehicleRefittable(EngineID engine); bool IsArticulatedVehicleRefittable(EngineID engine);
bool IsArticulatedEngine(EngineID engine_type); bool IsArticulatedEngine(EngineID engine_type);

@ -38,8 +38,8 @@ extern void ChangeVehicleViewWindow(VehicleID from_index, VehicleID to_index);
*/ */
static bool EnginesHaveCargoInCommon(EngineID engine_a, EngineID engine_b) static bool EnginesHaveCargoInCommon(EngineID engine_a, EngineID engine_b)
{ {
uint32 available_cargoes_a = GetUnionOfArticulatedRefitMasks(engine_a, true); CargoTypes available_cargoes_a = GetUnionOfArticulatedRefitMasks(engine_a, true);
uint32 available_cargoes_b = GetUnionOfArticulatedRefitMasks(engine_b, true); CargoTypes available_cargoes_b = GetUnionOfArticulatedRefitMasks(engine_b, true);
return (available_cargoes_a == 0 || available_cargoes_b == 0 || (available_cargoes_a & available_cargoes_b) != 0); return (available_cargoes_a == 0 || available_cargoes_b == 0 || (available_cargoes_a & available_cargoes_b) != 0);
} }
@ -174,9 +174,8 @@ static void TransferCargo(Vehicle *old_veh, Vehicle *new_head, bool part_of_chai
*/ */
static bool VerifyAutoreplaceRefitForOrders(const Vehicle *v, EngineID engine_type) static bool VerifyAutoreplaceRefitForOrders(const Vehicle *v, EngineID engine_type)
{ {
CargoTypes union_refit_mask_a = GetUnionOfArticulatedRefitMasks(v->engine_type, false);
uint32 union_refit_mask_a = GetUnionOfArticulatedRefitMasks(v->engine_type, false); CargoTypes union_refit_mask_b = GetUnionOfArticulatedRefitMasks(engine_type, false);
uint32 union_refit_mask_b = GetUnionOfArticulatedRefitMasks(engine_type, false);
const Order *o; const Order *o;
const Vehicle *u = (v->type == VEH_TRAIN) ? v->First() : v; const Vehicle *u = (v->type == VEH_TRAIN) ? v->First() : v;
@ -202,7 +201,7 @@ static bool VerifyAutoreplaceRefitForOrders(const Vehicle *v, EngineID engine_ty
*/ */
static CargoID GetNewCargoTypeForReplace(Vehicle *v, EngineID engine_type, bool part_of_chain) static CargoID GetNewCargoTypeForReplace(Vehicle *v, EngineID engine_type, bool part_of_chain)
{ {
uint32 available_cargo_types, union_mask; CargoTypes available_cargo_types, union_mask;
GetArticulatedRefitMasks(engine_type, true, &union_mask, &available_cargo_types); GetArticulatedRefitMasks(engine_type, true, &union_mask, &available_cargo_types);
if (union_mask == 0) return CT_NO_REFIT; // Don't try to refit an engine with no cargo capacity if (union_mask == 0) return CT_NO_REFIT; // Don't try to refit an engine with no cargo capacity

@ -71,7 +71,7 @@ struct BaseStation : StationPool::PoolItem<&_station_pool> {
uint16 random_bits; ///< Random bits assigned to this station uint16 random_bits; ///< Random bits assigned to this station
byte waiting_triggers; ///< Waiting triggers (NewGRF) for this station byte waiting_triggers; ///< Waiting triggers (NewGRF) for this station
uint8 cached_anim_triggers; ///< NOSAVE: Combined animation trigger bitmask, used to determine if trigger processing should happen. uint8 cached_anim_triggers; ///< NOSAVE: Combined animation trigger bitmask, used to determine if trigger processing should happen.
uint32 cached_cargo_triggers; ///< NOSAVE: Combined cargo trigger bitmask CargoTypes cached_cargo_triggers; ///< NOSAVE: Combined cargo trigger bitmask
TileArea train_station; ///< Tile area the train 'station' part covers TileArea train_station; ///< Tile area the train 'station' part covers
StationRect rect; ///< NOSAVE: Station spread out rectangle maintained by StationRect::xxx() functions StationRect rect; ///< NOSAVE: Station spread out rectangle maintained by StationRect::xxx() functions

@ -318,9 +318,7 @@ void Blitter_32bppAnim::DrawColourMappingRect(void *dst, int width, int height,
} }
Colour *udst = (Colour *)dst; Colour *udst = (Colour *)dst;
uint16 *anim; uint16 *anim = this->anim_buf + this->ScreenToAnimOffset((uint32 *)dst);
anim = this->anim_buf + this->ScreenToAnimOffset((uint32 *)dst);
if (pal == PALETTE_TO_TRANSPARENT) { if (pal == PALETTE_TO_TRANSPARENT) {
do { do {
@ -432,9 +430,7 @@ void Blitter_32bppAnim::DrawRect(void *video, int width, int height, uint8 colou
} }
Colour colour32 = LookupColourInPalette(colour); Colour colour32 = LookupColourInPalette(colour);
uint16 *anim_line; uint16 *anim_line = this->ScreenToAnimOffset((uint32 *)video) + this->anim_buf;
anim_line = this->ScreenToAnimOffset((uint32 *)video) + this->anim_buf;
do { do {
Colour *dst = (Colour *)video; Colour *dst = (Colour *)video;
@ -616,8 +612,8 @@ void Blitter_32bppAnim::PostResize()
if (_screen.width != this->anim_buf_width || _screen.height != this->anim_buf_height) { if (_screen.width != this->anim_buf_width || _screen.height != this->anim_buf_height) {
/* The size of the screen changed; we can assume we can wipe all data from our buffer */ /* The size of the screen changed; we can assume we can wipe all data from our buffer */
free(this->anim_alloc); free(this->anim_alloc);
this->anim_buf_height = _screen.height;
this->anim_buf_width = _screen.width; this->anim_buf_width = _screen.width;
this->anim_buf_height = _screen.height;
this->anim_buf_pitch = (_screen.width + 7) & ~7; this->anim_buf_pitch = (_screen.width + 7) & ~7;
this->anim_alloc = CallocT<uint16>(this->anim_buf_pitch * this->anim_buf_height + 8); this->anim_alloc = CallocT<uint16>(this->anim_buf_pitch * this->anim_buf_height + 8);

@ -195,10 +195,10 @@ Colour Blitter_32bppBase::ReallyAdjustBrightness(Colour colour, uint8 brightness
/* Reduce overbright strength */ /* Reduce overbright strength */
ob /= 2; ob /= 2;
return Colour( return Colour(
r >= 255 ? 255 : min(r + ob * (255 - r) / 256, 255), r >= 255 ? 255 : min(r + ob * (255 - r) / 256, 255),
g >= 255 ? 255 : min(g + ob * (255 - g) / 256, 255), g >= 255 ? 255 : min(g + ob * (255 - g) / 256, 255),
b >= 255 ? 255 : min(b + ob * (255 - b) / 256, 255), b >= 255 ? 255 : min(b + ob * (255 - b) / 256, 255),
colour.a); colour.a);
} }
Blitter::PaletteAnimation Blitter_32bppBase::UsePaletteAnimation() Blitter::PaletteAnimation Blitter_32bppBase::UsePaletteAnimation()

@ -529,7 +529,7 @@ const StringID _engine_sort_listing[][12] = {{
static bool CDECL CargoFilter(const EngineID *eid, const CargoID cid) static bool CDECL CargoFilter(const EngineID *eid, const CargoID cid)
{ {
if (cid == CF_ANY) return true; if (cid == CF_ANY) return true;
uint32 refit_mask = GetUnionOfArticulatedRefitMasks(*eid, true) & _standard_cargo_mask; CargoTypes refit_mask = GetUnionOfArticulatedRefitMasks(*eid, true) & _standard_cargo_mask;
return (cid == CF_NONE ? refit_mask == 0 : HasBit(refit_mask, cid)); return (cid == CF_NONE ? refit_mask == 0 : HasBit(refit_mask, cid));
} }
@ -540,7 +540,7 @@ static GUIEngineList::FilterFunction * const _filter_funcs[] = {
static int DrawCargoCapacityInfo(int left, int right, int y, EngineID engine) static int DrawCargoCapacityInfo(int left, int right, int y, EngineID engine)
{ {
CargoArray cap; CargoArray cap;
uint32 refits; CargoTypes refits;
GetArticulatedVehicleCargoesAndRefits(engine, &cap, &refits); GetArticulatedVehicleCargoesAndRefits(engine, &cap, &refits);
for (CargoID c = 0; c < NUM_CARGO; c++) { for (CargoID c = 0; c < NUM_CARGO; c++) {

@ -22,7 +22,7 @@
typedef byte CargoID; typedef byte CargoID;
/** Available types of cargo */ /** Available types of cargo */
enum CargoTypes { enum CargoType {
/* Temperate */ /* Temperate */
CT_PASSENGERS = 0, CT_PASSENGERS = 0,
CT_COAL = 1, CT_COAL = 1,
@ -70,6 +70,10 @@ enum CargoTypes {
CT_INVALID = 0xFF, ///< Invalid cargo type. CT_INVALID = 0xFF, ///< Invalid cargo type.
}; };
typedef uint32 CargoTypes;
static const CargoTypes ALL_CARGOTYPES = (CargoTypes)UINT32_MAX;
/** Class for storing amounts of cargo */ /** Class for storing amounts of cargo */
struct CargoArray { struct CargoArray {
private: private:

@ -28,12 +28,12 @@ CargoSpec CargoSpec::array[NUM_CARGO];
* Bitmask of cargo types available. This includes phony cargoes like regearing cargoes. * Bitmask of cargo types available. This includes phony cargoes like regearing cargoes.
* Initialized during a call to #SetupCargoForClimate. * Initialized during a call to #SetupCargoForClimate.
*/ */
uint32 _cargo_mask; CargoTypes _cargo_mask;
/** /**
* Bitmask of real cargo types available. Phony cargoes like regearing cargoes are excluded. * Bitmask of real cargo types available. Phony cargoes like regearing cargoes are excluded.
*/ */
uint32 _standard_cargo_mask; CargoTypes _standard_cargo_mask;
/** /**
* Set up the default cargo types for the given landscape type. * Set up the default cargo types for the given landscape type.

@ -129,8 +129,8 @@ private:
friend void SetupCargoForClimate(LandscapeID l); friend void SetupCargoForClimate(LandscapeID l);
}; };
extern uint32 _cargo_mask; extern CargoTypes _cargo_mask;
extern uint32 _standard_cargo_mask; extern CargoTypes _standard_cargo_mask;
void SetupCargoForClimate(LandscapeID l); void SetupCargoForClimate(LandscapeID l);
CargoID GetCargoIDByLabel(CargoLabel cl); CargoID GetCargoIDByLabel(CargoLabel cl);
@ -156,7 +156,7 @@ static inline bool IsCargoInClass(CargoID c, CargoClass cc)
if ((var = CargoSpec::Get(cargospec_index))->IsValid()) if ((var = CargoSpec::Get(cargospec_index))->IsValid())
#define FOR_ALL_CARGOSPECS(var) FOR_ALL_CARGOSPECS_FROM(var, 0) #define FOR_ALL_CARGOSPECS(var) FOR_ALL_CARGOSPECS_FROM(var, 0)
#define FOR_EACH_SET_CARGO_ID(var, cargo_bits) FOR_EACH_SET_BIT_EX(CargoID, var, uint, cargo_bits) #define FOR_EACH_SET_CARGO_ID(var, cargo_bits) FOR_EACH_SET_BIT_EX(CargoID, var, CargoTypes, cargo_bits)
/** /**
* Loop header for iterating over cargoes, sorted by name. This includes phony cargoes like regearing cargoes. * Loop header for iterating over cargoes, sorted by name. This includes phony cargoes like regearing cargoes.

@ -69,8 +69,6 @@ struct CompanyProperties {
byte colour; ///< Company colour. byte colour; ///< Company colour.
RailTypes avail_railtypes; ///< Rail types available to the company.
byte block_preview; ///< Number of quarters that the company is not allowed to get new exclusive engine previews (see CompaniesGenStatistics). byte block_preview; ///< Number of quarters that the company is not allowed to get new exclusive engine previews (see CompaniesGenStatistics).
TileIndex location_of_HQ; ///< Northern tile of HQ; #INVALID_TILE when there is none. TileIndex location_of_HQ; ///< Northern tile of HQ; #INVALID_TILE when there is none.
@ -114,6 +112,7 @@ struct Company : CompanyPool::PoolItem<&_company_pool>, CompanyProperties {
~Company(); ~Company();
Livery livery[LS_END]; Livery livery[LS_END];
RailTypes avail_railtypes; ///< Rail types available to this company.
RoadTypes avail_roadtypes; ///< Road types available to this company. RoadTypes avail_roadtypes; ///< Road types available to this company.
class AIInstance *ai_instance; class AIInstance *ai_instance;

@ -165,7 +165,7 @@ DisasterVehicle::DisasterVehicle(int x, int y, Direction direction, DisasterSubT
this->direction = direction; this->direction = direction;
this->tile = TileVirtXY(x, y); this->tile = TileVirtXY(x, y);
this->subtype = subtype; this->subtype = subtype;
this->UpdateDeltaXY(INVALID_DIR); this->UpdateDeltaXY();
this->owner = OWNER_NONE; this->owner = OWNER_NONE;
this->image_override = 0; this->image_override = 0;
this->current_order.Free(); this->current_order.Free();
@ -978,7 +978,7 @@ void ReleaseDisastersTargetingVehicle(VehicleID vehicle)
} }
} }
void DisasterVehicle::UpdateDeltaXY(Direction direction) void DisasterVehicle::UpdateDeltaXY()
{ {
this->x_offs = -1; this->x_offs = -1;
this->y_offs = -1; this->y_offs = -1;

@ -48,7 +48,7 @@ struct DisasterVehicle FINAL : public SpecializedVehicle<DisasterVehicle, VEH_DI
virtual ~DisasterVehicle() {} virtual ~DisasterVehicle() {}
void UpdatePosition(int x, int y, int z); void UpdatePosition(int x, int y, int z);
void UpdateDeltaXY(Direction direction); void UpdateDeltaXY();
void UpdateImage(); void UpdateImage();
bool Tick(); bool Tick();
}; };

@ -1432,14 +1432,14 @@ struct IsEmptyAction
struct PrepareRefitAction struct PrepareRefitAction
{ {
CargoArray &consist_capleft; ///< Capacities left in the consist. CargoArray &consist_capleft; ///< Capacities left in the consist.
uint32 &refit_mask; ///< Bitmask of possible refit cargoes. CargoTypes &refit_mask; ///< Bitmask of possible refit cargoes.
/** /**
* Create a refit preparation action. * Create a refit preparation action.
* @param consist_capleft Capacities left in consist, to be updated here. * @param consist_capleft Capacities left in consist, to be updated here.
* @param refit_mask Refit mask to be constructed from refit information of vehicles. * @param refit_mask Refit mask to be constructed from refit information of vehicles.
*/ */
PrepareRefitAction(CargoArray &consist_capleft, uint32 &refit_mask) : PrepareRefitAction(CargoArray &consist_capleft, CargoTypes &refit_mask) :
consist_capleft(consist_capleft), refit_mask(refit_mask) {} consist_capleft(consist_capleft), refit_mask(refit_mask) {}
/** /**
@ -1537,7 +1537,7 @@ static void HandleStationRefit(Vehicle *v, CargoArray &consist_capleft, Station
Backup<CompanyByte> cur_company(_current_company, v->owner, FILE_LINE); Backup<CompanyByte> cur_company(_current_company, v->owner, FILE_LINE);
uint32 refit_mask = v->GetEngine()->info.refit_mask; CargoTypes refit_mask = v->GetEngine()->info.refit_mask;
/* Remove old capacity from consist capacity and collect refit mask. */ /* Remove old capacity from consist capacity and collect refit mask. */
IterateVehicleParts(v_start, PrepareRefitAction(consist_capleft, refit_mask)); IterateVehicleParts(v_start, PrepareRefitAction(consist_capleft, refit_mask));
@ -1746,10 +1746,10 @@ static void LoadUnloadVehicle(Vehicle *front)
bool completely_emptied = true; bool completely_emptied = true;
bool anything_unloaded = false; bool anything_unloaded = false;
bool anything_loaded = false; bool anything_loaded = false;
uint32 full_load_amount = 0; CargoTypes full_load_amount = 0;
uint32 cargo_not_full = 0; CargoTypes cargo_not_full = 0;
uint32 cargo_full = 0; CargoTypes cargo_full = 0;
uint32 reservation_left = 0; CargoTypes reservation_left = 0;
front->cur_speed = 0; front->cur_speed = 0;
@ -1986,7 +1986,7 @@ static void LoadUnloadVehicle(Vehicle *front)
/* if the aircraft carries passengers and is NOT full, then /* if the aircraft carries passengers and is NOT full, then
* continue loading, no matter how much mail is in */ * continue loading, no matter how much mail is in */
if ((front->type == VEH_AIRCRAFT && IsCargoInClass(front->cargo_type, CC_PASSENGERS) && front->cargo_cap > front->cargo.StoredCount()) || if ((front->type == VEH_AIRCRAFT && IsCargoInClass(front->cargo_type, CC_PASSENGERS) && front->cargo_cap > front->cargo.StoredCount()) ||
(cargo_not_full && (cargo_full & ~cargo_not_full) == 0)) { // There are still non-full cargoes (cargo_not_full != 0 && (cargo_full & ~cargo_not_full) == 0)) { // There are still non-full cargoes
finished_loading = false; finished_loading = false;
} }
} else if (cargo_not_full != 0) { } else if (cargo_not_full != 0) {

@ -625,7 +625,7 @@ EffectVehicle *CreateEffectVehicle(int x, int y, int z, EffectVehicleType type)
v->y_pos = y; v->y_pos = y;
v->z_pos = z; v->z_pos = z;
v->tile = 0; v->tile = 0;
v->UpdateDeltaXY(INVALID_DIR); v->UpdateDeltaXY();
v->vehstatus = VS_UNCLICKABLE; v->vehstatus = VS_UNCLICKABLE;
_effect_init_procs[type](v); _effect_init_procs[type](v);
@ -669,7 +669,7 @@ bool EffectVehicle::Tick()
return _effect_tick_procs[this->subtype](this); return _effect_tick_procs[this->subtype](this);
} }
void EffectVehicle::UpdateDeltaXY(Direction direction) void EffectVehicle::UpdateDeltaXY()
{ {
this->x_offs = 0; this->x_offs = 0;
this->y_offs = 0; this->y_offs = 0;

@ -32,7 +32,7 @@ struct EffectVehicle FINAL : public SpecializedVehicle<EffectVehicle, VEH_EFFECT
/** We want to 'destruct' the right class. */ /** We want to 'destruct' the right class. */
virtual ~EffectVehicle() {} virtual ~EffectVehicle() {}
void UpdateDeltaXY(Direction direction); void UpdateDeltaXY();
bool Tick(); bool Tick();
TransparencyOption GetTransparencyOption() const; TransparencyOption GetTransparencyOption() const;
}; };

@ -762,7 +762,7 @@ static CompanyID GetPreviewCompany(Engine *e)
CompanyID best_company = INVALID_COMPANY; CompanyID best_company = INVALID_COMPANY;
/* For trains the cargomask has no useful meaning, since you can attach other wagons */ /* For trains the cargomask has no useful meaning, since you can attach other wagons */
uint32 cargomask = e->type != VEH_TRAIN ? GetUnionOfArticulatedRefitMasks(e->index, true) : (uint32)-1; CargoTypes cargomask = e->type != VEH_TRAIN ? GetUnionOfArticulatedRefitMasks(e->index, true) : ALL_CARGOTYPES;
int32 best_hist = -1; int32 best_hist = -1;
const Company *c; const Company *c;
@ -1127,7 +1127,9 @@ bool IsEngineRefittable(EngineID engine)
/* Is there any cargo except the default cargo? */ /* Is there any cargo except the default cargo? */
CargoID default_cargo = e->GetDefaultCargoType(); CargoID default_cargo = e->GetDefaultCargoType();
return default_cargo != CT_INVALID && ei->refit_mask != 1U << default_cargo; CargoTypes default_cargo_mask = 0;
SetBit(default_cargo_mask, default_cargo);
return default_cargo != CT_INVALID && ei->refit_mask != default_cargo_mask;
} }
/** /**

@ -26,7 +26,7 @@ extern const uint8 _engine_offsets[4];
bool IsEngineBuildable(EngineID engine, VehicleType type, CompanyID company); bool IsEngineBuildable(EngineID engine, VehicleType type, CompanyID company);
bool IsEngineRefittable(EngineID engine); bool IsEngineRefittable(EngineID engine);
void GetArticulatedVehicleCargoesAndRefits(EngineID engine, CargoArray *cargoes, uint32 *refits); void GetArticulatedVehicleCargoesAndRefits(EngineID engine, CargoArray *cargoes, CargoTypes *refits);
void SetYearEngineAgingStops(); void SetYearEngineAgingStops();
void StartupOneEngine(Engine *e, Date aging_date); void StartupOneEngine(Engine *e, Date aging_date);

@ -137,7 +137,7 @@ struct EngineInfo {
byte load_amount; byte load_amount;
byte climates; ///< Climates supported by the engine. byte climates; ///< Climates supported by the engine.
CargoID cargo_type; CargoID cargo_type;
uint32 refit_mask; CargoTypes refit_mask;
byte refit_cost; byte refit_cost;
byte misc_flags; ///< Miscellaneous flags. @see EngineMiscFlags byte misc_flags; ///< Miscellaneous flags. @see EngineMiscFlags
byte callback_mask; ///< Bitmask of vehicle callbacks that have to be called byte callback_mask; ///< Bitmask of vehicle callbacks that have to be called

@ -91,8 +91,8 @@ void GroundVehicle<T, Type>::CalculatePower(uint32& total_power, uint32& max_te,
if (current_power > 0) max_te += u->GetWeight() * u->GetTractiveEffort(); if (current_power > 0) max_te += u->GetWeight() * u->GetTractiveEffort();
} }
max_te *= 10000; // Tractive effort in (tonnes * 1000 * 10 =) N. max_te *= 9800; // Tractive effort in (tonnes * 1000 * 9.8 =) N.
max_te /= 256; // Tractive effort is a [0-255] coefficient. max_te /= 256; // Tractive effort is a [0-255] coefficient.
} }
/** /**

@ -391,7 +391,7 @@ static Foundation GetFoundation_Industry(TileIndex tile, Slope tileh)
return FlatteningFoundation(tileh); return FlatteningFoundation(tileh);
} }
static void AddAcceptedCargo_Industry(TileIndex tile, CargoArray &acceptance, uint32 *always_accepted) static void AddAcceptedCargo_Industry(TileIndex tile, CargoArray &acceptance, CargoTypes *always_accepted)
{ {
IndustryGfx gfx = GetIndustryGfx(tile); IndustryGfx gfx = GetIndustryGfx(tile);
const IndustryTileSpec *itspec = GetIndustryTileSpec(gfx); const IndustryTileSpec *itspec = GetIndustryTileSpec(gfx);

@ -476,7 +476,7 @@ STR_ABOUT_MENU_ZOOMIN_SCREENSHOT :Ingezoomd scree
STR_ABOUT_MENU_DEFAULTZOOM_SCREENSHOT :Screenshot met standaard zoom STR_ABOUT_MENU_DEFAULTZOOM_SCREENSHOT :Screenshot met standaard zoom
STR_ABOUT_MENU_GIANT_SCREENSHOT :Screenshot van hele kaart STR_ABOUT_MENU_GIANT_SCREENSHOT :Screenshot van hele kaart
STR_ABOUT_MENU_ABOUT_OPENTTD :Over 'OpenTTD' STR_ABOUT_MENU_ABOUT_OPENTTD :Over 'OpenTTD'
STR_ABOUT_MENU_SPRITE_ALIGNER :Sprite uitlijner STR_ABOUT_MENU_SPRITE_ALIGNER :Sprite-uitlijner
STR_ABOUT_MENU_TOGGLE_BOUNDING_BOXES :Schakel selectiekaders STR_ABOUT_MENU_TOGGLE_BOUNDING_BOXES :Schakel selectiekaders
STR_ABOUT_MENU_TOGGLE_DIRTY_BLOCKS :Schakel kleuren van braakliggende grond aan/uit STR_ABOUT_MENU_TOGGLE_DIRTY_BLOCKS :Schakel kleuren van braakliggende grond aan/uit
############ range ends here ############ range ends here
@ -1144,7 +1144,7 @@ STR_CONFIG_SETTING_RUNNING_COSTS :Onderhoudskoste
STR_CONFIG_SETTING_RUNNING_COSTS_HELPTEXT :Het niveau van onderhoud en bedrijfskosten van voertuigen en infrastuctuur STR_CONFIG_SETTING_RUNNING_COSTS_HELPTEXT :Het niveau van onderhoud en bedrijfskosten van voertuigen en infrastuctuur
STR_CONFIG_SETTING_CONSTRUCTION_SPEED :Bouwsnelheid: {STRING} STR_CONFIG_SETTING_CONSTRUCTION_SPEED :Bouwsnelheid: {STRING}
STR_CONFIG_SETTING_CONSTRUCTION_SPEED_HELPTEXT :Beperk de hoeveelheid bouwactiviteiten voor computerspeler STR_CONFIG_SETTING_CONSTRUCTION_SPEED_HELPTEXT :Beperk de hoeveelheid bouwactiviteiten voor computerspeler
STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS :Voertuig storingen: {STRING} STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS :Voertuigstoringen: {STRING}
STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS_HELPTEXT :Controle hoe vaak onvoldoende onderhouden voertuigen kapot kunnen gaan STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS_HELPTEXT :Controle hoe vaak onvoldoende onderhouden voertuigen kapot kunnen gaan
STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER :Subsidie indicator: {STRING} STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER :Subsidie indicator: {STRING}
STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER_HELPTEXT :Instellen hoeveel wordt betaald voor gesubsidieerde verbindingen STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER_HELPTEXT :Instellen hoeveel wordt betaald voor gesubsidieerde verbindingen

@ -757,6 +757,7 @@ STR_MUSIC_RULER_MARKER :{TINY_FONT}{BLA
STR_MUSIC_TRACK_NONE :{TINY_FONT}{DKGREEN}-- STR_MUSIC_TRACK_NONE :{TINY_FONT}{DKGREEN}--
STR_MUSIC_TRACK_DIGIT :{TINY_FONT}{DKGREEN}{ZEROFILL_NUM} STR_MUSIC_TRACK_DIGIT :{TINY_FONT}{DKGREEN}{ZEROFILL_NUM}
STR_MUSIC_TITLE_NONE :{TINY_FONT}{DKGREEN}------ STR_MUSIC_TITLE_NONE :{TINY_FONT}{DKGREEN}------
STR_MUSIC_TITLE_NOMUSIC :{TINY_FONT}{DKGREEN}Δεν υπάρχει διαθέσιμη μουσική
STR_MUSIC_TITLE_NAME :{TINY_FONT}{DKGREEN}«{STRING}» STR_MUSIC_TITLE_NAME :{TINY_FONT}{DKGREEN}«{STRING}»
STR_MUSIC_TRACK :{TINY_FONT}{BLACK}Κομμάτι STR_MUSIC_TRACK :{TINY_FONT}{BLACK}Κομμάτι
STR_MUSIC_XTITLE :{TINY_FONT}{BLACK}Τίτλος STR_MUSIC_XTITLE :{TINY_FONT}{BLACK}Τίτλος
@ -781,7 +782,9 @@ STR_PLAYLIST_TRACK_NAME :{TINY_FONT}{LTB
STR_PLAYLIST_TRACK_INDEX :{TINY_FONT}{BLACK}Λίστα σιδηροτροχιών STR_PLAYLIST_TRACK_INDEX :{TINY_FONT}{BLACK}Λίστα σιδηροτροχιών
STR_PLAYLIST_PROGRAM :{TINY_FONT}{BLACK}Πρόγραμμα - '{STRING}' STR_PLAYLIST_PROGRAM :{TINY_FONT}{BLACK}Πρόγραμμα - '{STRING}'
STR_PLAYLIST_CLEAR :{TINY_FONT}{BLACK}Καθαρισμός STR_PLAYLIST_CLEAR :{TINY_FONT}{BLACK}Καθαρισμός
STR_PLAYLIST_CHANGE_SET :{BLACK}Αλλαγή σετ
STR_PLAYLIST_TOOLTIP_CLEAR_CURRENT_PROGRAM_CUSTOM1 :{BLACK}Καθαρισμός τρέχοντος προγράμματος (μόνο Προσαρμοσμένο 1 ή Προσαρμοσμένο 2) STR_PLAYLIST_TOOLTIP_CLEAR_CURRENT_PROGRAM_CUSTOM1 :{BLACK}Καθαρισμός τρέχοντος προγράμματος (μόνο Προσαρμοσμένο 1 ή Προσαρμοσμένο 2)
STR_PLAYLIST_TOOLTIP_CHANGE_SET :{BLACK}Αλλαγή μουσικής επιλογής σε άλλο εγκατεστημένο σετ
STR_PLAYLIST_TOOLTIP_CLICK_TO_ADD_TRACK :{BLACK}Πατήστε στο μουσικό κομμάτι για προσθήκη στο τρέχον πρόγραμμα (Προσαρμοσμένο1 ή Προσαρμοσμένο2 μόνο) STR_PLAYLIST_TOOLTIP_CLICK_TO_ADD_TRACK :{BLACK}Πατήστε στο μουσικό κομμάτι για προσθήκη στο τρέχον πρόγραμμα (Προσαρμοσμένο1 ή Προσαρμοσμένο2 μόνο)
STR_PLAYLIST_TOOLTIP_CLICK_TO_REMOVE_TRACK :{BLACK}Πατήστε στο τραγούδι για να το αφαιρέσετε από το πρόγραμμα (Προσαρμοσμένο 1 ή 2 μόνο) STR_PLAYLIST_TOOLTIP_CLICK_TO_REMOVE_TRACK :{BLACK}Πατήστε στο τραγούδι για να το αφαιρέσετε από το πρόγραμμα (Προσαρμοσμένο 1 ή 2 μόνο)
@ -1441,6 +1444,11 @@ STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_HELPTEXT :Χρώμα εδ
STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_GREEN :Πράσινο STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_GREEN :Πράσινο
STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_DARK_GREEN :Σκούρο πράσινο STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_DARK_GREEN :Σκούρο πράσινο
STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_VIOLET :Βιολετί STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_VIOLET :Βιολετί
STR_CONFIG_SETTING_SCROLLMODE_HELPTEXT :Συμπεριφορά κατά την κύλιση του χάρτη
STR_CONFIG_SETTING_SCROLLMODE_DEFAULT :Μετακίνηση μικρού χάρτη με ΔΠΠ, θέση ποντικιού κλειδωμένη
STR_CONFIG_SETTING_SCROLLMODE_RMB_LOCKED :Μετακίνηση χάρτη με ΔΠΠ, θέση ποντικιού κλειδωμένη
STR_CONFIG_SETTING_SCROLLMODE_RMB :Μετακίνηση χάρτη με ΔΠΠ
STR_CONFIG_SETTING_SCROLLMODE_LMB :Μετακίνηση χάρτη με ΑΠΠ
STR_CONFIG_SETTING_SMOOTH_SCROLLING :Ομαλή μετάβαση οθόνης: {STRING} STR_CONFIG_SETTING_SMOOTH_SCROLLING :Ομαλή μετάβαση οθόνης: {STRING}
STR_CONFIG_SETTING_SMOOTH_SCROLLING_HELPTEXT :Ελέγξτε τον τρόπο με τον οποίο η κύρια προβολή κυλίεται σε μια συγκεκριμένη θέση όταν πατάτε πάνω στον μικρό χάρτη ή όταν δίνετε εντολή για μετάβαση σε ένα συγκεκριμένο αντικείμενο στον χάρτη. Όταν είναι ενεργοποιημένη, η κύλιση γίνεται ομαλά, και όταν είναι απενεργοποιημένη μεταβαίνει απ' ευθείας στο επιλεγμένο σημείο STR_CONFIG_SETTING_SMOOTH_SCROLLING_HELPTEXT :Ελέγξτε τον τρόπο με τον οποίο η κύρια προβολή κυλίεται σε μια συγκεκριμένη θέση όταν πατάτε πάνω στον μικρό χάρτη ή όταν δίνετε εντολή για μετάβαση σε ένα συγκεκριμένο αντικείμενο στον χάρτη. Όταν είναι ενεργοποιημένη, η κύλιση γίνεται ομαλά, και όταν είναι απενεργοποιημένη μεταβαίνει απ' ευθείας στο επιλεγμένο σημείο
STR_CONFIG_SETTING_MEASURE_TOOLTIP :Εμφάνιση εργαλείου μετρήσεως όταν χρησιμοποιούνται διάφορα εργαλεία: {STRING} STR_CONFIG_SETTING_MEASURE_TOOLTIP :Εμφάνιση εργαλείου μετρήσεως όταν χρησιμοποιούνται διάφορα εργαλεία: {STRING}

@ -1029,6 +1029,7 @@ STR_MUSIC_RULER_MARKER :{TINY_FONT}{BLA
STR_MUSIC_TRACK_NONE :{TINY_FONT}{DKGREEN}-- STR_MUSIC_TRACK_NONE :{TINY_FONT}{DKGREEN}--
STR_MUSIC_TRACK_DIGIT :{TINY_FONT}{DKGREEN}{ZEROFILL_NUM} STR_MUSIC_TRACK_DIGIT :{TINY_FONT}{DKGREEN}{ZEROFILL_NUM}
STR_MUSIC_TITLE_NONE :{TINY_FONT}{DKGREEN}------ STR_MUSIC_TITLE_NONE :{TINY_FONT}{DKGREEN}------
STR_MUSIC_TITLE_NOMUSIC :{TINY_FONT}{DKGREEN}Brak dostępnej muzyki
STR_MUSIC_TITLE_NAME :{TINY_FONT}{DKGREEN}"{STRING}" STR_MUSIC_TITLE_NAME :{TINY_FONT}{DKGREEN}"{STRING}"
STR_MUSIC_TRACK :{TINY_FONT}{BLACK}Ścieżka STR_MUSIC_TRACK :{TINY_FONT}{BLACK}Ścieżka
STR_MUSIC_XTITLE :{TINY_FONT}{BLACK}Tytuł STR_MUSIC_XTITLE :{TINY_FONT}{BLACK}Tytuł
@ -1053,6 +1054,7 @@ STR_PLAYLIST_TRACK_NAME :{TINY_FONT}{LTB
STR_PLAYLIST_TRACK_INDEX :{TINY_FONT}{BLACK}Wykaz ścieżek STR_PLAYLIST_TRACK_INDEX :{TINY_FONT}{BLACK}Wykaz ścieżek
STR_PLAYLIST_PROGRAM :{TINY_FONT}{BLACK}Programuj - '{STRING}' STR_PLAYLIST_PROGRAM :{TINY_FONT}{BLACK}Programuj - '{STRING}'
STR_PLAYLIST_CLEAR :{TINY_FONT}{BLACK}Wyczyść STR_PLAYLIST_CLEAR :{TINY_FONT}{BLACK}Wyczyść
STR_PLAYLIST_CHANGE_SET :{BLACK}Zmień zestaw
STR_PLAYLIST_TOOLTIP_CLEAR_CURRENT_PROGRAM_CUSTOM1 :{BLACK}Wyczyść obecny program (tylko Wlasny1 lub Wlasny2) STR_PLAYLIST_TOOLTIP_CLEAR_CURRENT_PROGRAM_CUSTOM1 :{BLACK}Wyczyść obecny program (tylko Wlasny1 lub Wlasny2)
STR_PLAYLIST_TOOLTIP_CLICK_TO_ADD_TRACK :{BLACK}Klik na ścieżce aby dodać do obecnego programu (Wlasny1 i Wlasny2) STR_PLAYLIST_TOOLTIP_CLICK_TO_ADD_TRACK :{BLACK}Klik na ścieżce aby dodać do obecnego programu (Wlasny1 i Wlasny2)
STR_PLAYLIST_TOOLTIP_CLICK_TO_REMOVE_TRACK :{BLACK}Kliknij na ścieżce muzycznej aby usunąć ją z wybranego programu (Wlasny1 lub Wlasny2) STR_PLAYLIST_TOOLTIP_CLICK_TO_REMOVE_TRACK :{BLACK}Kliknij na ścieżce muzycznej aby usunąć ją z wybranego programu (Wlasny1 lub Wlasny2)
@ -1714,6 +1716,9 @@ STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_HELPTEXT :Kolor terenu na
STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_GREEN :zielony STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_GREEN :zielony
STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_DARK_GREEN :ciemnozielony STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_DARK_GREEN :ciemnozielony
STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_VIOLET :fioletowy STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_VIOLET :fioletowy
STR_CONFIG_SETTING_SCROLLMODE_HELPTEXT :Zachowanie podczas przeciągania mapy
STR_CONFIG_SETTING_SCROLLMODE_RMB :Przeciągnij mapę prawym przyciskiem myszy
STR_CONFIG_SETTING_SCROLLMODE_LMB :Przeciągnij mapę lewym przyciskiem myszy
STR_CONFIG_SETTING_SMOOTH_SCROLLING :Wygładź przesuwanie widoku: {STRING} STR_CONFIG_SETTING_SMOOTH_SCROLLING :Wygładź przesuwanie widoku: {STRING}
STR_CONFIG_SETTING_SMOOTH_SCROLLING_HELPTEXT :Zdecyduj, jak główny widok przesuwa się do konkretnej lokacji, gdy klikasz na mini-mapie lub gdy używasz komendy do przesunięcia do danego obiektu na mapie. Kiedy włączone, widok przesuwa się płynnie, kiedy wyłączone, następuje skok bezpośrednio do wybranego miejsca STR_CONFIG_SETTING_SMOOTH_SCROLLING_HELPTEXT :Zdecyduj, jak główny widok przesuwa się do konkretnej lokacji, gdy klikasz na mini-mapie lub gdy używasz komendy do przesunięcia do danego obiektu na mapie. Kiedy włączone, widok przesuwa się płynnie, kiedy wyłączone, następuje skok bezpośrednio do wybranego miejsca
STR_CONFIG_SETTING_MEASURE_TOOLTIP :Pokaż dymek z pomiarem podczas używania różnych narzędzi: {STRING} STR_CONFIG_SETTING_MEASURE_TOOLTIP :Pokaż dymek z pomiarem podczas używania różnych narzędzi: {STRING}

@ -386,7 +386,7 @@ Point LinkGraphOverlay::GetStationMiddle(const Station *st) const
* Set a new cargo mask and rebuild the cache. * Set a new cargo mask and rebuild the cache.
* @param cargo_mask New cargo mask. * @param cargo_mask New cargo mask.
*/ */
void LinkGraphOverlay::SetCargoMask(uint32 cargo_mask) void LinkGraphOverlay::SetCargoMask(CargoTypes cargo_mask)
{ {
this->cargo_mask = cargo_mask; this->cargo_mask = cargo_mask;
this->RebuildCache(); this->RebuildCache();
@ -523,7 +523,7 @@ void LinkGraphLegendWindow::SetOverlay(LinkGraphOverlay *overlay) {
this->SetWidgetLoweredState(WID_LGL_COMPANY_FIRST + c, HasBit(companies, c)); this->SetWidgetLoweredState(WID_LGL_COMPANY_FIRST + c, HasBit(companies, c));
} }
} }
uint32 cargoes = this->overlay->GetCargoMask(); CargoTypes cargoes = this->overlay->GetCargoMask();
for (uint c = 0; c < NUM_CARGO; c++) { for (uint c = 0; c < NUM_CARGO; c++) {
if (!this->IsWidgetDisabled(WID_LGL_CARGO_FIRST + c)) { if (!this->IsWidgetDisabled(WID_LGL_CARGO_FIRST + c)) {
this->SetWidgetLoweredState(WID_LGL_CARGO_FIRST + c, HasBit(cargoes, c)); this->SetWidgetLoweredState(WID_LGL_CARGO_FIRST + c, HasBit(cargoes, c));
@ -629,7 +629,7 @@ void LinkGraphLegendWindow::UpdateOverlayCompanies()
*/ */
void LinkGraphLegendWindow::UpdateOverlayCargoes() void LinkGraphLegendWindow::UpdateOverlayCargoes()
{ {
uint32 mask = 0; CargoTypes mask = 0;
for (uint c = 0; c < NUM_CARGO; c++) { for (uint c = 0; c < NUM_CARGO; c++) {
if (this->IsWidgetDisabled(c + WID_LGL_CARGO_FIRST)) continue; if (this->IsWidgetDisabled(c + WID_LGL_CARGO_FIRST)) continue;
if (!this->IsWidgetLowered(c + WID_LGL_CARGO_FIRST)) continue; if (!this->IsWidgetLowered(c + WID_LGL_CARGO_FIRST)) continue;

@ -64,17 +64,17 @@ public:
* @param company_mask Bitmask of companies to be shown. * @param company_mask Bitmask of companies to be shown.
* @param scale Desired thickness of lines and size of station dots. * @param scale Desired thickness of lines and size of station dots.
*/ */
LinkGraphOverlay(const Window *w, uint wid, uint32 cargo_mask, uint32 company_mask, uint scale) : LinkGraphOverlay(const Window *w, uint wid, CargoTypes cargo_mask, uint32 company_mask, uint scale) :
window(w), widget_id(wid), cargo_mask(cargo_mask), company_mask(company_mask), scale(scale) window(w), widget_id(wid), cargo_mask(cargo_mask), company_mask(company_mask), scale(scale)
{} {}
void RebuildCache(); void RebuildCache();
void Draw(const DrawPixelInfo *dpi); void Draw(const DrawPixelInfo *dpi);
void SetCargoMask(uint32 cargo_mask); void SetCargoMask(CargoTypes cargo_mask);
void SetCompanyMask(uint32 company_mask); void SetCompanyMask(uint32 company_mask);
/** Get a bitmask of the currently shown cargoes. */ /** Get a bitmask of the currently shown cargoes. */
uint32 GetCargoMask() { return this->cargo_mask; } CargoTypes GetCargoMask() { return this->cargo_mask; }
/** Get a bitmask of the currently shown companies. */ /** Get a bitmask of the currently shown companies. */
uint32 GetCompanyMask() { return this->company_mask; } uint32 GetCompanyMask() { return this->company_mask; }
@ -82,7 +82,7 @@ public:
protected: protected:
const Window *window; ///< Window to be drawn into. const Window *window; ///< Window to be drawn into.
const uint widget_id; ///< ID of Widget in Window to be drawn to. const uint widget_id; ///< ID of Widget in Window to be drawn to.
uint32 cargo_mask; ///< Bitmask of cargos to be displayed. CargoTypes cargo_mask; ///< Bitmask of cargos to be displayed.
uint32 company_mask; ///< Bitmask of companies to be displayed. uint32 company_mask; ///< Bitmask of companies to be displayed.
LinkList cached_links; ///< Cache for links to reduce recalculation. LinkList cached_links; ///< Cache for links to reduce recalculation.
StationSupplyList cached_stations; ///< Cache for stations to be drawn. StationSupplyList cached_stations; ///< Cache for stations to be drawn.

@ -439,7 +439,7 @@ struct MainWindow : Window
/* Cycle through the drawing modes */ /* Cycle through the drawing modes */
this->viewport->map_type = ChangeRenderMode(this->viewport, wheel < 0); this->viewport->map_type = ChangeRenderMode(this->viewport, wheel < 0);
this->SetDirty(); this->SetDirty();
} else if (_settings_client.gui.scrollwheel_scrolling == 0) { } else if (_settings_client.gui.scrollwheel_scrolling != 2) {
ZoomInOrOutToCursorWindow(wheel < 0, this); ZoomInOrOutToCursorWindow(wheel < 0, this);
} }
} }

@ -161,12 +161,10 @@ protected:
/** static helper - return hash for the given key modulo number of slots */ /** static helper - return hash for the given key modulo number of slots */
inline static int CalcHash(const Tkey &key) inline static int CalcHash(const Tkey &key)
{ {
int32 hash = key.CalcHash(); uint32 hash = key.CalcHash();
if ((8 * Thash_bits) < 32) hash ^= hash >> (min(8 * Thash_bits, 31)); hash -= (hash >> 17); // hash * 131071 / 131072
if ((4 * Thash_bits) < 32) hash ^= hash >> (min(4 * Thash_bits, 31)); hash -= (hash >> 5); // * 31 / 32
if ((2 * Thash_bits) < 32) hash ^= hash >> (min(2 * Thash_bits, 31)); hash &= (1 << Thash_bits) - 1; // modulo slots
if ((1 * Thash_bits) < 32) hash ^= hash >> (min(1 * Thash_bits, 31));
hash &= (1 << Thash_bits) - 1;
return hash; return hash;
} }

@ -317,8 +317,8 @@ struct GRFTempEngineData {
Refittability refittability; ///< Did the newgrf set any refittability property? If not, default refittability will be applied. Refittability refittability; ///< Did the newgrf set any refittability property? If not, default refittability will be applied.
bool prop27_set; ///< Did the NewGRF set property 27 (misc flags)? bool prop27_set; ///< Did the NewGRF set property 27 (misc flags)?
uint8 rv_max_speed; ///< Temporary storage of RV prop 15, maximum speed in mph/0.8 uint8 rv_max_speed; ///< Temporary storage of RV prop 15, maximum speed in mph/0.8
uint32 ctt_include_mask; ///< Cargo types always included in the refit mask. CargoTypes ctt_include_mask; ///< Cargo types always included in the refit mask.
uint32 ctt_exclude_mask; ///< Cargo types always excluded from the refit mask. CargoTypes ctt_exclude_mask; ///< Cargo types always excluded from the refit mask.
/** /**
* Update the summary refittability on setting a refittability property. * Update the summary refittability on setting a refittability property.
@ -948,11 +948,11 @@ static bool ReadSpriteLayout(ByteReader *buf, uint num_building_sprites, bool us
} }
/** /**
* Translate the refit mask. * Translate the refit mask. refit_mask is uint32 as it has not been mapped to CargoTypes.
*/ */
static uint32 TranslateRefitMask(uint32 refit_mask) static CargoTypes TranslateRefitMask(uint32 refit_mask)
{ {
uint32 result = 0; CargoTypes result = 0;
uint8 bit; uint8 bit;
FOR_EACH_SET_BIT(bit, refit_mask) { FOR_EACH_SET_BIT(bit, refit_mask) {
CargoID cargo = GetCargoTranslation(bit, _cur.grffile, true); CargoID cargo = GetCargoTranslation(bit, _cur.grffile, true);
@ -1315,7 +1315,7 @@ static ChangeInfoResult RailVehicleChangeInfo(uint engine, int numinfo, int prop
uint8 count = buf->ReadByte(); uint8 count = buf->ReadByte();
_gted[e->index].UpdateRefittability(prop == 0x2C && count != 0); _gted[e->index].UpdateRefittability(prop == 0x2C && count != 0);
if (prop == 0x2C) _gted[e->index].defaultcargo_grf = _cur.grffile; if (prop == 0x2C) _gted[e->index].defaultcargo_grf = _cur.grffile;
uint32 &ctt = prop == 0x2C ? _gted[e->index].ctt_include_mask : _gted[e->index].ctt_exclude_mask; CargoTypes &ctt = prop == 0x2C ? _gted[e->index].ctt_include_mask : _gted[e->index].ctt_exclude_mask;
ctt = 0; ctt = 0;
while (count--) { while (count--) {
CargoID ctype = GetCargoTranslation(buf->ReadByte(), _cur.grffile); CargoID ctype = GetCargoTranslation(buf->ReadByte(), _cur.grffile);
@ -1503,7 +1503,7 @@ static ChangeInfoResult RoadVehicleChangeInfo(uint engine, int numinfo, int prop
uint8 count = buf->ReadByte(); uint8 count = buf->ReadByte();
_gted[e->index].UpdateRefittability(prop == 0x24 && count != 0); _gted[e->index].UpdateRefittability(prop == 0x24 && count != 0);
if (prop == 0x24) _gted[e->index].defaultcargo_grf = _cur.grffile; if (prop == 0x24) _gted[e->index].defaultcargo_grf = _cur.grffile;
uint32 &ctt = prop == 0x24 ? _gted[e->index].ctt_include_mask : _gted[e->index].ctt_exclude_mask; CargoTypes &ctt = prop == 0x24 ? _gted[e->index].ctt_include_mask : _gted[e->index].ctt_exclude_mask;
ctt = 0; ctt = 0;
while (count--) { while (count--) {
CargoID ctype = GetCargoTranslation(buf->ReadByte(), _cur.grffile); CargoID ctype = GetCargoTranslation(buf->ReadByte(), _cur.grffile);
@ -1675,7 +1675,7 @@ static ChangeInfoResult ShipVehicleChangeInfo(uint engine, int numinfo, int prop
uint8 count = buf->ReadByte(); uint8 count = buf->ReadByte();
_gted[e->index].UpdateRefittability(prop == 0x1E && count != 0); _gted[e->index].UpdateRefittability(prop == 0x1E && count != 0);
if (prop == 0x1E) _gted[e->index].defaultcargo_grf = _cur.grffile; if (prop == 0x1E) _gted[e->index].defaultcargo_grf = _cur.grffile;
uint32 &ctt = prop == 0x1E ? _gted[e->index].ctt_include_mask : _gted[e->index].ctt_exclude_mask; CargoTypes &ctt = prop == 0x1E ? _gted[e->index].ctt_include_mask : _gted[e->index].ctt_exclude_mask;
ctt = 0; ctt = 0;
while (count--) { while (count--) {
CargoID ctype = GetCargoTranslation(buf->ReadByte(), _cur.grffile); CargoID ctype = GetCargoTranslation(buf->ReadByte(), _cur.grffile);
@ -1825,7 +1825,7 @@ static ChangeInfoResult AircraftVehicleChangeInfo(uint engine, int numinfo, int
uint8 count = buf->ReadByte(); uint8 count = buf->ReadByte();
_gted[e->index].UpdateRefittability(prop == 0x1D && count != 0); _gted[e->index].UpdateRefittability(prop == 0x1D && count != 0);
if (prop == 0x1D) _gted[e->index].defaultcargo_grf = _cur.grffile; if (prop == 0x1D) _gted[e->index].defaultcargo_grf = _cur.grffile;
uint32 &ctt = prop == 0x1D ? _gted[e->index].ctt_include_mask : _gted[e->index].ctt_exclude_mask; CargoTypes &ctt = prop == 0x1D ? _gted[e->index].ctt_include_mask : _gted[e->index].ctt_exclude_mask;
ctt = 0; ctt = 0;
while (count--) { while (count--) {
CargoID ctype = GetCargoTranslation(buf->ReadByte(), _cur.grffile); CargoID ctype = GetCargoTranslation(buf->ReadByte(), _cur.grffile);
@ -2041,9 +2041,10 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte
break; break;
case 0x12: // Cargo types for random triggers case 0x12: // Cargo types for random triggers
statspec->cargo_triggers = buf->ReadDWord();
if (_cur.grffile->grf_version >= 7) { if (_cur.grffile->grf_version >= 7) {
statspec->cargo_triggers = TranslateRefitMask(statspec->cargo_triggers); statspec->cargo_triggers = TranslateRefitMask(buf->ReadDWord());
} else {
statspec->cargo_triggers = (CargoTypes)buf->ReadDWord();
} }
break; break;
@ -8319,9 +8320,9 @@ static void CalculateRefitMasks()
/* Did the newgrf specify any refitting? If not, use defaults. */ /* Did the newgrf specify any refitting? If not, use defaults. */
if (_gted[engine].refittability != GRFTempEngineData::UNSET) { if (_gted[engine].refittability != GRFTempEngineData::UNSET) {
uint32 mask = 0; CargoTypes mask = 0;
uint32 not_mask = 0; CargoTypes not_mask = 0;
uint32 xor_mask = ei->refit_mask; CargoTypes xor_mask = ei->refit_mask;
/* If the original masks set by the grf are zero, the vehicle shall only carry the default cargo. /* If the original masks set by the grf are zero, the vehicle shall only carry the default cargo.
* Note: After applying the translations, the vehicle may end up carrying no defined cargo. It becomes unavailable in that case. */ * Note: After applying the translations, the vehicle may end up carrying no defined cargo. It becomes unavailable in that case. */
@ -8342,7 +8343,7 @@ static void CalculateRefitMasks()
ei->refit_mask |= _gted[engine].ctt_include_mask; ei->refit_mask |= _gted[engine].ctt_include_mask;
ei->refit_mask &= ~_gted[engine].ctt_exclude_mask; ei->refit_mask &= ~_gted[engine].ctt_exclude_mask;
} else { } else {
uint32 xor_mask = 0; CargoTypes xor_mask = 0;
/* Don't apply default refit mask to wagons nor engines with no capacity */ /* Don't apply default refit mask to wagons nor engines with no capacity */
if (e->type != VEH_TRAIN || (e->u.rail.capacity != 0 && e->u.rail.railveh_type != RAILVEH_WAGON)) { if (e->type != VEH_TRAIN || (e->u.rail.capacity != 0 && e->u.rail.railveh_type != RAILVEH_WAGON)) {

@ -59,7 +59,7 @@ static const GRFFile *GetHouseSpecGrf(HouseID house_id)
*/ */
HouseResolverObject::HouseResolverObject(HouseID house_id, TileIndex tile, Town *town, HouseResolverObject::HouseResolverObject(HouseID house_id, TileIndex tile, Town *town,
CallbackID callback, uint32 param1, uint32 param2, CallbackID callback, uint32 param1, uint32 param2,
bool not_yet_constructed, uint8 initial_random_bits, uint32 watched_cargo_triggers) bool not_yet_constructed, uint8 initial_random_bits, CargoTypes watched_cargo_triggers)
: ResolverObject(GetHouseSpecGrf(house_id), callback, param1, param2) : ResolverObject(GetHouseSpecGrf(house_id), callback, param1, param2)
{ {
assert((tile != INVALID_TILE) == (town != NULL)); assert((tile != INVALID_TILE) == (town != NULL));
@ -489,7 +489,7 @@ static uint32 GetDistanceFromNearbyHouse(uint8 parameter, TileIndex tile, HouseI
} }
uint16 GetHouseCallback(CallbackID callback, uint32 param1, uint32 param2, HouseID house_id, Town *town, TileIndex tile, uint16 GetHouseCallback(CallbackID callback, uint32 param1, uint32 param2, HouseID house_id, Town *town, TileIndex tile,
bool not_yet_constructed, uint8 initial_random_bits, uint32 watched_cargo_triggers) bool not_yet_constructed, uint8 initial_random_bits, CargoTypes watched_cargo_triggers)
{ {
HouseResolverObject object(house_id, tile, town, callback, param1, param2, HouseResolverObject object(house_id, tile, town, callback, param1, param2,
not_yet_constructed, initial_random_bits, watched_cargo_triggers); not_yet_constructed, initial_random_bits, watched_cargo_triggers);
@ -610,13 +610,13 @@ void DrawNewHouseTileInGUI(int x, int y, HouseID house_id, bool ground)
} }
/* Simple wrapper for GetHouseCallback to keep the animation unified. */ /* Simple wrapper for GetHouseCallback to keep the animation unified. */
uint16 GetSimpleHouseCallback(CallbackID callback, uint32 param1, uint32 param2, const HouseSpec *spec, Town *town, TileIndex tile, uint32 extra_data) uint16 GetSimpleHouseCallback(CallbackID callback, uint32 param1, uint32 param2, const HouseSpec *spec, Town *town, TileIndex tile, CargoTypes extra_data)
{ {
return GetHouseCallback(callback, param1, param2, spec - HouseSpec::Get(0), town, tile, false, 0, extra_data); return GetHouseCallback(callback, param1, param2, spec - HouseSpec::Get(0), town, tile, false, 0, extra_data);
} }
/** Helper class for animation control. */ /** Helper class for animation control. */
struct HouseAnimationBase : public AnimationBase<HouseAnimationBase, HouseSpec, Town, uint32, GetSimpleHouseCallback> { struct HouseAnimationBase : public AnimationBase<HouseAnimationBase, HouseSpec, Town, CargoTypes, GetSimpleHouseCallback> {
static const CallbackID cb_animation_speed = CBID_HOUSE_ANIMATION_SPEED; static const CallbackID cb_animation_speed = CBID_HOUSE_ANIMATION_SPEED;
static const CallbackID cb_animation_next_frame = CBID_HOUSE_ANIMATION_NEXT_FRAME; static const CallbackID cb_animation_next_frame = CBID_HOUSE_ANIMATION_NEXT_FRAME;
@ -791,7 +791,7 @@ void TriggerHouse(TileIndex t, HouseTrigger trigger)
* @param trigger_cargoes Cargo types that triggered the callback. * @param trigger_cargoes Cargo types that triggered the callback.
* @param random Random bits. * @param random Random bits.
*/ */
void DoWatchedCargoCallback(TileIndex tile, TileIndex origin, uint32 trigger_cargoes, uint16 random) void DoWatchedCargoCallback(TileIndex tile, TileIndex origin, CargoTypes trigger_cargoes, uint16 random)
{ {
TileIndexDiffC diff = TileIndexToTileIndexDiffC(origin, tile); TileIndexDiffC diff = TileIndexToTileIndexDiffC(origin, tile);
uint32 cb_info = random << 16 | (uint8)diff.y << 8 | (uint8)diff.x; uint32 cb_info = random << 16 | (uint8)diff.y << 8 | (uint8)diff.x;
@ -804,7 +804,7 @@ void DoWatchedCargoCallback(TileIndex tile, TileIndex origin, uint32 trigger_car
* @param trigger_cargoes Triggering cargo types. * @param trigger_cargoes Triggering cargo types.
* @pre IsTileType(t, MP_HOUSE) * @pre IsTileType(t, MP_HOUSE)
*/ */
void WatchedCargoCallback(TileIndex tile, uint32 trigger_cargoes) void WatchedCargoCallback(TileIndex tile, CargoTypes trigger_cargoes)
{ {
assert(IsTileType(tile, MP_HOUSE)); assert(IsTileType(tile, MP_HOUSE));
HouseID id = GetHouseType(tile); HouseID id = GetHouseType(tile);

@ -25,7 +25,7 @@ struct HouseScopeResolver : public ScopeResolver {
Town *town; ///< Town of this house. Town *town; ///< Town of this house.
bool not_yet_constructed; ///< True for construction check. bool not_yet_constructed; ///< True for construction check.
uint16 initial_random_bits; ///< Random bits during construction checks. uint16 initial_random_bits; ///< Random bits during construction checks.
uint32 watched_cargo_triggers; ///< Cargo types that triggered the watched cargo callback. CargoTypes watched_cargo_triggers; ///< Cargo types that triggered the watched cargo callback.
/** /**
* Constructor of a house scope resolver. * Constructor of a house scope resolver.
@ -38,7 +38,7 @@ struct HouseScopeResolver : public ScopeResolver {
* @param watched_cargo_triggers Cargo types that triggered the watched cargo callback. * @param watched_cargo_triggers Cargo types that triggered the watched cargo callback.
*/ */
HouseScopeResolver(ResolverObject &ro, HouseID house_id, TileIndex tile, Town *town, HouseScopeResolver(ResolverObject &ro, HouseID house_id, TileIndex tile, Town *town,
bool not_yet_constructed, uint8 initial_random_bits, uint32 watched_cargo_triggers) bool not_yet_constructed, uint8 initial_random_bits, CargoTypes watched_cargo_triggers)
: ScopeResolver(ro), house_id(house_id), tile(tile), town(town), not_yet_constructed(not_yet_constructed), : ScopeResolver(ro), house_id(house_id), tile(tile), town(town), not_yet_constructed(not_yet_constructed),
initial_random_bits(initial_random_bits), watched_cargo_triggers(watched_cargo_triggers) initial_random_bits(initial_random_bits), watched_cargo_triggers(watched_cargo_triggers)
{ {
@ -77,7 +77,7 @@ struct HouseResolverObject : public ResolverObject {
HouseResolverObject(HouseID house_id, TileIndex tile = INVALID_TILE, Town *town = NULL, HouseResolverObject(HouseID house_id, TileIndex tile = INVALID_TILE, Town *town = NULL,
CallbackID callback = CBID_NO_CALLBACK, uint32 param1 = 0, uint32 param2 = 0, CallbackID callback = CBID_NO_CALLBACK, uint32 param1 = 0, uint32 param2 = 0,
bool not_yet_constructed = false, uint8 initial_random_bits = 0, uint32 watched_cargo_triggers = 0); bool not_yet_constructed = false, uint8 initial_random_bits = 0, CargoTypes watched_cargo_triggers = 0);
/* virtual */ ~HouseResolverObject(); /* virtual */ ~HouseResolverObject();
@ -121,7 +121,7 @@ void AnimateNewHouseTile(TileIndex tile);
void AnimateNewHouseConstruction(TileIndex tile); void AnimateNewHouseConstruction(TileIndex tile);
uint16 GetHouseCallback(CallbackID callback, uint32 param1, uint32 param2, HouseID house_id, Town *town = NULL, TileIndex tile = INVALID_TILE, uint16 GetHouseCallback(CallbackID callback, uint32 param1, uint32 param2, HouseID house_id, Town *town = NULL, TileIndex tile = INVALID_TILE,
bool not_yet_constructed = false, uint8 initial_random_bits = 0, uint32 watched_cargo_triggers = 0); bool not_yet_constructed = false, uint8 initial_random_bits = 0, CargoTypes watched_cargo_triggers = 0);
void WatchedCargoCallback(TileIndex tile, uint32 trigger_cargoes); void WatchedCargoCallback(TileIndex tile, uint32 trigger_cargoes);
bool HouseAllowsConstruction(HouseID house_id, TileIndex tile, Town *t, byte random_bits); bool HouseAllowsConstruction(HouseID house_id, TileIndex tile, Town *t, byte random_bits);

@ -963,7 +963,7 @@ void TriggerStationRandomisation(Station *st, TileIndex tile, StationRandomTrigg
uint32 whole_reseed = 0; uint32 whole_reseed = 0;
ETileArea area = ETileArea(st, tile, tas[trigger]); ETileArea area = ETileArea(st, tile, tas[trigger]);
uint32 empty_mask = 0; CargoTypes empty_mask = 0;
if (trigger == SRT_CARGO_TAKEN) { if (trigger == SRT_CARGO_TAKEN) {
/* Create a bitmask of completely empty cargo types to be matched */ /* Create a bitmask of completely empty cargo types to be matched */
for (CargoID i = 0; i < NUM_CARGO; i++) { for (CargoID i = 0; i < NUM_CARGO; i++) {

@ -153,7 +153,7 @@ struct StationSpec {
*/ */
uint16 cargo_threshold; uint16 cargo_threshold;
uint32 cargo_triggers; ///< Bitmask of cargo types which cause trigger re-randomizing CargoTypes cargo_triggers; ///< Bitmask of cargo types which cause trigger re-randomizing
byte callback_mask; ///< Bitmask of station callbacks that have to be called byte callback_mask; ///< Bitmask of station callbacks that have to be called

@ -540,7 +540,7 @@ static CommandCost ClearTile_Object(TileIndex tile, DoCommandFlag flags)
return cost; return cost;
} }
static void AddAcceptedCargo_Object(TileIndex tile, CargoArray &acceptance, uint32 *always_accepted) static void AddAcceptedCargo_Object(TileIndex tile, CargoArray &acceptance, CargoTypes *always_accepted)
{ {
if (!IsObjectType(tile, OBJECT_HQ)) return; if (!IsObjectType(tile, OBJECT_HQ)) return;

@ -107,7 +107,7 @@ struct RoadVehicle FINAL : public GroundVehicle<RoadVehicle, VEH_ROAD> {
friend struct GroundVehicle<RoadVehicle, VEH_ROAD>; // GroundVehicle needs to use the acceleration functions defined at RoadVehicle. friend struct GroundVehicle<RoadVehicle, VEH_ROAD>; // GroundVehicle needs to use the acceleration functions defined at RoadVehicle.
void MarkDirty(); void MarkDirty();
void UpdateDeltaXY(Direction direction); void UpdateDeltaXY();
ExpensesType GetExpenseType(bool income) const { return income ? EXPENSES_ROADVEH_INC : EXPENSES_ROADVEH_RUN; } ExpensesType GetExpenseType(bool income) const { return income ? EXPENSES_ROADVEH_INC : EXPENSES_ROADVEH_RUN; }
bool IsPrimaryVehicle() const { return this->IsFrontEngine(); } bool IsPrimaryVehicle() const { return this->IsFrontEngine(); }
void GetImage(Direction direction, EngineImageType image_type, VehicleSpriteSeq *result) const; void GetImage(Direction direction, EngineImageType image_type, VehicleSpriteSeq *result) const;

@ -407,7 +407,7 @@ void RoadVehicle::MarkDirty()
this->CargoChanged(); this->CargoChanged();
} }
void RoadVehicle::UpdateDeltaXY(Direction direction) void RoadVehicle::UpdateDeltaXY()
{ {
static const int8 _delta_xy_table[8][10] = { static const int8 _delta_xy_table[8][10] = {
/* y_extent, x_extent, y_offs, x_offs, y_bb_offs, x_bb_offs, y_extent_shorten, x_extent_shorten, y_bb_offs_shorten, x_bb_offs_shorten */ /* y_extent, x_extent, y_offs, x_offs, y_bb_offs, x_bb_offs, y_extent_shorten, x_extent_shorten, y_bb_offs_shorten, x_bb_offs_shorten */
@ -422,9 +422,9 @@ void RoadVehicle::UpdateDeltaXY(Direction direction)
}; };
int shorten = VEHICLE_LENGTH - this->gcache.cached_veh_length; int shorten = VEHICLE_LENGTH - this->gcache.cached_veh_length;
if (!IsDiagonalDirection(direction)) shorten >>= 1; if (!IsDiagonalDirection(this->direction)) shorten >>= 1;
const int8 *bb = _delta_xy_table[direction]; const int8 *bb = _delta_xy_table[this->direction];
this->x_bb_offs = bb[5] + bb[9] * shorten; this->x_bb_offs = bb[5] + bb[9] * shorten;
this->y_bb_offs = bb[4] + bb[8] * shorten;; this->y_bb_offs = bb[4] + bb[8] * shorten;;
this->x_offs = bb[3]; this->x_offs = bb[3];

@ -261,7 +261,7 @@ static const SaveLoad _company_desc[] = {
SLE_VAR(CompanyProperties, colour, SLE_UINT8), SLE_VAR(CompanyProperties, colour, SLE_UINT8),
SLE_VAR(CompanyProperties, money_fraction, SLE_UINT8), SLE_VAR(CompanyProperties, money_fraction, SLE_UINT8),
SLE_CONDVAR(CompanyProperties, avail_railtypes, SLE_VAR_I32 | SLE_FILE_I8, 0, 57), SLE_CONDNULL(1, 0, 57), ///< avail_railtypes
SLE_VAR(CompanyProperties, block_preview, SLE_UINT8), SLE_VAR(CompanyProperties, block_preview, SLE_UINT8),
SLE_CONDNULL(2, 0, 93), ///< cargo_types SLE_CONDNULL(2, 0, 93), ///< cargo_types

@ -944,7 +944,7 @@ static const OldChunks _company_chunk[] = {
OCL_SVAR( OC_UINT8, Company, block_preview ), OCL_SVAR( OC_UINT8, Company, block_preview ),
OCL_CNULL( OC_TTD, 1 ), // Old AI OCL_CNULL( OC_TTD, 1 ), // Old AI
OCL_SVAR( OC_TTD | OC_UINT8, Company, avail_railtypes ), OCL_CNULL( OC_TTD, 1 ), // avail_railtypes
OCL_SVAR( OC_TILE, Company, location_of_HQ ), OCL_SVAR( OC_TILE, Company, location_of_HQ ),
OCL_SVAR( OC_TTD | OC_UINT8, Company, share_owners[0] ), OCL_SVAR( OC_TTD | OC_UINT8, Company, share_owners[0] ),
OCL_SVAR( OC_TTD | OC_UINT8, Company, share_owners[1] ), OCL_SVAR( OC_TTD | OC_UINT8, Company, share_owners[1] ),

@ -315,7 +315,7 @@ static void Load_TOWN()
SlObject(&t->cargo_accepted, GetTileMatrixDesc()); SlObject(&t->cargo_accepted, GetTileMatrixDesc());
if (t->cargo_accepted.area.w != 0) { if (t->cargo_accepted.area.w != 0) {
uint arr_len = t->cargo_accepted.area.w / AcceptanceMatrix::GRID * t->cargo_accepted.area.h / AcceptanceMatrix::GRID; uint arr_len = t->cargo_accepted.area.w / AcceptanceMatrix::GRID * t->cargo_accepted.area.h / AcceptanceMatrix::GRID;
t->cargo_accepted.data = MallocT<uint32>(arr_len); t->cargo_accepted.data = MallocT<CargoTypes>(arr_len);
SlArray(t->cargo_accepted.data, arr_len, SLE_UINT32); SlArray(t->cargo_accepted.data, arr_len, SLE_UINT32);
/* Rebuild total cargo acceptance. */ /* Rebuild total cargo acceptance. */

@ -469,7 +469,7 @@ void AfterLoadVehicles(bool part_of_load)
default: break; default: break;
} }
v->UpdateDeltaXY(v->direction); v->UpdateDeltaXY();
v->coord.left = INVALID_COORD; v->coord.left = INVALID_COORD;
v->UpdatePosition(); v->UpdatePosition();
v->UpdateViewport(false); v->UpdateViewport(false);

@ -32,7 +32,7 @@ struct Ship FINAL : public SpecializedVehicle<Ship, VEH_SHIP> {
virtual ~Ship() { this->PreDestructor(); } virtual ~Ship() { this->PreDestructor(); }
void MarkDirty(); void MarkDirty();
void UpdateDeltaXY(Direction direction); void UpdateDeltaXY();
ExpensesType GetExpenseType(bool income) const { return income ? EXPENSES_SHIP_INC : EXPENSES_SHIP_RUN; } ExpensesType GetExpenseType(bool income) const { return income ? EXPENSES_SHIP_INC : EXPENSES_SHIP_RUN; }
void PlayLeaveStationSound() const; void PlayLeaveStationSound() const;
bool IsPrimaryVehicle() const { return true; } bool IsPrimaryVehicle() const { return true; }

@ -297,7 +297,7 @@ TileIndex Ship::GetOrderStationLocation(StationID station)
} }
} }
void Ship::UpdateDeltaXY(Direction direction) void Ship::UpdateDeltaXY()
{ {
static const int8 _delta_xy_table[8][4] = { static const int8 _delta_xy_table[8][4] = {
/* y_extent, x_extent, y_offs, x_offs */ /* y_extent, x_extent, y_offs, x_offs */
@ -311,7 +311,7 @@ void Ship::UpdateDeltaXY(Direction direction)
{32, 6, -16, -3}, // NW {32, 6, -16, -3}, // NW
}; };
const int8 *bb = _delta_xy_table[direction]; const int8 *bb = _delta_xy_table[this->direction];
this->x_offs = bb[3]; this->x_offs = bb[3];
this->y_offs = bb[2]; this->y_offs = bb[2];
this->x_extent = bb[1]; this->x_extent = bb[1];
@ -824,7 +824,7 @@ CommandCost CmdBuildShip(TileIndex tile, DoCommandFlag flags, const Engine *e, u
v->y_pos = y; v->y_pos = y;
v->z_pos = GetSlopePixelZ(x, y); v->z_pos = GetSlopePixelZ(x, y);
v->UpdateDeltaXY(v->direction); v->UpdateDeltaXY();
v->vehstatus = VS_HIDDEN | VS_STOPPED | VS_DEFPAL; v->vehstatus = VS_HIDDEN | VS_STOPPED | VS_DEFPAL;
v->spritenum = svi->image_index; v->spritenum = svi->image_index;

@ -1257,7 +1257,7 @@ void SmallMapWindow::SelectLegendItem(int click_pos, LegendAndColour *legend, in
*/ */
void SmallMapWindow::SetOverlayCargoMask() void SmallMapWindow::SetOverlayCargoMask()
{ {
uint32 cargo_mask = 0; CargoTypes cargo_mask = 0;
for (int i = 0; i != _smallmap_cargo_count; ++i) { for (int i = 0; i != _smallmap_cargo_count; ++i) {
if (_legend_linkstats[i].show_on_map) SetBit(cargo_mask, _legend_linkstats[i].type); if (_legend_linkstats[i].show_on_map) SetBit(cargo_mask, _legend_linkstats[i].type);
} }
@ -1474,7 +1474,7 @@ int SmallMapWindow::GetPositionOnLegend(Point pt)
/* virtual */ void SmallMapWindow::OnMouseWheel(int wheel) /* virtual */ void SmallMapWindow::OnMouseWheel(int wheel)
{ {
if (_settings_client.gui.scrollwheel_scrolling == 0) { if (_settings_client.gui.scrollwheel_scrolling != 2) {
const NWidgetBase *wid = this->GetWidget<NWidgetBase>(WID_SM_MAP); const NWidgetBase *wid = this->GetWidget<NWidgetBase>(WID_SM_MAP);
int cursor_x = _cursor.pos.x - this->left - wid->pos_x; int cursor_x = _cursor.pos.x - this->left - wid->pos_x;
int cursor_y = _cursor.pos.y - this->top - wid->pos_y; int cursor_y = _cursor.pos.y - this->top - wid->pos_y;

@ -26,7 +26,7 @@ public:
/** Factory for the sound driver for Windows. */ /** Factory for the sound driver for Windows. */
class FSoundDriver_Win32 : public DriverFactoryBase { class FSoundDriver_Win32 : public DriverFactoryBase {
public: public:
FSoundDriver_Win32() : DriverFactoryBase(Driver::DT_SOUND, 10, "win32", "Win32 WaveOut Sound Driver") {} FSoundDriver_Win32() : DriverFactoryBase(Driver::DT_SOUND, 9, "win32", "Win32 WaveOut Sound Driver") {}
/* virtual */ Driver *CreateInstance() const { return new SoundDriver_Win32(); } /* virtual */ Driver *CreateInstance() const { return new SoundDriver_Win32(); }
}; };

@ -0,0 +1,273 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file xaudio2_s.cpp XAudio2 sound driver. */
#ifdef WITH_XAUDIO2
#include "../stdafx.h"
#include "../openttd.h"
#include "../driver.h"
#include "../mixer.h"
#include "../debug.h"
#include "../core/alloc_func.hpp"
#include "../core/bitmath_func.hpp"
#include "../core/math_func.hpp"
// Windows 8 SDK required for XAudio2
#undef NTDDI_VERSION
#undef _WIN32_WINNT
#define NTDDI_VERSION NTDDI_WIN8
#define _WIN32_WINNT _WIN32_WINNT_WIN8
#include "xaudio2_s.h"
#include <windows.h>
#include <mmsystem.h>
#include <wrl\client.h>
#include <xaudio2.h>
using Microsoft::WRL::ComPtr;
#include "../os/windows/win32.h"
#include "../safeguards.h"
// Definition of the "XAudio2Create" call used to initialise XAudio2
typedef HRESULT(__stdcall *API_XAudio2Create)(_Outptr_ IXAudio2** ppXAudio2, UINT32 Flags, XAUDIO2_PROCESSOR XAudio2Processor);
static FSoundDriver_XAudio2 iFSoundDriver_XAudio2;
/**
* Implementation of the IXAudio2VoiceCallback interface.
* Provides buffered audio to XAudio2 from the OpenTTD mixer.
*/
class StreamingVoiceContext : public IXAudio2VoiceCallback
{
private:
int bufferLength;
char *buffer;
public:
IXAudio2SourceVoice* SourceVoice;
StreamingVoiceContext(int bufferLength)
{
this->bufferLength = bufferLength;
this->buffer = MallocT<char>(bufferLength);
}
virtual ~StreamingVoiceContext()
{
free(this->buffer);
}
HRESULT SubmitBuffer()
{
// Ensure we do have a valid voice
if (this->SourceVoice == nullptr)
{
return E_FAIL;
}
MxMixSamples(this->buffer, this->bufferLength / 4);
XAUDIO2_BUFFER buf = { 0 };
buf.AudioBytes = this->bufferLength;
buf.pAudioData = (const BYTE *) this->buffer;
return SourceVoice->SubmitSourceBuffer(&buf);
}
STDMETHOD_(void, OnVoiceProcessingPassStart)(UINT32) override
{
}
STDMETHOD_(void, OnVoiceProcessingPassEnd)() override
{
}
STDMETHOD_(void, OnStreamEnd)() override
{
}
STDMETHOD_(void, OnBufferStart)(void*) override
{
}
STDMETHOD_(void, OnBufferEnd)(void*) override
{
SubmitBuffer();
}
STDMETHOD_(void, OnLoopEnd)(void*) override
{
}
STDMETHOD_(void, OnVoiceError)(void*, HRESULT) override
{
}
};
static HMODULE _xaudio_dll_handle;
static IXAudio2SourceVoice* _source_voice = nullptr;
static IXAudio2MasteringVoice* _mastering_voice = nullptr;
static ComPtr<IXAudio2> _xaudio2;
static StreamingVoiceContext* _voice_context = nullptr;
/**
* Initialises the XAudio2 driver.
*
* @param parm Driver parameters.
* @return An error message if unsuccessful, or NULL otherwise.
*
*/
const char *SoundDriver_XAudio2::Start(const char * const *parm)
{
HRESULT hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
if (FAILED(hr))
{
DEBUG(driver, 0, "xaudio2_s: CoInitializeEx failed (%08x)", hr);
return "Failed to initialise COM";
}
_xaudio_dll_handle = LoadLibraryA(XAUDIO2_DLL_A);
if (_xaudio_dll_handle == NULL)
{
CoUninitialize();
DEBUG(driver, 0, "xaudio2_s: Unable to load " XAUDIO2_DLL_A);
return "Failed to load XAudio2 DLL";
}
API_XAudio2Create xAudio2Create = (API_XAudio2Create) GetProcAddress(_xaudio_dll_handle, "XAudio2Create");
if (xAudio2Create == NULL)
{
FreeLibrary(_xaudio_dll_handle);
CoUninitialize();
DEBUG(driver, 0, "xaudio2_s: Unable to find XAudio2Create function in DLL");
return "Failed to load XAudio2 DLL";
}
// Create the XAudio engine
UINT32 flags = 0;
hr = xAudio2Create(_xaudio2.GetAddressOf(), flags, XAUDIO2_DEFAULT_PROCESSOR);
if (FAILED(hr))
{
FreeLibrary(_xaudio_dll_handle);
CoUninitialize();
DEBUG(driver, 0, "xaudio2_s: XAudio2Create failed (%08x)", hr);
return "Failed to inititialise the XAudio2 engine";
}
// Create a mastering voice
hr = _xaudio2->CreateMasteringVoice(&_mastering_voice);
if (FAILED(hr))
{
_xaudio2.Reset();
FreeLibrary(_xaudio_dll_handle);
CoUninitialize();
DEBUG(driver, 0, "xaudio2_s: CreateMasteringVoice failed (%08x)", hr);
return "Failed to create a mastering voice";
}
// Create a source voice to stream our audio
WAVEFORMATEX wfex;
wfex.wFormatTag = WAVE_FORMAT_PCM;
wfex.nChannels = 2;
wfex.wBitsPerSample = 16;
wfex.nSamplesPerSec = GetDriverParamInt(parm, "hz", 44100);
wfex.nBlockAlign = (wfex.nChannels * wfex.wBitsPerSample) / 8;
wfex.nAvgBytesPerSec = wfex.nSamplesPerSec * wfex.nBlockAlign;
// Limit buffer size to prevent overflows
int bufsize = GetDriverParamInt(parm, "bufsize", 8192);
bufsize = min(bufsize, UINT16_MAX);
_voice_context = new StreamingVoiceContext(bufsize * 4);
if (_voice_context == nullptr)
{
_mastering_voice->DestroyVoice();
_xaudio2.Reset();
FreeLibrary(_xaudio_dll_handle);
CoUninitialize();
return "Failed to create streaming voice context";
}
hr = _xaudio2->CreateSourceVoice(&_source_voice, &wfex, 0, 1.0f, _voice_context);
if (FAILED(hr))
{
_mastering_voice->DestroyVoice();
_xaudio2.Reset();
FreeLibrary(_xaudio_dll_handle);
CoUninitialize();
DEBUG(driver, 0, "xaudio2_s: CreateSourceVoice failed (%08x)", hr);
return "Failed to create a source voice";
}
_voice_context->SourceVoice = _source_voice;
hr = _source_voice->Start(0, 0);
if (FAILED(hr))
{
DEBUG(driver, 0, "xaudio2_s: _source_voice->Start failed (%08x)", hr);
Stop();
return "Failed to start the source voice";
}
MxInitialize(wfex.nSamplesPerSec);
// Submit the first buffer
hr = _voice_context->SubmitBuffer();
if (FAILED(hr))
{
DEBUG(driver, 0, "xaudio2_s: _voice_context->SubmitBuffer failed (%08x)", hr);
Stop();
return "Failed to submit the first audio buffer";
}
return NULL;
}
/**
* Terminates the XAudio2 driver.
*/
void SoundDriver_XAudio2::Stop()
{
// Clean up XAudio2
_source_voice->DestroyVoice();
delete _voice_context;
_voice_context = nullptr;
_mastering_voice->DestroyVoice();
_xaudio2.Reset();
FreeLibrary(_xaudio_dll_handle);
CoUninitialize();
}
#endif

@ -0,0 +1,33 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file xaudio2_s.h Base for XAudio2 sound handling. */
#ifndef SOUND_XAUDIO2_H
#define SOUND_XAUDIO2_H
#include "sound_driver.hpp"
/** Implementation of the XAudio2 sound driver. */
class SoundDriver_XAudio2 : public SoundDriver {
public:
/* virtual */ const char *Start(const char * const *param);
/* virtual */ void Stop();
/* virtual */ const char *GetName() const { return "xaudio2"; }
};
/** Factory for the XAudio2 sound driver. */
class FSoundDriver_XAudio2 : public DriverFactoryBase {
public:
FSoundDriver_XAudio2() : DriverFactoryBase(Driver::DT_SOUND, 10, "xaudio2", "XAudio2 Sound Driver") {}
/* virtual */ Driver *CreateInstance() const { return new SoundDriver_XAudio2(); }
};
#endif /* SOUND_XAUDIO2_H */

@ -473,7 +473,7 @@ public:
byte last_vehicle_type; byte last_vehicle_type;
std::vector<Vehicle *> loading_vehicles; std::vector<Vehicle *> loading_vehicles;
GoodsEntry goods[NUM_CARGO]; ///< Goods at this station GoodsEntry goods[NUM_CARGO]; ///< Goods at this station
uint32 always_accepted; ///< Bitmask of always accepted cargo types (by houses, HQs, industry tiles when industry doesn't accept cargo) CargoTypes always_accepted; ///< Bitmask of always accepted cargo types (by houses, HQs, industry tiles when industry doesn't accept cargo)
IndustryVector industries_near; ///< Cached list of industries near the station that can accept cargo, @see DeliverGoodsToIndustry() IndustryVector industries_near; ///< Cached list of industries near the station that can accept cargo, @see DeliverGoodsToIndustry()

@ -442,12 +442,12 @@ void UpdateAllStationVirtCoords()
* @param st Station to query * @param st Station to query
* @return the expected mask * @return the expected mask
*/ */
static uint GetAcceptanceMask(const Station *st) static CargoTypes GetAcceptanceMask(const Station *st)
{ {
uint mask = 0; CargoTypes mask = 0;
for (CargoID i = 0; i < NUM_CARGO; i++) { for (CargoID i = 0; i < NUM_CARGO; i++) {
if (HasBit(st->goods[i].status, GoodsEntry::GES_ACCEPTANCE)) mask |= 1 << i; if (HasBit(st->goods[i].status, GoodsEntry::GES_ACCEPTANCE)) SetBit(mask, i);
} }
return mask; return mask;
} }
@ -526,7 +526,7 @@ CargoArray GetProductionAroundTiles(TileIndex tile, int w, int h, int rad)
* @param rad Search radius in addition to given area * @param rad Search radius in addition to given area
* @param always_accepted bitmask of cargo accepted by houses and headquarters; can be NULL * @param always_accepted bitmask of cargo accepted by houses and headquarters; can be NULL
*/ */
CargoArray GetAcceptanceAroundTiles(TileIndex tile, int w, int h, int rad, uint32 *always_accepted) CargoArray GetAcceptanceAroundTiles(TileIndex tile, int w, int h, int rad, CargoTypes *always_accepted)
{ {
CargoArray acceptance; CargoArray acceptance;
if (always_accepted != NULL) *always_accepted = 0; if (always_accepted != NULL) *always_accepted = 0;
@ -564,7 +564,7 @@ CargoArray GetAcceptanceAroundTiles(TileIndex tile, int w, int h, int rad, uint3
void UpdateStationAcceptance(Station *st, bool show_msg) void UpdateStationAcceptance(Station *st, bool show_msg)
{ {
/* old accepted goods types */ /* old accepted goods types */
uint old_acc = GetAcceptanceMask(st); CargoTypes old_acc = GetAcceptanceMask(st);
/* And retrieve the acceptance. */ /* And retrieve the acceptance. */
CargoArray acceptance; CargoArray acceptance;
@ -597,7 +597,7 @@ void UpdateStationAcceptance(Station *st, bool show_msg)
} }
/* Only show a message in case the acceptance was actually changed. */ /* Only show a message in case the acceptance was actually changed. */
uint new_acc = GetAcceptanceMask(st); CargoTypes new_acc = GetAcceptanceMask(st);
if (old_acc == new_acc) return; if (old_acc == new_acc) return;
/* show a message to report that the acceptance was changed? */ /* show a message to report that the acceptance was changed? */
@ -3358,7 +3358,7 @@ static VehicleEnterTileStatus VehicleEnter_Station(Vehicle *v, TileIndex tile, i
void TriggerWatchedCargoCallbacks(Station *st) void TriggerWatchedCargoCallbacks(Station *st)
{ {
/* Collect cargoes accepted since the last big tick. */ /* Collect cargoes accepted since the last big tick. */
uint cargoes = 0; CargoTypes cargoes = 0;
for (CargoID cid = 0; cid < NUM_CARGO; cid++) { for (CargoID cid = 0; cid < NUM_CARGO; cid++) {
if (HasBit(st->goods[cid].status, GoodsEntry::GES_ACCEPTED_BIGTICK)) SetBit(cargoes, cid); if (HasBit(st->goods[cid].status, GoodsEntry::GES_ACCEPTED_BIGTICK)) SetBit(cargoes, cid);
} }

@ -28,7 +28,7 @@ void ShowStationViewWindow(StationID station);
void UpdateAllStationVirtCoords(); void UpdateAllStationVirtCoords();
CargoArray GetProductionAroundTiles(TileIndex tile, int w, int h, int rad); CargoArray GetProductionAroundTiles(TileIndex tile, int w, int h, int rad);
CargoArray GetAcceptanceAroundTiles(TileIndex tile, int w, int h, int rad, uint32 *always_accepted = NULL); CargoArray GetAcceptanceAroundTiles(TileIndex tile, int w, int h, int rad, CargoTypes *always_accepted = NULL);
void UpdateStationAcceptance(Station *st, bool show_msg); void UpdateStationAcceptance(Station *st, bool show_msg);

@ -58,7 +58,7 @@
int DrawStationCoverageAreaText(int left, int right, int top, StationCoverageType sct, int rad, bool supplies) int DrawStationCoverageAreaText(int left, int right, int top, StationCoverageType sct, int rad, bool supplies)
{ {
TileIndex tile = TileVirtXY(_thd.pos.x, _thd.pos.y); TileIndex tile = TileVirtXY(_thd.pos.x, _thd.pos.y);
uint32 cargo_mask = 0; CargoTypes cargo_mask = 0;
if (_thd.drawstyle == HT_RECT && tile < MapSize()) { if (_thd.drawstyle == HT_RECT && tile < MapSize()) {
CargoArray cargoes; CargoArray cargoes;
if (supplies) { if (supplies) {
@ -158,8 +158,8 @@ protected:
static Listing last_sorting; static Listing last_sorting;
static byte facilities; // types of stations of interest static byte facilities; // types of stations of interest
static bool include_empty; // whether we should include stations without waiting cargo static bool include_empty; // whether we should include stations without waiting cargo
static const uint32 cargo_filter_max; static const CargoTypes cargo_filter_max;
static uint32 cargo_filter; // bitmap of cargo types to include static CargoTypes cargo_filter; // bitmap of cargo types to include
static const Station *last_station; static const Station *last_station;
/* Constants for sorting stations */ /* Constants for sorting stations */
@ -656,8 +656,8 @@ public:
Listing CompanyStationsWindow::last_sorting = {false, 0}; Listing CompanyStationsWindow::last_sorting = {false, 0};
byte CompanyStationsWindow::facilities = FACIL_TRAIN | FACIL_TRUCK_STOP | FACIL_BUS_STOP | FACIL_AIRPORT | FACIL_DOCK; byte CompanyStationsWindow::facilities = FACIL_TRAIN | FACIL_TRUCK_STOP | FACIL_BUS_STOP | FACIL_AIRPORT | FACIL_DOCK;
bool CompanyStationsWindow::include_empty = true; bool CompanyStationsWindow::include_empty = true;
const uint32 CompanyStationsWindow::cargo_filter_max = UINT32_MAX; const CargoTypes CompanyStationsWindow::cargo_filter_max = ALL_CARGOTYPES;
uint32 CompanyStationsWindow::cargo_filter = UINT32_MAX; CargoTypes CompanyStationsWindow::cargo_filter = ALL_CARGOTYPES;
const Station *CompanyStationsWindow::last_station = NULL; const Station *CompanyStationsWindow::last_station = NULL;
/* Availible station sorting functions */ /* Availible station sorting functions */
@ -1805,7 +1805,7 @@ struct StationViewWindow : public Window {
{ {
const Station *st = Station::Get(this->window_number); const Station *st = Station::Get(this->window_number);
uint32 cargo_mask = 0; CargoTypes cargo_mask = 0;
for (CargoID i = 0; i < NUM_CARGO; i++) { for (CargoID i = 0; i < NUM_CARGO; i++) {
if (HasBit(st->goods[i].status, GoodsEntry::GES_ACCEPTANCE)) SetBit(cargo_mask, i); if (HasBit(st->goods[i].status, GoodsEntry::GES_ACCEPTANCE)) SetBit(cargo_mask, i);
} }

@ -1342,7 +1342,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg
} }
case SCC_CARGO_LIST: { // {CARGO_LIST} case SCC_CARGO_LIST: { // {CARGO_LIST}
uint32 cmask = args->GetInt32(SCC_CARGO_LIST); CargoTypes cmask = args->GetInt32(SCC_CARGO_LIST);
bool first = true; bool first = true;
const CargoSpec *cs; const CargoSpec *cs;

@ -334,7 +334,7 @@ bool FindSubsidyTownCargoRoute()
/* Select a random town. */ /* Select a random town. */
const Town *src_town = Town::GetRandom(); const Town *src_town = Town::GetRandom();
uint32 town_cargo_produced = src_town->cargo_produced; CargoTypes town_cargo_produced = src_town->cargo_produced;
/* Passenger subsidies are not handled here. */ /* Passenger subsidies are not handled here. */
ClrBit(town_cargo_produced, CT_PASSENGERS); ClrBit(town_cargo_produced, CT_PASSENGERS);

@ -81,7 +81,7 @@ typedef CommandCost ClearTileProc(TileIndex tile, DoCommandFlag flags);
* @param acceptance Storage destination of the cargo acceptance in 1/8 * @param acceptance Storage destination of the cargo acceptance in 1/8
* @param always_accepted Bitmask of always accepted cargo types * @param always_accepted Bitmask of always accepted cargo types
*/ */
typedef void AddAcceptedCargoProc(TileIndex tile, CargoArray &acceptance, uint32 *always_accepted); typedef void AddAcceptedCargoProc(TileIndex tile, CargoArray &acceptance, CargoTypes *always_accepted);
/** /**
* Tile callback function signature for obtaining a tile description * Tile callback function signature for obtaining a tile description
@ -165,11 +165,11 @@ VehicleEnterTileStatus VehicleEnterTile(Vehicle *v, TileIndex tile, int x, int y
void ChangeTileOwner(TileIndex tile, Owner old_owner, Owner new_owner); void ChangeTileOwner(TileIndex tile, Owner old_owner, Owner new_owner);
void GetTileDesc(TileIndex tile, TileDesc *td); void GetTileDesc(TileIndex tile, TileDesc *td);
static inline void AddAcceptedCargo(TileIndex tile, CargoArray &acceptance, uint32 *always_accepted) static inline void AddAcceptedCargo(TileIndex tile, CargoArray &acceptance, CargoTypes *always_accepted)
{ {
AddAcceptedCargoProc *proc = _tile_type_procs[GetTileType(tile)]->add_accepted_cargo_proc; AddAcceptedCargoProc *proc = _tile_type_procs[GetTileType(tile)]->add_accepted_cargo_proc;
if (proc == NULL) return; if (proc == NULL) return;
uint32 dummy = 0; // use dummy bitmask so there don't need to be several 'always_accepted != NULL' checks CargoTypes dummy = 0; // use dummy bitmask so there don't need to be several 'always_accepted != NULL' checks
proc(tile, acceptance, always_accepted == NULL ? &dummy : always_accepted); proc(tile, acceptance, always_accepted == NULL ? &dummy : always_accepted);
} }

@ -29,7 +29,7 @@ struct BuildingCounts {
T class_count[HOUSE_CLASS_MAX]; T class_count[HOUSE_CLASS_MAX];
}; };
typedef TileMatrix<uint32, 4> AcceptanceMatrix; typedef TileMatrix<CargoTypes, 4> AcceptanceMatrix;
static const uint CUSTOM_TOWN_NUMBER_DIFFICULTY = 4; ///< value for custom town number in difficulty settings static const uint CUSTOM_TOWN_NUMBER_DIFFICULTY = 4; ///< value for custom town number in difficulty settings
static const uint CUSTOM_TOWN_MAX_NUMBER = 5000; ///< this is the maximum number of towns a user can specify in customisation static const uint CUSTOM_TOWN_MAX_NUMBER = 5000; ///< this is the maximum number of towns a user can specify in customisation
@ -89,9 +89,9 @@ struct Town : TownPool::PoolItem<&_town_pool> {
inline byte GetPercentTransported(CargoID cid) const { return this->supplied[cid].old_act * 256 / (this->supplied[cid].old_max + 1); } inline byte GetPercentTransported(CargoID cid) const { return this->supplied[cid].old_act * 256 / (this->supplied[cid].old_max + 1); }
/* Cargo production and acceptance stats. */ /* Cargo production and acceptance stats. */
uint32 cargo_produced; ///< Bitmap of all cargoes produced by houses in this town. CargoTypes cargo_produced; ///< Bitmap of all cargoes produced by houses in this town.
AcceptanceMatrix cargo_accepted; ///< Bitmap of cargoes accepted by houses for each 4*4 map square of the town. AcceptanceMatrix cargo_accepted; ///< Bitmap of cargoes accepted by houses for each 4*4 map square of the town.
uint32 cargo_accepted_total; ///< NOSAVE: Bitmap of all cargoes accepted by houses in this town. CargoTypes cargo_accepted_total; ///< NOSAVE: Bitmap of all cargoes accepted by houses in this town.
uint16 time_until_rebuild; ///< time until we rebuild a house uint16 time_until_rebuild; ///< time until we rebuild a house
@ -322,6 +322,6 @@ static inline uint16 TownTicksToGameTicks(uint16 ticks) {
} }
extern uint32 _town_cargoes_accepted; extern CargoTypes _town_cargoes_accepted;
#endif /* TOWN_H */ #endif /* TOWN_H */

@ -54,7 +54,7 @@
#include "safeguards.h" #include "safeguards.h"
TownID _new_town_id; TownID _new_town_id;
uint32 _town_cargoes_accepted; ///< Bitmap of all cargoes accepted by houses. CargoTypes _town_cargoes_accepted; ///< Bitmap of all cargoes accepted by houses.
/* Initialize the town-pool */ /* Initialize the town-pool */
TownPool _town_pool("Town"); TownPool _town_pool("Town");
@ -769,14 +769,14 @@ static void AddProducedCargo_Town(TileIndex tile, CargoArray &produced)
AddProducedHouseCargo(GetHouseType(tile), tile, produced); AddProducedHouseCargo(GetHouseType(tile), tile, produced);
} }
static inline void AddAcceptedCargoSetMask(CargoID cargo, uint amount, CargoArray &acceptance, uint32 *always_accepted) static inline void AddAcceptedCargoSetMask(CargoID cargo, uint amount, CargoArray &acceptance, CargoTypes *always_accepted)
{ {
if (cargo == CT_INVALID || amount == 0) return; if (cargo == CT_INVALID || amount == 0) return;
acceptance[cargo] += amount; acceptance[cargo] += amount;
SetBit(*always_accepted, cargo); SetBit(*always_accepted, cargo);
} }
void AddAcceptedHouseCargo(HouseID house_id, TileIndex tile, CargoArray &acceptance, uint32 *always_accepted) void AddAcceptedHouseCargo(HouseID house_id, TileIndex tile, CargoArray &acceptance, CargoTypes *always_accepted)
{ {
const HouseSpec *hs = HouseSpec::Get(house_id); const HouseSpec *hs = HouseSpec::Get(house_id);
Town *t = (tile == INVALID_TILE) ? NULL : Town::GetByTile(tile); Town *t = (tile == INVALID_TILE) ? NULL : Town::GetByTile(tile);
@ -820,7 +820,7 @@ void AddAcceptedHouseCargo(HouseID house_id, TileIndex tile, CargoArray &accepta
} }
} }
static void AddAcceptedCargo_Town(TileIndex tile, CargoArray &acceptance, uint32 *always_accepted) static void AddAcceptedCargo_Town(TileIndex tile, CargoArray &acceptance, CargoTypes *always_accepted)
{ {
AddAcceptedHouseCargo(GetHouseType(tile), tile, acceptance, always_accepted); AddAcceptedHouseCargo(GetHouseType(tile), tile, acceptance, always_accepted);
} }
@ -880,7 +880,7 @@ void UpdateTownCargoTotal(Town *t)
static void UpdateTownCargoes(Town *t, TileIndex start, bool update_total = true) static void UpdateTownCargoes(Town *t, TileIndex start, bool update_total = true)
{ {
CargoArray accepted, produced; CargoArray accepted, produced;
uint32 dummy; CargoTypes dummy;
/* Gather acceptance for all houses in an area around the start tile. /* Gather acceptance for all houses in an area around the start tile.
* The area is composed of the square the tile is in, extended one square in all * The area is composed of the square the tile is in, extended one square in all
@ -894,7 +894,7 @@ static void UpdateTownCargoes(Town *t, TileIndex start, bool update_total = true
} }
/* Create bitmap of produced and accepted cargoes. */ /* Create bitmap of produced and accepted cargoes. */
uint32 acc = 0; CargoTypes acc = 0;
for (uint cid = 0; cid < NUM_CARGO; cid++) { for (uint cid = 0; cid < NUM_CARGO; cid++) {
if (accepted[cid] >= 8) SetBit(acc, cid); if (accepted[cid] >= 8) SetBit(acc, cid);
if (produced[cid] > 0) SetBit(t->cargo_produced, cid); if (produced[cid] > 0) SetBit(t->cargo_produced, cid);

@ -130,7 +130,7 @@ struct Train FINAL : public GroundVehicle<Train, VEH_TRAIN> {
friend struct GroundVehicle<Train, VEH_TRAIN>; // GroundVehicle needs to use the acceleration functions defined at Train. friend struct GroundVehicle<Train, VEH_TRAIN>; // GroundVehicle needs to use the acceleration functions defined at Train.
void MarkDirty(); void MarkDirty();
void UpdateDeltaXY(Direction direction); void UpdateDeltaXY();
ExpensesType GetExpenseType(bool income) const { return income ? EXPENSES_TRAIN_INC : EXPENSES_TRAIN_RUN; } ExpensesType GetExpenseType(bool income) const { return income ? EXPENSES_TRAIN_INC : EXPENSES_TRAIN_RUN; }
void PlayLeaveStationSound() const; void PlayLeaveStationSound() const;
bool IsPrimaryVehicle() const { return this->IsFrontEngine(); } bool IsPrimaryVehicle() const { return this->IsFrontEngine(); }

@ -1673,7 +1673,7 @@ CommandCost CmdSellRailWagon(DoCommandFlag flags, Vehicle *t, uint16 data, uint3
return cost; return cost;
} }
void Train::UpdateDeltaXY(Direction direction) void Train::UpdateDeltaXY()
{ {
/* Set common defaults. */ /* Set common defaults. */
this->x_offs = -1; this->x_offs = -1;
@ -1684,7 +1684,7 @@ void Train::UpdateDeltaXY(Direction direction)
this->x_bb_offs = 0; this->x_bb_offs = 0;
this->y_bb_offs = 0; this->y_bb_offs = 0;
if (!IsDiagonalDirection(direction)) { if (!IsDiagonalDirection(this->direction)) {
static const int _sign_table[] = static const int _sign_table[] =
{ {
/* x, y */ /* x, y */
@ -1697,12 +1697,12 @@ void Train::UpdateDeltaXY(Direction direction)
int half_shorten = (VEHICLE_LENGTH - this->gcache.cached_veh_length) / 2; int half_shorten = (VEHICLE_LENGTH - this->gcache.cached_veh_length) / 2;
/* For all straight directions, move the bound box to the centre of the vehicle, but keep the size. */ /* For all straight directions, move the bound box to the centre of the vehicle, but keep the size. */
this->x_offs -= half_shorten * _sign_table[direction]; this->x_offs -= half_shorten * _sign_table[this->direction];
this->y_offs -= half_shorten * _sign_table[direction + 1]; this->y_offs -= half_shorten * _sign_table[this->direction + 1];
this->x_extent += this->x_bb_offs = half_shorten * _sign_table[direction]; this->x_extent += this->x_bb_offs = half_shorten * _sign_table[direction];
this->y_extent += this->y_bb_offs = half_shorten * _sign_table[direction + 1]; this->y_extent += this->y_bb_offs = half_shorten * _sign_table[direction + 1];
} else { } else {
switch (direction) { switch (this->direction) {
/* Shorten southern corner of the bounding box according the vehicle length /* Shorten southern corner of the bounding box according the vehicle length
* and center the bounding box on the vehicle. */ * and center the bounding box on the vehicle. */
case DIR_NE: case DIR_NE:
@ -4171,7 +4171,7 @@ bool TrainController(Train *v, Vehicle *nomove, bool reverse)
} }
/* update image of train, as well as delta XY */ /* update image of train, as well as delta XY */
v->UpdateDeltaXY(v->direction); v->UpdateDeltaXY();
v->x_pos = gp.x; v->x_pos = gp.x;
v->y_pos = gp.y; v->y_pos = gp.y;

@ -260,7 +260,7 @@ bool Vehicle::NeedsServicing() const
if (replace_when_old && !v->NeedsAutorenewing(c, false)) continue; if (replace_when_old && !v->NeedsAutorenewing(c, false)) continue;
/* Check refittability */ /* Check refittability */
uint32 available_cargo_types, union_mask; CargoTypes available_cargo_types, union_mask;
GetArticulatedRefitMasks(new_engine, true, &union_mask, &available_cargo_types); GetArticulatedRefitMasks(new_engine, true, &union_mask, &available_cargo_types);
/* Is there anything to refit? */ /* Is there anything to refit? */
if (union_mask != 0) { if (union_mask != 0) {

@ -381,9 +381,8 @@ public:
/** /**
* Updates the x and y offsets and the size of the sprite used * Updates the x and y offsets and the size of the sprite used
* for this vehicle. * for this vehicle.
* @param direction the direction the vehicle is facing
*/ */
virtual void UpdateDeltaXY(Direction direction) {} virtual void UpdateDeltaXY() {}
/** /**
* Determines the effective direction-specific vehicle movement speed. * Determines the effective direction-specific vehicle movement speed.
@ -1233,7 +1232,7 @@ struct SpecializedVehicle : public Vehicle {
/* Explicitly choose method to call to prevent vtable dereference - /* Explicitly choose method to call to prevent vtable dereference -
* it gives ~3% runtime improvements in games with many vehicles */ * it gives ~3% runtime improvements in games with many vehicles */
if (update_delta) ((T *)this)->T::UpdateDeltaXY(this->direction); if (update_delta) ((T *)this)->T::UpdateDeltaXY();
if (this->cur_image_valid_dir != this->direction) { if (this->cur_image_valid_dir != this->direction) {
_sprite_group_resolve_check_veh_check = true; _sprite_group_resolve_check_veh_check = true;
_sprite_group_resolve_check_veh_type = EXPECTED_TYPE; _sprite_group_resolve_check_veh_type = EXPECTED_TYPE;

@ -604,7 +604,7 @@ struct RefitWindow : public Window {
do { do {
if (v->type == VEH_TRAIN && !vehicles_to_refit.Contains(v->index)) continue; if (v->type == VEH_TRAIN && !vehicles_to_refit.Contains(v->index)) continue;
const Engine *e = v->GetEngine(); const Engine *e = v->GetEngine();
uint32 cmask = e->info.refit_mask; CargoTypes cmask = e->info.refit_mask;
byte callback_mask = e->info.callback_mask; byte callback_mask = e->info.callback_mask;
/* Skip this engine if it does not carry anything */ /* Skip this engine if it does not carry anything */
@ -1270,9 +1270,9 @@ void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order, Window *pare
uint ShowRefitOptionsList(int left, int right, int y, EngineID engine) uint ShowRefitOptionsList(int left, int right, int y, EngineID engine)
{ {
/* List of cargo types of this engine */ /* List of cargo types of this engine */
uint32 cmask = GetUnionOfArticulatedRefitMasks(engine, false); CargoTypes cmask = GetUnionOfArticulatedRefitMasks(engine, false);
/* List of cargo types available in this climate */ /* List of cargo types available in this climate */
uint32 lmask = _cargo_mask; CargoTypes lmask = _cargo_mask;
/* Draw nothing if the engine is not refittable */ /* Draw nothing if the engine is not refittable */
if (HasAtMostOneBit(cmask)) return y; if (HasAtMostOneBit(cmask)) return y;

@ -587,12 +587,12 @@ static bool QZ_PollEvent()
while (_current_magnification >= 1.0f) { while (_current_magnification >= 1.0f) {
_current_magnification -= 1.0f; _current_magnification -= 1.0f;
_cursor.wheel++; _cursor.wheel--;
HandleMouseEvents(); HandleMouseEvents();
} }
while (_current_magnification <= -1.0f) { while (_current_magnification <= -1.0f) {
_current_magnification += 1.0f; _current_magnification += 1.0f;
_cursor.wheel--; _cursor.wheel++;
HandleMouseEvents(); HandleMouseEvents();
} }
break; break;

@ -148,7 +148,7 @@ public:
/* Cycle through the drawing modes */ /* Cycle through the drawing modes */
this->viewport->map_type = ChangeRenderMode(this->viewport, wheel < 0); this->viewport->map_type = ChangeRenderMode(this->viewport, wheel < 0);
this->SetDirty(); this->SetDirty();
} else if (_settings_client.gui.scrollwheel_scrolling == 0) { } else if (_settings_client.gui.scrollwheel_scrolling != 2) {
ZoomInOrOutToCursorWindow(wheel < 0, this); ZoomInOrOutToCursorWindow(wheel < 0, this);
} }
} }

@ -2882,8 +2882,8 @@ static void MouseLoop(MouseClick click, int mousewheel)
if (vp != NULL && (_game_mode == GM_MENU || _game_mode == GM_BOOTSTRAP || HasModalProgress())) return; if (vp != NULL && (_game_mode == GM_MENU || _game_mode == GM_BOOTSTRAP || HasModalProgress())) return;
if (mousewheel != 0) { if (mousewheel != 0) {
/* Send mousewheel event to window */ /* Send mousewheel event to window, unless we're scrolling a viewport or the map */
w->OnMouseWheel(mousewheel); if (!scrollwheel_scrolling || (vp == NULL && w->window_class != WC_SMALLMAP)) w->OnMouseWheel(mousewheel);
/* Dispatch a MouseWheelEvent for widgets if it is not a viewport */ /* Dispatch a MouseWheelEvent for widgets if it is not a viewport */
if (vp == NULL) DispatchMouseWheelEvent(w, w->nested_root->GetWidgetFromPos(x - w->left, y - w->top), mousewheel); if (vp == NULL) DispatchMouseWheelEvent(w, w->nested_root->GetWidgetFromPos(x - w->left, y - w->top), mousewheel);

Loading…
Cancel
Save