diff --git a/Makefile.lang.in b/Makefile.lang.in
index 7ce331913d..2853ae3898 100644
--- a/Makefile.lang.in
+++ b/Makefile.lang.in
@@ -78,7 +78,7 @@ depend:
clean:
$(E) '$(STAGE) Cleaning up language files'
- $(Q)rm -f strgen.o string.o alloc_func.o getoptdata.o table/strings.h $(STRGEN) $(LANGS) $(LANGS:%=$(BIN_DIR)/lang/%) lang/english.*
+ $(Q)rm -f strgen_base.o strgen.o string.o alloc_func.o getoptdata.o table/strings.h $(STRGEN) $(LANGS) $(LANGS:%=$(BIN_DIR)/lang/%) lang/english.*
mrproper: clean
$(Q)rm -rf $(BIN_DIR)/lang
diff --git a/Makefile.setting.in b/Makefile.setting.in
index 656de05723..1e2dc992f8 100644
--- a/Makefile.setting.in
+++ b/Makefile.setting.in
@@ -58,7 +58,7 @@ depend:
clean:
$(E) '$(STAGE) Cleaning up settings files'
- $(Q)rm -f settingsgen.o alloc_func.o getoptdata.o ini_load.o $(SETTINGSGEN) table/settings.h
+ $(Q)rm -f settingsgen.o alloc_func.o getoptdata.o string.o ini_load.o $(SETTINGSGEN) table/settings.h
mrproper: clean
diff --git a/azure-pipelines-ci.yml b/azure-pipelines-ci.yml
index ea7f355141..e71ab60ea4 100644
--- a/azure-pipelines-ci.yml
+++ b/azure-pipelines-ci.yml
@@ -34,6 +34,13 @@ jobs:
workingDirectory: $(Build.ArtifactStagingDirectory)
- script: $(Build.ArtifactStagingDirectory)\windows-dependencies\vcpkg.exe integrate install
displayName: 'Install dependencies'
+ - bash: |
+ set -ex
+ cd bin/baseset
+ curl -L https://binaries.openttd.org/extra/opengfx/0.5.2/opengfx-0.5.2-all.zip > opengfx-0.5.2-all.zip
+ unzip opengfx-0.5.2-all.zip
+ rm -f opengfx-0.5.2-all.zip
+ displayName: 'Install OpenGFX'
- task: VSBuild@1
displayName: 'Build'
inputs:
@@ -41,7 +48,11 @@ jobs:
platform: $(BuildPlatform)
configuration: Release
maximumCpuCount: true
- # Running the regression is currently not possibe via MSVC (console is not redirected)
+ - script: |
+ call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86
+ cd projects
+ call regression.bat
+ displayName: 'Test'
- job: linux
displayName: 'Linux'
diff --git a/bin/ai/regression/run.vbs b/bin/ai/regression/run.vbs
new file mode 100644
index 0000000000..88cea5c4eb
--- /dev/null
+++ b/bin/ai/regression/run.vbs
@@ -0,0 +1,154 @@
+Option Explicit
+
+' $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 .
+
+Dim FSO
+Set FSO = CreateObject("Scripting.FileSystemObject")
+
+Function GetTestList()
+ Dim retests, i, tests, dir
+ Set retests = New RegExp
+ Set GetTestList = CreateObject("Scripting.Dictionary")
+
+ retests.Pattern = "ai/regression/tst_*"
+ retests.Global = True
+ For i = 0 To WScript.Arguments.Count - 1
+ Dim test
+ test = "ai/regression/tst_" & WScript.Arguments.Item(i)
+ If FSO.FolderExists(test) Then
+ retests.Pattern = test
+ Exit For
+ End If
+ Next
+
+ For Each dir In FSO.GetFolder("ai/regression/").SubFolders
+ Dim name
+ name = "ai/regression/" & dir.Name
+ If retests.Test(name) Then
+ GetTestList.Add name, name
+ End If
+ Next
+End Function
+
+Function GetParams()
+ GetParams = "-snull -mnull -vnull:ticks=30000"
+ If WScript.Arguments.Count = 0 Then Exit Function
+ If WScript.Arguments.Item(0) <> "-r" Then Exit Function
+ GetParams = ""
+End Function
+
+Sub FilterFile(filename)
+ Dim lines, filter, file
+
+ Set file = FSO.OpenTextFile(filename, 1)
+ If Not file.AtEndOfStream Then
+ lines = file.ReadAll
+ End If
+ file.Close
+
+ Set filter = New RegExp
+ filter.Global = True
+ filter.Multiline = True
+ filter.Pattern = "0x(\(nil\)|0+)(x0)?"
+ lines = filter.Replace(lines, "0x00000000")
+ filter.Pattern = "^dbg: \[script\]"
+ lines = filter.Replace(lines, "")
+ filter.Pattern = "^ "
+ lines = filter.Replace(lines, "ERROR: ")
+ filter.Pattern = "ERROR: \[1\] \[P\] "
+ lines = filter.Replace(lines, "")
+ filter.Pattern = "^dbg: .*\r\n"
+ lines = filter.Replace(lines, "")
+
+ Set file = FSO.OpenTextFile(filename, 2)
+ file.Write lines
+ file.Close
+End Sub
+
+Function CompareFiles(filename1, filename2)
+ Dim file, lines1, lines2
+ Set file = FSO.OpenTextFile(filename1, 1)
+ If Not file.AtEndOfStream Then
+ lines1 = file.ReadAll
+ End IF
+ file.Close
+ Set file = FSO.OpenTextFile(filename2, 1)
+ If Not file.AtEndOfStream Then
+ lines2 = file.ReadAll
+ End IF
+ file.Close
+ CompareFiles = (lines1 = lines2)
+End Function
+
+Function RunTest(test, params, ret)
+ Dim WshShell, oExec, sav, command
+ Set WshShell = CreateObject("WScript.Shell")
+
+ ' Make sure that only one info.nut is present for each test run. Otherwise openttd gets confused.
+ FSO.CopyFile "ai/regression/regression_info.nut", test & "/info.nut"
+
+ sav = test & "/test.sav"
+ If Not FSO.FileExists(sav) Then
+ sav = "ai/regression/empty.sav"
+ End If
+
+ command = ".\openttd -x -c ai/regression/regression.cfg " & params & " -g " & sav & " -d script=2 -d misc=9"
+ ' 2>&1 must be after >tmp.regression, else stderr is not redirected to the file
+ WshShell.Run "cmd /c " & command & " >tmp.regression 2>&1", 0, True
+
+ FilterFile "tmp.regression"
+
+ If CompareFiles(test & "/result.txt", "tmp.regression") Then
+ RunTest = "passed!"
+ Else
+ RunTest = "failed!"
+ ret = 1
+ End If
+
+ FSO.DeleteFile test & "/info.nut"
+End Function
+
+On Error Resume Next
+WScript.StdOut.WriteLine ""
+If Err.Number <> 0 Then
+ WScript.Echo "This script must be started with cscript."
+ WScript.Quit 1
+End If
+On Error Goto 0
+
+If Not FSO.FileExists("ai/regression/run.vbs") Then
+ WScript.Echo "Make sure you are in the root of OpenTTD before starting this script."
+ WScript.Quit 1
+End If
+
+If FSO.FileExists("scripts/game_start.scr") Then
+ FSO.MoveFile "scripts/game_start.scr", "scripts/game_start.scr.regression"
+End If
+
+Dim params, test, ret
+params = GetParams()
+ret = 0
+
+For Each test in GetTestList()
+ WScript.StdOut.Write "Running " & test & "... "
+ WScript.StdOut.WriteLine RunTest(test, params, ret)
+Next
+
+If FSO.FileExists("scripts/game_start.scr.regression") Then
+ FSO.MoveFile "scripts/game_start.scr.regression", "scripts/game_start.scr"
+End If
+
+If WScript.Arguments.Count > 0 Then
+ If WScripts.Arguments.Items(0) = "-k" Then
+ WScript.Quit ret
+ End If
+End If
+
+FSO.DeleteFile "tmp.regression"
+
+WScript.Quit ret
diff --git a/config.lib b/config.lib
index 4d508739b3..2e7208368e 100644
--- a/config.lib
+++ b/config.lib
@@ -1343,8 +1343,6 @@ make_compiler_cflags() {
if [ $cc_version -ge 110 ]; then
# remark #2259: non-pointer conversion from ... to ... may lose significant bits
flags="$flags -wd2259"
- # Use c++0x mode so static_assert() is available
- cxxflags="$cxxflags -std=c++11"
fi
if [ $cc_version -lt 140 ]; then
@@ -1362,7 +1360,8 @@ make_compiler_cflags() {
fi
elif echo "$version_line" | grep -q "clang"; then
# Enable some things only for certain clang versions
- cc_version="`$1 -v 2>&1 | head -n 1 | sed s@[^0-9]@@g | cut -c 1-2`"
+ # Need to try really hard to get the version line, because OSX clang likes to hide its true version
+ cc_version="`$1 -v 2>&1 | grep -i version | head -n 1 | sed s@[^0-9]@@g | cut -c 1-2`"
# aliasing rules are not held in openttd code
flags="$flags -fno-strict-aliasing"
@@ -1412,7 +1411,7 @@ make_compiler_cflags() {
if [ "$cc_version" -ge "33" ]; then
# clang completed C++11 support in version 3.3
- flags="$flags -std=c++11 -DCUSTOM_ALLOCATOR"
+ flags="$flags -DCUSTOM_ALLOCATOR"
else
log 1 "configure: error: clang version is too old: `$1 -v 2>&1 | head -n 1`, minumum: 3.3"
exit 1
@@ -1476,12 +1475,6 @@ make_compiler_cflags() {
flags="$flags -Wnon-virtual-dtor"
fi
- if [ $cc_version -ge 403 ] && [ $cc_version -lt 600 ]; then
- # Use gnu++0x mode so static_assert() is available.
- # Don't use c++0x, it breaks mingw (with gcc 4.4.0).
- cxxflags="$cxxflags -std=gnu++11"
- fi
-
if [ $cc_version -eq 405 ]; then
# Prevent optimisation supposing enums are in a range specified by the standard
# For details, see http://gcc.gnu.org/PR43680
@@ -1511,7 +1504,7 @@ make_compiler_cflags() {
if [ $cc_version -ge 600 ]; then
# -flifetime-dse=2 (default since GCC 6) doesn't play
# well with our custom pool item allocator
- cxxflags="$cxxflags -flifetime-dse=1 -std=gnu++14"
+ cxxflags="$cxxflags -flifetime-dse=1"
fi
if [ "$enable_lto" != "0" ]; then
@@ -1602,6 +1595,8 @@ make_cflags_and_ldflags() {
CFLAGS="$CFLAGS -D$os"
CFLAGS_BUILD="$CFLAGS_BUILD -D$os"
+ CXXFLAGS="$CXXFLAGS -std=c++11"
+ CXXFLAGS_BUILD="$CXXFLAGS_BUILD -std=c++11"
if [ "$enable_static" != "0" ]; then
STATIC_FLAGS="--static"
@@ -3247,10 +3242,16 @@ detect_iconv() {
# Try to find iconv.h, seems to only thing to detect iconv with
if [ "$with_iconv" = "1" ] || [ "$with_iconv" = "" ] || [ "$with_iconv" = "2" ]; then
- iconv=`ls -1 /usr/include 2>/dev/null | grep "iconv.h"`
- if [ -z "$iconv" ]; then
- iconv=`ls -1 /usr/local/include 2>/dev/null | grep "iconv.h"`
- fi
+ # Iterate over search paths
+ iconv=""
+ search_paths=`LC_ALL=C $cxx_host $OSX_SYSROOT $CFLAGS -E - -v &1 | \
+ $awk '/#include <...> search starts here:/{flag=1;next}/End of search list./{flag=0}flag'`
+ for path in $search_paths; do
+ iconv=`ls -1 $path 2>/dev/null | grep "iconv.h"`
+ if [ -n "$iconv" ]; then
+ break
+ fi
+ done
else
# Make sure it exists
iconv=`ls $with_iconv/include/iconv.h 2>/dev/null`
diff --git a/projects/openttd_vs100.vcxproj b/projects/openttd_vs100.vcxproj
new file mode 100644
index 0000000000..3baeeb5eb7
--- /dev/null
+++ b/projects/openttd_vs100.vcxproj
@@ -0,0 +1,1328 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ Win32
+
+
+ Release
+ x64
+
+
+
+ openttd
+ {668328A0-B40E-4CDB-BD72-D0064424414A}
+ openttd
+
+
+
+ Application
+ false
+ Unicode
+
+
+ Application
+ false
+ Unicode
+ true
+
+
+ Application
+ false
+ Unicode
+
+
+ Application
+ false
+ Unicode
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <_ProjectFileVersion>10.0.30319.1
+ $(SolutionDir)..\objs\$(Platform)\$(Configuration)\
+ $(SolutionDir)..\objs\$(Platform)\$(Configuration)\
+ false
+ $(SolutionDir)..\objs\$(Platform)\$(Configuration)\
+ $(SolutionDir)..\objs\$(Platform)\$(Configuration)\
+
+ $(SolutionDir)..\objs\$(Platform)\$(Configuration)\
+ false
+ $(SolutionDir)..\objs\$(Platform)\$(Configuration)\
+ $(SolutionDir)..\objs\$(Platform)\$(Configuration)\
+
+ AllRules.ruleset
+
+
+ AllRules.ruleset
+
+
+ AllRules.ruleset
+
+
+ AllRules.ruleset
+
+
+ $(SolutionDir)..\objs\$(Platform)\$(Configuration)\
+ $(ProjectDir)..\bin
+
+
+
+ .\Release/openttd.tlb
+
+
+
+
+ /MP /J %(AdditionalOptions)
+ Full
+ AnySuitable
+ true
+ Size
+ true
+ ..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)
+ 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)
+ true
+ Sync
+ MultiThreaded
+ 4Bytes
+ false
+ true
+
+
+
+
+
+
+ All
+ $(IntDir)
+ $(IntDir)
+ $(IntDir)$(TargetName).pdb
+ Level3
+ false
+ true
+ ProgramDatabase
+ FastCall
+ Default
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ 0x0809
+
+
+ winmm.lib;ws2_32.lib;imm32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;icule.lib;iculx.lib;%(AdditionalDependencies)
+ true
+ %(IgnoreSpecificDefaultLibraries)
+ true
+ Windows
+ 1048576
+ 1048576
+ true
+ false
+
+
+ MachineX86
+ true
+
+
+ dpi_aware.manifest;os_versions.manifest
+
+
+ copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"
+
+
+
+
+ .\Debug/openttd.tlb
+
+
+
+
+ /MP %(AdditionalOptions)
+ Disabled
+ ..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)
+ 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)
+ EnableFastChecks
+ MultiThreadedDebug
+
+
+ $(IntDir)
+ $(IntDir)
+ $(IntDir)$(TargetName).pdb
+ Level3
+ false
+ true
+ EditAndContinue
+ FastCall
+ Default
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ 0x0809
+
+
+ winmm.lib;ws2_32.lib;imm32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;icule.lib;iculx.lib;%(AdditionalDependencies)
+ true
+ LIBCMT.lib;%(IgnoreSpecificDefaultLibraries)
+ true
+ Windows
+ 1048576
+ 1048576
+ false
+
+
+ MachineX86
+
+
+ dpi_aware.manifest;os_versions.manifest
+
+
+ copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"
+
+
+
+
+ X64
+ .\Release/openttd.tlb
+
+
+
+
+ /MP /J %(AdditionalOptions)
+ Full
+ AnySuitable
+ true
+ Size
+ true
+ ..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)
+ 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)
+ true
+ Sync
+ MultiThreaded
+ Default
+ false
+ true
+
+
+
+
+
+
+ All
+ $(IntDir)
+ $(IntDir)
+ $(IntDir)$(TargetName).pdb
+ Level3
+ false
+ true
+ ProgramDatabase
+ FastCall
+ Default
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ 0x0809
+
+
+ winmm.lib;ws2_32.lib;imm32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;icule.lib;iculx.lib;%(AdditionalDependencies)
+ true
+ %(IgnoreSpecificDefaultLibraries)
+ true
+ Windows
+ 1048576
+ 1048576
+ true
+ MachineX64
+ true
+
+
+ dpi_aware.manifest;os_versions.manifest
+
+
+ copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"
+
+
+
+
+ X64
+ .\Debug/openttd.tlb
+
+
+
+
+ /MP %(AdditionalOptions)
+ Disabled
+ ..\objs\langs;..\objs\settings;..\src\3rdparty\squirrel\include;%(AdditionalIncludeDirectories)
+ 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)
+ EnableFastChecks
+ MultiThreadedDebug
+
+
+
+
+
+
+ $(IntDir)
+ $(IntDir)
+ $(IntDir)$(TargetName).pdb
+ Level3
+ false
+ true
+ ProgramDatabase
+ Cdecl
+ Default
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ 0x0809
+
+
+ winmm.lib;ws2_32.lib;imm32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;icule.lib;iculx.lib;%(AdditionalDependencies)
+ true
+ LIBCMT.lib;%(IgnoreSpecificDefaultLibraries)
+ true
+ Windows
+ 1048576
+ 1048576
+ MachineX64
+
+
+ dpi_aware.manifest;os_versions.manifest
+
+
+ copy "$(OutDir)$(TargetName)$(TargetExt)" "$(SolutionDir)..\bin\$(TargetName)$(TargetExt)"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {0f066b23-18df-4284-8265-f4a5e7e3b966}
+ false
+
+
+ {a133a442-bd0a-4ade-b117-ad7545e4bdd1}
+ false
+
+
+ {1a2b3c5e-1c23-41a5-9c9b-acba2aa75fec}
+ false
+
+
+
+
diff --git a/projects/openttd_vs100.vcxproj.filters b/projects/openttd_vs100.vcxproj.filters
new file mode 100644
index 0000000000..515f2b4c05
--- /dev/null
+++ b/projects/openttd_vs100.vcxproj.filters
@@ -0,0 +1,3080 @@
+
+
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000000}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000001}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000002}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000003}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000004}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000005}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000006}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000007}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000008}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000009}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000010}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000011}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000012}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000013}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000014}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000015}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000016}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000017}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000018}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000019}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000020}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000021}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000022}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000023}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000024}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000025}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000026}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000027}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000028}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000029}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000030}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000031}
+
+
+ {c76ff9f1-1e62-46d8-8d55-000000000032}
+
+
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ Core Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ GUI Source Code
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Widgets
+
+
+ Command handlers
+
+
+ Command handlers
+
+
+ Command handlers
+
+
+ Command handlers
+
+
+ Command handlers
+
+
+ Command handlers
+
+
+ Command handlers
+
+
+ Command handlers
+
+
+ Command handlers
+
+
+ Command handlers
+
+
+ Command handlers
+
+
+ Command handlers
+
+
+ Command handlers
+
+
+ Command handlers
+
+
+ Command handlers
+
+
+ Command handlers
+
+
+ Command handlers
+
+
+ Command handlers
+
+
+ Command handlers
+
+
+ Command handlers
+
+
+ Command handlers
+
+
+ Command handlers
+
+
+ Command handlers
+
+
+ Command handlers
+
+
+ Command handlers
+
+
+ Command handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Save/Load handlers
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ Tables
+
+
+ MD5
+
+
+ MD5
+
+
+ Script
+
+
+ Script
+
+
+ Script
+
+
+ Script
+
+
+ Script
+
+
+ Script
+
+
+ Script
+
+
+ Script
+
+
+ Script
+
+
+ Script
+
+
+ Script
+
+
+ Script
+
+
+ Script
+
+
+ Script
+
+
+ Script
+
+
+ Script
+
+
+ Script
+
+
+ Script
+
+
+ Script
+
+
+ Squirrel
+
+
+ Squirrel
+
+
+ Squirrel
+
+
+ Squirrel
+
+
+ Squirrel
+
+
+ Squirrel
+
+
+ Squirrel
+
+
+ Squirrel
+
+
+ Squirrel
+
+
+ Squirrel
+
+
+ Squirrel
+
+
+ Squirrel
+
+
+ Squirrel
+
+
+ Squirrel
+
+
+ Squirrel headers
+
+
+ Squirrel headers
+
+
+ Squirrel headers
+
+
+ Squirrel headers
+
+
+ Squirrel headers
+
+
+ Squirrel headers
+
+
+ Squirrel headers
+
+
+ Squirrel headers
+
+
+ Squirrel headers
+
+
+ Squirrel headers
+
+
+ Squirrel headers
+
+
+ Squirrel headers
+
+
+ Squirrel headers
+
+
+ Squirrel headers
+
+
+ Squirrel headers
+
+
+ Squirrel headers
+
+
+ Squirrel headers
+
+
+ Squirrel headers
+
+
+ Squirrel headers
+
+
+ Squirrel headers
+
+
+ AI Core
+
+
+ AI Core
+
+
+ AI Core
+
+
+ AI Core
+
+
+ AI Core
+
+
+ AI Core
+
+
+ AI Core
+
+
+ AI Core
+
+
+ AI Core
+
+
+ AI Core
+
+
+ AI Core
+
+
+ AI Core
+
+
+ AI API
+
+
+ Game API
+
+
+ Game Core
+
+
+ Game Core
+
+
+ Game Core
+
+
+ Game Core
+
+
+ Game Core
+
+
+ Game Core
+
+
+ Game Core
+
+
+ Game Core
+
+
+ Game Core
+
+
+ Game Core
+
+
+ Game Core
+
+
+ Game Core
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Script API Implementation
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Blitters
+
+
+ Drivers
+
+
+ Drivers
+
+
+ Drivers
+
+
+ Sprite loaders
+
+
+ Sprite loaders
+
+
+ Sprite loaders
+
+
+ NewGRF
+
+
+ NewGRF
+
+
+ NewGRF
+
+
+ NewGRF
+
+
+ NewGRF
+
+
+ NewGRF
+
+
+ NewGRF
+
+
+ NewGRF
+
+
+ NewGRF
+
+
+ NewGRF
+
+
+ NewGRF
+
+
+ NewGRF
+
+
+ NewGRF
+
+
+ NewGRF
+
+
+ NewGRF
+
+
+ NewGRF
+
+
+ NewGRF
+
+
+ NewGRF
+
+
+ NewGRF
+
+
+ NewGRF
+
+
+ NewGRF
+
+
+ Map Accessors
+
+
+ Map Accessors
+
+
+ Map Accessors
+
+
+ Map Accessors
+
+
+ Map Accessors
+
+
+ Map Accessors
+
+
+ Map Accessors
+
+
+ Map Accessors
+
+
+ Map Accessors
+
+
+ Map Accessors
+
+
+ Map Accessors
+
+
+ Map Accessors
+
+
+ Map Accessors
+
+
+ Map Accessors
+
+
+ Map Accessors
+
+
+ Map Accessors
+
+
+ Map Accessors
+
+
+ Misc
+
+
+ Misc
+
+
+ Misc
+
+
+ Misc
+
+
+ Misc
+
+
+ Misc
+
+
+ Misc
+
+
+ Misc
+
+
+ Misc
+
+
+ Misc
+
+
+ Misc
+
+
+ Misc
+
+
+ Network Core
+
+
+ Network Core
+
+
+ Network Core
+
+
+ Network Core
+
+
+ Network Core
+
+
+ Network Core
+
+
+ Network Core
+
+
+ Network Core
+
+
+ Network Core
+
+
+ Network Core
+
+
+ Network Core
+
+
+ Network Core
+
+
+ Network Core
+
+
+ Network Core
+
+
+ Network Core
+
+
+ Network Core
+
+
+ Network Core
+
+
+ Network Core
+
+
+ Network Core
+
+
+ Network Core
+
+
+ Network Core
+
+
+ Network Core
+
+
+ Network Core
+
+
+ Network Core
+
+
+ Network Core
+
+
+ Pathfinder
+
+
+ Pathfinder
+
+
+ Pathfinder
+
+
+ Pathfinder
+
+
+ Pathfinder
+
+
+ Pathfinder
+
+
+ NPF
+
+
+ NPF
+
+
+ NPF
+
+
+ NPF
+
+
+ NPF
+
+
+ NPF
+
+
+ YAPF
+
+
+ YAPF
+
+
+ YAPF
+
+
+ YAPF
+
+
+ YAPF
+
+
+ YAPF
+
+
+ YAPF
+
+
+ YAPF
+
+
+ YAPF
+
+
+ YAPF
+
+
+ YAPF
+
+
+ YAPF
+
+
+ YAPF
+
+
+ YAPF
+
+
+ YAPF
+
+
+ YAPF
+
+
+ YAPF
+
+
+ YAPF
+
+
+ Video
+
+
+ Video
+
+
+ Video
+
+
+ Video
+
+
+ Music
+
+
+ Music
+
+
+ Music
+
+
+ Sound
+
+
+ Sound
+
+
+ Sound
+
+
+ Windows files
+
+
+ Windows files
+
+
+ Windows files
+
+
+ Threading
+
+
+ Threading
+
+
+
+
+
+
+
diff --git a/projects/openttd_vs140.sln b/projects/openttd_vs140.sln
index d256cfa495..32f3033fb2 100644
--- a/projects/openttd_vs140.sln
+++ b/projects/openttd_vs140.sln
@@ -24,6 +24,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "settings", "settings_vs140.
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "settingsgen", "settingsgen_vs140.vcxproj", "{E9548DE9-F089-49B7-93A6-30BE2CC311C7}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "regression", "regression_vs140.vcxproj", "{4712B013-437D-42CE-947F-DEBABA15261F}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -84,6 +86,10 @@ Global
{E9548DE9-F089-49B7-93A6-30BE2CC311C7}.Release|Win32.Build.0 = Debug|Win32
{E9548DE9-F089-49B7-93A6-30BE2CC311C7}.Release|x64.ActiveCfg = Debug|Win32
{E9548DE9-F089-49B7-93A6-30BE2CC311C7}.Release|x64.Build.0 = Debug|Win32
+ {4712B013-437D-42CE-947F-DEBABA15261F}.Debug|Win32.ActiveCfg = Debug|Win32
+ {4712B013-437D-42CE-947F-DEBABA15261F}.Debug|x64.ActiveCfg = Debug|Win32
+ {4712B013-437D-42CE-947F-DEBABA15261F}.Release|Win32.ActiveCfg = Debug|Win32
+ {4712B013-437D-42CE-947F-DEBABA15261F}.Release|x64.ActiveCfg = Debug|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/projects/openttd_vs141.sln b/projects/openttd_vs141.sln
index e314c628a7..86f2685cd9 100644
--- a/projects/openttd_vs141.sln
+++ b/projects/openttd_vs141.sln
@@ -24,6 +24,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "settings", "settings_vs141.
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "settingsgen", "settingsgen_vs141.vcxproj", "{E9548DE9-F089-49B7-93A6-30BE2CC311C7}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "regression", "regression_vs141.vcxproj", "{4712B013-437D-42CE-947F-DEBABA15261F}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -84,6 +86,10 @@ Global
{E9548DE9-F089-49B7-93A6-30BE2CC311C7}.Release|Win32.Build.0 = Debug|Win32
{E9548DE9-F089-49B7-93A6-30BE2CC311C7}.Release|x64.ActiveCfg = Debug|Win32
{E9548DE9-F089-49B7-93A6-30BE2CC311C7}.Release|x64.Build.0 = Debug|Win32
+ {4712B013-437D-42CE-947F-DEBABA15261F}.Debug|Win32.ActiveCfg = Debug|Win32
+ {4712B013-437D-42CE-947F-DEBABA15261F}.Debug|x64.ActiveCfg = Debug|Win32
+ {4712B013-437D-42CE-947F-DEBABA15261F}.Release|Win32.ActiveCfg = Debug|Win32
+ {4712B013-437D-42CE-947F-DEBABA15261F}.Release|x64.ActiveCfg = Debug|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/projects/openttd_vs80.vcproj b/projects/openttd_vs80.vcproj
new file mode 100644
index 0000000000..8e1ddd90b6
--- /dev/null
+++ b/projects/openttd_vs80.vcproj
@@ -0,0 +1,4545 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/projects/regression.bat b/projects/regression.bat
new file mode 100644
index 0000000000..db373c371b
--- /dev/null
+++ b/projects/regression.bat
@@ -0,0 +1,6 @@
+cd ..\bin
+editbin /nologo /subsystem:console openttd.exe
+cscript /nologo ai\regression\run.vbs
+set RESULT=%ERRORLEVEL%
+editbin /nologo /subsystem:windows openttd.exe
+exit %RESULT%
diff --git a/projects/regression_vs140.vcxproj b/projects/regression_vs140.vcxproj
new file mode 100644
index 0000000000..b1c9f4930a
--- /dev/null
+++ b/projects/regression_vs140.vcxproj
@@ -0,0 +1,41 @@
+
+
+
+
+ Debug
+ Win32
+
+
+
+ {4712B013-437D-42CE-947F-DEBABA15261F}
+ regression
+ regression
+
+
+
+ Makefile
+ v140
+
+
+
+
+
+
+
+
+
+
+
+ call regression.bat
+ call regression.bat
+ del ..\bin\tmp.regression
+
+
+
+ {668328a0-b40e-4cdb-bd72-d0064424414a}
+
+
+
+
+
+
diff --git a/projects/regression_vs141.vcxproj b/projects/regression_vs141.vcxproj
new file mode 100644
index 0000000000..fda3f3312d
--- /dev/null
+++ b/projects/regression_vs141.vcxproj
@@ -0,0 +1,41 @@
+
+
+
+
+ Debug
+ Win32
+
+
+
+ {4712B013-437D-42CE-947F-DEBABA15261F}
+ regression
+ regression
+
+
+
+ Makefile
+ v141
+
+
+
+
+
+
+
+
+
+
+
+ call regression.bat
+ call regression.bat
+ del ..\bin\tmp.regression
+
+
+
+ {668328a0-b40e-4cdb-bd72-d0064424414a}
+
+
+
+
+
+
diff --git a/src/lang/english.txt b/src/lang/english.txt
index a7153ca872..d456c08ce9 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -4580,6 +4580,7 @@ STR_ORDER_CONDITIONAL_AGE :Age (years)
STR_ORDER_CONDITIONAL_REQUIRES_SERVICE :Requires service
STR_ORDER_CONDITIONAL_UNCONDITIONALLY :Always
STR_ORDER_CONDITIONAL_REMAINING_LIFETIME :Remaining lifetime (years)
+STR_ORDER_CONDITIONAL_MAX_RELIABILITY :Maximum reliability
STR_ORDER_CONDITIONAL_CARGO_WAITING :Waiting cargo
STR_ORDER_CONDITIONAL_ACCEPTANCE_DROPDOWN :Accepted cargo
STR_ORDER_CONDITIONAL_FREE_PLATFORMS :Free platforms
diff --git a/src/lang/spanish.txt b/src/lang/spanish.txt
index 2d0dd31218..7497cc6f1f 100644
--- a/src/lang/spanish.txt
+++ b/src/lang/spanish.txt
@@ -2708,6 +2708,10 @@ STR_FRAMERATE_FPS_BAD :{RED}{DECIMAL}
STR_FRAMERATE_GRAPH_MILLISECONDS :{TINY_FONT}{COMMA} ms
STR_FRAMERATE_GRAPH_SECONDS :{TINY_FONT}{COMMA} s
############ Leave those lines in this order!!
+STR_FRAMERATE_GL_TRAINS :{BLACK} Ticks de trenes:
+STR_FRAMERATE_GL_ROADVEHS :{BLACK} Ticks de vehículos de carretera:
+STR_FRAMERATE_GL_SHIPS :{BLACK} Ticks de barcos:
+STR_FRAMERATE_GL_AIRCRAFT :{BLACK} Ticks de aeronaves:
STR_FRAMERATE_DRAWING :{BLACK}Renderizado gráfico:
############ End of leave-in-this-order
############ Leave those lines in this order!!
diff --git a/src/mixer.cpp b/src/mixer.cpp
index 6aaa8204d4..6014f6082e 100644
--- a/src/mixer.cpp
+++ b/src/mixer.cpp
@@ -15,6 +15,7 @@
#include "framerate_type.h"
#include "safeguards.h"
+#include "mixer.h"
struct MixerChannel {
bool active;
@@ -38,6 +39,7 @@ struct MixerChannel {
static MixerChannel _channels[8];
static uint32 _play_rate = 11025;
static uint32 _max_size = UINT_MAX;
+static MxStreamCallback _music_stream = NULL;
/**
* The theoretical maximum volume for a single sound sample. Multiple sound
@@ -151,6 +153,9 @@ void MxMixSamples(void *buffer, uint samples)
/* Clear the buffer */
memset(buffer, 0, sizeof(int16) * 2 * samples);
+ /* Fetch music if a sampled stream is available */
+ if (_music_stream) _music_stream((int16*)buffer, samples);
+
/* Mix each channel */
for (mc = _channels; mc != endof(_channels); mc++) {
if (mc->active) {
@@ -215,6 +220,17 @@ void MxSetChannelVolume(MixerChannel *mc, uint volume, float pan)
void MxActivateChannel(MixerChannel *mc)
{
mc->active = true;
+}
+
+/**
+ * Set source of PCM music
+ * @param music_callback Function that will be called to fill sample buffers with music data.
+ * @return Sample rate of mixer, which the buffers supplied to the callback must be rendered at.
+ */
+uint32 MxSetMusicSource(MxStreamCallback music_callback)
+{
+ _music_stream = music_callback;
+ return _play_rate;
}
@@ -222,5 +238,6 @@ bool MxInitialize(uint rate)
{
_play_rate = rate;
_max_size = UINT_MAX / _play_rate;
+ _music_stream = NULL; /* rate may have changed, any music source is now invalid */
return true;
}
diff --git a/src/mixer.h b/src/mixer.h
index 0ccee61092..9766682d6b 100644
--- a/src/mixer.h
+++ b/src/mixer.h
@@ -14,6 +14,14 @@
struct MixerChannel;
+/**
+ * Type of callback functions for supplying PCM music.
+ * A music decoder/renderer implements this function and installs it with MxSetMusicSource, which also returns the sample rate used.
+ * @param buffer Pointer to interleaved 2-channel signed 16 bit PCM data buffer, guaranteed to be 0-initialized.
+ * @param samples number of samples that must be filled into \c buffer.
+ */
+typedef void(*MxStreamCallback)(int16 *buffer, size_t samples);
+
bool MxInitialize(uint rate);
void MxMixSamples(void *buffer, uint samples);
@@ -22,4 +30,6 @@ void MxSetChannelRawSrc(MixerChannel *mc, int8 *mem, size_t size, uint rate, boo
void MxSetChannelVolume(MixerChannel *mc, uint volume, float pan);
void MxActivateChannel(MixerChannel*);
+uint32 MxSetMusicSource(MxStreamCallback music_callback);
+
#endif /* MIXER_H */
diff --git a/src/music/fluidsynth.cpp b/src/music/fluidsynth.cpp
index 63be1dd99c..d1088f4bc4 100644
--- a/src/music/fluidsynth.cpp
+++ b/src/music/fluidsynth.cpp
@@ -16,11 +16,11 @@
#include "fluidsynth.h"
#include "midifile.hpp"
#include
+#include "../mixer.h"
static struct {
fluid_settings_t* settings; ///< FluidSynth settings handle
fluid_synth_t* synth; ///< FluidSynth synthesizer handle
- fluid_audio_driver_t* adriver; ///< FluidSynth audio driver handle
fluid_player_t* player; ///< FluidSynth MIDI player handle
} _midi; ///< Metadata about the midi we're playing.
@@ -42,33 +42,27 @@ static const char *default_sf[] = {
NULL
};
+static void RenderMusicStream(int16 *buffer, size_t samples)
+{
+ if (!_midi.synth || !_midi.player) return;
+ fluid_synth_write_s16(_midi.synth, samples, buffer, 0, 2, buffer, 1, 2);
+}
+
const char *MusicDriver_FluidSynth::Start(const char * const *param)
{
- const char *driver_name = GetDriverParam(param, "driver");
const char *sfont_name = GetDriverParam(param, "soundfont");
int sfont_id;
- if (!driver_name) driver_name = "alsa";
-
- DEBUG(driver, 1, "Fluidsynth: driver %s, sf %s", driver_name, sfont_name);
+ DEBUG(driver, 1, "Fluidsynth: sf %s", sfont_name);
/* Create the settings. */
_midi.settings = new_fluid_settings();
if (!_midi.settings) return "Could not create midi settings";
- if (fluid_settings_setstr(_midi.settings, "audio.driver", driver_name) != 1) {
- return "Could not set audio driver name";
- }
-
/* Create the synthesizer. */
_midi.synth = new_fluid_synth(_midi.settings);
if (!_midi.synth) return "Could not open synth";
- /* Create the audio driver. The synthesizer starts playing as soon
- as the driver is created. */
- _midi.adriver = new_fluid_audio_driver(_midi.settings, _midi.synth);
- if (!_midi.adriver) return "Could not open audio driver";
-
/* Load a SoundFont and reset presets (so that new instruments
* get used from the SoundFont) */
if (!sfont_name) {
@@ -87,13 +81,17 @@ const char *MusicDriver_FluidSynth::Start(const char * const *param)
_midi.player = NULL;
+ uint32 samplerate = MxSetMusicSource(RenderMusicStream);
+ fluid_synth_set_sample_rate(_midi.synth, samplerate);
+ DEBUG(driver, 1, "Fluidsynth: samplerate %.0f", (float)samplerate);
+
return NULL;
}
void MusicDriver_FluidSynth::Stop()
{
+ MxSetMusicSource(NULL);
this->StopSong();
- delete_fluid_audio_driver(_midi.adriver);
delete_fluid_synth(_midi.synth);
delete_fluid_settings(_midi.settings);
}
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp
index 6590771b27..dded80fdaf 100644
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -2411,6 +2411,7 @@ VehicleOrderID ProcessConditionalOrder(const Order *order, const Vehicle *v)
switch (order->GetConditionVariable()) {
case OCV_LOAD_PERCENTAGE: skip_order = OrderConditionCompare(occ, CalcPercentVehicleFilled(v, NULL), value); break;
case OCV_RELIABILITY: skip_order = OrderConditionCompare(occ, ToPercent16(v->reliability), value); break;
+ case OCV_MAX_RELIABILITY: skip_order = OrderConditionCompare(occ, ToPercent16(v->GetEngine()->reliability), value); break;
case OCV_MAX_SPEED: skip_order = OrderConditionCompare(occ, v->GetDisplayMaxSpeed() * 10 / 16, value); break;
case OCV_AGE: skip_order = OrderConditionCompare(occ, v->age / DAYS_IN_LEAP_YEAR, value); break;
case OCV_REQUIRES_SERVICE: skip_order = OrderConditionCompare(occ, v->NeedsServicing(), value); break;
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index 6044188ad3..9211b3745a 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -598,6 +598,7 @@ static const StringID _order_goto_dropdown_aircraft[] = {
static const OrderConditionVariable _order_conditional_variable[] = {
OCV_LOAD_PERCENTAGE,
OCV_RELIABILITY,
+ OCV_MAX_RELIABILITY,
OCV_MAX_SPEED,
OCV_AGE,
OCV_REMAINING_LIFETIME,
diff --git a/src/order_type.h b/src/order_type.h
index e55fd4be13..881057b35b 100644
--- a/src/order_type.h
+++ b/src/order_type.h
@@ -142,6 +142,7 @@ enum OrderConditionVariable {
OCV_REQUIRES_SERVICE, ///< Skip when the vehicle requires service
OCV_UNCONDITIONALLY, ///< Always skip
OCV_REMAINING_LIFETIME, ///< Skip based on the remaining lifetime
+ OCV_MAX_RELIABILITY, ///< Skip based on the maximum reliability
OCV_CARGO_WAITING, ///< Skip if specified cargo is waiting at next station
OCV_CARGO_ACCEPTANCE, ///< Skip if specified cargo is accepted at next station
OCV_FREE_PLATFORMS, ///< Skip based on free platforms at next station
diff --git a/src/os/windows/win32.cpp b/src/os/windows/win32.cpp
index e0434068a0..4597d1c2d4 100644
--- a/src/os/windows/win32.cpp
+++ b/src/os/windows/win32.cpp
@@ -303,7 +303,7 @@ void CreateConsole()
if (_has_console) return;
_has_console = true;
- AllocConsole();
+ if (!AllocConsole()) return;
hand = GetStdHandle(STD_OUTPUT_HANDLE);
GetConsoleScreenBufferInfo(hand, &coninfo);
diff --git a/src/pathfinder/follow_track.hpp b/src/pathfinder/follow_track.hpp
index 90178ec06c..9c6815da4c 100644
--- a/src/pathfinder/follow_track.hpp
+++ b/src/pathfinder/follow_track.hpp
@@ -432,8 +432,9 @@ protected:
}
}
- /* single tram bits cause reversing */
- if (IsTram() && GetSingleTramBit(m_old_tile) == ReverseDiagDir(m_exitdir)) {
+ /* Single tram bits and standard road stops cause reversing. */
+ if (IsRoadTT() && ((IsTram() && GetSingleTramBit(m_old_tile) == ReverseDiagDir(m_exitdir)) ||
+ (IsStandardRoadStopTile(m_old_tile) && GetRoadStopDir(m_old_tile) == ReverseDiagDir(m_exitdir)))) {
/* reverse */
m_new_tile = m_old_tile;
m_new_td_bits = TrackdirToTrackdirBits(ReverseTrackdir(m_old_td));
diff --git a/src/pathfinder/npf/npf.cpp b/src/pathfinder/npf/npf.cpp
index 40fe2740c0..22105efc7d 100644
--- a/src/pathfinder/npf/npf.cpp
+++ b/src/pathfinder/npf/npf.cpp
@@ -970,12 +970,13 @@ static void NPFFollowTrack(AyStar *aystar, OpenListNode *current)
* multiple targets that are spread around, we should perform a breadth first
* search by specifiying CalcZero as our heuristic.
*/
-static NPFFoundTargetData NPFRouteInternal(AyStarNode *start1, bool ignore_start_tile1, AyStarNode *start2, bool ignore_start_tile2, NPFFindStationOrTileData *target, AyStar_EndNodeCheck target_proc, AyStar_CalculateH heuristic_proc, AyStarUserData *user, uint reverse_penalty, bool ignore_reserved = false)
+static NPFFoundTargetData NPFRouteInternal(AyStarNode *start1, bool ignore_start_tile1, AyStarNode *start2, bool ignore_start_tile2, NPFFindStationOrTileData *target, AyStar_EndNodeCheck target_proc, AyStar_CalculateH heuristic_proc, AyStarUserData *user, uint reverse_penalty, bool ignore_reserved = false, int max_penalty = 0)
{
int r;
NPFFoundTargetData result;
/* Initialize procs */
+ _npf_aystar.max_path_cost = max_penalty;
_npf_aystar.CalculateH = heuristic_proc;
_npf_aystar.EndNodeCheck = target_proc;
_npf_aystar.FoundEndNode = NPFSaveTargetData;
@@ -1063,7 +1064,7 @@ static NPFFoundTargetData NPFRouteToStationOrTile(TileIndex tile, Trackdir track
* reverse_penalty applied (NPF_TILE_LENGTH is the equivalent of one full
* tile).
*/
-static NPFFoundTargetData NPFRouteToDepotBreadthFirstTwoWay(TileIndex tile1, Trackdir trackdir1, bool ignore_start_tile1, TileIndex tile2, Trackdir trackdir2, bool ignore_start_tile2, NPFFindStationOrTileData *target, AyStarUserData *user, uint reverse_penalty)
+static NPFFoundTargetData NPFRouteToDepotBreadthFirstTwoWay(TileIndex tile1, Trackdir trackdir1, bool ignore_start_tile1, TileIndex tile2, Trackdir trackdir2, bool ignore_start_tile2, NPFFindStationOrTileData *target, AyStarUserData *user, uint reverse_penalty, int max_penalty)
{
AyStarNode start1;
AyStarNode start2;
@@ -1075,7 +1076,7 @@ static NPFFoundTargetData NPFRouteToDepotBreadthFirstTwoWay(TileIndex tile1, Tra
/* perform a breadth first search. Target is NULL,
* since we are just looking for any depot...*/
- return NPFRouteInternal(&start1, ignore_start_tile1, (IsValidTile(tile2) ? &start2 : NULL), ignore_start_tile2, target, NPFFindDepot, NPFCalcZero, user, reverse_penalty);
+ return NPFRouteInternal(&start1, ignore_start_tile1, (IsValidTile(tile2) ? &start2 : NULL), ignore_start_tile2, target, NPFFindDepot, NPFCalcZero, user, reverse_penalty, false, max_penalty);
}
void InitializeNPF()
@@ -1121,7 +1122,7 @@ FindDepotData NPFRoadVehicleFindNearestDepot(const RoadVehicle *v, int max_penal
Trackdir trackdir = v->GetVehicleTrackdir();
AyStarUserData user = { v->owner, TRANSPORT_ROAD, INVALID_RAILTYPES, v->compatible_roadtypes };
- NPFFoundTargetData ftd = NPFRouteToDepotBreadthFirstTwoWay(v->tile, trackdir, false, v->tile, ReverseTrackdir(trackdir), false, NULL, &user, 0);
+ NPFFoundTargetData ftd = NPFRouteToDepotBreadthFirstTwoWay(v->tile, trackdir, false, INVALID_TILE, INVALID_TRACKDIR, false, NULL, &user, 0, max_penalty);
if (ftd.best_bird_dist != 0) return FindDepotData();
@@ -1176,7 +1177,7 @@ Track NPFShipChooseTrack(const Ship *v, TileIndex tile, DiagDirection enterdir,
* we did not find our target, but ftd.best_trackdir contains the direction leading
* to the tile closest to our target. */
path_found = (ftd.best_bird_dist == 0);
- if (ftd.best_trackdir == 0xff) return INVALID_TRACK;
+ if (ftd.best_trackdir == INVALID_TRACKDIR) return INVALID_TRACK;
return TrackdirToTrack(ftd.best_trackdir);
}
@@ -1211,7 +1212,7 @@ FindDepotData NPFTrainFindNearestDepot(const Train *v, int max_penalty)
assert(trackdir != INVALID_TRACKDIR);
AyStarUserData user = { v->owner, TRANSPORT_RAIL, v->compatible_railtypes, ROADTYPES_NONE };
- NPFFoundTargetData ftd = NPFRouteToDepotBreadthFirstTwoWay(v->tile, trackdir, false, last->tile, trackdir_rev, false, &fstd, &user, NPF_INFINITE_PENALTY);
+ NPFFoundTargetData ftd = NPFRouteToDepotBreadthFirstTwoWay(v->tile, trackdir, false, last->tile, trackdir_rev, false, &fstd, &user, NPF_INFINITE_PENALTY, max_penalty);
if (ftd.best_bird_dist != 0) return FindDepotData();
/* Found target */
diff --git a/src/pathfinder/pathfinder_type.h b/src/pathfinder/pathfinder_type.h
index 9f5a42d76d..73031d5c81 100644
--- a/src/pathfinder/pathfinder_type.h
+++ b/src/pathfinder/pathfinder_type.h
@@ -20,8 +20,8 @@ static const int NPF_TILE_LENGTH = 100;
/**
* This penalty is the equivalent of "infinite", which means that paths that
* get this penalty will be chosen, but only if there is no other route
- * without it. Be careful with not applying this penalty to often, or the
- * total path cost might overflow..
+ * without it. Be careful with not applying this penalty too often, or the
+ * total path cost might overflow.
*/
static const int NPF_INFINITE_PENALTY = 1000 * NPF_TILE_LENGTH;
@@ -35,8 +35,8 @@ static const int YAPF_TILE_CORNER_LENGTH = 71;
/**
* This penalty is the equivalent of "infinite", which means that paths that
* get this penalty will be chosen, but only if there is no other route
- * without it. Be careful with not applying this penalty to often, or the
- * total path cost might overflow..
+ * without it. Be careful with not applying this penalty too often, or the
+ * total path cost might overflow.
*/
static const int YAPF_INFINITE_PENALTY = 1000 * YAPF_TILE_LENGTH;
diff --git a/src/pathfinder/yapf/yapf_road.cpp b/src/pathfinder/yapf/yapf_road.cpp
index d86de74292..801a75677c 100644
--- a/src/pathfinder/yapf/yapf_road.cpp
+++ b/src/pathfinder/yapf/yapf_road.cpp
@@ -35,6 +35,10 @@ public:
typedef typename Node::Key Key; ///< key to hash tables
protected:
+ int m_max_cost;
+
+ CYapfCostRoadT() : m_max_cost(0) {};
+
/** to access inherited path finder */
Tpf& Yapf()
{
@@ -105,6 +109,11 @@ protected:
}
public:
+ inline void SetMaxCost(int max_cost)
+ {
+ m_max_cost = max_cost;
+ }
+
/**
* Called by YAPF to calculate the cost from the origin to the given node.
* Calculates only the cost of given node, adds it to the parent node cost
@@ -120,6 +129,8 @@ public:
/* start at n.m_key.m_tile / n.m_key.m_td and walk to the end of segment */
TileIndex tile = n.m_key.m_tile;
Trackdir trackdir = n.m_key.m_td;
+ int parent_cost = (n.m_parent != NULL) ? n.m_parent->m_cost : 0;
+
for (;;) {
/* base tile cost depending on distance between edges */
segment_cost += Yapf().OneTileCost(tile, trackdir);
@@ -128,6 +139,12 @@ public:
/* we have reached the vehicle's destination - segment should end here to avoid target skipping */
if (Yapf().PfDetectDestinationTile(tile, trackdir)) break;
+ /* Finish if we already exceeded the maximum path cost (i.e. when
+ * searching for the nearest depot). */
+ if (m_max_cost > 0 && (parent_cost + segment_cost) > m_max_cost) {
+ return false;
+ }
+
/* stop if we have just entered the depot */
if (IsRoadDepotTile(tile) && trackdir == DiagDirToDiagTrackdir(ReverseDiagDir(GetRoadDepotDirection(tile)))) {
/* next time we will reverse and leave the depot */
@@ -172,7 +189,6 @@ public:
n.m_segment_last_td = trackdir;
/* save also tile cost */
- int parent_cost = (n.m_parent != NULL) ? n.m_parent->m_cost : 0;
n.m_cost = parent_cost + segment_cost;
return true;
}
@@ -453,15 +469,12 @@ public:
* @param tile Tile of the vehicle.
* @param td Trackdir of the vehicle.
* @param max_distance max length (penalty) for paths.
- * @todo max_distance not used by YAPF for road vehicles.
- * It can be removed or copy the SetMaxCost() strategy
- * applied in YAPF for rail. The best depot can be at
- * a distance greater than max_distance.
*/
inline FindDepotData FindNearestDepot(const RoadVehicle *v, TileIndex tile, Trackdir td, int max_distance)
{
/* Set origin. */
Yapf().SetOrigin(tile, TrackdirToTrackdirBits(td));
+ Yapf().SetMaxCost(max_distance);
/* Find the best path and return if no depot is found. */
if (!Yapf().FindPath(v)) return FindDepotData();
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index 0c78881291..70fbcb2a38 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -3570,6 +3570,16 @@ bool AfterLoadGame()
FOR_ALL_COMPANIES(c) c->purchase_land_limit = _settings_game.construction.purchase_land_frame_burst << 16;
}
+ if (SlXvIsFeaturePresent(XSLFI_MORE_COND_ORDERS, 1, 1)) {
+ Order *order;
+ FOR_ALL_ORDERS(order) {
+ // Insertion of OCV_MAX_RELIABILITY between OCV_REMAINING_LIFETIME and OCV_CARGO_WAITING
+ if (order->IsType(OT_CONDITIONAL) && order->GetConditionVariable() > OCV_REMAINING_LIFETIME) {
+ order->SetConditionVariable(static_cast((uint)order->GetConditionVariable() + 1));
+ }
+ }
+ }
+
/* Road stops is 'only' updating some caches */
AfterLoadRoadStops();
AfterLoadLabelMaps();
diff --git a/src/saveload/extended_ver_sl.cpp b/src/saveload/extended_ver_sl.cpp
index 641f54fc1e..6b15ec380b 100644
--- a/src/saveload/extended_ver_sl.cpp
+++ b/src/saveload/extended_ver_sl.cpp
@@ -49,7 +49,7 @@ static const uint32 _sl_xv_slxi_chunk_version = 0; ///< current version
const SlxiSubChunkInfo _sl_xv_sub_chunk_infos[] = {
{ XSLFI_TRACE_RESTRICT, XSCF_NULL, 10, 10, "tracerestrict", NULL, NULL, "TRRM,TRRP,TRRS" },
{ XSLFI_TRACE_RESTRICT_OWNER, XSCF_NULL, 1, 1, "tracerestrict_owner", NULL, NULL, NULL },
- { XSLFI_TRACE_RESTRICT_ORDRCND, XSCF_NULL, 2, 2, "tracerestrict_order_cond", NULL, NULL, NULL },
+ { XSLFI_TRACE_RESTRICT_ORDRCND, XSCF_NULL, 3, 3, "tracerestrict_order_cond", NULL, NULL, NULL },
{ XSLFI_TRACE_RESTRICT_STATUSCND,XSCF_NULL, 1, 1, "tracerestrict_status_cond", NULL, NULL, NULL },
{ XSLFI_TRACE_RESTRICT_REVERSE, XSCF_NULL, 1, 1, "tracerestrict_reverse", NULL, NULL, NULL },
{ XSLFI_PROG_SIGS, XSCF_NULL, 1, 1, "programmable_signals", NULL, NULL, "SPRG" },
@@ -67,7 +67,7 @@ const SlxiSubChunkInfo _sl_xv_sub_chunk_infos[] = {
{ XSLFI_INFRA_SHARING, XSCF_NULL, 2, 2, "infra_sharing", NULL, NULL, "CPDP" },
{ XSLFI_VARIABLE_DAY_LENGTH, XSCF_NULL, 2, 2, "variable_day_length", NULL, NULL, NULL },
{ XSLFI_ORDER_OCCUPANCY, XSCF_NULL, 2, 2, "order_occupancy", NULL, NULL, NULL },
- { XSLFI_MORE_COND_ORDERS, XSCF_NULL, 1, 1, "more_cond_orders", NULL, NULL, NULL },
+ { XSLFI_MORE_COND_ORDERS, XSCF_NULL, 2, 2, "more_cond_orders", NULL, NULL, NULL },
{ XSLFI_EXTRA_LARGE_MAP, XSCF_NULL, 0, 1, "extra_large_map", NULL, NULL, NULL },
{ XSLFI_REVERSE_AT_WAYPOINT, XSCF_NULL, 1, 1, "reverse_at_waypoint", NULL, NULL, NULL },
{ XSLFI_VEH_LIFETIME_PROFIT, XSCF_NULL, 1, 1, "veh_lifetime_profit", NULL, NULL, NULL },
diff --git a/src/script/api/ai/ai_order.hpp.sq b/src/script/api/ai/ai_order.hpp.sq
index 71cc8cfe90..ab25e4810d 100644
--- a/src/script/api/ai/ai_order.hpp.sq
+++ b/src/script/api/ai/ai_order.hpp.sq
@@ -44,6 +44,7 @@ void SQAIOrder_Register(Squirrel *engine)
SQAIOrder.DefSQConst(engine, ScriptOrder::OF_INVALID, "OF_INVALID");
SQAIOrder.DefSQConst(engine, ScriptOrder::OC_LOAD_PERCENTAGE, "OC_LOAD_PERCENTAGE");
SQAIOrder.DefSQConst(engine, ScriptOrder::OC_RELIABILITY, "OC_RELIABILITY");
+ SQAIOrder.DefSQConst(engine, ScriptOrder::OC_MAX_RELIABILITY, "OC_MAX_RELIABILITY");
SQAIOrder.DefSQConst(engine, ScriptOrder::OC_MAX_SPEED, "OC_MAX_SPEED");
SQAIOrder.DefSQConst(engine, ScriptOrder::OC_AGE, "OC_AGE");
SQAIOrder.DefSQConst(engine, ScriptOrder::OC_REQUIRES_SERVICE, "OC_REQUIRES_SERVICE");
diff --git a/src/script/api/game/game_order.hpp.sq b/src/script/api/game/game_order.hpp.sq
index f95dce925a..e2126c603d 100644
--- a/src/script/api/game/game_order.hpp.sq
+++ b/src/script/api/game/game_order.hpp.sq
@@ -44,6 +44,7 @@ void SQGSOrder_Register(Squirrel *engine)
SQGSOrder.DefSQConst(engine, ScriptOrder::OF_INVALID, "OF_INVALID");
SQGSOrder.DefSQConst(engine, ScriptOrder::OC_LOAD_PERCENTAGE, "OC_LOAD_PERCENTAGE");
SQGSOrder.DefSQConst(engine, ScriptOrder::OC_RELIABILITY, "OC_RELIABILITY");
+ SQGSOrder.DefSQConst(engine, ScriptOrder::OC_MAX_RELIABILITY, "OC_MAX_RELIABILITY");
SQGSOrder.DefSQConst(engine, ScriptOrder::OC_MAX_SPEED, "OC_MAX_SPEED");
SQGSOrder.DefSQConst(engine, ScriptOrder::OC_AGE, "OC_AGE");
SQGSOrder.DefSQConst(engine, ScriptOrder::OC_REQUIRES_SERVICE, "OC_REQUIRES_SERVICE");
diff --git a/src/script/api/script_order.cpp b/src/script/api/script_order.cpp
index 20ba33e5fc..486668497d 100644
--- a/src/script/api/script_order.cpp
+++ b/src/script/api/script_order.cpp
@@ -215,6 +215,7 @@ static int ScriptOrderPositionToRealOrderPosition(VehicleID vehicle_id, ScriptOr
switch (condition) {
case OC_LOAD_PERCENTAGE:
case OC_RELIABILITY:
+ case OC_MAX_RELIABILITY:
case OC_MAX_SPEED:
case OC_AGE:
case OC_REMAINING_LIFETIME:
diff --git a/src/script/api/script_order.hpp b/src/script/api/script_order.hpp
index 63089a2bd4..a4f945511e 100644
--- a/src/script/api/script_order.hpp
+++ b/src/script/api/script_order.hpp
@@ -91,6 +91,7 @@ public:
/* Note: these values represent part of the in-game OrderConditionVariable enum */
OC_LOAD_PERCENTAGE = ::OCV_LOAD_PERCENTAGE, ///< Skip based on the amount of load, value is in tons.
OC_RELIABILITY = ::OCV_RELIABILITY, ///< Skip based on the reliability, value is percent (0..100).
+ OC_MAX_RELIABILITY = ::OCV_MAX_RELIABILITY, ///< Skip based on the maximum reliability. Value in percent
OC_MAX_SPEED = ::OCV_MAX_SPEED, ///< Skip based on the maximum speed, value is in OpenTTD's internal speed unit, see ScriptEngine::GetMaxSpeed.
OC_AGE = ::OCV_AGE, ///< Skip based on the age, value is in years.
OC_REQUIRES_SERVICE = ::OCV_REQUIRES_SERVICE, ///< Skip when the vehicle requires service, no value.
diff --git a/src/script/squirrel.cpp b/src/script/squirrel.cpp
index d11e85bee8..23163f6b34 100644
--- a/src/script/squirrel.cpp
+++ b/src/script/squirrel.cpp
@@ -449,7 +449,8 @@ SQRESULT Squirrel::LoadFile(HSQUIRRELVM vm, const char *filename, SQBool printer
}
unsigned short bom = 0;
if (size >= 2) {
- fread(&bom, 1, sizeof(bom), file); // Inside tar, no point checking return value of fread
+ size_t sr = fread(&bom, 1, sizeof(bom), file);
+ (void)sr; // Inside tar, no point checking return value of fread
}
SQLEXREADFUNC func;
@@ -487,8 +488,7 @@ SQRESULT Squirrel::LoadFile(HSQUIRRELVM vm, const char *filename, SQBool printer
return sq_throwerror(vm, "I/O error");
}
unsigned char uc;
- fread(&uc, 1, sizeof(uc), file);
- if (uc != 0xBF) {
+ if (fread(&uc, 1, sizeof(uc), file) != sizeof(uc) || uc != 0xBF) {
FioFCloseFile(file);
return sq_throwerror(vm, "Unrecognized encoding");
}
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index 86e0f25af1..2047174a66 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -909,10 +909,11 @@ CommandCost CmdBuildTunnel(TileIndex start_tile, DoCommandFlag flags, uint32 p1,
*/
assert(coa >= _cleared_object_areas.Begin() && coa < _cleared_object_areas.End());
size_t coa_index = coa - _cleared_object_areas.Begin();
+ assert(coa_index < UINT_MAX); // more than 2**32 cleared areas would be a bug in itself
coa = NULL;
ret = DoCommand(end_tile, end_tileh & start_tileh, 0, flags, CMD_TERRAFORM_LAND);
- _cleared_object_areas[coa_index].first_tile = old_first_tile;
+ _cleared_object_areas[(uint)coa_index].first_tile = old_first_tile;
if (ret.Failed()) return_cmd_error(STR_ERROR_UNABLE_TO_EXCAVATE_LAND);
cost.AddCost(ret);
}
diff --git a/src/window.cpp b/src/window.cpp
index bd0509aa8e..e3bfc7b069 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -1747,7 +1747,7 @@ static Point LocalGetWindowPlacement(const WindowDesc *desc, int16 sm_width, int
int16 default_width = max(desc->GetDefaultWidth(), sm_width);
int16 default_height = max(desc->GetDefaultHeight(), sm_height);
- if (desc->parent_cls != 0 /* WC_MAIN_WINDOW */ && (w = FindWindowById(desc->parent_cls, window_number)) != NULL) {
+ if (desc->parent_cls != WC_NONE && (w = FindWindowById(desc->parent_cls, window_number)) != NULL) {
bool rtl = _current_text_dir == TD_RTL;
if (desc->parent_cls == WC_BUILD_TOOLBAR || desc->parent_cls == WC_SCEN_LAND_GEN) {
pt.x = w->left + (rtl ? w->width - default_width : 0);