Compare commits

..

No commits in common. 'jgrpp' and 'jgrpp-0.55.3' have entirely different histories.

@ -14,7 +14,3 @@ notifications:
pull-request:
issue:
tag-created:
workflow-run:
only:
- .github/workflows/release.yml
- .github/workflows/ci-nightly.yml

@ -1,13 +1,3 @@
<!--
Commit message:
- Please use Feature / Add / Change / Fix for player-facing changes. E.g.: "Feature: My cool new feature".
- Please use Feature / Add / Change / Fix followed by "[NewGRF]" or "[Script]" for moddable changes. E.g.: "Feature: [NewGRF] My cool new NewGRF addition".
- Please use Codechange / Codefix for developer-facing changes. E.g.: "Codefix #1234: Validate against nullptr properly".
See https://github.com/OpenTTD/OpenTTD/blob/master/CODINGSTYLE.md#commit-message for more details.
-->
## Motivation / Problem
<!--
@ -52,7 +42,7 @@ Some things are not automated, and forgotten often. This list is a reminder for
* This PR touches english.txt or translations? Check the [guidelines](https://github.com/OpenTTD/OpenTTD/blob/master/docs/eints.md)
* This PR affects the save game format? (label 'savegame upgrade')
* This PR affects the GS/AI API? (label 'needs review: Script API')
* ai_changelog.hpp, game_changelog.hpp need updating.
* ai_changelog.hpp, gs_changelog.hpp need updating.
* The compatibility wrappers (compat_*.nut) need updating.
* This PR affects the NewGRF API? (label 'needs review: NewGRF')
* newgrf_debug_data.h may need updating.

@ -1,4 +1,4 @@
name: CI - Build
name: CI
on:
pull_request:
@ -22,82 +22,421 @@ jobs:
emscripten:
name: Emscripten
uses: ./.github/workflows/ci-emscripten.yml
secrets: inherit
runs-on: ubuntu-20.04
container:
# If you change this version, change the number in the cache step too.
image: emscripten/emsdk:3.1.37
steps:
- name: Checkout
if: github.event_name != 'workflow_dispatch'
uses: actions/checkout@v3
- name: Checkout (Manual)
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.ref }}
- name: Setup cache
uses: actions/cache@v3
with:
path: /emsdk/upstream/emscripten/cache
key: 3.1.37-${{ runner.os }}
- name: Patch Emscripten to support LZMA
run: |
cd /emsdk/upstream/emscripten
patch -p1 < ${GITHUB_WORKSPACE}/os/emscripten/emsdk-liblzma.patch
- name: Build (host tools)
run: |
mkdir build-host
cd build-host
echo "::group::CMake"
cmake .. -DOPTION_TOOLS_ONLY=ON
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc) --target tools
echo "::endgroup::"
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build
run: |
mkdir build
cd build
echo "::group::CMake"
emcmake cmake .. -DHOST_BINARY_DIR=../build-host
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc) -t openttd
echo "::endgroup::"
linux:
strategy:
fail-fast: false
matrix:
include:
- name: Clang
compiler: clang-15
cxxcompiler: clang++-15
libraries: libsdl2-dev
compiler: clang
cxxcompiler: clang++
libraries: libsdl2-dev nlohmann-json3-dev
- name: GCC - SDL2
compiler: gcc
cxxcompiler: g++
libraries: libsdl2-dev
libraries: libsdl2-dev nlohmann-json3-dev
- name: GCC - SDL1.2
compiler: gcc
cxxcompiler: g++
libraries: libsdl1.2-dev nlohmann-json3-dev
- name: GCC - Dedicated
compiler: gcc
cxxcompiler: g++
libraries: grfcodec
extra-cmake-parameters: -DOPTION_DEDICATED=ON -DCMAKE_CXX_FLAGS_INIT="-DRANDOM_DEBUG" -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON
# Compile without SDL / SDL2, as that should compile fine too.
extra-cmake-parameters: -DOPTION_DEDICATED=ON -DCMAKE_CXX_FLAGS_INIT="-DRANDOM_DEBUG"
# Compile without SDL / SDL2 / nlohmann-json, as that should compile fine too.
name: Linux (${{ matrix.name }})
uses: ./.github/workflows/ci-linux.yml
secrets: inherit
runs-on: ubuntu-20.04
env:
CC: ${{ matrix.compiler }}
CXX: ${{ matrix.cxxcompiler }}
steps:
- name: Checkout
if: github.event_name != 'workflow_dispatch'
uses: actions/checkout@v3
- name: Checkout (Manual)
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.ref }}
- name: Install dependencies
run: |
echo "::group::Update apt"
sudo apt-get update
echo "::endgroup::"
with:
compiler: ${{ matrix.compiler }}
cxxcompiler: ${{ matrix.cxxcompiler }}
libraries: ${{ matrix.libraries }}
extra-cmake-parameters: ${{ matrix.extra-cmake-parameters }}
echo "::group::Install dependencies"
sudo apt-get install -y --no-install-recommends \
liballegro4-dev \
libcurl4-openssl-dev \
libfontconfig-dev \
libharfbuzz-dev \
libicu-dev \
liblzma-dev \
libzstd-dev \
liblzo2-dev \
${{ matrix.libraries }} \
zlib1g-dev \
# EOF
echo "::endgroup::"
env:
DEBIAN_FRONTEND: noninteractive
- name: Get OpenGFX
run: |
mkdir -p ~/.local/share/openttd/baseset
cd ~/.local/share/openttd/baseset
echo "::group::Download OpenGFX"
curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenGFX"
unzip opengfx-all.zip
echo "::endgroup::"
rm -f opengfx-all.zip
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build
run: |
mkdir build
cd build
echo "::group::CMake"
cmake .. ${{ matrix.extra-cmake-parameters }}
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc)
echo "::endgroup::"
macos:
strategy:
fail-fast: false
matrix:
include:
- name: arm64 - Debug
arch: arm64
full_arch: arm64
extra-cmake-parameters: -DCMAKE_BUILD_TYPE=Debug
- name: arm64 - Release
arch: arm64
full_arch: arm64
extra-cmake-parameters: -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOPTION_USE_ASSERTS=OFF
- arch: x64
full_arch: x86_64
name: Mac OS (${{ matrix.arch }})
runs-on: macos-latest
env:
MACOSX_DEPLOYMENT_TARGET: 10.13
steps:
- name: Checkout
if: github.event_name != 'workflow_dispatch'
uses: actions/checkout@v3
- name: Checkout (Manual)
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.ref }}
- name: Install dependencies
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: |
brew install \
pkg-config \
# EOF
- name: Prepare cache key
id: key
run: |
echo "image=$ImageOS-$ImageVersion" >> $GITHUB_OUTPUT
- name: Enable vcpkg cache
uses: actions/cache@v3
with:
path: /usr/local/share/vcpkg/installed
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-1 # Increase the number whenever dependencies are modified
restore-keys: |
${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}
- name: Prepare vcpkg
run: |
vcpkg install --triplet=${{ matrix.arch }}-osx \
curl \
liblzma \
libpng \
lzo \
nlohmann-json \
zlib \
zstd \
# EOF
- name: Install OpenGFX
run: |
mkdir -p ~/Documents/OpenTTD/baseset
cd ~/Documents/OpenTTD/baseset
name: Mac OS (${{ matrix.name }})
echo "::group::Download OpenGFX"
curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip
echo "::endgroup::"
uses: ./.github/workflows/ci-macos.yml
secrets: inherit
echo "::group::Unpack OpenGFX"
unzip opengfx-all.zip
echo "::endgroup::"
with:
arch: ${{ matrix.arch }}
full_arch: ${{ matrix.full_arch }}
extra-cmake-parameters: ${{ matrix.extra-cmake-parameters }}
rm -f opengfx-all.zip
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build
run: |
mkdir build
cd build
echo "::group::CMake"
cmake .. \
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.full_arch }} \
-DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-osx \
-DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake \
# EOF
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(sysctl -n hw.logicalcpu) cores"
cmake --build . -j $(sysctl -n hw.logicalcpu)
echo "::endgroup::"
windows:
strategy:
fail-fast: false
matrix:
os: [windows-latest, windows-2019]
arch: [x86, x64]
name: Windows (${{ matrix.os }} / ${{ matrix.arch }})
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
if: github.event_name != 'workflow_dispatch'
uses: actions/checkout@v3
- name: Checkout (Manual)
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.ref }}
- name: Prepare cache key
id: key
shell: powershell
run: |
# Work around caching failure with GNU tar
New-Item -Type Junction -Path vcpkg -Target c:\vcpkg
Write-Output "image=$env:ImageOS-$env:ImageVersion" >> $env:GITHUB_OUTPUT
- name: Enable vcpkg cache
uses: actions/cache@v3
with:
path: vcpkg/installed
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-1 # Increase the number whenever dependencies are modified
restore-keys: |
${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}
- name: Prepare vcpkg
shell: bash
run: |
vcpkg install --triplet=${{ matrix.arch }}-windows-static \
liblzma \
libpng \
lzo \
nlohmann-json \
zlib \
zstd \
# EOF
- name: Install OpenGFX
shell: bash
run: |
mkdir -p "C:/Users/Public/Documents/OpenTTD/baseset"
cd "C:/Users/Public/Documents/OpenTTD/baseset"
echo "::group::Download OpenGFX"
curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenGFX"
unzip opengfx-all.zip
echo "::endgroup::"
rm -f opengfx-all.zip
- name: Install MSVC problem matcher
uses: ammaraskar/msvc-problem-matcher@master
- name: Configure developer command prompt for ${{ matrix.arch }}
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Build
shell: bash
run: |
mkdir build
cd build
echo "::group::CMake"
cmake .. \
-GNinja \
-DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-windows-static \
-DCMAKE_TOOLCHAIN_FILE="c:\vcpkg\scripts\buildsystems\vcpkg.cmake" \
# EOF
echo "::endgroup::"
echo "::group::Build"
cmake --build .
echo "::endgroup::"
msys2:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
arch: x86
- os: windows-latest
arch: x64
- msystem: MINGW64
arch: x86_64
- msystem: MINGW32
arch: i686
name: MinGW (${{ matrix.arch }})
runs-on: windows-latest
steps:
- name: Checkout
if: github.event_name != 'workflow_dispatch'
uses: actions/checkout@v3
- name: Checkout (Manual)
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.ref }}
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
release: false
install: >-
git
make
mingw-w64-${{ matrix.arch }}-cmake
mingw-w64-${{ matrix.arch }}-gcc
mingw-w64-${{ matrix.arch }}-lzo2
mingw-w64-${{ matrix.arch }}-libpng
mingw-w64-${{ matrix.arch }}-nlohmann-json
- name: Install OpenGFX
shell: bash
run: |
mkdir -p "C:/Users/Public/Documents/OpenTTD/baseset"
cd "C:/Users/Public/Documents/OpenTTD/baseset"
echo "::group::Download OpenGFX"
curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenGFX"
unzip opengfx-all.zip
echo "::endgroup::"
rm -f opengfx-all.zip
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
name: Windows (${{ matrix.arch }})
- name: Build
shell: msys2 {0}
run: |
mkdir build
cd build
uses: ./.github/workflows/ci-windows.yml
secrets: inherit
echo "::group::CMake"
cmake .. -DOPTION_NO_WARN_UNINIT=1 -G"MSYS Makefiles"
echo "::endgroup::"
with:
os: ${{ matrix.os }}
arch: ${{ matrix.arch }}
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc)
echo "::endgroup::"
check_annotations:
name: Check Annotations
@ -106,6 +445,7 @@ jobs:
- linux
- macos
- windows
- msys2
if: always() && github.event_name == 'pull_request'
@ -113,4 +453,4 @@ jobs:
steps:
- name: Check annotations
uses: OpenTTD/actions/annotation-check@v5
uses: OpenTTD/actions/annotation-check@v3

@ -1,69 +0,0 @@
name: CI (Emscripten)
on:
workflow_call:
env:
CTEST_OUTPUT_ON_FAILURE: 1
jobs:
emscripten:
name: CI
runs-on: ubuntu-20.04
container:
# If you change this version, change the number in the cache step too.
image: emscripten/emsdk:3.1.42
steps:
- name: Checkout
if: github.event_name != 'workflow_dispatch'
uses: actions/checkout@v4
- name: Checkout (Manual)
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- name: Setup cache
uses: actions/cache@v4
with:
path: /emsdk/upstream/emscripten/cache
key: 3.1.42-${{ runner.os }}
- name: Patch Emscripten to support LZMA
run: |
cd /emsdk/upstream/emscripten
patch -p1 < ${GITHUB_WORKSPACE}/os/emscripten/emsdk-liblzma.patch
- name: Build (host tools)
run: |
mkdir build-host
cd build-host
echo "::group::CMake"
cmake .. -DOPTION_TOOLS_ONLY=ON
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc) --target tools
echo "::endgroup::"
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build
run: |
mkdir build
cd build
echo "::group::CMake"
emcmake cmake .. -DHOST_BINARY_DIR=../build-host
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc) --target openttd
echo "::endgroup::"

@ -1,131 +0,0 @@
name: CI (Linux)
on:
workflow_call:
inputs:
compiler:
required: true
type: string
cxxcompiler:
required: true
type: string
libraries:
required: true
type: string
extra-cmake-parameters:
required: true
type: string
env:
CTEST_OUTPUT_ON_FAILURE: 1
jobs:
linux:
name: CI
runs-on: ubuntu-latest
env:
CC: ${{ inputs.compiler }}
CXX: ${{ inputs.cxxcompiler }}
steps:
- name: Checkout
if: github.event_name != 'workflow_dispatch'
uses: actions/checkout@v4
- name: Checkout (Manual)
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- name: Setup vcpkg caching
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg ${{ runner.temp }}/vcpkg
${{ runner.temp }}/vcpkg/bootstrap-vcpkg.sh -disableMetrics
- name: Install dependencies
run: |
echo "::group::Update apt"
sudo apt-get update
echo "::endgroup::"
echo "::group::Install dependencies"
sudo apt-get install -y --no-install-recommends \
liballegro4-dev \
libcurl4-openssl-dev \
libfontconfig-dev \
libharfbuzz-dev \
libicu-dev \
liblzma-dev \
libzstd-dev \
liblzo2-dev \
${{ inputs.libraries }} \
zlib1g-dev \
# EOF
echo "::group::Install vcpkg dependencies"
# Disable vcpkg integration, as we mostly use system libraries.
mv vcpkg.json vcpkg-disabled.json
# We only use breakpad from vcpkg, as its CMake files
# are a bit special. So the Ubuntu's variant doesn't work.
#${{ runner.temp }}/vcpkg/vcpkg install breakpad
echo "::endgroup::"
env:
DEBIAN_FRONTEND: noninteractive
- name: Get OpenGFX
run: |
mkdir -p ~/.local/share/openttd/baseset
cd ~/.local/share/openttd/baseset
echo "::group::Download OpenGFX"
curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenGFX"
unzip opengfx-all.zip
echo "::endgroup::"
rm -f opengfx-all.zip
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build
run: |
mkdir build
cd build
echo "::group::CMake"
cmake .. -DCMAKE_TOOLCHAIN_FILE=${{ runner.temp }}/vcpkg/scripts/buildsystems/vcpkg.cmake ${{ inputs.extra-cmake-parameters }}
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc) --target all openttd_test
echo "::endgroup::"
- name: Test
run: |
(
cd build
ctest -j $(nproc) --timeout 120
)
# Re-enable vcpkg.
mv vcpkg-disabled.json vcpkg.json
# Check no tracked files have been modified.
git diff --exit-code

@ -1,97 +0,0 @@
name: CI (MacOS)
on:
workflow_call:
inputs:
arch:
required: true
type: string
full_arch:
required: true
type: string
extra-cmake-parameters:
required: false
type: string
default: ""
env:
CTEST_OUTPUT_ON_FAILURE: 1
jobs:
macos:
name: CI
runs-on: macos-14
env:
MACOSX_DEPLOYMENT_TARGET: 10.13
steps:
- name: Setup Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Checkout
if: github.event_name != 'workflow_dispatch'
uses: actions/checkout@v4
- name: Checkout (Manual)
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- name: Setup vcpkg caching
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg ${{ runner.temp }}/vcpkg
${{ runner.temp }}/vcpkg/bootstrap-vcpkg.sh -disableMetrics
- name: Install OpenGFX
run: |
mkdir -p ~/Documents/OpenTTD/baseset
cd ~/Documents/OpenTTD/baseset
echo "::group::Download OpenGFX"
curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenGFX"
unzip opengfx-all.zip
echo "::endgroup::"
rm -f opengfx-all.zip
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build
run: |
mkdir build
cd build
echo "::group::CMake"
cmake .. \
-DCMAKE_OSX_ARCHITECTURES=${{ inputs.full_arch }} \
-DVCPKG_TARGET_TRIPLET=${{ inputs.arch }}-osx \
-DCMAKE_TOOLCHAIN_FILE=${{ runner.temp }}/vcpkg/scripts/buildsystems/vcpkg.cmake \
${{ inputs.extra-cmake-parameters }} \
# EOF
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(sysctl -n hw.logicalcpu) cores"
cmake --build . -j $(sysctl -n hw.logicalcpu) --target all openttd_test
echo "::endgroup::"
- name: Test
run: |
cd build
ctest -j $(sysctl -n hw.logicalcpu) --timeout 120

@ -1,91 +0,0 @@
name: CI (MinGW)
on:
workflow_call:
inputs:
arch:
required: true
type: string
msystem:
required: true
type: string
env:
CTEST_OUTPUT_ON_FAILURE: 1
jobs:
mingw:
name: CI
runs-on: windows-latest
steps:
- name: Checkout
if: github.event_name != 'workflow_dispatch'
uses: actions/checkout@v4
- name: Checkout (Manual)
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: ${{ inputs.msystem }}
release: false
install: >-
git
make
mingw-w64-${{ inputs.arch }}-cmake
mingw-w64-${{ inputs.arch }}-gcc
mingw-w64-${{ inputs.arch }}-lzo2
mingw-w64-${{ inputs.arch }}-libpng
mingw-w64-${{ inputs.arch }}-lld
mingw-w64-${{ inputs.arch }}-ninja
- name: Install OpenGFX
shell: bash
run: |
mkdir -p "C:/Users/Public/Documents/OpenTTD/baseset"
cd "C:/Users/Public/Documents/OpenTTD/baseset"
echo "::group::Download OpenGFX"
curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenGFX"
unzip opengfx-all.zip
echo "::endgroup::"
rm -f opengfx-all.zip
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build
shell: msys2 {0}
env:
NINJA_STATUS: "[%f/%t -- %e] " # [finished_edges/total_edges -- elapsed_time], default value is "[%f/%t] "
run: |
mkdir build
cd build
echo "::group::CMake"
cmake .. \
-GNinja \
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
-DOPTION_NO_WARN_UNINIT=1 \
# EOF
echo "::endgroup::"
echo "::group::Build"
cmake --build . --target all openttd_test
echo "::endgroup::"
- name: Test
shell: msys2 {0}
run: |
cd build
ctest --timeout 120

@ -1,84 +0,0 @@
name: CI - Nightly
on:
workflow_dispatch:
inputs:
ref:
description: 'Ref to build (for Pull Requests, use refs/pull/NNN/head)'
required: true
env:
CTEST_OUTPUT_ON_FAILURE: 1
jobs:
linux:
strategy:
fail-fast: false
matrix:
include:
- name: GCC - SDL1.2
compiler: gcc
cxxcompiler: g++
libraries: libsdl1.2-dev
name: Linux (${{ matrix.name }})
uses: ./.github/workflows/ci-linux.yml
secrets: inherit
with:
compiler: ${{ matrix.compiler }}
cxxcompiler: ${{ matrix.cxxcompiler }}
libraries: ${{ matrix.libraries }}
extra-cmake-parameters:
macos:
strategy:
fail-fast: false
matrix:
include:
- arch: x64
full_arch: x86_64
name: Mac OS (${{ matrix.arch }})
uses: ./.github/workflows/ci-macos.yml
secrets: inherit
with:
arch: ${{ matrix.arch }}
full_arch: ${{ matrix.full_arch }}
mingw:
strategy:
fail-fast: false
matrix:
include:
- msystem: MINGW64
arch: x86_64
- msystem: MINGW32
arch: i686
name: MinGW (${{ matrix.arch }})
uses: ./.github/workflows/ci-mingw.yml
secrets: inherit
with:
msystem: ${{ matrix.msystem }}
arch: ${{ matrix.arch }}
check_annotations:
name: Check Annotations
needs:
- linux
- macos
- mingw
if: always()
runs-on: ubuntu-latest
steps:
- name: Check annotations
uses: OpenTTD/actions/annotation-check@v5

@ -1,94 +0,0 @@
name: CI (Windows)
on:
workflow_call:
inputs:
arch:
required: true
type: string
os:
required: true
type: string
env:
CTEST_OUTPUT_ON_FAILURE: 1
jobs:
windows:
name: CI
runs-on: ${{ inputs.os }}
steps:
- name: Checkout
if: github.event_name != 'workflow_dispatch'
uses: actions/checkout@v4
- name: Checkout (Manual)
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- name: Setup vcpkg caching
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg ${{ runner.temp }}\vcpkg
${{ runner.temp }}\vcpkg\bootstrap-vcpkg.bat -disableMetrics
- name: Install OpenGFX
shell: bash
run: |
mkdir -p "C:/Users/Public/Documents/OpenTTD/baseset"
cd "C:/Users/Public/Documents/OpenTTD/baseset"
echo "::group::Download OpenGFX"
curl -L https://cdn.openttd.org/opengfx-releases/0.6.0/opengfx-0.6.0-all.zip -o opengfx-all.zip
echo "::endgroup::"
echo "::group::Unpack OpenGFX"
unzip opengfx-all.zip
echo "::endgroup::"
rm -f opengfx-all.zip
- name: Install MSVC problem matcher
uses: ammaraskar/msvc-problem-matcher@master
- name: Configure developer command prompt for ${{ inputs.arch }}
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ inputs.arch }}
- name: Build
shell: bash
env:
NINJA_STATUS: "[%f/%t -- %e] " # [finished_edges/total_edges -- elapsed_time], default value is "[%f/%t] "
run: |
mkdir build
cd build
echo "::group::CMake"
cmake .. \
-GNinja \
-DVCPKG_TARGET_TRIPLET=${{ inputs.arch }}-windows-static \
-DCMAKE_TOOLCHAIN_FILE="${{ runner.temp }}\vcpkg\scripts\buildsystems\vcpkg.cmake" \
# EOF
echo "::endgroup::"
echo "::group::Build"
cmake --build . --target all openttd_test
echo "::endgroup::"
- name: Test
shell: bash
run: |
cd build
ctest --timeout 120

@ -30,27 +30,14 @@ jobs:
steps:
- name: Checkout
if: github.event_name != 'workflow_dispatch'
uses: actions/checkout@v4
uses: actions/checkout@v3
- name: Checkout (Manual)
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v4
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.ref }}
- name: Setup vcpkg caching
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg ${{ runner.temp }}/vcpkg
${{ runner.temp }}/vcpkg/bootstrap-vcpkg.sh -disableMetrics
- name: Install dependencies
run: |
echo "::group::Update apt"
@ -67,48 +54,28 @@ jobs:
liblzma-dev \
liblzo2-dev \
libsdl2-dev \
nlohmann-json3-dev \
zlib1g-dev \
# EOF
echo "::group::Install vcpkg dependencies"
# Disable vcpkg integration, as we mostly use system libraries.
mv vcpkg.json vcpkg-disabled.json
# We only use breakpad from vcpkg, as its CMake files
# are a bit special. So the Ubuntu's variant doesn't work.
${{ runner.temp }}/vcpkg/vcpkg install breakpad
echo "::endgroup::"
env:
DEBIAN_FRONTEND: noninteractive
- name: Prepare build
- name: Set number of make jobs
run: |
mkdir build
cd build
echo "::group::CMake"
cmake .. -DCMAKE_TOOLCHAIN_FILE=${{ runner.temp }}/vcpkg/scripts/buildsystems/vcpkg.cmake
echo "::endgroup::"
echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@v2
with:
languages: cpp
config-file: ./.github/codeql/codeql-config.yml
- name: Build
run: |
cd build
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc)
echo "::endgroup::"
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@v2
with:
category: /language:cpp
upload: False
@ -126,6 +93,6 @@ jobs:
output: sarif-results/cpp.sarif
- name: Upload results
uses: github/codeql-action/upload-sarif@v3
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: sarif-results/cpp.sarif

@ -1,103 +0,0 @@
name: Preview build
on:
workflow_call:
secrets:
PREVIEW_CLOUDFLARE_API_TOKEN:
description: API token to upload a preview to Cloudflare Pages
required: true
PREVIEW_CLOUDFLARE_ACCOUNT_ID:
description: Account ID to upload a preview to Cloudflare Pages
required: true
jobs:
preview:
name: Build preview
environment:
name: preview
url: https://preview.openttd.org/pr${{ github.event.pull_request.number }}/
runs-on: ubuntu-latest
container:
# If you change this version, change the number in the cache step too.
image: emscripten/emsdk:3.1.42
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Name branch
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
git checkout -b pr${{ github.event.pull_request.number }}
- name: Setup cache
uses: actions/cache@v4
with:
path: /emsdk/upstream/emscripten/cache
key: 3.1.42-${{ runner.os }}
- name: Patch Emscripten to support LZMA
run: |
cd /emsdk/upstream/emscripten
patch -p1 < ${GITHUB_WORKSPACE}/os/emscripten/emsdk-liblzma.patch
- name: Build (host tools)
run: |
mkdir build-host
cd build-host
echo "::group::CMake"
cmake .. -DOPTION_TOOLS_ONLY=ON
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
make -j$(nproc) tools
echo "::endgroup::"
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build
run: |
mkdir build
cd build
echo "::group::CMake"
emcmake cmake .. \
-DHOST_BINARY_DIR=../build-host \
-DCMAKE_BUILD_TYPE=Release \
# EOF
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc) --target openttd
echo "::endgroup::"
- name: Prepare preview
run: |
mkdir public
cp build/openttd.data public/
cp build/openttd.html public/
cp build/openttd.js public/
cp build/openttd.wasm public/
# Ensure we use the latest version of npm; the one we get with current
# emscripten doesn't allow running "npx wrangler" as root.
# Current emscripten can't install npm>=10.0.0 because node is too old.
npm install -g npm@9
- name: Publish preview
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.PREVIEW_CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.PREVIEW_CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ vars.PREVIEW_CLOUDFLARE_PROJECT_NAME }}
directory: public
branch: pr${{ github.event.pull_request.number }}

@ -1,21 +0,0 @@
name: Preview
on:
pull_request_target:
types:
- labeled
- synchronize
branches:
- master
- release/**
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
preview:
if: ${{ (github.event.action == 'labeled' && github.event.label.name == 'preview') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'preview')) }}
name: Preview
uses: ./.github/workflows/preview-build.yml
secrets: inherit

@ -0,0 +1,134 @@
name: Preview build
on:
repository_dispatch:
types:
- Preview*
jobs:
preview:
name: Build preview
runs-on: ubuntu-20.04
container:
# If you change this version, change the number in the cache step too.
image: emscripten/emsdk:3.1.37
steps:
- name: Update deployment status to in progress
uses: octokit/request-action@v2.x
with:
route: POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses
mediaType: |
previews:
- ant-man
- flash
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
deployment_id: ${{ github.event.client_payload.deployment_id }}
state: in_progress
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.sha }}
- name: Name branch
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
name=$(echo "${{ github.event.client_payload.folder }}")
git checkout -b ${name}
- name: Setup cache
uses: actions/cache@v3
with:
path: /emsdk/upstream/emscripten/cache
key: 3.1.37-${{ runner.os }}
- name: Patch Emscripten to support LZMA
run: |
cd /emsdk/upstream/emscripten
patch -p1 < ${GITHUB_WORKSPACE}/os/emscripten/emsdk-liblzma.patch
- name: Build (host tools)
run: |
mkdir build-host
cd build-host
echo "::group::CMake"
cmake .. -DOPTION_TOOLS_ONLY=ON
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
make -j$(nproc) tools
echo "::endgroup::"
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build
run: |
mkdir build
cd build
echo "::group::CMake"
emcmake cmake .. \
-DHOST_BINARY_DIR=../build-host \
-DCMAKE_BUILD_TYPE=Release \
# EOF
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc) --target openttd
echo "::endgroup::"
- name: Publish preview
run: |
pip3 install awscli
aws s3 cp --only-show-errors build/openttd.data s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/
aws s3 cp --only-show-errors build/openttd.html s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/
aws s3 cp --only-show-errors build/openttd.js s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/
aws s3 cp --only-show-errors build/openttd.wasm s3://${{ secrets.PREVIEW_S3_BUCKET }}/${{ github.event.client_payload.folder }}/
# Invalidate the cache of the CloudFront distribution
aws cloudfront create-invalidation --distribution-id ${{ secrets.PREVIEW_CF_DISTRIBUTION_ID }} --paths "/${{ github.event.client_payload.folder }}/*"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Update deployment status to success
uses: octokit/request-action@v2.x
with:
route: POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses
mediaType: |
previews:
- ant-man
- flash
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
deployment_id: ${{ github.event.client_payload.deployment_id }}
state: success
environment_url: https://preview.openttd.org/${{ github.event.client_payload.folder }}/
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- if: failure()
name: Update deployment status to failure
uses: octokit/request-action@v2.x
with:
route: POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses
mediaType: |
previews:
- ant-man
- flash
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
deployment_id: ${{ github.event.client_payload.deployment_id }}
state: failure
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}

@ -0,0 +1,66 @@
name: Preview label
on:
pull_request_target:
types:
- labeled
env:
TEAM_CORE_DEVELOPER: core-developers
jobs:
check_preview_label:
name: Check for preview label
if: github.event.action == 'labeled' && github.event.label.name == 'preview'
runs-on: ubuntu-20.04
steps:
- name: Check if label was added by core developer
id: core_developer
continue-on-error: true
uses: octokit/request-action@v2.x
with:
route: GET /orgs/OpenTTD/teams/${{ env.TEAM_CORE_DEVELOPER }}/memberships/${{ github.event.sender.login }}
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- if: steps.core_developer.outcome == 'failure'
name: Remove preview label if not core developer
uses: octokit/request-action@v2.x
with:
route: DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/preview
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
issue_number: ${{ github.event.number }}
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- if: steps.core_developer.outcome == 'success'
name: Create deployment
id: deployment
uses: octokit/request-action@v2.x
with:
route: POST /repos/{owner}/{repo}/deployments
mediaType: |
previews:
- ant-man
- flash
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
ref: ${{ github.event.pull_request.head.sha }}
task: deploy:preview
auto_merge: false
required_contexts: "[]"
environment: preview-pr-${{ github.event.number }}
description: "Preview for Pull Request #${{ github.event.number }}"
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- if: steps.core_developer.outcome == 'success'
name: Trigger 'preview build'
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
event-type: "Preview build #${{ github.event.number }}"
client-payload: '{"folder": "pr${{ github.event.number }}", "sha": "${{ github.event.pull_request.head.sha }}", "deployment_id": "${{ fromJson(steps.deployment.outputs.data).id }}"}'

@ -0,0 +1,66 @@
name: Preview push
on:
pull_request_target:
types:
- synchronize
jobs:
check_new_preview:
name: Check preview needs update
runs-on: ubuntu-20.04
steps:
- name: Check if earlier preview exists
id: earlier_preview
uses: octokit/request-action@v2.x
with:
route: GET /repos/{owner}/{repo}/deployments
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
environment: preview-pr-${{ github.event.number }}
per_page: 1
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- if: toJson(fromJson(steps.earlier_preview.outputs.data)) != '[]'
name: Check for preview label
id: preview_label
uses: octokit/request-action@v2.x
with:
route: GET /repos/{owner}/{repo}/issues/{issue_number}/labels
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
issue_number: ${{ github.event.number }}
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- if: toJson(fromJson(steps.earlier_preview.outputs.data)) != '[]' && contains(fromJson(steps.preview_label.outputs.data).*.name, 'preview')
name: Create deployment
id: deployment
uses: octokit/request-action@v2.x
with:
route: POST /repos/{owner}/{repo}/deployments
mediaType: |
previews:
- ant-man
- flash
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
ref: ${{ github.event.pull_request.head.sha }}
task: deploy:preview
auto_merge: false
required_contexts: "[]"
environment: preview-pr-${{ github.event.number }}
description: "Preview for Pull Request #${{ github.event.number }}"
env:
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
- if: toJson(fromJson(steps.earlier_preview.outputs.data)) != '[]' && contains(fromJson(steps.preview_label.outputs.data).*.name, 'preview')
name: Trigger 'preview build'
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
event-type: "Preview build #${{ github.event.number }}"
client-payload: '{"folder": "pr${{ github.event.number }}", "sha": "${{ github.event.pull_request.head.sha }}", "deployment_id": "${{ fromJson(steps.deployment.outputs.data).id }}"}'

@ -15,7 +15,7 @@ jobs:
steps:
- name: Download source
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: internal-source
@ -78,7 +78,7 @@ jobs:
echo "::endgroup::"
- name: Store bundles
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: openttd-docs
path: build/bundles/*.tar.xz

@ -1,120 +0,0 @@
name: Release (Linux, Dedicated)
on:
workflow_call:
inputs:
survey_key:
required: false
type: string
default: ""
jobs:
linux:
name: Linux (Dedicated)
runs-on: ubuntu-latest
container:
# manylinux_2_28 is based on AlmaLinux 8, and already has a lot of things
# installed and preconfigured. It makes it easier to build OpenTTD.
# This distro is based on glibc 2.28, released in 2018.
image: quay.io/pypa/manylinux_2_28_x86_64
steps:
- name: Download source
uses: actions/download-artifact@v4
with:
name: internal-source
- name: Unpack source
run: |
tar -xf source.tar.gz --strip-components=1
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Enable Rust cache
uses: Swatinem/rust-cache@v2
- name: Setup vcpkg caching
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install dependencies
run: |
echo "::group::Install system dependencies"
# perl-IPC-Cmd, wget, and zip are needed to run vcpkg.
# autoconf-archive is needed to build ICU.
yum install -y \
autoconf-archive \
perl-IPC-Cmd \
wget \
zip \
# EOF
# aclocal looks first in /usr/local/share/aclocal, and if that doesn't
# exist only looks in /usr/share/aclocal. We have files in both that
# are important. So copy the latter to the first, and we are good to
# go.
cp /usr/share/aclocal/* /usr/local/share/aclocal/
echo "::endgroup::"
# We use vcpkg for our dependencies, to get more up-to-date version.
echo "::group::Install vcpkg and dependencies"
git clone https://github.com/microsoft/vcpkg /vcpkg
(
cd /vcpkg
./bootstrap-vcpkg.sh -disableMetrics
)
- name: Patch bundle name
run: |
sed -i 's/generic/dedicated/g' cmake/InstallAndPackage.cmake
- name: Build
run: |
mkdir -p build
cd build
echo "::group::CMake"
cmake ${GITHUB_WORKSPACE} \
-DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_BUILD_TYPE=Release \
-DOPTION_DEDICATED=ON \
-DOPTION_COMPRESS_DEBUG=ON \
-DOPTION_LTO=ON \
-DOPTION_TRIM_PATH_PREFIX=ON \
-DOPTION_SURVEY_KEY=${{ inputs.survey_key }} \
-DOPTION_PACKAGE_DEPENDENCIES=ON \
# EOF
echo "::endgroup::"
echo "::group::Build"
echo "Running on $(nproc) cores"
cmake --build . -j $(nproc) --target openttd
echo "::endgroup::"
- name: Create bundles
run: |
cd ${GITHUB_WORKSPACE}/build
echo "::group::Run CPack"
cpack
echo "::endgroup::"
echo "::group::Cleanup"
# Remove the sha256 files CPack generates; we will do this ourself at
# the end of this workflow.
rm -f bundles/*.sha256
echo "::endgroup::"
- name: Store bundles
uses: actions/upload-artifact@v4
with:
name: openttd-linux-dedicated
path: build/bundles
retention-days: 5

@ -18,8 +18,8 @@ jobs:
include:
- container_image: "ubuntu:20.04"
bundle_name: "focal"
compiler: "g++-10"
c_compiler: "gcc-10"
compiler: "g++"
c_compiler: "gcc"
- container_image: "ubuntu:22.04"
bundle_name: "jammy"
compiler: "g++"
@ -39,7 +39,7 @@ jobs:
steps:
- name: Download source
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: internal-source
@ -116,7 +116,7 @@ jobs:
echo "::endgroup::"
- name: Store bundles
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: openttd-linux-${{ matrix.bundle_name }}
path: build/bundles

@ -12,16 +12,15 @@ jobs:
linux:
name: Linux (Generic)
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
container:
# manylinux_2_28 is based on AlmaLinux 8, and already has a lot of things
# manylinux2014 is based on CentOS 7, but already has a lot of things
# installed and preconfigured. It makes it easier to build OpenTTD.
# This distro is based on glibc 2.28, released in 2018.
image: quay.io/pypa/manylinux_2_28_x86_64
image: quay.io/pypa/manylinux2014_x86_64
steps:
- name: Download source
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: internal-source
@ -29,19 +28,13 @@ jobs:
run: |
tar -xf source.tar.gz --strip-components=1
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Enable Rust cache
uses: Swatinem/rust-cache@v2
- name: Setup vcpkg caching
uses: actions/github-script@v7
- name: Enable vcpkg cache
uses: actions/cache@v3
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
path: /vcpkg/installed
key: ubuntu-20.04-vcpkg-release-1 # Increase the number whenever dependencies are modified
restore-keys: |
ubuntu-20.04-vcpkg-release
- name: Install dependencies
run: |
@ -81,6 +74,7 @@ jobs:
cmake --build . -j $(nproc)
cmake --install .
)
echo "::endgroup::"
echo "::group::Install audio drivers"
# These audio libs are to make sure the SDL version of vcpkg adds
@ -88,40 +82,47 @@ jobs:
# binary, but the headers are used to enable them in SDL.
yum install -y \
alsa-lib-devel \
jack-audio-connection-kit-devel \
pulseaudio-libs-devel \
# EOF
echo "::endgroup::"
echo "::group::Install video drivers"
# These video libs are to make sure the SDL version of vcpkg adds
# video-support; these libraries are not added to the resulting
# binary, but the headers are used to enable them in SDL.
yum install -y \
libX11-devel \
libXcursor-devel \
libXext-devel \
libXfixes-devel \
libXi-devel \
libxkbcommon-devel \
libXrandr-devel \
libXScrnSaver-devel \
mesa-libEGL-devel \
mesa-libGL-devel \
mesa-libGLES-devel \
wayland-devel \
wayland-protocols-devel \
# EOF
echo "::endgroup::"
# We use vcpkg for our dependencies, to get more up-to-date version.
echo "::group::Install vcpkg and dependencies"
git clone https://github.com/microsoft/vcpkg /vcpkg
# We do a little dance to make sure we copy the cached install folder
# into our new clone.
git clone --depth=1 https://github.com/microsoft/vcpkg /vcpkg-clone
if [ -e /vcpkg/installed ]; then
mv /vcpkg/installed /vcpkg-clone/
rm -rf /vcpkg
fi
mv /vcpkg-clone /vcpkg
(
cd /vcpkg
./bootstrap-vcpkg.sh -disableMetrics
# Make Python3 available for other packages.
./vcpkg install python3
ln -sf $(pwd)/installed/x64-linux/tools/python3/python3.[0-9][0-9] /usr/bin/python3
./vcpkg install \
curl[http2] \
fontconfig \
freetype \
harfbuzz \
icu \
liblzma \
libpng \
lzo \
nlohmann-json \
sdl2 \
zlib \
zstd \
# EOF
)
echo "::endgroup::"
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
@ -162,7 +163,7 @@ jobs:
echo "::endgroup::"
- name: Store bundles
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: openttd-linux-generic
path: build/bundles

@ -12,18 +12,13 @@ jobs:
macos:
name: MacOS
runs-on: macos-14
runs-on: macos-11
env:
MACOSX_DEPLOYMENT_TARGET: 10.13
steps:
- name: Setup Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Download source
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: internal-source
@ -31,25 +26,6 @@ jobs:
run: |
tar -xf source.tar.gz --strip-components=1
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Enable Rust cache
uses: Swatinem/rust-cache@v2
- name: Setup vcpkg caching
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg ${{ runner.temp }}/vcpkg
${{ runner.temp }}/vcpkg/bootstrap-vcpkg.sh -disableMetrics
- name: Install dependencies
env:
HOMEBREW_NO_AUTO_UPDATE: 1
@ -57,6 +33,40 @@ jobs:
run: |
brew install \
pandoc \
pkg-config \
# EOF
- name: Prepare cache key
id: key
run: |
echo "image=$ImageOS-$ImageVersion" >> $GITHUB_OUTPUT
- name: Enable vcpkg cache
uses: actions/cache@v3
with:
path: /usr/local/share/vcpkg/installed
key: ${{ steps.key.outputs.image }}-vcpkg-release-1 # Increase the number whenever dependencies are modified
restore-keys: |
${{ steps.key.outputs.image }}-vcpkg-release
${{ steps.key.outputs.image }}-vcpkg-x64
- name: Prepare vcpkg
run: |
vcpkg install \
curl:x64-osx \
curl:arm64-osx \
liblzma:x64-osx \
liblzma:arm64-osx \
libpng:x64-osx \
libpng:arm64-osx \
lzo:x64-osx \
lzo:arm64-osx \
nlohmann-json:x64-osx \
nlohmann-json:arm64-osx \
zlib:x64-osx \
zlib:arm64-osx \
zstd:x64-osx \
zstd:arm64-osx \
# EOF
- name: Install GCC problem matcher
@ -99,7 +109,7 @@ jobs:
cmake ${GITHUB_WORKSPACE} \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DVCPKG_TARGET_TRIPLET=arm64-osx \
-DCMAKE_TOOLCHAIN_FILE=${{ runner.temp }}/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \
-DCMAKE_BUILD_TYPE=Release \
-DOPTION_TRIM_PATH_PREFIX=ON \
@ -121,7 +131,7 @@ jobs:
cmake ${GITHUB_WORKSPACE} \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
-DVCPKG_TARGET_TRIPLET=x64-osx \
-DCMAKE_TOOLCHAIN_FILE=${{ runner.temp }}/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \
-DCMAKE_BUILD_TYPE=Release \
-DOPTION_TRIM_PATH_PREFIX=ON \
@ -197,7 +207,7 @@ jobs:
mv _CPack_Packages/*/Bundle/openttd-*.zip bundles/
- name: Store bundles
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: openttd-macos-universal
path: build-x64/bundles

@ -30,14 +30,14 @@ jobs:
steps:
- name: Checkout (Release)
if: github.event_name == 'release'
uses: actions/checkout@v4
uses: actions/checkout@v3
with:
# We generate a changelog; for this we need the full git log.
fetch-depth: 0
- name: Checkout (Manual)
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v4
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.ref }}
# We generate a changelog; for this we need the full git log.
@ -45,7 +45,7 @@ jobs:
- name: Checkout (Trigger)
if: github.event_name == 'repository_dispatch'
uses: actions/checkout@v4
uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.ref }}
# We generate a changelog; for this we need the full git log.
@ -92,12 +92,12 @@ jobs:
id: metadata
run: |
echo "::group::Prepare metadata files"
cmake -DGENERATE_OTTDREV=.ottdrev -P cmake/scripts/FindVersion.cmake
cmake -DGENERATE_OTTDREV=1 -P cmake/scripts/FindVersion.cmake
./.github/changelog.sh > .changelog
TZ='UTC' date +"%Y-%m-%d %H:%M UTC" > .release_date
head -1 .ottdrev | cut -f 1 -d$'\t' > .version
head -1 .ottdrev-vc | cut -f 1 -d$'\t' > .version
if [ $(head -1 .ottdrev | cut -f 5 -d$'\t') = '1' ]; then
if [ $(head -1 .ottdrev-vc | cut -f 5 -d$'\t') = '1' ]; then
# Assume that all tags are always releases. Why else make a tag?
IS_TAG="true"
@ -152,18 +152,14 @@ jobs:
- name: Generate survey key
id: survey_key
run: |
if [ -z "${{ vars.SURVEY_TYPE }}" ]; then
echo "SURVEY_TYPE variable not found; most likely running in a fork. Skipping step."
SURVEY_KEY=""
else
PAYLOAD='{"version":"${{ steps.metadata.outputs.version }}","type":"${{ vars.SURVEY_TYPE }}"}'
echo "${{ secrets.SURVEY_SIGNING_KEY }}" > survey_signing_key.pem
SIGNATURE=$(echo -n "${PAYLOAD}" | openssl dgst -sha256 -sign survey_signing_key.pem | base64 -w0)
rm -f survey_signing_key.pem
SURVEY_KEY=$(curl -f -s -X POST -d "${PAYLOAD}" -H "Content-Type: application/json" -H "X-Signature: ${SIGNATURE}" https://survey-participate.openttd.org/create-survey-key/${{ vars.SURVEY_TYPE }})
fi
#PAYLOAD='{"version":"${{ steps.metadata.outputs.version }}","type":"${{ vars.SURVEY_TYPE }}"}'
#
#echo "${{ secrets.SURVEY_SIGNING_KEY }}" > survey_signing_key.pem
#SIGNATURE=$(echo -n "${PAYLOAD}" | openssl dgst -sha256 -sign survey_signing_key.pem | base64 -w0)
#rm -f survey_signing_key.pem
#
#SURVEY_KEY=$(curl -f -s -X POST -d "${PAYLOAD}" -H "Content-Type: application/json" -H "X-Signature: ${SIGNATURE}" https://survey-participate.openttd.org/create-survey-key/${{ vars.SURVEY_TYPE }})
SURVEY_KEY=""
echo "survey_key=${SURVEY_KEY}" >> $GITHUB_OUTPUT
@ -193,14 +189,14 @@ jobs:
echo "::endgroup::"
- name: Store bundles
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: openttd-source
path: build/bundles/*
retention-days: 5
- name: Store source (for other jobs)
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: internal-source
path: source.tar.gz

@ -30,7 +30,7 @@ jobs:
steps:
- name: Download source
uses: actions/download-artifact@v4
uses: actions/download-artifact@v3
with:
name: internal-source
@ -39,29 +39,39 @@ jobs:
run: |
tar -xf source.tar.gz --strip-components=1
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
shell: bash
run: |
choco install pandoc
- name: Enable Rust cache
uses: Swatinem/rust-cache@v2
- name: Prepare cache key
id: key
shell: powershell
run: |
# Work around caching failure with GNU tar
New-Item -Type Junction -Path vcpkg -Target c:\vcpkg
- name: Setup vcpkg caching
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
Write-Output "image=$env:ImageOS-$env:ImageVersion" >> $env:GITHUB_OUTPUT
- name: Install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg ${{ runner.temp }}\vcpkg
${{ runner.temp }}\vcpkg\bootstrap-vcpkg.bat -disableMetrics
- name: Enable vcpkg cache
uses: actions/cache@v3
with:
path: vcpkg/installed
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-1 # Increase the number whenever dependencies are modified
restore-keys: |
${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}
- name: Install dependencies
- name: Prepare vcpkg
shell: bash
run: |
choco install pandoc
vcpkg install --triplet=${{ matrix.arch }}-windows-static \
liblzma \
libpng \
lzo \
nlohmann-json \
zlib \
zstd \
# EOF
- name: Install MSVC problem matcher
uses: ammaraskar/msvc-problem-matcher@master
@ -94,6 +104,22 @@ jobs:
with:
arch: ${{ matrix.host }}
- name: Import code signing certificate
if: ${{ false }} # Disabled
shell: powershell
# If this is run on a fork, there may not be a certificate set up - continue in this case
continue-on-error: true
run: |
$tempFile = [System.IO.Path]::GetTempFileName()
$bytes = [System.Convert]::FromBase64String($env:WINDOWS_CERTIFICATE_P12)
[IO.File]::WriteAllBytes($tempFile, $bytes)
$pwd = ConvertTo-SecureString $env:WINDOWS_CERTIFICATE_PASSWORD -AsPlainText -Force
Import-PfxCertificate -FilePath $tempFile -CertStoreLocation Cert:\CurrentUser\My -Password $pwd
Remove-Item $tempFile
env:
WINDOWS_CERTIFICATE_P12: ${{ secrets.WINDOWS_CERTIFICATE_P12 }}
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
- name: Build (with installer)
if: inputs.is_tag == 'true'
shell: bash
@ -105,11 +131,12 @@ jobs:
cmake ${GITHUB_WORKSPACE} \
-GNinja \
-DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-windows-static \
-DCMAKE_TOOLCHAIN_FILE="${{ runner.temp }}\vcpkg\scripts\buildsystems\vcpkg.cmake" \
-DCMAKE_TOOLCHAIN_FILE="c:\vcpkg\scripts\buildsystems\vcpkg.cmake" \
-DOPTION_USE_NSIS=ON \
-DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DOPTION_SURVEY_KEY=${{ inputs.survey_key }} \
-DWINDOWS_CERTIFICATE_COMMON_NAME="${WINDOWS_CERTIFICATE_COMMON_NAME}" \
# EOF
echo "::endgroup::"
@ -117,12 +144,7 @@ jobs:
cmake --build . --target openttd
echo "::endgroup::"
env:
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_CODESIGN_ACCOUNT_NAME: ${{ secrets.AZURE_CODESIGN_ACCOUNT_NAME }}
AZURE_CODESIGN_ENDPOINT: ${{ secrets.AZURE_CODESIGN_ENDPOINT }}
AZURE_CODESIGN_PROFILE_NAME: ${{ secrets.AZURE_CODESIGN_PROFILE_NAME }}
WINDOWS_CERTIFICATE_COMMON_NAME: ${{ secrets.WINDOWS_CERTIFICATE_COMMON_NAME }}
- name: Build (without installer)
if: inputs.is_tag != 'true'
@ -135,10 +157,11 @@ jobs:
cmake ${GITHUB_WORKSPACE} \
-GNinja \
-DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-windows-static \
-DCMAKE_TOOLCHAIN_FILE="${{ runner.temp }}\vcpkg\scripts\buildsystems\vcpkg.cmake" \
-DCMAKE_TOOLCHAIN_FILE="c:\vcpkg\scripts\buildsystems\vcpkg.cmake" \
-DHOST_BINARY_DIR=${GITHUB_WORKSPACE}/build-host \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DOPTION_SURVEY_KEY=${{ inputs.survey_key }} \
-DWINDOWS_CERTIFICATE_COMMON_NAME="${WINDOWS_CERTIFICATE_COMMON_NAME}" \
# EOF
echo "::endgroup::"
@ -146,12 +169,7 @@ jobs:
cmake --build . --target openttd
echo "::endgroup::"
env:
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_CODESIGN_ACCOUNT_NAME: ${{ secrets.AZURE_CODESIGN_ACCOUNT_NAME }}
AZURE_CODESIGN_ENDPOINT: ${{ secrets.AZURE_CODESIGN_ENDPOINT }}
AZURE_CODESIGN_PROFILE_NAME: ${{ secrets.AZURE_CODESIGN_PROFILE_NAME }}
WINDOWS_CERTIFICATE_COMMON_NAME: ${{ secrets.WINDOWS_CERTIFICATE_COMMON_NAME }}
- name: Create bundles
shell: bash
@ -176,18 +194,16 @@ jobs:
- name: Sign installer
if: ${{ false }} # inputs.is_tag == 'true'
shell: bash
# If this is run on a fork, there may not be a certificate set up - continue in this case
continue-on-error: true
run: |
${GITHUB_WORKSPACE}/os/windows/sign.bat "${GITHUB_WORKSPACE}/build/bundles"
cd ${GITHUB_WORKSPACE}/build/bundles
../../os/windows/sign.bat *.exe "${WINDOWS_CERTIFICATE_COMMON_NAME}"
env:
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_CODESIGN_ACCOUNT_NAME: ${{ secrets.AZURE_CODESIGN_ACCOUNT_NAME }}
AZURE_CODESIGN_ENDPOINT: ${{ secrets.AZURE_CODESIGN_ENDPOINT }}
AZURE_CODESIGN_PROFILE_NAME: ${{ secrets.AZURE_CODESIGN_PROFILE_NAME }}
WINDOWS_CERTIFICATE_COMMON_NAME: ${{ secrets.WINDOWS_CERTIFICATE_COMMON_NAME }}
- name: Store bundles
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with:
name: openttd-windows-${{ matrix.arch }}
path: build/bundles

@ -51,16 +51,6 @@ jobs:
with:
survey_key: ${{ needs.source.outputs.survey_key }}
linux-dedicated:
name: Linux (Dedicated)
needs: source
uses: ./.github/workflows/release-linux-dedicated.yml
secrets: inherit
with:
survey_key: ${{ needs.source.outputs.survey_key }}
macos:
name: MacOS
needs: source

@ -14,7 +14,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v3
- name: Check for finding script functions that require company/deity mode enforcement/checks
run: |

@ -15,7 +15,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v3
- name: Check for unused strings
run: |

1
.gitignore vendored

@ -5,5 +5,4 @@ docs/aidocs/*
docs/gamedocs/*
docs/source/*
/out
/vcpkg_installed
*.tmp

@ -1,2 +1,2 @@
jgrpp-0.59.1 20240519 0 5e971bfc026aa9a58773d89c583e78765156b9e4 1 0 2024
f0d82005ae0e64dc0f833d5cbd6776afb06c9a513cc83119ce8fd0a2e5be097b -
jgrpp-0.55.3 20230923 0 ef91136633638530926308dd1247f032c75de797 1 0 2023
cbd69089e76cdc2b41d0afe493f758fa226a2226bac202fa0bb0335b4b53b6b3 -

@ -5,7 +5,7 @@ if(NOT BINARY_NAME)
endif()
project(${BINARY_NAME}
VERSION 15.0
VERSION 14.0
)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
@ -36,7 +36,7 @@ set_directory_options()
include(Static)
set_static_if_needed()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS NO)
@ -120,6 +120,7 @@ find_package(LibLZMA)
find_package(LZO)
find_package(ZSTD 1.4)
find_package(PNG)
find_package(nlohmann_json)
if(WIN32 OR EMSCRIPTEN)
# Windows uses WinHttp for HTTP requests.
@ -254,12 +255,6 @@ if(OPTION_PACKAGE_DEPENDENCIES)
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
endif()
if(OPTION_NO_SPLIT_LIB)
set(OPENTTD_LIB openttd)
else()
set(OPENTTD_LIB openttd_lib)
endif()
include(CTest)
include(SourceList)
@ -270,21 +265,12 @@ include_directories(${CMAKE_SOURCE_DIR}/src/3rdparty/squirrel/include)
include(MSVCFilters)
if(OPTION_NO_SPLIT_LIB)
add_executable(openttd WIN32 ${GENERATED_SOURCE_FILES})
else()
add_library(openttd_lib OBJECT ${GENERATED_SOURCE_FILES})
add_executable(openttd WIN32)
add_executable(openttd_test)
set_target_properties(openttd_test PROPERTIES EXCLUDE_FROM_ALL TRUE)
endif()
add_executable(openttd WIN32 ${GENERATED_SOURCE_FILES})
set_target_properties(openttd PROPERTIES OUTPUT_NAME "${BINARY_NAME}")
# All other files are added via target_sources()
if (MINGW AND OPTION_MINGW_STDTHREADS)
target_link_libraries(${OPENTTD_LIB} mingw_stdthreads)
endif()
add_executable(openttd_test)
set_target_properties(openttd_test PROPERTIES EXCLUDE_FROM_ALL TRUE)
# All other files are added via target_sources()
set(host_tools_list strgen settingsgen)
@ -321,14 +307,6 @@ endif()
if(MSVC)
# Add DPI manifest to project; other WIN32 targets get this via ottdres.rc
target_sources(openttd PRIVATE "${CMAKE_SOURCE_DIR}/os/windows/openttd.manifest")
# If target -static is used, switch our project to static (/MT) too.
# If the target ends on -static-md, it will remain dynamic (/MD).
if(VCPKG_TARGET_TRIPLET MATCHES "-static" AND NOT VCPKG_TARGET_TRIPLET MATCHES "-md")
set_property(TARGET openttd_lib PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_property(TARGET openttd PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_property(TARGET openttd_test PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
endif()
add_subdirectory(${CMAKE_SOURCE_DIR}/bin)
@ -346,30 +324,18 @@ endif()
add_dependencies(openttd
find_version)
if(NOT OPTION_NO_SPLIT_LIB)
target_link_libraries(openttd openttd_lib)
target_link_libraries(openttd_test PRIVATE openttd_lib)
if(ANDROID)
target_link_libraries(openttd_test PRIVATE log)
endif()
include(Catch)
catch_discover_tests(openttd_test)
endif()
target_link_libraries(${OPENTTD_LIB}
target_link_libraries(openttd
openttd::languages
openttd::settings
openttd::script_api
Threads::Threads
)
target_link_libraries(openttd
openttd::media
openttd::basesets
openttd::script_api
openttd::binfiles
Threads::Threads
)
target_link_libraries(openttd_test)
include(Catch)
catch_discover_tests(openttd_test)
if(HAIKU)
target_link_libraries(openttd "be" "network" "midi")
@ -389,10 +355,10 @@ link_package(ZLIB TARGET ZLIB::ZLIB ENCOURAGED)
link_package(LIBLZMA TARGET LibLZMA::LibLZMA ENCOURAGED)
link_package(LZO)
link_package(ZSTD TARGET ZSTD::ZSTD RECOMMENDED)
link_package(nlohmann_json ENCOURAGED)
if(NOT WIN32 AND NOT EMSCRIPTEN)
link_package(CURL ENCOURAGED)
target_link_libraries(openttd_lib ${CMAKE_DL_LIBS})
endif()
if(NOT OPTION_DEDICATED)
@ -424,7 +390,7 @@ include(CheckAtomic)
if(APPLE)
link_package(Iconv TARGET Iconv::Iconv)
target_link_libraries(${OPENTTD_LIB}
target_link_libraries(openttd
${AUDIOTOOLBOX_LIBRARY}
${AUDIOUNIT_LIBRARY}
${COCOA_LIBRARY}
@ -443,7 +409,6 @@ if(EMSCRIPTEN)
target_link_libraries(WASM::WASM INTERFACE "-s ALLOW_MEMORY_GROWTH=1")
target_link_libraries(WASM::WASM INTERFACE "-s INITIAL_MEMORY=33554432")
target_link_libraries(WASM::WASM INTERFACE "-s DISABLE_EXCEPTION_CATCHING=0")
target_link_libraries(WASM::WASM INTERFACE "-s WASM_BIGINT")
add_definitions(-s DISABLE_EXCEPTION_CATCHING=0)
# Export functions to Javascript.
@ -459,23 +424,6 @@ if(EMSCRIPTEN)
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_BINARY_DIR}/lang/english.lng@/lang/english.lng")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/bin/ai@/ai")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/bin/game@/game")
# Documentation files for the in-game text file viewer
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/README.md@/README.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/CREDITS.md@/CREDITS.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/CONTRIBUTING.md@/CONTRIBUTING.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/COPYING.md@/COPYING.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/known-bugs.txt@/known-bugs.txt")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/changelog.txt@/changelog.txt")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/admin_network.md@/docs/admin_network.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/debugging_desyncs.md@/docs/debugging_desyncs.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/desync.md@/docs/desync.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/directory_structure.md@/docs/directory_structure.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/eints.md@/docs/eints.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/linkgraph.md@/docs/linkgraph.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/logging_and_performance_metrics.md@/docs/logging_and_performance_metrics.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/multiplayer.md@/docs/multiplayer.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/savegame_format.md@/docs/savegame_format.md")
target_link_libraries(WASM::WASM INTERFACE "--preload-file ${CMAKE_SOURCE_DIR}/docs/symbol_server.md@/docs/symbol_server.md")
# We use IDBFS for persistent storage.
target_link_libraries(WASM::WASM INTERFACE "-lidbfs.js")
@ -521,14 +469,13 @@ if(WIN32)
-DPSAPI_VERSION=1
)
target_link_libraries(${OPENTTD_LIB}
target_link_libraries(openttd
ws2_32
winmm
imm32
usp10
psapi
winhttp
bcrypt
)
endif()
@ -536,13 +483,8 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
add_definitions(-DPOINTER_IS_64BIT)
endif()
if(OPTION_NO_TAGGED_PTRS)
add_definitions(-DNO_TAGGED_PTRS)
endif()
enable_testing()
add_subdirectory(regression)
include(CreateRegression)
create_regression()
if(APPLE OR WIN32)
find_package(Pandoc)
@ -560,7 +502,6 @@ string(REGEX REPLACE "(^|;)-D" "\\1" CFG_DEFS "${CFG_DEFS}")
get_property(CFG_DEFS_2 DIRECTORY . PROPERTY COMPILE_DEFINITIONS)
list(APPEND CFG_DEFS ${CFG_DEFS_2})
list(FILTER CFG_DEFS EXCLUDE REGEX "_DIR=")
list(FILTER CFG_DEFS EXCLUDE REGEX "SURVEY_KEY=")
# Generate a target to determine version, which is execute every 'make' run
add_custom_target(find_version

@ -157,7 +157,7 @@ enum SomeEnumeration {
* Use curly braces and put the contained statements on their own lines (e.g., don't put them directly after the **if**).
* Opening curly bracket **{** stays on the first line, closing curly bracket **}** gets a line to itself (except for the **}** preceding an **else**, which should be on the same line as the **else**).
* When only a single statement is contained, the brackets can be omitted. In this case, put the single statement on the same line as the preceding keyword (**if**, **while**, etc.). Note that this is only allowed for if statements without an **else** clause.
* Non-trivial fall throughs must be documented, using a `[[fallthrough]]` attribute.
* All fall throughs must be documented, using a **FALLTHROUGH** define/macro.
* The NOT_REACHED() macro can be used in default constructs that should never be reached.
* Unconditional loops are written with **`for (;;) {`**
@ -180,7 +180,7 @@ switch (a) {
case 1:
DoSomething();
[[fallthrough]];
/* FALL THROUGH */
case 2:
DoMore();
@ -191,7 +191,7 @@ switch (a) {
int r = 2;
DoEvenMore(a);
[[fallthrough]];
/* FALL THROUGH */
}
case 4: {
@ -248,7 +248,7 @@ Templates are a very powerful C++ tool, but they can easily confuse beginners. T
* Templates are to be documented in a very clear and verbose manner. Never assume anything in the documentation.
* the template keyword and the template layout get a separate line. typenames are either "T" or preceded by a "T", integers get a single capital letter or a descriptive name preceded by "T".
```c++
template <typename T, typename Tsomething, int N, uint8_t Tnumber_of_something>
template <typename T, typename Tsomething, int N, byte Tnumber_of_something>
int Func();
```
@ -416,57 +416,38 @@ There is a check-script on the git server (also available for clients, see below
The first line of a message must match:
```
<keyword>( #<issue>|<commit>(, (#<issue>|<commit>))*)?: ([<component>])? <details>
<pre>
<keyword>( #<issue>| <commit>(, (<keyword> #<issue>|<commit>))*)?: ([<section])? <Details>
</pre>
```
Keywords are:
* Add, Feature: Adding new stuff. Difference between "Feature" and "Add" is somewhat subjective. "Feature" for user-point-of-view stuff, "Add" for other.
* Change: Changing behaviour from user-point-of-view.
* Remove: Removing something from user-point-of-view.
* Codechange, Cleanup: Changes without intentional change of behaviour from user-point-of-view. Difference between "Codechange" and "Cleanup" is somewhat subjective.
* Fix, Revert: Fixing stuff.
* Doc, Update: Documentation changes, version increments, translator commits.
* Prepare: Preparation for bigger changes. Rarely used.
Keywords can either be player-facing, NewGRF / Script author-facing, or developer-facing.
If you commit a fix for an [issue](https://github.com/OpenTTD/OpenTTD/issues), add the corresponding issue number in the form of #NNNN. Do it as well if you implement a feature with a matching entry.
For player-facing changes, we have these keywords:
* Feature: Adding a significant new functionality to the game. This can be small in code-size, but is meant for the bigger things from a player perspective.
* Add: Similar to Feature, but for small functionalities.
* Change: Changing existing behaviour to an extent the player needs to know about it.
* Fix: Fixing an issue with the game (as seen by the player).
* Remove: Completely removing a functionality.
* Revert: Reverting an earlier Feature / Add / Change / Fix / Remove.
* Doc: Update to (player-facing) documentation, like in the `docs/` folder etc.
* Update: Translator commits.
In the case of bugfixes, if you know what revision the bug was introduced (eg regression), please mention that revision as well just after the prefix. Finding the trouble-causing revision is highly encouraged as it makes backporting/branching/releases that much easier.
For NewGRF / Script author-facing changes, we use the same keywords as player-facing changes, followed by `[NewGRF]` / `[Script]` component.
This also means the commit is aimed (and worded) towards the NewGRF / Script authors, rather than players.
To further structure the changelog, you can add sections. Example are:
* "Network" for network specific changes
* "NewGRF" for NewGRF additions
* "YAPP", "NPF", for changes in these features
* "OSX", "Debian", "win32", for OS-specific packaging changes
For developer-facing changes, we have these keywords:
* Codechange: Changes to the code the player is not going to notice. Refactors, modernization, etc.
* Cleanup: Similar to Codechange, but when it is more about removing old code, rather than an actual change.
* Codefix: Fixing problems in earlier commits that the player is not actually going to notice. Wrong comments, missing files, CI changes.
If you commit a `Fix` for an [issue](https://github.com/OpenTTD/OpenTTD/issues), add the corresponding issue number in the form of #NNNNN.
In the case of `Fix`es, if you know the hash of the commit in which the bug was introduced (eg regression), please mention that hash (the first 7 characters) as well just after the keyword (or, if present, after the issue number).
Finding the trouble-causing commit is highly encouraged as it makes backporting / branching / releases that much easier.
Do not mention two keywords; if two apply, pick one that best represents the commit (for example, "Fix #123" is mostly always better than "Revert", even if both are true).
The `<details>` part starts with a capital and does not end with a dot.
Try to be descriptive to what the player will notice, not to what is actually being changed in the code.
See `changelog.txt` for inspiration.
To further structure the changelog, you can add components. Example are:
* "Network" for network specific changes.
* "NewGRF" for NewGRF additions.
* "Script" for AI / GS additions.
* "YAPF", "NPF", for changes in these features.
* "MacOS", "Linux", "Windows", for OS-specific changes.
* "CI", "CMake", for changes to the (build) infrastructure.
Further explanations, more details, etc. don't go into the first line. Use a new line for those.
Further explanations, general bitching, etc. don't go into the first line. Use a new line for those.
Complete examples:
* `Fix: [YAPF] Infinite loop in pathfinder`
* `Fix #5926: [YAPF] Infinite loop in pathfinder`
* `Codefix 80dffae: Warning about unsigned unary minus`
* `Fix #6673, 99bb3a9: Store the map variety setting in the savegame`
* `Codefix #5922: ClientSizeChanged is only called via WndProcGdi which already has the mutex`
* `Codechange #1264, #2037, #2038, #2110: Rewrite the autoreplace kernel`
* Fix: [YAPF] Infinite loop in pathfinder.
* Fix #5926: [YAPF] Infinite loop in pathfinder.
* Fix 80dffae130: Warning about unsigned unary minus.
* Fix #6673, 99bb3a95b4: Store the map variety setting in the samegame.
* Revert d9065fbfbe, Fix #5922: ClientSizeChanged is only called via WndProcGdi which already has the mutex.
* Fix #1264, Fix #2037, Fix #2038, Fix #2110: Rewrite the autoreplace kernel.
## Other tips

@ -4,6 +4,7 @@
OpenTTD makes use of the following external libraries:
- (encouraged) nlohmann-json: JSON handling
- (encouraged) zlib: (de)compressing of old (0.3.0-1.0.5) savegames, content downloads,
heightmaps
- (encouraged) liblzma: (de)compressing of savegames (1.1.0 and later)
@ -38,7 +39,7 @@ OpenTTD needs the Platform SDK, if it isn't installed already. This can be
done during installing Visual Studio, by selecting
`Visual C++ MFC for x86 and x64` (and possibly
`Visual C++ ATL for x86 and x64` depending on your version). If not, you
can get download it as [MS Windows Platform SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk).
can get download it as [MS Windows Platform SDK](https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk).
Install the SDK by following the instructions as given.
@ -54,13 +55,14 @@ the `static` versions, and OpenTTD currently needs the following dependencies:
- libzstd
- libpng
- lzo
- nlohmann-json
- zlib
To install both the x64 (64bit) and x86 (32bit) variants (though only one is necessary), you can use:
```ps
.\vcpkg install --triplet=x64-windows-static
.\vcpkg install --triplet=x86-windows-static
.\vcpkg install liblzma:x64-windows-static zstd:x64-windows-static libpng:x64-windows-static lzo:x64-windows-static nlohmann-json:x64-windows-static zlib:x64-windows-static
.\vcpkg install liblzma:x86-windows-static zstd:x86-windows-static libpng:x86-windows-static lzo:x86-windows-static nlohmann-json:x86-windows-static zlib:x86-windows-static
```
You can open the folder (as a CMake project). CMake will be detected, and you can compile from there.
@ -110,6 +112,9 @@ builds.
- `-DOPTION_USE_ASSERTS=OFF`: disable asserts. Use with care, as assert
statements capture early signs of trouble. Release builds have them
disabled by default.
- `-DOPTION_USE_THREADS=OFF`: disable the use of threads. This will block
the interface in many places, and in general gives a worse experience of
the game. Use with care.
- `-DOPTION_TOOLS_ONLY=ON`: only build tools like `strgen`. Does not build
the game itself. Useful for cross-compiling.

@ -14,7 +14,7 @@ In return, they should reciprocate that respect in addressing your issue or asse
The [issue tracker](https://github.com/OpenTTD/OpenTTD/issues) is the preferred channel for [bug reports](#bug-reports), but please respect the following restrictions:
* Please **do not** use the issue tracker for help playing or using OpenTTD.
Please try [irc](https://wiki.openttd.org/en/Development/IRC%20channel), [Discord](https://discord.gg/openttd), or the [forums](https://www.tt-forums.net/)
Please try [irc](https://wiki.openttd.org/en/Development/IRC%20channel), or the [forums](https://www.tt-forums.net/)
* Please **do not** derail or troll issues. Keep the discussion on topic and respect the opinions of others.
@ -23,7 +23,7 @@ Use [GitHub's "reactions" feature](https://github.com/blog/2119-add-reactions-to
We reserve the right to delete comments which violate this rule.
* Please **do not** open issues or pull requests regarding add-on content in NewGRF, GameScripts, AIs, etc.
These are created by third-parties. Please try [irc](https://wiki.openttd.org/en/Development/IRC%20channel), [Discord](https://discord.gg/openttd), or the [forums](https://www.tt-forums.net/) to discuss these.
These are created by third-parties. Please try [irc](https://wiki.openttd.org/en/Development/IRC%20channel) or the [forums](https://www.tt-forums.net/) to discuss these.
* Please use [the web translator](https://translator.openttd.org/) to submit corrections and improvements to translations of the game.
@ -108,11 +108,11 @@ Pull requests should fit with the [goals of the project](./CONTRIBUTING.md#proje
Every pull request should have a clear scope, with no unrelated commits.
[Code style](./CODINGSTYLE.md) must be complied with for pull requests to be accepted; this also includes [commit message format](./CODINGSTYLE.md#commit-message).
[Code style](https://wiki.openttd.org/en/Development/Coding%20style) must be complied with for pull requests to be accepted; this also includes [commit message format](https://wiki.openttd.org/en/Development/Coding%20style#commit-message).
Adhering to the following process is the best way to get your work included in the project:
1. [Fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) the project, clone your fork, and configure the remotes:
1. [Fork](https://help.github.com/fork-a-repo/) the project, clone your fork, and configure the remotes:
```bash
git clone https://github.com/<your-username>/OpenTTD.git openttd
@ -136,7 +136,7 @@ contain your feature, change, or fix:
git checkout upstream/master -b <topic-branch-name>
```
4. Commit your changes in logical chunks. Please adhere to these [git commit message guidelines](./CODINGSTYLE.md#commit-message) or your code is unlikely to be merged into the main project.
4. Commit your changes in logical chunks. Please adhere to these [git commit message guidelines](https://wiki.openttd.org/en/Development/Coding%20style#commit-message) or your code is unlikely to be merged into the main project.
Use Git's [interactive rebase](https://docs.github.com/en/get-started/using-git/about-git-rebase) feature to tidy up your commits before making them public.
5. Locally rebase the upstream development branch into your topic branch:
@ -172,7 +172,7 @@ The results of the CI tests will show on your pull request.
By clicking on Details you can further zoom in; in case of a failure it will show you why it failed.
In case of success it will report how awesome you were.
Tip: [commit message format](./CODINGSTYLE.md#commit-message) is a common reason for pull requests to fail validation.
Tip: [commit message format](https://wiki.openttd.org/en/Development/Coding%20style#commit-message) is a common reason for pull requests to fail validation.
### Are there any development docs?
@ -182,16 +182,6 @@ There is no single source for OpenTTD development docs. It's a complex project w
A good entry point is [Development](https://wiki.openttd.org/en/Development/) on the OpenTTD wiki; this provides links to wiki documentation and other sources.
The GitHub repo also includes some non-comprehensive documentation in [/docs](./docs).
These include:
- When to [change other languages and when not to](./docs/eints.md).
- The [savegame format](./docs/savegame_format.md).
- The [release process](./docs/releasing_openttd.md).
- Some [notes on the link graph algorithm](./docs/linkgraph.md).
- The [network game coordinator](./docs/game_coordinator.md).
- How to use [the admin port for network games](./docs/admin_network.md), also useful for multiplayer server hosts.
- The [performance metrics and logging features](./docs/logging_and_performance_metrics.md), also useful for add-on developers.
- How [symbol server and analysis works](./docs/symbol_server.md).
- And several miscellaneous files detailing internal data structures and graphics measurements and palettes.
You may also want the guide to [compiling OpenTTD](./COMPILING.md).
@ -266,7 +256,7 @@ This is inevitable, because it is a main feature of git.
If you are concerned about your privacy, we strongly recommend to use "Anonymous &lt;anonymous@openttd.org&gt;" as the git commit author. We might refuse anonymous contributions if malicious intent is suspected.
Please note that the contributor identity, once given, is used for copyright verification and to provide proof should a malicious commit be made.
As such, the [EU GDPR](https://gdpr.eu) "right to be forgotten" does not apply, as this is an overriding legitimate interest.
As such, the [EU GDPR](https://www.eugdpr.org/key-changes.html) "right to be forgotten" does not apply, as this is an overriding legitimate interest.
Please also note that your commit is public and as such will potentially be processed by many third-parties.
Git's distributed nature makes it impossible to track where exactly your commit, and thus your personal data, will be stored and be processed.

@ -1,5 +1,5 @@
This is the license which applies to OpenTTD with the exception of some
3rd party modules. See [our readme](./README.md) for details
3rd party modules. See [./README.md](./README.md) for details
GNU General Public License
==========================

@ -3,15 +3,14 @@
- Matthijs Kooijman (blathijs) - Pathfinder-guru, Debian port (since 0.3)
- Christoph Elsenhans (frosch) - General coding (since 0.6)
- Loïc Guilloux (glx) - General / Windows Expert (since 0.4.5)
- Koen Bussemaker (Kuhnovic) - General / Ship pathfinder (since 14)
- Charles Pigott (LordAro) - General / Correctness police (since 1.9)
- Michael Lutz (michi_cc) - General / Path based signals (since 0.7)
- Niels Martin Hansen (nielsm) - Music system, general coding (since 1.9)
- Owen Rudge (orudge) - Forum host, OS/2 port (since 0.1)
- Peter Nelson (peter1138) - Spiritual descendant from NewGRF gods (since 0.4.5)
- Peter Nelson (peter1138) - Spiritual descendant from newGRF gods (since 0.4.5)
- Remko Bijker (Rubidium) - Coder and way more (since 0.4.5)
- Patric Stout (TrueBrain) - NoProgrammer (since 0.3), sys op
- Tyler Trahan (2TallTyler) - General / Time Lord (since 13)
- Tyler Trahan (2TallTyler) - General coding (since 13)
### Inactive Developers:
@ -57,7 +56,6 @@
- George - Canal/Lock graphics
- Andrew Parkhouse (andythenorth) - River graphics
- David Dallaston (Pikka) - Tram tracks
- Richard Wheeler (zephyris) - OpenTTD TrueType font
- All Translators - For their support to make OpenTTD a truly international game
- Bug Reporters - Thanks for all bug reports
- Chris Sawyer - For an amazing game!

@ -1,10 +1,6 @@
## JGR's Patchpack version 0.59.1
## JGR's Patchpack version 0.55.3
This is a collection of features and other modifications applied to [OpenTTD](http://www.openttd.org/).
It's a separate version of the game which can be installed and played alongside the standard game, not a loadable mod (NewGRF, script, or so on).
This is mainly intended to be used by players who are already familiar with the standard game and how to play it.
It is not aimed at beginner/novice players. Some features and settings are there for very experienced players and so may have a steep learning curve.
This is a collection of patches applied to [OpenTTD](http://www.openttd.org/)
* * *
@ -20,14 +16,14 @@ section "Licensing" below for details,
See [below](#openttd) for the original OpenTTD readme.
The thread for this patchpack can be found [here](http://www.tt-forums.net/viewtopic.php?f=33&t=73469).
See [jgrpp-changelog.md](jgrpp-changelog.md) for the changelog.
See the [wiki](https://github.com/JGRennison/OpenTTD-patches/wiki) for guides on how to use some of the included features.
See [installation.md](/installation.md) for instructions on how to install.
The TT-Forums thread for this patchpack can be found [here](http://www.tt-forums.net/viewtopic.php?f=33&t=73469).
(Nearly all of the patches which are listed below have been modified, fixed or extended in some way, and so are not the same as the originals which are linked).
#### Railways and Trains
@ -62,7 +58,6 @@ The TT-Forums thread for this patchpack can be found [here](http://www.tt-forums
* Remember the last-used signal type between games.
* Add client setting to show the introduction year for train wagons.
* Add setting for rail depot maximum speed.
* Add setting to allow auto-fill signal dragging to skip over stations/waypoints.
#### Roads and Road Vehicles
@ -120,6 +115,7 @@ The TT-Forums thread for this patchpack can be found [here](http://www.tt-forums
* Open train vehicle details window on total cargo tab if shift pressed.
* Add news/advice setting to warn if no depot order in vehicle schedule.
* [Add buttons to collapse/expand all groups](http://www.tt-forums.net/viewtopic.php?f=33&t=74365).
* Add a menu item to the vehicle list to assign all listed vehicles to a new group.
* Add a setting to include the train length and group name in the vehicle details window.
* Add a setting for whether to open the new vehicle GUI when share-cloning.
* Add setting to disable mass action buttons for top-level vehicle lists.
@ -135,6 +131,7 @@ The TT-Forums thread for this patchpack can be found [here](http://www.tt-forums
* [Automated timetables and separation](http://www.tt-forums.net/viewtopic.php?f=33&t=46391).
* Allow clearing of timetable time fields which are at 0. Allow explicitly setting timetable time fields to 0 without clearing them.
* Allow changing/clearing the timetabled waiting time and max speed of all of a vehicle's orders at once.
* Add client setting to show the remainder ticks in timetable, after dividing to days or minutes.
* Add a company setting to control the number of ticks used in auto-fill timetable rounding.
* [Cargo type orders](https://www.tt-forums.net/viewtopic.php?p=1047749).
@ -169,6 +166,7 @@ The TT-Forums thread for this patchpack can be found [here](http://www.tt-forums
* [Departure boards](https://www.tt-forums.net/viewtopic.php?f=33&t=49956).
* Add road waypoints.
* Add NewGRF road stops.
* Add a setting to increase the station catchment radius.
* Station rating: track "last visited vehicle type" separately per cargo.
* Add setting to scale station cargo capacity and rating tolerance by size.
@ -189,6 +187,7 @@ The TT-Forums thread for this patchpack can be found [here](http://www.tt-forums
#### Towns
* [Town cargo generation factor](http://www.tt-forums.net/viewtopic.php?t=46399).
* [Rating in town label](http://www.tt-forums.net/viewtopic.php?f=33&t=42598).
* [Random town road reconstruction](https://www.tt-forums.net/viewtopic.php?f=33&t=36438). This defaults to off.
* Add very and extremely slow options to town growth rate setting.
@ -205,6 +204,7 @@ The TT-Forums thread for this patchpack can be found [here](http://www.tt-forums
#### Industries
* Industry cargo generation factor.
* Allow linking only inputs or outputs to the smallmap and map mode viewports in the industry chain window.
#### Map and Landscaping
@ -214,13 +214,14 @@ The TT-Forums thread for this patchpack can be found [here](http://www.tt-forums
* Add a new tree placement mode (perfect).
* [Minimum town distance](https://www.tt-forums.net/viewtopic.php?f=33&t=33625).
* Add map generation settings to control river/lake, rocky patch, and tropic zone generation.
* Add generation of wide rivers.
* Add settings to customise the size of town zones, and city zones.
* Add setting to show purchased land using clear tile ground sprites (dirt, grass, snow, desert, etc).
#### Construction
* Enable building rivers in game. Off by default.
* Add a setting to disable removing sea/rivers.
* Allow building objects by area (1x1 objects only).
* Allow purchasing a region of tiles at once, by dragging.
* Add setting to control if and how land purchasing is permitted.
* Add a company rate limit for land purchasing.
@ -258,7 +259,6 @@ The TT-Forums thread for this patchpack can be found [here](http://www.tt-forums
* Add zoom in support to the minimap window.
* Add setting to increase the size of the main toolbar.
* Add cargo filtering and a show by cargo mode to the company delivered cargo graph.
* Add setting to display the area outside of the map as water.
#### Limits
@ -302,6 +302,7 @@ The TT-Forums thread for this patchpack can be found [here](http://www.tt-forums
* Add setting to allow non server admins to use the money cheat in multiplayer.
* Allow clicking the money text in the cheats window to enter a quantity.
* Add cheats to set inflation income and cost factors.
* Add cheat to set all station ratings to 100%.
* Add cheat to set all town local authority ratings to Outstanding.
#### Cargo Distribution and Link Graph
@ -320,6 +321,7 @@ The TT-Forums thread for this patchpack can be found [here](http://www.tt-forums
#### Console and Scripts
* Add basic tab-completion to the console window.
* Add console commands for conditional execution from game date.
* [Daily/monthly/yearly scripts](http://www.tt-forums.net/viewtopic.php?f=33&t=49595)
@ -397,10 +399,9 @@ The *feature-sx* branches use the savegame framework in the *save_ext* branch.
- 1.6) [OpenTTD directories](#16-openttd-directories)
- 1.7) [Compiling OpenTTD](#17-compiling-openttd)
- 2.0) [Contact and community](#20-contact-and-community)
- 2.1) [Multiplayer games](#21-multiplayer-games)
- 2.2) [Contributing to OpenTTD](#22-contributing-to-openttd)
- 2.3) [Reporting bugs](#23-reporting-bugs)
- 2.4) [Translating](#24-translating)
- 2.1) [Contributing to OpenTTD](#21-contributing-to-openttd)
- 2.2) [Reporting bugs](#22-reporting-bugs)
- 2.3) [Translating](#23-translating)
- 3.0) [Licensing](#30-licensing)
- 4.0) [Credits](#40-credits)
@ -464,9 +465,9 @@ For some platforms, you will need to refer to [the installation guide](https://w
The free data files, split into OpenGFX for graphics, OpenSFX for sounds and
OpenMSX for music can be found at:
- [OpenGFX](https://www.openttd.org/downloads/opengfx-releases/latest)
- [OpenSFX](https://www.openttd.org/downloads/opensfx-releases/latest)
- [OpenMSX](https://www.openttd.org/downloads/openmsx-releases/latest)
- https://www.openttd.org/downloads/opengfx-releases/latest for OpenGFX
- https://www.openttd.org/downloads/opensfx-releases/latest for OpenSFX
- https://www.openttd.org/downloads/openmsx-releases/latest for OpenMSX
Please follow the readme of these packages about the installation procedure.
The Windows installer can optionally download and install these packages.
@ -504,15 +505,6 @@ Most types of add-on content can be downloaded within OpenTTD via the 'Check Onl
Add-on content can also be installed manually, but that's more complicated; the [OpenTTD wiki](https://wiki.openttd.org/) may offer help with that, or the [OpenTTD directory structure guide](./docs/directory_structure.md).
### 1.5.1) Social Integration
OpenTTD has the ability to load plugins to integrate with Social Platforms like Steam, Discord, etc.
To enable such integration, the plugin for the specific platform has to be downloaded and stored in the `social_integration` folder.
See [OpenTTD's website](https://www.openttd.org), under Downloads, for what plugins are available.
### 1.6) OpenTTD directories
OpenTTD uses its own directory structure to store game data, add-on content etc.
@ -540,19 +532,12 @@ If you want to compile OpenTTD from source, instructions can be found in [COMPIL
- the OpenTTD wiki has a [page listing OpenTTD communities](https://wiki.openttd.org/en/Community/Community) including some in languages other than English
### 2.1) Multiplayer games
You can play OpenTTD with others, either cooperatively or competitively.
See the [multiplayer documentation](./docs/multiplayer.md) for more details.
### 2.2) Contributing to OpenTTD
### 2.1) Contributing to OpenTTD
We welcome contributors to OpenTTD. More information for contributors can be found in [CONTRIBUTING.md](./CONTRIBUTING.md)
### 2.3) Reporting bugs
### 2.2) Reporting bugs
Good bug reports are very helpful. We have a [guide to reporting bugs](./CONTRIBUTING.md#bug-reports) to help with this.
@ -560,7 +545,7 @@ Desyncs in multiplayer are complex to debug and report (some software developmen
Instructions can be found in [debugging and reporting desyncs](./docs/debugging_desyncs.md).
### 2.4) Translating
### 2.3) Translating
OpenTTD is translated into many languages. Translations are added and updated via the [online translation tool](https://translator.openttd.org).
@ -580,24 +565,12 @@ See the comments in the source files in `src/3rdparty/md5` for the complete lice
The fmt implementation in `src/3rdparty/fmt` is licensed under the MIT license.
See `src/3rdparty/fmt/LICENSE.rst` for the complete license text.
The nlohmann json implementation in `src/3rdparty/nlohmann` is licensed under the MIT license.
See `src/3rdparty/nlohmann/LICENSE.MIT` for the complete license text.
The OpenGL API in `src/3rdparty/opengl` is licensed under the MIT license.
See `src/3rdparty/opengl/khrplatform.h` for the complete license text.
The catch2 implementation in `src/3rdparty/catch2` is licensed under the Boost Software License, Version 1.0.
See `src/3rdparty/catch2/LICENSE.txt` for the complete license text.
The icu scriptrun implementation in `src/3rdparty/icu` is licensed under the Unicode license.
See `src/3rdparty/icu/LICENSE` for the complete license text.
The monocypher implementation in `src/3rdparty/monocypher` is licensed under the 2-clause BSD and CC-0 license.
See `src/3rdparty/monocypher/LICENSE.md` for the complete license text.
The OpenTTD Social Integration API in `src/3rdparty/openttd_social_integration_api` is licensed under the MIT license.
See `src/3rdparty/openttd_social_integration_api/LICENSE` for the complete license text.
## 4.0 Credits
See [CREDITS.md](./CREDITS.md)

@ -4,5 +4,3 @@
* 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/>.
*/
AILog.Info("14 API compatibility in effect.");

@ -1,6 +0,0 @@
/*
* 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/>.
*/

@ -4,5 +4,3 @@
* 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/>.
*/
GSLog.Info("14 API compatibility in effect.");

@ -1,6 +0,0 @@
/*
* 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/>.
*/

@ -1,467 +1,3 @@
14.0-beta3 (2024-02-06)
------------------------------------------------------------------------
Add: [Script] ScriptTileList_StationCoverage to get station coverage area (#12015)
Change: Update OpenTTD TTF fonts to v0.5 (#11994)
Fix #12012: Crash when opening orders of another company (#12013)
Fix #12001: Use correct valid cargo check for old-style NewGRF town house 3rd cargo set up (#12006)
Fix #11997: Adjust economy date by 1920 when loading TTD/TTO savegames (#12007)
Fix: Focus hotkey in road/tram stop building window (#12008)
Fix: Signals were incorrectly shifted by 1 pixel when selected (#12005)
Fix: Missing default vehicles and industry acceptance/production (#12000)
Fix: [Script] Avoid overflow in scripts when infinite money is enabled (#12016)
Fix: [Script] Don't kill GS misusing GSText (#12009)
14.0-beta2 (2024-02-04)
------------------------------------------------------------------------
Change: [NewGRF] Improved support for redefining default cargo types (#11719)
Fix #11982: Crash when trying to place signals on things other than plain rails (#11977)
Fix #11975: Inconsistent behaviour when changing first AI company settings (#11976)
Fix #11972: Year cut off in graph windows (#11974)
Fix #11968: Crash when opening orders window of new vehicles (#11973)
Fix #11966: Monospace text in windows may not have been fully scrollable (#11981)
Fix #11802: Made determining water region edge traversability more robust (#11986)
Fix: Second colour vehicle-type default liveries were not being updated (#11971)
14.0-beta1 (2024-02-03)
------------------------------------------------------------------------
Feature: Order option to unbunch vehicles at depot (#11945)
Feature: Infinite money mode (#11902)
Feature: Setting to disable the loading speed penalty for trains longer than the station (#11682)
Feature: Plugin framework for Social Integration with Steam, Discord, GOG, etc (#11628)
Feature: Scalable OpenTTD TrueType font made by Zephyris (#11593)
Feature: Toyland-specific river graphics (#11523)
Feature: Add zoom level buttons to sprite aligner (#11518)
Feature: Add shading to river slopes (#11491)
Feature: Place cargo icon on cargo filter dropdowns (#11487)
Feature: Mode to display timetable in seconds (#11435)
Feature: Setting to influence how many minutes a calendar year takes (#11428)
Feature: Base graphics can offer parameters for additional settings (#11347)
Feature: Sandbox option to lock station ratings at 100% (#11346)
Feature: Setting to use real-time "wallclock" as timekeeping units (#11341)
Feature: Setting to automatically restart server based on hours played (#11142)
Feature: Add config option to set default company secondary colour for new games (#11068)
Feature: Transparency option for cost and income indicators (#11001)
Feature: Create group of vehicles from manage vehicle list button (#10890)
Feature: Show coverage highlight the same as stations when adding waypoints (#10875)
Feature: Show the number of industries already built in the Fund New Industry window (#10806)
Feature: Add search filter and name text to build waypoint window (#10786)
Feature: Setting to disallow level crossings with competitors (#10755)
Feature: Opt-in survey when leaving a game (#10719)
Feature: Replace buying/selling company shares with hostile takeovers of AI companies (#10709, #10914)
Feature: Settings to scale cargo production of towns and industries (#10606)
Feature: Separate rail/road and sea/air velocity units, and add knots (#10594)
Feature: Region-based pathfinder for ships (#10543)
Feature: Filter engine build menu by name and NewGRF extra text (#10519)
Feature: Industry directory text filter (#10518)
Feature: Ctrl+Click to reset late counter for the entire vehicle group (#10464)
Feature: Orientation of rail and road depots can be changed (#9642)
Feature: Display help and manuals in-game (#7786)
Feature: [NewGRF] Town production effect and multiplier (#11947)
Feature: [NewGRF] Randomize direction of rail vehicle on build based on probability callback (#11489)
Feature: [NewGRF] Related Act2 objects for airports and airport tiles (#11282)
Feature: [NewGRF] Allow higher max speeds for ships (#10734)
Feature: [NewGRF] Increase limit of objects/stations/roadstops per NewGRF (#10672)
Feature: [NewGRF] Road stops (#10144)
Feature: [Script] Goal destination can be updated (#10817)
Add: Argument for console command "restart" to use either current or newgame settings (#11962, #11963)
Add: {CURRENCY_SHORT} only did k / m suffix. Add bn / tn and make translatable (#11921)
Add: Show in multiplayer the amount of hours a game has been unpaused (#11886)
Add: Allow loading heightmaps from command-line (#11870)
Add: List_[scenario|heightmap] and load_[scenario|height] console commands (#11867)
Add: Latvian Lats currency (#11691)
Add: Horizontal scroll for script debug log (#11597)
Add: GUI options to select sprite font and AA mode for all fonts (#11593)
Add: Website button for basesets in Game Options window, the Game Script settings window and AI settings window (#11512)
Add: [Emscripten] Support for bootstrapping (#11109)
Add: Hotkey to focus town / industry directory filter box (#11030)
Add: Maximum number of companies allowed to the client list (#10523)
Add: Use specific error message when vehicle cannot go to station/waypoint (#10494)
Add: Show NewGRF name in NewGRF-created errors (#10457)
Add: Alternative setting for right-click close window option to exclude pinned windows (#10204)
Add: Allow autoreplace with same model vehicle (#7729)
Add: [NewGRF] Allow inspection of road tiles and airports (#11282, #11323)
Add: [NewGRF] Station variable 6B to get extended station id of nearby tiles (#10953)
Add: [NewGRF] String code "9A 21" to display force from textstack (#10782)
Add: [NewGRF] Station property 1C/1D to set name/classname (#10672)
Add: [Script] Optional filter parameter to ScriptXXXList constructors (#11698,#11663)
Add: [Script] AI/GS Time Mode to choose between economy (default) and calendar time (#11603)
Add: [Script] Allow to set max loan for each company separately (#11224)
Add: [Script] GSIndustry.GetConstructionDate() method (#11145)
Add: [Script] Game script control of industry production level and news messages (#11141)
Add: [Script] GSAsyncMode to set async mode of gamescript commands (#10913)
Add: [Script] GSCompanyMode::IsValid and IsDeity, and enforce valid company/deity mode where applicable (#10536, #10529)
Add: [Script] Allow GS to found town with random road layout (#10442)
Add: [Script] Create own Randomizer per instance (#10349)
Change: Better handle different GUI sizes for most windows, and squash inconsistencies between windows
Change: Allow configuring AI slots above the current maximum number of competitors (#11961)
Change: Forcefully enable prefixing logs with date (#11930)
Change: Position error window closer to cursor on large screens (#11923)
Change: Only open story-book in center when a GS does it (#11916)
Change: Rebrand Cheats as Sandbox Options (#11874)
Change: Make smooth-scrolling based on actual time (#11865)
Change: Set smooth-scrolling on by default (#11860)
Change: Disable building rail infrastructure if train build limit is zero (#11847)
Change: Invalidate music volume when restarting music playback on Windows (#11836)
Change: Make street lights transparent with houses (#11828)
Change: Redesign script debug window (#11782)
Change: Reorganize Settings menu items (#11683)
Change: Set amount of smoke/sparks to "realistic" by default (#11624)
Change: Show a message in livery window if vehicle type has no groups (#11617)
Change: Add distinct tooltips for vehicle group colour schemes (#11617)
Change: Move colour selection dropdowns to bottom of window (#11617)
Change: Support custom transparency remaps with 32bpp blitters (#11616)
Change: Make "middle" the default stopping location for trains in platforms (#11605)
Change: Scale sprites to requested highest resolution level (#11600)
Change: Allow opening multiple script debug windows by holding Ctrl (#11592)
Change: Don't show scoring year in high score table (#11546)
Change: Revert pressed-button content shifting introduced in r2161 (#11542)
Change: Show rating in station list even with no cargo waiting (#11540)
Change: Hide unused cargos from vehicle cargo filter (#11533)
Change: Don't restart playback when toggling playlist shuffle (#11504)
Change: Increase finance window lines (and underlines) with interface scale (#11459)
Change: Move baseset missing/corrupted files label to list item (#11455)
Change: Add horizontal scrollbar to Industry Directory window (#11434)
Change: Improve layout of airport, dock, object, road/tram stop, train station pickers (#11430)
Change: Display cargo lists in sorted cargo order (#11383)
Change: Link houses production on industry chain graph by TPE_PASSENGERS or TPE_MAIL cargo (#11378)
Change: Passenger subsidies are generated for any TPE_PASSENGER cargo type (#11378)
Change: Towns generate cargo based on town production effect (#11378)
Change: Always allow expanding towns in Scenario Editor to build new roads (#11377)
Change: Don't set vehicle on time if timetable not started (#11359)
Change: Store station blocked/wires/pylons flags in map (#11337)
Change: Recover when possible from crashes during a crash (#11238)
Change: Store crash logs in JSON format (#11232)
Change: Remove autosave from settings window; it is already in the Game Options (#11218)
Change: Enable "Forbid 90 degree turns" setting by default (#11160)
Change: Do not allow mixing road/tram types in powered road type list (#11148)
Change: Only show platform stopping location in orders when other than default (#11102)
Change: Autorail / autoroad tools can start dragging from invalid tiles (#11089)
Change: Only allow buying Exclusive Transport Rights when no one has them (#11076)
Change: Remove currency code/symbol suffix from language files (#11061)
Change: Add separate setting for server sent commands per frame limit (#11023)
Change: Cargo flow legend only shows defined cargo (#10872)
Change: Use "Via-Destination-Source" as default station cargodist display (#10851)
Change: Preserve orders and related settings where possible when moving engines around in a train (#10799)
Change: Standardise unit conversions and allow decimal places (#10795)
Change: Use separate names for default stations/roadstops (#10786)
Change: [MacOS] Require at least 10.15 to run the game (#10745)
Change: Hide all variants from UI when (display) parent is hidden (#10708)
Change: Split Game options into General, Graphics and Sound tabs (#10674)
Change: Extend entity override manager and station spec lists to support 16 bit IDs (#10672)
Change: Base autosaves intervals on real time (instead of game time) (#10655)
Change: Allow overbuilding station and waypoint tiles (#10618)
Change: Use realtime for Linkgraph update settings (#10610)
Change: Make tick length 27 milliseconds (#10607)
Change: Increase max cargo age and let min cargo payment approach zero (#10596)
Change: Show buy company dialog window even when playing in the AI company (#10459)
Change: Use HTTPS for content-service connections (#10448)
Change: Big UFO disaster targets current location of a random train (#10290)
Change: Remove land generator setting from World Generation GUI (#10093)
Change: Build signals to the next junction when dragging regardless of the Ctrl state (#9637)
Change: Allow dedicated server to use threaded saves (#10787)
Change: [NewGRF] Increase vehicle random data from 8 to 16 bits (#10701)
Change: [NewGRF] Read Action 3 IDs as extended-bytes for all features (#10672)
Change: [NewGRF] Make Action 3 debug messages more consistent (#10672)
Change: [NewGRF] Extend callback 161 (engine name) with bit 0x22 for context 'Autoreplace - Vehicles in use' (#10666)
Change: [Script] Replace easy/medium/hard values with default value (#11959)
Change: [Script] Limit total script ops that can be consumed by a list valuate (#11670)
Change: [Script] Allow GS access to ScriptGroup, ScriptGameSettings.IsDisabledVehicleType, more ScriptCompany and more ScriptOrder functions (#10642)
Change: [Script] Improve ScriptText validation error messages (#10545)
Change: [Script] Restore support of {RAW_STRING} in ScriptText (#10492)
Change: [Script] Validate ScriptText parameters type and amount (#10492)
Change: [Script] Automate the ScriptObject reference counting (#10492)
Change: [Script] Extract params info from GS strings (#10492)
Change: [Script] A ScriptText with too many parameters is now a fatal error (#10483)
Change: [Script] Log AI/GS Squirrel crashes in white text for readability (#10375)
Fix #11918: Houses should only build next to road stops, not any station type (#11919)
Fix #11827: Make text layouter aware of ligatures (#11831)
Fix #11752: Characters could be repeated when wrapping multi-line text (#11761)
Fix #11748: Decreasing service interval value sufficiently would result in it wrapping around (#11749)
Fix #11629: Crash when getting the nearest town for rotated airports (#11631)
Fix #11516: Adjust window size by interface scale during ReInit (#11517)
Fix #11515: Changing interface scale could have unintended effects on zoom level (#11615)
Fix #11442: "Default" colour in group colour window is not updated when changing master colour (#11614)
Fix #11437: Flipped shorter rail vehicles disappear in windows (#11446)
Fix #11413: Incorrect sorting by industry production (#11414)
Fix #11407: Don't steal focus from dropdown menus (#11484)
Fix #11402: Make string filter locale-aware (#11426)
Fix #11329: Don't assert vehicle list length is non-zero when only asked to set string parameter (#11330)
Fix #11315: Sort industries and cargoes by name in industry chain window (#11317)
Fix #11307: Incorrect GroupStatistics after selling leading wagon (#11311)
Fix #11261: Airport menu selectability after closing window on a class with no available airports (#11344)
Fix #11230: Sort by button in group list window could be misaligned (#11231)
Fix #11215: Assert in NewGRF parameters window (manual parameter mode) (#11217)
Fix #11203: [Linux] Crash when editing CJK characters in edit box (#11204)
Fix #11180: Aircraft crashes could point to the wrong tile (#11184)
Fix #11164: Don't create duplicate town names when using 'Many random towns' in the scenario editor (#11165)
Fix #11162: Second company colour was not consistently applied to articulated vehicles (#11163)
Fix #11115: Focus the abandon game/exit game windows (#11125)
Fix #11096: Increase priority of error and confirmation windows (#11104)
Fix #11087: Disable base graphics/sound dropdown outside main menu (#11091)
Fix #11054: Prevent translation of currency codes (#11061)
Fix #11026: Use real engine name instead of default name for filtering (#11033)
Fix #10982: No help text for gamelog command (#10984)
Fix #10880: Crash in object window due to incorrect parameter order (#10881)
Fix #10868: Crash when Script tries to load large savegame data (#11029)
Fix #10811: Allow dragging vehicle in depot to any free row (#11508)
Fix #10660: Sprite Font scale affected by viewport zoom level limits (#10668)
Fix #10619: Crash loading linkgraph for older savegames (#10620)
Fix #10600: 'Replace Vehicles' didn't show numbers >999 (#10680)
Fix #10578: Allow to select any version of AI/GS from GUI (#10604)
Fix #10522: Link graph tooltip vertical lines were not handled correctly (#10524)
Fix #10511: Don't search for depot every tick if one cannot be found (#11548)
Fix #10478: Clarify airport noise control setting texts (#11169)
Fix #10452: Prevent long stalls during river generation (#11544)
Fix #10430: Display chain window causing assert (#10431)
Fix #10343: Don't extend town-disallowed roadtypes (#10347)
Fix #10251: [MacOS] Screen looks blue-ish when using newer SDKs (#11207)
Fix #10222: Adjust line drawing algorithm (#10491)
Fix #10131: Actually cancel downloads when pressing cancel (#10485)
Fix #10118: Cycle through current signal group, not just path signals (#11798)
Fix #10439: [Script] Validate story page button colour, flags, cursor and vehicle type (#11892)
Fix #10438: [Script] Validate story page element type for ScriptStoryPage::NewElement (#11888)
Fix #9865: Removing files with the console always failed
Fix #9810: Rebuilding a through road stop costs money (#9852)
Fix #9722: Crash when pressing hotkeys early in world generation (#11858)
Fix #9697: Limit the default width of the Online Players window (#11936)
Fix #9642: Keep infrastructure totals when overbuilding road depots (#11229)
Fix #9545: Crash when all cargo types are disabled (#11432)
Fix #8846: When upgrading NewGRF presets, copy NewGRF parameters only if the NewGRF are compatible (#11348)
Fix #8253: Improve profit graph when having lots of money (#11915)
Fix #6377: Two tarballs with the same folder in them were considered as one (#11855)
Fix #5713: Ships could be sent to unreachable depots (#11768)
Fix #4575: Use Latin 'l' in English translation of zloty (#11090)
Fix #4415: Land info build date is also renovation date (#11759)
Fix: Display rank correctly with more than 15 companies in a league table (#11940)
Fix: Extra refit button when train/RV is in a depot (#11904)
Fix: Update server listing as offline when unexpected disconnect during refresh (#11891)
Fix: Horizontal scale of framerate window switched excessively (#11813)
Fix: [Linux] Various issues with resolutions and fullscreen in multi-display setups (#11778, #11779)
Fix: Build button text when train purchase window using "Engines" filter (#11755)
Fix: One-way state remained after removing road from road and tram tile (#11745)
Fix: Draw video driver info at the correct size and text wrap (#10716)
Fix: Language genders could not be applied to SCC_INDUSTRY_NAME (#11697)
Fix: Spurious cancellations of HTTP content downloads (#11668)
Fix: Calculation of initial engine age was inaccurate (#11660)
Fix: Prevent underflow if engine base life is less than 8 years (#11635)
Fix: Changing default livery did not propagate to group liveries (#11633)
Fix: Window width/height was doubly-scaled with automatic DPI switch (#11598)
Fix: Don't crash when saving a crashlog save with no main window open (#11586)
Fix: Prevent overflow when calculating max town noise (#11564)
Fix: Deleting towns did not check for waypoints referencing the town (#11513)
Fix: Invalidate playlist window when (un)shuffling playlist (#11504)
Fix: Restore original cargo legend 'blob' dimensions (#11480)
Fix: Extmidi did not move on to next song after playing ends (#11469)
Fix: Server password length in the UI was unnecessarily limited (#11408)
Fix: OpenTTD can fail to exit on an error due to mutex locks in threads (#11398)
Fix: Scale minimum width for server name by interface scale (#11381)
Fix: Server connection was not closed when relay window was closed (#11366)
Fix: Upgrading NewGRF presets could result in incomplete display of NewGRF parameters until restart (#11348)
Fix: Check for engine variant loops during NewGRF initialization (#11343)
Fix: Don't allow industries to produce invalid cargo (#11314)
Fix: Also apply cargo filters on shared groups in vehicle listing (#11294)
Fix: Only count distance traveled in vehicles for cargo payment (#11283)
Fix: Base cargo payment on load/unload tile, instead of station sign location (#11281)
Fix: Crash when opening a damaged base-graphics (#11275)
Fix: Trivial autoreplace of mixed cargo articulated engines (#11253)
Fix: [Emscripten] Config not saved on exit (#11248)
Fix: Inaccurate waiting cargo total in station window when using cargodist (#11213)
Fix: No fast forward in network was ensured only from GUI side (#11206)
Fix: Crash when not passing command-line parameter for -n (#11153)
Fix: [Bootstrap] Don't crash when failing to connect to content server (#11122)
Fix: Crash when failing to load a game into a dedicated server at startup (#11021)
Fix: Don't allow changing settings over the network that are marked as local settings (#11009)
Fix: Move no_http_content_downloads and use_relay_service to private settings (#10762)
Fix: Extra viewport could not be scrolled with right-click-close (#10644)
Fix: Specify units for value of share trading age setting (#10612)
Fix: Road type is not available before its introduction date (#10585)
Fix: Do not update a RV's Z-position when stationary while turning (#10570)
Fix: Don't (briefly) switch from title-only playlist on menu screen (#10553)
Fix: Reset content download progress to zero if falling back to TCP (#10485)
Fix: Make script goals work with the whole range of ClientIDs (#10435)
Fix: [NewGRF] Tile slope missing from road stops varact2 variable 0x42 (#11373)
Fix: [NewGRF] House class mappings were not reset between games (#11279)
Fix: [NewGRF] Profile didn't stop if there were no events yet (#10816)
Fix: [NewGRF] Support more than 256 stations/waypoints/roadstops per class (#10793)
Fix: [NewGRF] Var68 for station and roadstop was broken (#10784)
Fix: [NewGRF] Object and road stop ignore property handlers (#10525)
Fix: [Script] Apply random deviation to settings only at script start (#11944)
Fix: [Script] Improve ScriptText validation (#11721)
Fix: [Script] GSAdmin.Send() could generate invalid JSON (#11250)
Fix: [Script] Crash if squirrel compatibility scripts cannot be parsed (#11589)
Fix: [Script] Don't list unavailable road types for game scripts (#10585)
Fix: [Script] Game scripts were able to build with non-existing road types (#10539)
Fix: [Script] Inconsistent precondition failure return values (#10533)
Fix: [Script] Crash when companies disappear (#10529)
Fix: [Script] ScriptBase::Rand() return value could return negative values (#10443)
Fix: [Script] Incorrect value for GOAL_INVALID (#10436)
Fix: [Script] Extend Script::IsValidVehicle to check for primary vehicles (#10386)
Remove: "generation_seed" from config, as it was a write-only value (#11927)
Remove: Debug redirect over network (#11776)
Remove: Officially mark Vista as no longer supported (#11531)
Remove: OS/2 and SunOS ports (#11018, #11210)
Remove: Obsolete NewGRF text unprinting (#10884)
Remove: [Script] CONFIG_RANDOM from AddSetting flags (#11942)
13.4 (2023-07-29)
------------------------------------------------------------------------
Fix: Setting tree lines drawn incorrectly for RTL languages (#11070)
Fix #11043: Don't choose toolbar dropdown option if focus is lost (#11044)
Fix #10917: Pay loan interest before generating statistics (#11040)
Fix #11016: Use after free in network invalid packet error path (#11022)
Fix #10987: Double-close of dropdown stopped land-info tool working as default (#11000)
13.3 (2023-06-11)
------------------------------------------------------------------------
Fix: [Win32] use full monitor resolution for fullscreen (#10985)
13.2 (2023-06-10)
------------------------------------------------------------------------
Change: [Win32] position window in center of workspace of primary display (#10942)
Change: Automatically disable hardware acceleration when GPU driver crashed the game last attempt (#10928)
Change: [Linux] Default scroll mode to non-mouse-lock (#10920)
Change: Include font style in font name for Freetype (#10879)
Fix: Don't restore backed up vehicle name if it's no longer unique (#10979)
Fix #10975: Train name wrongly marked as unique when joining trains (#10976)
Fix: Crash when not even a single row fits for dropdowns on low resolution screens (#10934)
Fix: Crash with tooltip on low resolution screens (#10933)
Fix: Crash when window can't be placed on low resolution screens (#10932)
Fix #10502: Apply engine refit before attaching free wagons (#10926)
Fix: Wayland crash on startup due to Pango also using FontConfig (#10916)
Fix: When syncing width of GUI items, take padding into account (#10915)
Fix: Make dropdowns self-close when losing focus (#10912)
Fix: Land info window maximum width was not scaled (#10894)
Fix: Check max member count in squirrel classes (#10883)
Fix: Ask FontConfig for the face index when opening fonts (#10878)
Fix #10831: Level crossing parts left barred after crossing tile removal (#10874)
Fix: Rail waypoint selection window not closed when parent windows closed (#10873)
Fix #10846: [Script] Crash on trying to allocate an excessively large array (#10848)
Fix: [Win32] Text line breaking did not properly handle punctuation characters (#10775)
Fix: [Emscripten] Crash when saving games (#10758)
Fix: [Win32] Wrong multi-line text layout due to incorrect whitespace handling (#10752)
Fix #10741: Rail platforms left partially reserved after train crash (#10751)
Fix: Shaded engines in purchase list incorrectly shaded (#10736)
Fix #10735: [NewGRF] {POP_COLOUR} fails if string is drawn with extra flags (#10736)
Fix #8177: Ships with max speed overflow to near-zero speed (#10695)
Fix #10289: Don't silently fail when setting timetable start dates (#10690)
Fix #8302: Improve "Maintenance intervals are in percents" helptext (#10686)
Fix #10665: "No vehicles are available yet" message did not appear correctly on non-temperate climates (#10673)
Fix #10630: Don't allow shifting service date earlier than year 0 (#10643)
Fix #10637, #10638: Incorrect water infrastructure totals when building certain object types (#10639, #10640)
Fix: Abort loading savegame if road vehicle is on invalid road type (#10622)
13.1 (2023-04-10)
------------------------------------------------------------------------
Add: [NewGRF] Engine name callback for nested variants. (#10399)
Fix: Improve main toolbar tooltips (#10616)
Fix: [NewGRF] Additional validation for Action3 (+others) (#10601)
Fix: Clear button for editbox didn't take account of padding (#10583)
Fix: [Script] Access to enum/consts defined outside of main.nut (#10573)
Fix #10568: Bogus warning when loading a save with a NewGRFs on dedicated servers (#10572)
Fix #10554: Crash when scrolling in the autoreplace window with collapsed variants (#10555)
Fix: Network server highlight invisible with RTL languages. (#10551)
Fix: Client name was not being used as company manager name (#10535)
Fix: Prevent road vehicles on crossing from crashing into the side of a train (#10496)
Fix #10477: [macOS] Calculation for window sizes when using custom fonts was being rounded incorrectly (#10489)
Fix #10486: Crash in debug window when GS started before AIs (#10487)
Fix #10469: [Script] Negative numbers in League Table window were sorted incorrectly (#10471)
Fix #10465: Crash on timeout if user never enters a password for server (#10466)
Fix #10280, #10461: Crash on opening town windows as a spectator (#10462)
Fix #10059: Script config values stored in the config file could cause crashes (#10444)
13.0 (2023-02-05)
------------------------------------------------------------------------
Change #10077: Make maximum loan a positive multiple of the loan interval (#10355)
Fix #10361: [Script] Don't try to give saved data to a dead script (#10433)
Fix #10419: Water infrastructure accounting when building ship depots and docks (#10432)
13.0-RC2 (2023-01-28)
------------------------------------------------------------------------
Feature: Press Ctrl to build a diagonal area of trees (#10342)
Feature: Set a custom number of industries in map generation window (#10340)
Change: Display font status as aa/noaa instead of true/false (#10352)
Fix: [Script] Improved API documentation for scripts (#10413, #10412)
Fix #10255: Reduce basic thickness of linkgraph GUI lines (#10410)
Fix #10220: Don't select unselectable engine as default (#10404)
Fix #10395: When loading old saves, don't forcibly bar level crossings (#10400)
Fix #10377: Bad sorting of rail vehicles when primary variant is missing (#10378)
Fix #10368: Server restarting game caused clients to hit assertion (#10369)
Fix #10362: NewGRF bridges without speed limits (#10365)
Fix #10363: CargoDist setting helptext shouldn't suggest symmetric distribution for diamonds in subtropic (#10364)
Fix: [Script] Switch to OWNER_TOWN prevented OWNER_DEITY test during industry prospecting (#10360)
Fix #10009: Bad overflow protection when taking out loans (#10359)
Fix #9865: Removing files with the console always failed (#10357)
Fix #10057: FallbackParagraphLayout fails to properly wrap (#10356)
Fix #10177: Company list password padlock showed after switching to single player (#10354)
Fix: Various Wide River issues (#10348)
Fix: Link variants to parents when finalising engines (#10346)
Fix #10333: Only show industry prospecting errors to local company (#10338)
Fix #10335: Set initial scrollbar count for object GUI (#10336)
Fix #10331: Starting new company during load must happen after AI start (#10332)
Fix #10309: [SDL] Uninitialized width and height when turning off full screen (#10328)
Fix #10032: Capacities of articulated vehicles in build window (#10326)
Fix: Improve handling of corrupt NewGRF or image files (#10321, #10316)
Fix: [NewGRF] Don't assume engclass 2 should be elrail (#10315)
Fix: [Script] AIGroup.GetProfitLastYear could get values different than those displayed in GUI (#10227)
Fix #10304: [Scripts] Don't start GS in intro game (#10305)
Fix: [Script] Copy compat files for version 13 (#10303)
13.0-RC1 (2023-01-01)
------------------------------------------------------------------------
Feature: 'font' console command to configure fonts within game (#10278)
Feature: Ctrl-click to bulk edit timetable speeds/waiting times (#10265)
Feature: [NewGRF] Vehicle variants in expandable purchase list (#10220)
Feature: Expand all towns in the scenario editor (#10215)
Add: [NewGRF] Slope-aware and roadtype-specific one-way sprites (#10282)
Change: Display text files in black (#10291)
Change: Make vehicle list dropdown buttons resize to fit strings (#10286)
Change: [NewGRF] Support flipping shorter engines without explicit support (#10262)
Change: Separate ground sprite from foundation sprite offsets (#10256)
Change: Vertically centre sprite font relative to TrueType font (#10254)
Change: [macOS] Set minimum macOS version to 10.13 (#10253)
Change: Use lowered not disabled widget for current vehicle details tab (#10252)
Change: Various improvements to NewGRF sprite aligner (#10249)
Change: reset_engines console command now rerandomises introduction dates and reliability (#10220)
Change: Show error message on failed industry prospecting (#10202)
Fix: Local authority window rating list height ignored icon sizes (#10285)
Fix #10150: Town signs could be truncated when using custom fonts (#10283)
Fix #8971: Resize QueryStrings with interface scale change (#10281)
Fix #10274: Crash when rescanning scripts with GS selected (#10276)
Fix #10151: Use smaller padding for signs (#10272)
Fix #10263: [Script] Restore tile validation for commands (#10269)
Fix: Missing scrollbar for rail/roadtype dropdowns (#10264)
Fix #10260: Incorrect rect height drawing image in vehicle details (#10261)
Fix #10257: Incorrect catenary position on sloped bridge heads (#10258)
Fix: Vertically centre chat prompt (#10250)
Fix #10214: League and graph buttons in toolbar did not have a default action (#10246)
Fix #10242: Allow a space for text shadow when clipping text (#10243)
Fix #10206: Fully disable scripts in intro game (#10241)
Fix #10218: Don't try to create river tiles along incorrect slopes (#10235)
Fix #10208: [NewGRF] Allow using a specific underlay for road/tram tunnels (#10233)
Fix #10224: Don't change fast-forward mode while saving (#10230)
Fix #10147: Sound effect volume slider no longer set volume (#10228)
Fix #10223: Crash when vehicle cloning fails on order cloning (#10225)
Fix: Maximum space for engine preview image was never scaled (#10219)
Fix #10216: Crash when upgrading savegame with crashed vehicles (#10217)
Fix #10212: [Script] Nested ScriptAccounting scopes not restored properly (#10213)
Fix #10114: Incorrect drag-highlight position with non-power-of-2 scaling (#10211)
Fix #10198: Rearrange Intro GUI to make button rows narrower (#10203)
Fix: Missing extra padding when drawing tooltip text (#10201)
Fix: Bad alignment of button icons when using the original baseset (#10200)
Fix: Signal icons incorrectly positioned in UI (#10199)
Fix #10021: Object GUI resized when switching between different objects (#10196)
Fix #9720: Delay start of GS/AI to after loading of savegame (#9745)
13.0-beta2 (2022-11-27)
------------------------------------------------------------------------
Feature: Allow AI/GS to be fully modified in scenario editor (#10152)

@ -83,5 +83,5 @@ else()
endif()
if(HAVE_CXX_ATOMICS_WITH_LIB OR HAVE_CXX_ATOMICS64_WITH_LIB)
target_link_libraries(${OPENTTD_LIB} atomic)
target_link_libraries(openttd atomic)
endif()

@ -4,6 +4,25 @@
#
macro(compile_flags)
if(MSVC)
if(VCPKG_TARGET_TRIPLET MATCHES "-static" AND NOT VCPKG_TARGET_TRIPLET MATCHES "-md")
# Switch to MT (static) instead of MD (dynamic) binary
# For MSVC two generators are available
# - a command line generator (Ninja) using CMAKE_BUILD_TYPE to specify the
# configuration of the build tree
# - an IDE generator (Visual Studio) using CMAKE_CONFIGURATION_TYPES to
# specify all configurations that will be available in the generated solution
list(APPEND MSVC_CONFIGS "${CMAKE_BUILD_TYPE}" "${CMAKE_CONFIGURATION_TYPES}")
# Set usage of static runtime for all configurations
foreach(MSVC_CONFIG ${MSVC_CONFIGS})
string(TOUPPER "CMAKE_CXX_FLAGS_${MSVC_CONFIG}" MSVC_FLAGS)
string(REPLACE "/MD" "/MT" ${MSVC_FLAGS} "${${MSVC_FLAGS}}")
string(TOUPPER "CMAKE_C_FLAGS_${MSVC_CONFIG}" MSVC_FLAGS)
string(REPLACE "/MD" "/MT" ${MSVC_FLAGS} "${${MSVC_FLAGS}}")
endforeach()
endif()
# "If /Zc:rvalueCast is specified, the compiler follows section 5.4 of the
# C++11 standard". We need C++11 for the way we use threads.
add_compile_options(/Zc:rvalueCast)
@ -16,13 +35,6 @@ macro(compile_flags)
endif()
endif()
# Our strings are UTF-8.
if(MSVC)
add_compile_options(/utf-8)
else()
add_compile_options(-finput-charset=utf-8)
endif()
# Add some -D flags for Debug builds. We cannot use add_definitions(), because
# it does not appear to support the $<> tags.
add_compile_options(
@ -41,7 +53,6 @@ macro(compile_flags)
"$<$<CONFIG:Debug>:-Wa,-mbig-obj>" # Switch to pe-bigobj-x86-64 as x64 Debug builds push pe-x86-64 to the limits (linking errors with ASLR, ...)
)
endif()
add_compile_options(-Wno-stringop-overflow) # This warning false-positives on some MinGW versions so just turn it off
endif()
# Prepare a generator that checks if we are not a debug, and don't have asserts
@ -49,13 +60,9 @@ macro(compile_flags)
#set(IS_STABLE_RELEASE "$<AND:$<NOT:$<CONFIG:Debug>>,$<NOT:$<BOOL:${OPTION_USE_ASSERTS}>>>")
if(MSVC)
add_compile_options(
/W3
#/w34100 # 'identifier' : unreferenced formal parameter
/w34189 # 'identifier' : local variable is initialized but not referenced
)
if(MSVC_VERSION GREATER 1929 AND MSVC_VERSION LESS 1937 AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# Starting with version 19.30 (fixed in version 19.37), there is an optimisation bug, see #9966 for details
add_compile_options(/W3)
if(MSVC_VERSION GREATER 1929 AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# Starting with version 19.30, there is an optimisation bug, see #9966 for details
# This flag disables the broken optimisation to work around the bug
add_compile_options(/d2ssa-rse-)
endif()
@ -74,7 +81,6 @@ macro(compile_flags)
-Wformat=2
-Winit-self
"$<$<COMPILE_LANGUAGE:CXX>:-Wnon-virtual-dtor>"
"$<$<COMPILE_LANGUAGE:CXX>:-Wsuggest-override>"
# Often parameters are unused, which is fine.
-Wno-unused-parameter
@ -86,6 +92,8 @@ macro(compile_flags)
# break anything. So disable strict-aliasing to make the
# compiler all happy.
-fno-strict-aliasing
)
if(OPTION_TRIM_PATH_PREFIX)
@ -100,6 +108,22 @@ macro(compile_flags)
endif()
endif(NOT CMAKE_BUILD_TYPE)
# When we are a stable release (Release build + USE_ASSERTS not set),
# assertations are off, which trigger a lot of warnings. We disable
# these warnings for these releases.
#if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# add_compile_options(
# "$<${IS_STABLE_RELEASE}:-Wno-unused-variable>"
# "$<${IS_STABLE_RELEASE}:-Wno-unused-but-set-parameter>"
# "$<${IS_STABLE_RELEASE}:-Wno-unused-but-set-variable>"
# )
#else (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# add_compile_options(
# "$<${IS_STABLE_RELEASE}:-Wno-unused-variable>"
# "$<${IS_STABLE_RELEASE}:-Wno-unused-parameter>"
# )
#endif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# Ninja processes the output so the output from the compiler
# isn't directly to a terminal; hence, the default is
# non-coloured output. We can override this to get nicely
@ -136,13 +160,6 @@ macro(compile_flags)
# and of course they both warn when the other compiler is happy
"$<$<COMPILE_LANGUAGE:CXX>:-Wno-redundant-move>"
)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11)
add_compile_options(
# GCC >= 11 has false positives if operator new is inlined but operator delete isn't, or vice versa
"-Wno-mismatched-new-delete"
)
endif()
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")

@ -1,13 +1,16 @@
# Macro which contains all bits and pieces to create a single grf file based
# on NFO and PNG files.
#
# create_grf_command(NFO_SOURCE_FILES nfo_file1 ... PNG_SOURCE_FILES png_file1 ...)
# create_grf_command()
#
function(create_grf_command)
cmake_parse_arguments(GRF "" "" "NFO_SOURCE_FILES;PNG_SOURCE_FILES" ${ARGN})
set(EXTRA_PNG_SOURCE_FILES ${ARGV})
get_filename_component(GRF_SOURCE_FOLDER_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
get_filename_component(GRF_BINARY_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../${GRF_SOURCE_FOLDER_NAME}.grf ABSOLUTE)
file(GLOB_RECURSE GRF_PNG_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.png)
file(GLOB_RECURSE GRF_NFO_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.nfo)
set(GRF_PNG_SOURCE_FILES ${GRF_PNG_SOURCE_FILES} ${EXTRA_PNG_SOURCE_FILES})
# Copy over all the PNG files to the correct folder
foreach(GRF_PNG_SOURCE_FILE IN LISTS GRF_PNG_SOURCE_FILES)
@ -25,13 +28,12 @@ function(create_grf_command)
list(APPEND GRF_PNG_BINARY_FILES ${GRF_PNG_BINARY_FILE})
endforeach()
add_custom_command(OUTPUT ${GRF_BINARY_FILE} ${GRF_BINARY_FILE}.hash
add_custom_command(OUTPUT ${GRF_BINARY_FILE}
COMMAND ${CMAKE_COMMAND}
-DGRF_SOURCE_FOLDER=${CMAKE_CURRENT_SOURCE_DIR}
-DGRF_BINARY_FILE=${GRF_BINARY_FILE}
-DNFORENUM_EXECUTABLE=${NFORENUM_EXECUTABLE}
-DGRFCODEC_EXECUTABLE=${GRFCODEC_EXECUTABLE}
-DGRFID_EXECUTABLE=${GRFID_EXECUTABLE}
-P ${CMAKE_SOURCE_DIR}/cmake/scripts/CreateGRF.cmake
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/cmake/scripts/CreateGRF.cmake
DEPENDS ${GRF_PNG_BINARY_FILES}

@ -3,15 +3,20 @@
# 'ctest'. The first is prefered, as it is more verbose, and takes care of
# dependencies correctly.
#
# create_regression(file1 ...)
# create_regression()
#
macro(create_regression)
set(REGRESSION_SOURCE_FILES ${ARGN})
# Find all the files in the regression folder; they need to be copied to the
# build folder before we can run the regression
file(GLOB_RECURSE REGRESSION_SOURCE_FILES ${CMAKE_SOURCE_DIR}/regression/*)
foreach(REGRESSION_SOURCE_FILE IN LISTS REGRESSION_SOURCE_FILES)
string(REPLACE "${CMAKE_SOURCE_DIR}/regression/" "" REGRESSION_SOURCE_FILE_NAME "${REGRESSION_SOURCE_FILE}")
string(CONCAT REGRESSION_BINARY_FILE "${CMAKE_BINARY_DIR}/ai/" "${REGRESSION_SOURCE_FILE_NAME}")
if("${REGRESSION_SOURCE_FILE_NAME}" STREQUAL "regression.cfg")
continue()
endif()
add_custom_command(OUTPUT ${REGRESSION_BINARY_FILE}
COMMAND ${CMAKE_COMMAND} -E copy
${REGRESSION_SOURCE_FILE}
@ -23,36 +28,59 @@ macro(create_regression)
list(APPEND REGRESSION_BINARY_FILES ${REGRESSION_BINARY_FILE})
endforeach()
get_filename_component(REGRESSION_TEST_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
# Copy the regression configuration in a special folder, so all autogenerated
# folders end up in the same place after running regression.
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/regression/regression.cfg
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/regression/regression.cfg
${CMAKE_BINARY_DIR}/regression/regression.cfg
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/regression/regression.cfg
COMMENT "Copying ${REGRESSION_SOURCE_FILE_NAME} regression file"
)
list(APPEND REGRESSION_BINARY_FILES ${CMAKE_BINARY_DIR}/regression/regression.cfg)
# Create a new target which copies regression files
add_custom_target(regression_${REGRESSION_TEST_NAME}_files
# Create a new target which copies all regression files
add_custom_target(regression_files
ALL # this is needed because 'make test' doesn't resolve dependencies, and otherwise this is never executed
DEPENDS
${REGRESSION_BINARY_FILES}
)
add_dependencies(regression_files regression_${REGRESSION_TEST_NAME}_files)
add_custom_target(regression_${REGRESSION_TEST_NAME}
COMMAND ${CMAKE_COMMAND}
-DOPENTTD_EXECUTABLE=$<TARGET_FILE:openttd>
-DEDITBIN_EXECUTABLE=${EDITBIN_EXECUTABLE}
-DREGRESSION_TEST=${REGRESSION_TEST_NAME}
-P "${CMAKE_SOURCE_DIR}/cmake/scripts/Regression.cmake"
DEPENDS openttd regression_${REGRESSION_TEST_NAME}_files
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Running regression test ${REGRESSION_TEST_NAME}"
)
enable_testing()
# Also make sure that 'make test' runs the regression
add_test(NAME regression_${REGRESSION_TEST_NAME}
COMMAND ${CMAKE_COMMAND}
-DOPENTTD_EXECUTABLE=$<TARGET_FILE:openttd>
-DEDITBIN_EXECUTABLE=${EDITBIN_EXECUTABLE}
-DREGRESSION_TEST=${REGRESSION_TEST_NAME}
-P "${CMAKE_SOURCE_DIR}/cmake/scripts/Regression.cmake"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
# Find all the tests we have, and create a target for them
file(GLOB REGRESSION_TESTS ${CMAKE_SOURCE_DIR}/regression/*)
foreach(REGRESSION_TEST IN LISTS REGRESSION_TESTS)
get_filename_component(REGRESSION_TEST_NAME "${REGRESSION_TEST}" NAME)
if("${REGRESSION_TEST_NAME}" STREQUAL "regression.cfg")
continue()
endif()
add_custom_target(regression_${REGRESSION_TEST_NAME}
COMMAND ${CMAKE_COMMAND}
-DOPENTTD_EXECUTABLE=$<TARGET_FILE:openttd>
-DEDITBIN_EXECUTABLE=${EDITBIN_EXECUTABLE}
-DREGRESSION_TEST=${REGRESSION_TEST_NAME}
-P "${CMAKE_SOURCE_DIR}/cmake/scripts/Regression.cmake"
DEPENDS openttd regression_files
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Running regression test ${REGRESSION_TEST_NAME}"
)
# Also make sure that 'make test' runs the regression
add_test(NAME regression_${REGRESSION_TEST_NAME}
COMMAND ${CMAKE_COMMAND}
-DOPENTTD_EXECUTABLE=$<TARGET_FILE:openttd>
-DEDITBIN_EXECUTABLE=${EDITBIN_EXECUTABLE}
-DREGRESSION_TEST=${REGRESSION_TEST_NAME}
-P "${CMAKE_SOURCE_DIR}/cmake/scripts/Regression.cmake"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
list(APPEND REGRESSION_TARGETS regression_${REGRESSION_TEST_NAME})
endforeach()
add_dependencies(regression regression_${REGRESSION_TEST_NAME})
# Create a new target which runs the regression
add_custom_target(regression
DEPENDS ${REGRESSION_TARGETS})
endmacro()

@ -66,7 +66,7 @@ macro(test_compile_libbfd var libs)
endif ()
if (BFD_FOUND OR UNIX)
if (NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" OR OPTION_NO_LINE_TABLE))
if (NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
add_compile_options(-gline-tables-only)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -gline-tables-only")

@ -2,7 +2,6 @@
#
find_program(GRFCODEC_EXECUTABLE grfcodec)
find_program(GRFID_EXECUTABLE grfid)
find_program(NFORENUM_EXECUTABLE nforenum)
include(FindPackageHandleStandardArgs)
@ -10,6 +9,5 @@ find_package_handle_standard_args(Grfcodec
FOUND_VAR GRFCODEC_FOUND
REQUIRED_VARS
GRFCODEC_EXECUTABLE
GRFID_EXECUTABLE
NFORENUM_EXECUTABLE
)

@ -23,58 +23,27 @@ install(TARGETS openttd
COMPONENT Runtime
)
if (NOT EMSCRIPTEN)
# Emscripten embeds these files in openttd.data.
# See CMakeLists.txt in the root.
install(DIRECTORY
${CMAKE_BINARY_DIR}/lang
${CMAKE_BINARY_DIR}/baseset
${CMAKE_BINARY_DIR}/ai
${CMAKE_BINARY_DIR}/game
${CMAKE_SOURCE_DIR}/bin/scripts
DESTINATION ${DATA_DESTINATION_DIR}
COMPONENT language_files
REGEX "ai/[^\.]+$" EXCLUDE # Ignore subdirs in ai dir
)
else()
install(FILES
${CMAKE_BINARY_DIR}/openttd.js
${CMAKE_BINARY_DIR}/openttd.wasm
${CMAKE_BINARY_DIR}/openttd.data
DESTINATION ${BINARY_DESTINATION_DIR}
COMPONENT Runtime
)
endif()
install(DIRECTORY
${CMAKE_BINARY_DIR}/lang
${CMAKE_BINARY_DIR}/baseset
${CMAKE_BINARY_DIR}/ai
${CMAKE_BINARY_DIR}/game
${CMAKE_SOURCE_DIR}/bin/scripts
DESTINATION ${DATA_DESTINATION_DIR}
COMPONENT language_files
REGEX "ai/[^\.]+$" EXCLUDE # Ignore subdirs in ai dir
)
install(FILES
${CMAKE_SOURCE_DIR}/COPYING.md
${CMAKE_SOURCE_DIR}/README.md
${CMAKE_SOURCE_DIR}/CREDITS.md
${CMAKE_SOURCE_DIR}/CONTRIBUTING.md
${CMAKE_SOURCE_DIR}/changelog.txt
${CMAKE_SOURCE_DIR}/docs/multiplayer.md
${CMAKE_SOURCE_DIR}/known-bugs.txt
${CMAKE_SOURCE_DIR}/jgrpp-changelog.md
DESTINATION ${DOCS_DESTINATION_DIR}
COMPONENT docs)
install(FILES
${CMAKE_SOURCE_DIR}/docs/admin_network.md
${CMAKE_SOURCE_DIR}/docs/debugging_desyncs.md
${CMAKE_SOURCE_DIR}/docs/desync.md
${CMAKE_SOURCE_DIR}/docs/directory_structure.md
${CMAKE_SOURCE_DIR}/docs/eints.md
${CMAKE_SOURCE_DIR}/docs/game_coordinator.md
${CMAKE_SOURCE_DIR}/docs/linkgraph.md
${CMAKE_SOURCE_DIR}/docs/logging_and_performance_metrics.md
${CMAKE_SOURCE_DIR}/docs/multiplayer.md
${CMAKE_SOURCE_DIR}/docs/savegame_format.md
${CMAKE_SOURCE_DIR}/docs/symbol_server.md
${CMAKE_SOURCE_DIR}/docs/obg_format.txt
${CMAKE_SOURCE_DIR}/docs/obm_format.txt
${CMAKE_SOURCE_DIR}/docs/obs_format.txt
DESTINATION ${DOCS_DESTINATION_DIR}/docs
COMPONENT docs)
# A Linux manual only makes sense when using FHS. Otherwise it is a very odd
# file with little context to what it is.
if(OPTION_INSTALL_FHS)
@ -92,7 +61,7 @@ if(OPTION_INSTALL_FHS)
COMPONENT manual)
endif()
if(UNIX AND NOT APPLE AND NOT EMSCRIPTEN)
if(UNIX AND NOT APPLE)
install(DIRECTORY
${CMAKE_BINARY_DIR}/media/icons
${CMAKE_BINARY_DIR}/media/pixmaps
@ -171,10 +140,10 @@ elseif(WIN32)
set(CPACK_PACKAGE_FILE_NAME "openttd-#CPACK_PACKAGE_VERSION#-windows-${CPACK_SYSTEM_NAME}")
if(DEFINED ENV{AZURE_CODESIGN_PROFILE_NAME})
if(WINDOWS_CERTIFICATE_COMMON_NAME)
add_custom_command(TARGET openttd
POST_BUILD
COMMAND "${CMAKE_SOURCE_DIR}/os/windows/sign.bat" "${BINARY_DESTINATION_DIR}"
COMMAND "${CMAKE_SOURCE_DIR}/os/windows/sign.bat" "$<TARGET_FILE:openttd>" "${WINDOWS_CERTIFICATE_COMMON_NAME}"
)
endif()
elseif(UNIX)
@ -194,7 +163,7 @@ elseif(UNIX)
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(LSB_RELEASE_ID)
if(LSB_RELEASE_ID STREQUAL "Ubuntu" OR LSB_RELEASE_ID STREQUAL "Debian" OR LSB_RELEASE_ID STREQUAL "Linuxmint")
if(LSB_RELEASE_ID STREQUAL "Ubuntu" OR LSB_RELEASE_ID STREQUAL "Debian")
execute_process(COMMAND ${LSB_RELEASE_EXEC} -cs
OUTPUT_VARIABLE LSB_RELEASE_CODENAME
OUTPUT_STRIP_TRAILING_WHITESPACE

@ -8,13 +8,13 @@ function(link_package NAME)
# which (later) cmake considers to be an error. Work around this with by stripping the incoming string.
if(LP_TARGET AND TARGET ${LP_TARGET})
string(STRIP "${LP_TARGET}" LP_TARGET)
target_link_libraries(${OPENTTD_LIB} ${LP_TARGET})
target_link_libraries(openttd ${LP_TARGET})
message(STATUS "${NAME} found -- -DWITH_${UCNAME} -- ${LP_TARGET}")
else()
string(STRIP "${${NAME}_LIBRARY}" ${NAME}_LIBRARY)
string(STRIP "${${NAME}_LIBRARIES}" ${NAME}_LIBRARIES)
include_directories(${${NAME}_INCLUDE_DIRS} ${${NAME}_INCLUDE_DIR})
target_link_libraries(${OPENTTD_LIB} ${${NAME}_LIBRARIES} ${${NAME}_LIBRARY})
target_link_libraries(openttd ${${NAME}_LIBRARIES} ${${NAME}_LIBRARY})
message(STATUS "${NAME} found -- -DWITH_${UCNAME} -- ${${NAME}_INCLUDE_DIRS} ${${NAME}_INCLUDE_DIR} -- ${${NAME}_LIBRARIES} ${${NAME}_LIBRARY}")
endif()
elseif(LP_ENCOURAGED)

@ -57,10 +57,16 @@ function(set_options)
option(OPTION_DEDICATED "Build dedicated server only (no GUI)" OFF)
option(OPTION_INSTALL_FHS "Install with Filesystem Hierarchy Standard folders" ${DEFAULT_OPTION_INSTALL_FHS})
option(OPTION_USE_ASSERTS "Use assertions; leave enabled for nightlies, betas, and RCs" ON)
if(EMSCRIPTEN)
# Although pthreads is supported, it is not in a way yet that is
# useful for us.
option(OPTION_USE_THREADS "Use threads" OFF)
else()
option(OPTION_USE_THREADS "Use threads" ON)
endif()
option(OPTION_USE_NSIS "Use NSIS to create windows installer; enable only for stable releases" OFF)
option(OPTION_TOOLS_ONLY "Build only tools target" OFF)
option(OPTION_DOCS_ONLY "Build only docs target" OFF)
option(OPTION_ALLOW_INVALID_SIGNATURE "Allow loading of content with invalid signatures" OFF)
if (OPTION_DOCS_ONLY)
set(OPTION_TOOLS_ONLY ON PARENT_SCOPE)
@ -78,6 +84,7 @@ function(show_options)
message(STATUS "Option Dedicated - ${OPTION_DEDICATED}")
message(STATUS "Option Install FHS - ${OPTION_INSTALL_FHS}")
message(STATUS "Option Use assert - ${OPTION_USE_ASSERTS}")
message(STATUS "Option Use threads - ${OPTION_USE_THREADS}")
message(STATUS "Option Use NSIS - ${OPTION_USE_NSIS}")
if(OPTION_SURVEY_KEY)
@ -85,11 +92,6 @@ function(show_options)
else()
message(STATUS "Option Survey Key - NOT USED")
endif()
if(OPTION_ALLOW_INVALID_SIGNATURE)
message(STATUS "Option Allow Invalid Signature - USED")
message(WARNING "Ignoring invalid signatures is a security risk! Use with care!")
endif()
endfunction()
# Add the definitions for the options that are selected.
@ -101,6 +103,10 @@ function(add_definitions_based_on_options)
add_definitions(-DDEDICATED)
endif()
if(NOT OPTION_USE_THREADS)
add_definitions(-DNO_THREADS)
endif()
if(OPTION_USE_ASSERTS)
add_definitions(-DWITH_ASSERT)
else()
@ -110,8 +116,4 @@ function(add_definitions_based_on_options)
if(OPTION_SURVEY_KEY)
add_definitions(-DSURVEY_KEY="${OPTION_SURVEY_KEY}")
endif()
if(OPTION_ALLOW_INVALID_SIGNATURE)
add_definitions(-DALLOW_INVALID_SIGNATURE)
endif()
endfunction()

@ -1,4 +1,12 @@
function(_add_files_tgt tgt)
# Add a file to be compiled.
#
# add_files([file1 ...] CONDITION condition [condition ...])
#
# CONDITION is a complete statement that can be evaluated with if().
# If it evaluates true, the source files will be added; otherwise not.
# For example: ADD_IF SDL_FOUND AND Allegro_FOUND
#
function(add_files)
cmake_parse_arguments(PARAM "" "" "CONDITION" ${ARGN})
set(PARAM_FILES "${PARAM_UNPARSED_ARGUMENTS}")
@ -9,32 +17,10 @@ function(_add_files_tgt tgt)
endif()
foreach(FILE IN LISTS PARAM_FILES)
# Some IDEs are not happy with duplicated filenames, so we detect that before adding the file.
#get_target_property(${tgt}_FILES ${tgt} SOURCES)
#if(${tgt}_FILES MATCHES "/${FILE}(;|$)")
# string(REGEX REPLACE "(^|.+;)([^;]+/${FILE})(;.+|$)" "\\2" RES "${${tgt}_FILES}")
# # Ignore header files duplicates in 3rdparty.
# if(NOT (${FILE} MATCHES "\.h" AND (${RES} MATCHES "3rdparty" OR ${CMAKE_CURRENT_SOURCE_DIR} MATCHES "3rdparty")))
# message(FATAL_ERROR "${tgt}: ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} filename is a duplicate of ${RES}")
# endif()
#endif()
target_sources(${tgt} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${FILE})
target_sources(openttd PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${FILE})
endforeach()
endfunction()
# Add a file to be compiled.
#
# add_files([file1 ...] CONDITION condition [condition ...])
#
# CONDITION is a complete statement that can be evaluated with if().
# If it evaluates true, the source files will be added; otherwise not.
# For example: ADD_IF SDL_FOUND AND Allegro_FOUND
#
function(add_files)
_add_files_tgt(${OPENTTD_LIB} ${ARGV})
endfunction()
# Add a test file to be compiled.
#
# add_test_files([file1 ...] CONDITION condition [condition ...])
@ -44,9 +30,18 @@ endfunction()
# For example: ADD_IF SDL_FOUND AND Allegro_FOUND
#
function(add_test_files)
if(NOT OPTION_NO_SPLIT_LIB)
_add_files_tgt(openttd_test ${ARGV})
cmake_parse_arguments(PARAM "" "" "CONDITION" ${ARGN})
set(PARAM_FILES "${PARAM_UNPARSED_ARGUMENTS}")
if(PARAM_CONDITION)
if(NOT (${PARAM_CONDITION}))
return()
endif()
endif()
foreach(FILE IN LISTS PARAM_FILES)
target_sources(openttd_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${FILE})
endforeach()
endfunction()
# This function works around an 'issue' with CMake, where

@ -58,7 +58,6 @@ list(SORT ${PLACE_HOLDER})
string(REPLACE ";" "\n" ${PLACE_HOLDER} "${${PLACE_HOLDER}}")
# Get the grf md5
file(READ ${BASESET_EXTRAGRF_FILE}.hash ORIG_EXTRA_GRF_MD5)
string(STRIP ${ORIG_EXTRA_GRF_MD5} ORIG_EXTRA_GRF_MD5)
file(MD5 ${BASESET_EXTRAGRF_FILE} ORIG_EXTRA_GRF_MD5)
configure_file(${BASESET_SOURCE_FILE} ${BASESET_BINARY_FILE})

@ -11,9 +11,6 @@ endif()
if(NOT GRFCODEC_EXECUTABLE)
message(FATAL_ERROR "Script needs GRFCODEC_EXECUTABLE defined")
endif()
if(NOT GRFID_EXECUTABLE)
message(FATAL_ERROR "Script needs GRFID_EXECUTABLE defined")
endif()
if(NOT GRF_SOURCE_FOLDER)
message(FATAL_ERROR "Script needs GRF_SOURCE_FOLDER defined")
endif()
@ -21,9 +18,6 @@ if(NOT GRF_BINARY_FILE)
message(FATAL_ERROR "Script needs GRF_BINARY_FILE defined")
endif()
# Remove the existing output so failures never go unnoticed
file(REMOVE ${GRF_BINARY_FILE} ${GRF_BINARY_FILE}.hash)
get_filename_component(GRF_SOURCE_FOLDER_NAME "${GRF_SOURCE_FOLDER}" NAME)
file(WRITE sprites/${GRF_SOURCE_FOLDER_NAME}.nfo "")
@ -53,7 +47,7 @@ if(RESULT)
message(FATAL_ERROR "NFORenum failed")
endif()
execute_process(COMMAND ${GRFCODEC_EXECUTABLE} -n -s -e -g2 -p1 ${GRF_SOURCE_FOLDER_NAME}.grf RESULT_VARIABLE RESULT)
execute_process(COMMAND ${GRFCODEC_EXECUTABLE} -n -s -e -p1 ${GRF_SOURCE_FOLDER_NAME}.grf RESULT_VARIABLE RESULT)
if(RESULT)
if(NOT RESULT MATCHES "^[0-9]*$")
message(FATAL_ERROR "Failed to run GRFCodec (${RESULT}), please check GRFCODEC_EXECUTABLE variable")
@ -61,15 +55,4 @@ if(RESULT)
message(FATAL_ERROR "GRFCodec failed")
endif()
execute_process(COMMAND ${GRFID_EXECUTABLE} -m ${GRF_SOURCE_FOLDER_NAME}.grf OUTPUT_VARIABLE GRFID_HASH RESULT_VARIABLE RESULT)
if(RESULT)
if(NOT RESULT MATCHES "^[0-9]*$")
message(FATAL_ERROR "Failed to run GRFID (${RESULT}), please check GRFID_EXECUTABLE variable")
endif()
message(FATAL_ERROR "GRFID failed")
endif()
file(WRITE ${GRF_BINARY_FILE}.hash ${GRFID_HASH})
# Copy build files back to the source directory.
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${GRF_SOURCE_FOLDER_NAME}.grf ${GRF_BINARY_FILE})

@ -56,14 +56,11 @@ foreach(ENUM IN LISTS ENUM_LINES)
endif()
# Check for enum match
if("${LINE}" MATCHES "^ *enum *${ENUM_PATTERN}( *: *[^ ]*)? *\{")
if("${LINE}" MATCHES "^ *enum *${ENUM_PATTERN} *\{")
# REGEX REPLACE does a REGEX MATCHALL and fails if an empty string is matched
string(REGEX MATCH "[^ ]*" RESULT "${LINE}")
string(REPLACE "${RESULT}" "" RM_INDENT "${LINE}")
string(REGEX MATCH " *: *[^ ]*" RESULT "${LINE}")
string(REPLACE "${RESULT}" "" LINE "${LINE}")
set(ACTIVE 1)
if(ACTIVE_COMMENT GREATER 0)
string(APPEND ${PLACE_HOLDER} "\n${COMMENT}")

@ -34,6 +34,7 @@ execute_process(COMMAND ${OPENTTD_EXECUTABLE}
-mnull
-vnull:ticks=30000
-d script=2
-d misc=9
-Q
OUTPUT_VARIABLE REGRESSION_OUTPUT
ERROR_VARIABLE REGRESSION_RESULT
@ -53,27 +54,16 @@ string(REPLACE "0x(nil)" "0x00000000" REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REPLACE "0x0000000000000000" "0x00000000" REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REPLACE "0x0x0" "0x00000000" REGRESSION_RESULT "${REGRESSION_RESULT}")
# Convert path separators
string(REPLACE "\\" "/" REGRESSION_RESULT "${REGRESSION_RESULT}")
# Remove timestamps if any
string(REGEX REPLACE "\\\[[0-9-]+ [0-9:]+\\\] " "" REGRESSION_RESULT "${REGRESSION_RESULT}")
# Remove log level
string(REGEX REPLACE "\\\[script:[0-9]\\\]" "" REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REGEX REPLACE "\[[0-9-]+ [0-9:]+\] " "" REGRESSION_RESULT "${REGRESSION_RESULT}")
# Convert the output to a format that is expected (and more readable) by result.txt
string(REPLACE "dbg: " "ERROR: " REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REPLACE "ERROR: [1] " "" REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REPLACE "[P] " "" REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REPLACE "[S] " "" REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REPLACE "\ndbg: [script]" "\n" REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REPLACE "\n " "\nERROR: " REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REPLACE "\nERROR: [1] " "\n" REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REPLACE "\n[P] " "\n" REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REGEX REPLACE "dbg: ([^\n]*)\n?" "" REGRESSION_RESULT "${REGRESSION_RESULT}")
# Remove duplicate script info
string(REGEX REPLACE "ERROR: Registering([^\n]*)\n?" "" REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REGEX REPLACE "ERROR: [12]([^\n]*)\n?" "" REGRESSION_RESULT "${REGRESSION_RESULT}")
string(REGEX REPLACE "ERROR: The first([^\n]*)\n?" "" REGRESSION_RESULT "${REGRESSION_RESULT}")
# Read the expected result
file(READ ai/${REGRESSION_TEST}/result.txt REGRESSION_EXPECTED)
@ -97,7 +87,7 @@ foreach(RESULT IN LISTS REGRESSION_RESULT)
if(NOT RESULT STREQUAL EXPECTED)
message("${ARGC}: - ${EXPECTED}")
message("${ARGC}: + ${RESULT}")
message("${ARGC}: + ${RESULT}'")
set(ERROR YES)
endif()
endforeach()

@ -71,23 +71,13 @@ reset_reader()
file(STRINGS "${SCRIPT_API_FILE}" SOURCE_LINES)
set(NUM_LINE 0)
macro(doxygen_check)
if(NOT "${DOXYGEN_SKIP}" STREQUAL "")
message(FATAL_ERROR "${SCRIPT_API_FILE}:${NUM_LINE}: a DOXYGEN_API block was not properly closed")
endif()
endmacro()
foreach(LINE IN LISTS SOURCE_LINES)
math(EXPR NUM_LINE "${NUM_LINE} + 1")
# Ignore special doxygen blocks
if("${LINE}" MATCHES "^#ifndef DOXYGEN_API")
doxygen_check()
set(DOXYGEN_SKIP "next")
continue()
endif()
if("${LINE}" MATCHES "^#ifdef DOXYGEN_API")
doxygen_check()
set(DOXYGEN_SKIP "true")
continue()
endif()
@ -96,10 +86,10 @@ foreach(LINE IN LISTS SOURCE_LINES)
continue()
endif()
if("${LINE}" MATCHES "^#else")
if(DOXYGEN_SKIP STREQUAL "next")
if("${DOXYGEN_SKIP}" STREQUAL "next")
set(DOXYGEN_SKIP "true")
elseif(DOXYGEN_SKIP STREQUAL "true")
set(DOXYGEN_SKIP "false")
else()
unset(DOXYGEN_SKIP)
endif()
continue()
endif()
@ -678,6 +668,4 @@ foreach(LINE IN LISTS SOURCE_LINES)
endif()
endforeach()
doxygen_check()
configure_file(${SCRIPT_API_SOURCE_FILE} ${SCRIPT_API_BINARY_FILE})

@ -53,7 +53,4 @@ Do NOT remove the dmp_cmds savegames of a desync you have reported until the
desync has been fixed; if you, by accident, send us the wrong savegames we
will not be able to reproduce the desync and thus will be unable to fix it.
## More information
You can find more theory on the causes and debugging of desyncs in the
[desync documentation](./desync.md).

@ -19,14 +19,14 @@ your operating system:
- Windows:
- `C:\My Documents\OpenTTD` (95, 98, ME)
- `C:\Documents and Settings\<username>\My Documents\OpenTTD` (2000, XP)
- `C:\Users\<username>\Documents\OpenTTD` (7, 8.1, 10, 11)
- `C:\Users\<username>\Documents\OpenTTD` (Vista, 7, 8.1, 10)
- macOS: `~/Documents/OpenTTD`
- Linux: `$XDG_DATA_HOME/openttd` which is usually `~/.local/share/openttd`
when built with XDG base directory support, otherwise `~/.openttd`
3. The shared directory
- Windows:
- `C:\Documents and Settings\All Users\Shared Documents\OpenTTD` (2000, XP)
- `C:\Users\Public\Documents\OpenTTD` (7, 8.1, 10, 11)
- `C:\Users\Public\Documents\OpenTTD` (Vista, 7, 8.1, 10)
- macOS: `/Library/Application Support/OpenTTD`
- Linux: not available
4. The binary directory (where the OpenTTD executable is)

@ -25,10 +25,6 @@ The translators will decide whether, where and how to apply your suggestion.
Sorry, we don't offer this option.
Only when there is a consistency problem that needs addressing, this can be done via a PR.
We are very strict about this, and in general all PRs making translation changes will be closed.
But if it is really needed, and the change is not a revert of any older change, a PR can be created to do mass changes to a translation.
### I want to change the language definition (plural form, genders, cases) of a translation.
Please [create an issue](https://github.com/OpenTTD/OpenTTD/issues/new/choose) for this.

@ -1050,11 +1050,8 @@
</tr>
</table>
</li>
<li>m6 bit 7: rail station / waypoint may have catenary pylons</li>
<li>m6 bits <span style="color: blue">6</span>..3: the station type (rail, airport, truck, bus, oilrig, dock, buoy, waypoint, <span style="color: blue">road waypoint</span>)</li>
<li>m6 bit 2: pbs reservation state for railway stations/waypoints</li>
<li>m6 bit <span style="color: blue">1</span>: rail station / waypoint may have catenary wires</li>
<li>m6 bit 0: rail station / waypoint is blocked</li>
<li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of road (road stops)</li>
<li>m7: animation frame (railway stations/waypoints, airports)</li>
@ -1062,7 +1059,7 @@
<li style="color: blue">m8 bits 14..12: <a href="#RoadCachedOneWayState">Road cached one way state</a></li>
<li>m8 bits 11..6: <a href="#TramType">Tramtype</a></li>
<li>m8 bits 5..0: <a href="#TrackType">track type</a> for railway stations/waypoints</li>
<li>m8 bits 5..0: custom road stop id; 0 means standard graphics</li>
<li style="color: blue">m8 bits 5..0: custom road stop id; 0 means standard graphics</li>
</ul>
</td>
</tr>

@ -194,7 +194,7 @@ the array so you can quickly see what is used and what is not.
<td class="bits" rowspan=2><span class="used" title="Random bits">XXXX</span> <span class="free">OOOO</span></td>
<td class="bits" rowspan=2><span class="used" title="Custom station specifications ID">XXXX XXXX</span></td>
<td class="bits"><span class="used" title="Graphics index">XXXX XXXX</span></td>
<td class="bits" rowspan=2><span class="used" title="May have pylons">X</span> <span class="patch" title="Station type (extra bit)">P</span><span class="used" title="Station type">XXX</span> <span class="used" title="Reserved track">X</span><span class="patch" title="May have wires (moved from bit 6)">P</span><span class="used" title="Tile is blocked">X</span></td>
<td class="bits" rowspan=2><span class="free">O<span class="patch" title="Station type (extra bit)">P</span></span><span class="used" title="Station type">XXX</span> <span class="used" title="Reserved track">X</span><span class="free">OO</span></td>
<td class="bits" rowspan=2><span class="used" title="Animation frame">XXXX XXXX</span></td>
<td class="bits" rowspan=2><span class="free">OOOO OOOO OO</span><span class="used" title="Railway type">XX XXXX</span></td>
</tr>
@ -209,12 +209,12 @@ the array so you can quickly see what is used and what is not.
<td class="bits" rowspan=2><span class="usable" title="Graphics index">OOOO O</span><span class="used" title="Graphics index: 00 (exit towards NE), 01 (exit towards SE), 02 (exit towards SW), 03 (exit towards NW), 04 (drive through X), 05 (drive through Y)">XXX</span></td>
<td class="bits" rowspan=6><span class="free">O<span class="patch" title="Station type (extra bit)">P</span></span><span class="used" title="Station type">XXX</span> <span class="free">OOO</span></td>
<td class="bits" rowspan=2><span class="free">OOO</span><span class="used" title="Owner of road">X XXXX</span></td>
<td class="bits"><span class="free">O</span><span class="patch" title="Road cached one way state">PPP</span> <span class="used" title="Tram type">XXXX XX</span> <span class="used" title="Custom road stops specifications ID">XXXXXX</span></td>
<td class="bits"><span class="free">O</span><span class="patch" title="Road cached one way state">PPP</span> <span class="used" title="Tram type">XXXX XX</span><span class="patch" title="Custom road stops specifications ID">PP PPPP</span></td>
</tr>
<tr>
<td class="caption">road waypoint</td>
<td class="bits"><span class="used" title="Owner of tram">XXXX</span> <span class="patch" title="Pavement type">PP</span> <span class="patch" title="Disallow vehicles to go a specific direction (drive-through road stop)">PP</span></td>
<td class="bits"><span class="patch" title="Snow/desert present">P</span> <span class="patch" title="Road cached one way state">PPP</span> <span class="used" title="Tram type">XXXX XX</span> <span class="used" title="Custom road stops specifications ID">XXXXXX</span></td>
<td class="bits"><span class="patch" title="Snow/desert present">P</span> <span class="patch" title="Road cached one way state">PPP</span> <span class="used" title="Tram type">XXXX XX</span><span class="patch" title="Custom road stops specifications ID">PP PPPP</span></td>
</tr>
<tr>
<td class="caption">airport</td>

@ -193,9 +193,6 @@ If it is, and your server still isn't showing up, start OpenTTD with
`-d net=4` as extra argument. This will show debug message related to the
network, including communication to/from the Game Coordinator.
See the [Game Coordinator documentation](./game_coordinator.md) for more
technical information about the Game Coordinator service.
### My server warns a lot about getaddrinfo taking N seconds
This could be a transient issue with your (local) DNS server, but if the

@ -83,8 +83,6 @@
The default graphics chain for the primary vehicle may check the cargo states of the other ship parts if required.<br />
Additional ship parts may be refitted individually.
<p>This requires the <span class="code">multi_part_ships</span> feature.</p>
<p>From version 3 of the <span class="code">multi_part_ships</span> feature, spritegroup loading/loaded cargo thresholds refer to the entire ship, not just the first vehicle.</p>
</p>
<p>
Added callback: <span class="code">refit_part_name</span><br />
@ -218,17 +216,6 @@
If there is no bridge above, the value is 0xFF.
</td>
</tr>
<tr><td>adjacent_crossing</td><td>bitmask(RAILTYPE_ADJACENT_CROSSING_XXX, ...)</td>
<td>
Adjacent level crossing information:
<dl>
<dt>SOUTH</dt>
<dd>This level crossing tile is part of a continuous adjacent crossing with the tile to the south (SW or SE)</dd>
<dt>NORTH</dt>
<dd>This level crossing tile is part of a continuous adjacent crossing with the tile to the north (NW or NE)</dd>
</dl>
</td>
</tr>
</table>
<h3 id="roadtype-properties"><a href="https://newgrf-specs.tt-wiki.net/wiki/NML:Roadtypes#Roadtype_properties">Roadtype properties</a></h3>
<table>
@ -304,7 +291,7 @@
<tr><td>use_land_ground</td><td>0 or 1</td><td>
Sets whether to use the underlying ground as the object ground sprite, ignoring the ground sprite provided in the sprite layout.<br />
When enabled, the ground sprite will be bare ground, grass, snow, desert, etc. as if it were a clear ground tile.<br />
In edge foundation mode, or when foundations are disabled, the ground may be coast/shore when flooded.
In edge foundation mode, the ground may be coast/shore when flooded.
</td></tr>
<tr><td>edge_foundation_mode</td><td>[mode0, mode1, mode2, mode3]</td><td>
Enables edge foundation mode for the object.<br />
@ -657,7 +644,7 @@ item (FEAT_GLOBALVARS) {
<td>
Set the look-ahead to single signal only mode for the most recently defined style (defined using the <span class="code">define_style</span> property).<br />
This property only makes a difference when the "realistic train braking is aspect limited" game setting is enabled, or when using a different signal
type which uses <span class="code">style_combined_normal_shunt</span>.<br />
type which uses <span class="code">tyle_combined_normal_shunt</span>.<br />
This is similar to <span class="code">style_lookahead_extra_aspects</span> with a value of 0, except the lookahead always ends at the
next signal, even if that signal type sets <span class="code">style_no_aspect_increase</span>.<br />
If enabled, this property overrides <span class="code">style_lookahead_extra_aspects</span>.<br />
@ -675,13 +662,6 @@ item (FEAT_GLOBALVARS) {
Set whether signals should be drawn on the opposite side of the track for the most recently defined style (defined using the <span class="code">define_style</span> property).
</td>
</tr>
<tr><td>style_both_sides</td><td>0 or 1</td>
<td>
Set whether signals should be drawn on both sides of the track for the most recently defined style (defined using the <span class="code">define_style</span> property).<br />
If set, the <span class="code">signal_context_is_second</span> variable is true when drawing the second signal.<br />
If this and <span class="code">style_opposite_side</span> are both set, the first signal is drawn on the opposite side and the second signal is drawn on the usual side.
</td>
</tr>
<tr><td>style_realistic_braking_only</td><td>0 or 1</td>
<td>
Set whether signals using this style may only be built when realistic braking is enabled, for the most recently defined style (defined using the <span class="code">define_style</span> property).
@ -731,11 +711,6 @@ item (FEAT_GLOBALVARS) {
The signal is being drawn on a tunnel entrance/exit (not a bridge)
</td>
</tr>
<tr><td>signal_context_is_second</td><td>0 or 1</td>
<td>
The second signal is being drawn (on the opposite side to the first signal), see the style_both_sides property
</td>
</tr>
<tr><td>signal_context_info</td><td></td>
<td>
Above signal context variables in one variable (all of the signals_signal_context variable)

@ -554,16 +554,6 @@
The Action 0 Id field is not used, the value is ignored.
</p>
<p>This is indicated by the feature name: <font face="monospace">action0_signals_style</font>, version 1</p>
<h4 id="signals_style_both_sides">Set custom signal style signal drawn on both sides (mappable property: signals_style_both_sides)</h4>
<p>This applies to the most recent custom signal style defined using the <a href="#signals_define_style">signals_define_style</a> property.<br />
When enabled, signals using this style are drawn on both sides of the track.<br />
Bit 9 of <a href="#signals_signal_context">signals_signal_context</a> is set when drawing the second signal on the opposite side.</p>
<p>If this and <a href="#signals_style_opposite_side">signals_style_opposite_side</a> are both set, the first signal is drawn on the opposite side
and the second signal is drawn on the usual side.</p>
<p>The property length is 1 byte. 0 is disabled (default). 1 is enabled.<br />
The Action 0 Id field is not used, the value is ignored.
</p>
<p>This is indicated by the feature name: <font face="monospace">action0_signals_style</font>, version 3</p>
<h4 id="signals_style_realistic_braking_only">Set custom signal style signal requires realistic braking (mappable property: signals_style_realistic_braking_only)</h4>
<p>This applies to the most recent custom signal style defined using the <a href="#signals_define_style">signals_define_style</a> property.<br />
When enabled, signals using this style may only be built when realistic braking is enabled.</p>
@ -583,7 +573,7 @@
<h4 id="object_use_land_ground">Object uses land ground sprite (mappable property: object_use_land_ground)</h4>
<p>This property sets whether to use the underlying ground as the object ground sprite, ignoring the ground sprite provided in the sprite layout.<br />
When enabled, the ground sprite will be bare ground, grass, snow, desert, etc. as if it were a clear ground tile.<br />
In edge foundation mode, or when foundations are disabled, the ground may be coast/shore when flooded.<br />
In edge foundation mode, the ground may be coast/shore when flooded.<br />
The property length is 1 byte. 0 is disabled (default). 1 is enabled.</p>
<p>This is indicated by the feature name: <font face="monospace">action0_object_use_land_ground</font>, version 1</p>
<h4 id="object_edge_foundation_mode">Enable object edge foundation mode (mappable property: object_edge_foundation_mode)</h4>
@ -882,16 +872,6 @@
</table>
</p>
<p>This is indicated by the feature name: <font face="monospace">varaction2_railtype_signal_vertical_clearance</font>, version 1</p>
<h4 id="railtype_adjacent_crossing">Adjacent level crossing information (mappable variable: railtype_adjacent_crossing)</h4>
<p>
<table>
<tr><th>Bit</th><th>Meaning</th></tr>
<tr><td>0</td><td>This level crossing tile is part of a continuous adjacent crossing with the tile to the south (SW or SE)</td></tr>
<tr><td>1</td><td>This level crossing tile is part of a continuous adjacent crossing with the tile to the north (NW or NE)</td></tr>
</table>
The value is 0 for non level crossing tiles.
</p>
<p>This is indicated by the feature name: <font face="monospace">varaction2_railtype_adjacent_crossing</font>, version 1</p>
<br />
<h3 id="varaction2_object"><a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/Objects">Variational Action 2 - Objects</a></h3>
<h4 id="object_foundation_tile_slope">Tile slope after foundation applied (mappable variable: object_foundation_tile_slope)</h4>
@ -939,7 +919,6 @@
</table>
</td></tr>
<tr><td>8</td><td>Tunnel tile</td></tr>
<tr><td>9</td><td>Second signal (being drawn on opposite side), see: <a href="#signals_style_both_sides">signals_style_both_sides</a></td></tr>
</table>
</p>
<p>This is indicated by the feature name: <font face="monospace">varaction2_signals_signal_context</font>, version 1</p>
@ -986,7 +965,6 @@
Additional ship parts may be refitted individually.
</p>
<p>This is indicated by the feature name: <font face="monospace">multi_part_ships</font>, version 1</p>
<p>From version 3 of the <font face="monospace">multi_part_ships</font> feature, Action 2 loadtypes/loadingtypes cargo thresholds refer to the entire ship, not just the first vehicle.</p>
<p><b>Callback EC008002 - Ship part name for refit window</b><br />
This callback is called on the primary vehicle to get the name of each part of the ship (e.g. the name of each cargo hold) in the refit window.<br />
This is not called for ships of only one part.<br />

@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>JGR's Patchpack - Additions to the NewGRF Road Stops Specification in NML</title>
<title>JGR's Patchpack - NewGRF Road Stops Addition to NewGRF Specifications in NML</title>
<style type="text/css">
td li { white-space: nowrap; text-align: left; }
th { white-space: nowrap; text-align: center; }
@ -13,10 +13,10 @@
</style>
</head>
<body>
<h2>Additions to the NewGRF Road Stops Specification in JGR's Patchpack in NML</h2>
<p>This document describes the non-standard additions to the NewGRF road stops feature in the <a href="https://newgrf-specs.tt-wiki.net/wiki/NML:Main">Official OpenTTD NML Specifications</a>, as implemented in this patchpack, and the associated <a href="https://github.com/JGRennison/nml">NML fork</a><br />
The additions here are compatible with the specification and OpenTTD 14.0, such that GRFs can run on OpenTTD 14.0 and also optionally use patchpack extensions where available.</p>
<p>These additions and the official specification do not match the obsolete OpenTTD PR #7955 which used a different NewGRF interface.</p>
<h2>NewGRF Road Stops Addition to NewGRF Specifications in JGR's Patchpack in NML</h2>
<p>This document describes the non-standard addition of the NewGRF road stops feature to the <a href="https://newgrf-specs.tt-wiki.net/wiki/NML:Main">Official OpenTTD NML Specifications</a>, as implemented in this patchpack, and the associated <a href="https://github.com/JGRennison/nml">NML fork</a></br>
This feature does not match OpenTTD PR #7955 in a number of key areas, this feature may not necessarily match implementations of NewGRF road stops in other patches, branches, etc.</br>
This feature as implemented here MAY also be present in other patchpacks.</p>
<p>The feature identifier is <span class="code">FEAT_ROADSTOPS</span>, (the PARENT scope for this feature is the road stop's station's town).<br />
There is no permanent storage associated with this feature.</p>
@ -25,9 +25,10 @@
<p>See the associated <a href="newgrf-roadstops.html">non-NML document</a> for more details on the NewGRF road stops feature.</p>
<p>This feature will be automatically skipped when loaded into a version of OpenTTD which does not support this feature (before 14.0).<br />
If this feature is the only significant thing in this GRF, then <span class="code">version_openttd(14, 0) || extended_feature_test("road_stops")</span> MAY be called and some message, error or other form of
signalling to the user used to inform the user that this version of OpenTTD does not support the feature, if the value is false.</p>
<p>This feature will be automatically skipped when loaded into a version of OpenTTD which does not support this feature.<br />
If this feature is the only significant thing in this GRF, then <span class="code">extended_feature_test("road_stops")</span> SHOULD be called and some message, error or other form of
signalling to the user used to inform the user that this version of OpenTTD does not support the feature, if the return value is false.<br />
Otherwise the GRF could silently do nothing instead of the expected functionality, creating confusion for end users.</p>
<p><b>Sections:</b>
<ul>
@ -57,7 +58,7 @@
Predefined classes include:<br />
<ul>
<li>DFLT - Default class</li>
<li>WAYP - Waypoints: All road waypoints must be put in this class. <b>Not in standard specification</b>.</li>
<li>WAYP - Waypoints: All road waypoints must be put in this class</li>
</ul>
</td></tr>
<tr><td>classname</td><td>string</td><td>You only need to set this for one object in every class. </td></tr>
@ -69,7 +70,7 @@
<p><b>RST_DRAW_FLAG_DRIVE_THROUGH_ROAD_OVERLAY</b><br />
<span class="indent">Draw road overlays for drive-through stops.</span></p>
<p><b>RST_DRAW_FLAG_WAYPOINT_GROUND</b><br />
<span class="indent">Draw spritelayout ground sprite on top of underlying road (if unset, the spritelayout ground sprite is not drawn). <b>Not in standard specification</b>.</span></p>
<span class="indent">Draw spritelayout ground sprite on top of underlying road (if unset, the spritelayout ground sprite is not drawn).</span></p>
</td></tr>
<tr><td>cargo_random_triggers</td><td>cargo bitmask</td><td>Cargo bitmask to use for random triggers</td></tr>
<tr><td>animation_info</td><td>Array [ANIMATION_XXX, frame-count]</td><td>XXX = [LOOPING | NON_LOOPING], 1..253 frames</td></tr>
@ -79,7 +80,7 @@
<p><b>RST_GENERAL_FLAG_RANDOM_ANIMATION</b><br />
<span class="indent">Animation callback requires random bits in variable <span class="code">extra_callback_info1</span>.</span></p>
<p><b>RST_GENERAL_FLAG_NO_ONE_WAY_OVERLAY</b><br />
<span class="indent">Do not show one way road overlay sprites, this should only be set if different graphics are provided for the different one-way states using the <span class="code">one_way_info</span> variable. <b>Not in standard specification</b>.</span></p>
<span class="indent">Do not show one way road overlay sprites, this should only be set if different graphics are provided for the different one-way states using the <span class="code">one_way_info</span> variable.</span></p>
<p><b>RST_GENERAL_FLAG_NO_CATENARY</b><br />
<span class="indent">Do not show catenary graphics. (This only takes effect from <span class="code">road_stops</span> version 2).</span></p>
<p><b>RST_GENERAL_FLAG_DRIVE_THROUGH_ONLY</b><br />
@ -91,12 +92,12 @@
<p><b>RST_GENERAL_FLAG_BUILD_MENU_TRAM_ONLY</b><br />
<span class="indent">Only show in the tram build menu (not road). (This only takes effect from <span class="code">road_stops</span> version 4).</span></p>
<p><b>RST_GENERAL_FLAG_BUILD_MENU_DRAW_DISABLED_VIEWS</b><br />
<span class="indent">Use custom graphics for disabled road stop views. (This only takes effect from <span class="code">road_stops</span> version 8). <b>Not in standard specification</b>.</span></p>
<span class="indent">Use custom graphics for disabled road stop views. (This only takes effect from <span class="code">road_stops</span> version 8).</span></p>
<p><b>RST_GENERAL_FLAG_DRAW_MODE_REGISTER</b><br />
<span class="indent">Read the road stop draw mode from variable 0x100 (set using STORE_TEMP), this overrides the <span class="code">draw_mode</span> property. (This only takes effect from <span class="code">road_stops</span> version 9). <b>Not in standard specification</b>.</span></p>
<span class="indent">Read the road stop draw mode from variable 0x100 (set using STORE_TEMP), this overrides the <span class="code">draw_mode</span> property. (This only takes effect from <span class="code">road_stops</span> version 9).</span></p>
</td></tr>
<tr><td>minimum_bridge_height<br /><b>Not in standard specification</b></td><td>Array of 6 items [0..255, ...]</td><td>Minimum clearances required for a bridge for each of the <a href="#roadstop_views">6 views/rotations</a> (or 0 to not allow any bridge). Values are given in height level units (1 level == 8px).</td></tr>
<tr><td>disallowed_bridge_pillars<br /><b>Not in standard specification</b></td><td>Array of 6 items [bitmask(RST_BRIDGE_PILLAR_FLAG_, ...), ...]</td><td>
<tr><td>minimum_bridge_height</td><td>Array of 6 items [0..255, ...]</td><td>Minimum clearances required for a bridge for each of the <a href="#roadstop_views">6 views/rotations</a> (or 0 to not allow any bridge). Values are given in height level units (1 level == 8px).</td></tr>
<tr><td>disallowed_bridge_pillars</td><td>Array of 6 items [bitmask(RST_BRIDGE_PILLAR_FLAG_, ...), ...]</td><td>
<p>Which bridge pillars are disallowed on the tile for each of the <a href="#roadstop_views">6 views/rotations</a>.</p>
<p><b>RST_BRIDGE_PILLAR_FLAG_CORNER_W</b><br />
<span class="indent">Pillar in west corner</span></p>
@ -116,7 +117,7 @@
<span class="indent">Pillar along entire north-west edge</span></p>
</td></tr>
<tr><td>cost_multipliers</td><td>[build_cost, clear_cost]</td><td>Build and clear cost multipliers, 16 is the same as a non-NewGRF road stop</td></tr>
<tr><td>height<br /><b>Not in standard specification</b></td><td>0..255</td><td>Road stop height (in the build window), in height level units (1 level == 8px), see also: <a href="https://newgrf-specs.tt-wiki.net/wiki/NML:Objects#Object_properties">object height property</a>.</td></tr>
<tr><td>height</td><td>0..255</td><td>Road stop height (in the build window), in height level units (1 level == 8px), see also: <a href="https://newgrf-specs.tt-wiki.net/wiki/NML:Objects#Object_properties">object height property</a>.</td></tr>
</table>
<h3 id="roadstop_variables">Road Stop Variables</h3>
@ -126,11 +127,11 @@
<table>
<tr><th>Name</th><th>Value range</th><th>Comment</th></tr>
<tr><td>view</td><td>0..5</td><td>The <a href="#roadstop_views">view/rotation</a> of the road stop</td></tr>
<tr><td>stop_type</td><td>RST_TYPE_XXX</td><td>XXX = BUS | TRUCK | WAYPOINT (<b>Not in standard specification</b>)</td></tr>
<tr><td>stop_type</td><td>RST_TYPE_XXX</td><td>XXX = BUS | TRUCK | WAYPOINT</td></tr>
<tr><td>terrain_type</td><td>TILETYPE_XXX</td><td>XXX = NORMAL | DESERT | RAIN_FOREST | SNOW</td></tr>
<tr><td>tile_slope</td><td>SLOPE_XXX</td><td>See <a href="https://newgrf-specs.tt-wiki.net/wiki/NML:List_of_tile_slopes">tile slopes</a> for an overview of possible values</td></tr>
<tr><td>has_road</td><td>0 | 1</td><td>1 if this road stop has road</td></tr>
<tr><td>has_tram</td><td>0 | 1</td><td>1 if this road stop has tram</td></tr>
<tr><td>has_road</td><td>0 | 1</td><td>1 is this road stop has road</td></tr>
<tr><td>has_tram</td><td>0 | 1</td><td>1 is this road stop has tram</td></tr>
<tr><td>road_type</td><td>road type | 0xFF</td><td>Road type. If there is no road the value will be 0xFF. If the roadtype has no entry in the roadtype translation table of the GRF, this value will be 0xFF. If no translation table is present, the raw value will be returned.</td></tr>
<tr><td>tram_type</td><td>tram type | 0xFF</td><td>Tram type. If there is no tram the value will be 0xFF. If the tramtype has no entry in the tramtype translation table of the GRF, this value will be 0xFF. If no translation table is present, the raw value will be returned.</td></tr>
<tr><td>town_manhattan_dist</td><td></td><td>Manhattan distance to the associated town</td></tr>
@ -142,10 +143,11 @@
<tr><td>company_colour2</td><td>COLOUR_XXX</td><td></td></tr>
<tr><td>animation_frame</td><td>0..255</td><td>Animation frame of the current tile</td></tr>
<tr><td>waiting_triggers</td><td>0..255</td><td>Waiting triggers</td></tr>
<tr><td>random_bits</td><td>0..16777215</td><td>All random bits</td></tr>
<tr><td>random_bits_tile</td><td>0..255</td><td>Random bits (per tile), see also <a href="https://newgrf-specs.tt-wiki.net/wiki/NML:Stations#Base_station_variables">random_bits_station</a></td></tr>
<tr><td>one_way_info<br /><b>Not in standard specification</b></td><td>RST_OWI_XXX</td><td>One-way road information of drive-through stop tile<br />XXX = TWO_WAY | WEST_BOUND | EAST_BOUND | NO_ENTRY</td></tr>
<tr><td>one_way_info_inferred<br /><b>Not in standard specification</b></td><td>RST_OWI_XXX</td><td>Inferred one-way road information of drive-through stop tile<br />XXX = TWO_WAY | WEST_BOUND | EAST_BOUND | NO_ENTRY</td></tr>
<tr><td>drawn_in_gui<br /><b>Not in standard specification</b></td><td>0 | 1</td><td>1 if this road stop is being drawn in the build window</td></tr>
<tr><td>one_way_info</td><td>RST_OWI_XXX</td><td>One-way road information of drive-through stop tile<br />XXX = TWO_WAY | WEST_BOUND | EAST_BOUND | NO_ENTRY</td></tr>
<tr><td>one_way_info_inferred</td><td>RST_OWI_XXX</td><td>Inferred one-way road information of drive-through stop tile<br />XXX = TWO_WAY | WEST_BOUND | EAST_BOUND | NO_ENTRY</td></tr>
<tr><td>drawn_in_gui</td><td>0 | 1</td><td>1 if this road stop is being drawn in the build window</td></tr>
</table>
<br />
Variables that require one or more parameters:
@ -173,13 +175,13 @@
<tr><td>nearby_tile_one_way_info</td><td>x, y offset (-8..7)</td><td>RST_OWI_XXX</td><td>One-way state of nearby drive-through road stop tile</td></tr>
<tr><td>nearby_tile_road_stop_info</td><td>x, y offset (-8..7)</td><td></td><td>Above nearby road stop tile variables in one variable (all of variable 0x68)</td></tr>
<tr><td>nearby_tile_grfid</td><td>x, y offset (-8..7)</td><td>-1, 0 or a GRFID</td><td>Return value is -1 if the tile is not a road stop, 0 if the tile is a non-custom road stop, or else the GRFID of the NewGRF defining the road stop</td></tr>
<tr><td>nearby_tile_is_plain_road<br /><b>Not in standard specification</b></td><td>x, y offset (-8..7)</td><td>0 | 1</td><td>Is nearby tile a plain road tile</td></tr>
<tr><td>nearby_tile_road_bits<br /><b>Not in standard specification</b></td><td>x, y offset (-8..7)</td><td>bitmask(ROADBIT_XXX, ...)</td><td>XXX = [NW | SW | SE | NE]<br />Present road bits on nearby tile</td></tr>
<tr><td>nearby_tile_tram_bits<br /><b>Not in standard specification</b></td><td>x, y offset (-8..7)</td><td>bitmask(ROADBIT_XXX, ...)</td><td>XXX = [NW | SW | SE | NE]<br />Present tram bits on nearby tile</td></tr>
<tr><td>nearby_tile_road_piece<br /><b>Not in standard specification</b></td><td>x, y offset (-8..7)</td><td>0..18 | 0xFF</td><td>Present road piece and slope in <a href="https://newgrf-specs.tt-wiki.net/wiki/Action3/Roadtypes#Road_underlay_.2802.29">sprite order</a>, or 0xFF if none</td></tr>
<tr><td>nearby_tile_tram_piece<br /><b>Not in standard specification</b></td><td>x, y offset (-8..7)</td><td>0..18 | 0xFF</td><td>Present tram piece and slope in <a href="https://newgrf-specs.tt-wiki.net/wiki/Action3/Roadtypes#Road_underlay_.2802.29">sprite order</a>, or 0xFF if none</td></tr>
<tr><td>nearby_tile_road_stop_info<br /><b>Not in standard specification</b></td><td>x, y offset (-8..7)</td><td></td><td>Above nearby road tile variables in one variable (all of variable 0x6B)</td></tr>
<tr><td>nearby_tile_road_stop_info_v2<br /><b>Not in standard specification</b></td><td>x, y offset (-8..7)</td><td></td><td>Above nearby road tile variables in one variable (all of variable roadstop_road_stop_info_nearby_tiles_v2)</td></tr>
<tr><td>nearby_tile_is_plain_road</td><td>x, y offset (-8..7)</td><td>0 | 1</td><td>Is nearby tile a plain road tile</td></tr>
<tr><td>nearby_tile_road_bits</td><td>x, y offset (-8..7)</td><td>bitmask(ROADBIT_XXX, ...)</td><td>XXX = [NW | SW | SE | NE]<br />Present road bits on nearby tile</td></tr>
<tr><td>nearby_tile_tram_bits</td><td>x, y offset (-8..7)</td><td>bitmask(ROADBIT_XXX, ...)</td><td>XXX = [NW | SW | SE | NE]<br />Present tram bits on nearby tile</td></tr>
<tr><td>nearby_tile_road_piece</td><td>x, y offset (-8..7)</td><td>0..18 | 0xFF</td><td>Present road piece and slope in <a href="https://newgrf-specs.tt-wiki.net/wiki/Action3/Roadtypes#Road_underlay_.2802.29">sprite order</a>, or 0xFF if none</td></tr>
<tr><td>nearby_tile_tram_piece</td><td>x, y offset (-8..7)</td><td>0..18 | 0xFF</td><td>Present tram piece and slope in <a href="https://newgrf-specs.tt-wiki.net/wiki/Action3/Roadtypes#Road_underlay_.2802.29">sprite order</a>, or 0xFF if none</td></tr>
<tr><td>nearby_tile_road_stop_info</td><td>x, y offset (-8..7)</td><td></td><td>Above nearby road tile variables in one variable (all of variable 0x6B)</td></tr>
<tr><td>nearby_tile_road_stop_info_v2</td><td>x, y offset (-8..7)</td><td></td><td>Above nearby road tile variables in one variable (all of variable roadstop_road_stop_info_nearby_tiles_v2)</td></tr>
</table>
<h3 id="roadstop_callbacks">Road Stop Callbacks</h3>

@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>JGR's Patchpack - Additions to the NewGRF Road Stops Specification</title>
<title>JGR's Patchpack - NewGRF Road Stops Addition to NewGRF Specifications</title>
<style type="text/css">
td li { white-space: nowrap; text-align: left; }
th { white-space: nowrap; text-align: center; }
@ -11,16 +11,15 @@
</style>
</head>
<body>
<h2>Additions to the NewGRF Road Stops Specification in JGR's Patchpack</h2>
<p>This document describes the non-standard additions to the NewGRF road stops feature in the <a href="https://newgrf-specs.tt-wiki.net/wiki/Main_Page">Official OpenTTD NewGRF Specifications</a> (OpenTTD 14.0 and later), as implemented in this patchpack.</br>
The additions here are compatible with the specification and OpenTTD 14.0, such that GRFs can run on OpenTTD 14.0 and also optionally use patchpack extensions where available.</p>
<p>These additions and the official specification do not match the obsolete OpenTTD PR #7955 which used a different NewGRF interface.</p>
<h2>NewGRF Road Stops Addition to NewGRF Specifications in JGR's Patchpack</h2>
<p>This document describes the non-standard addition of the NewGRF road stops feature to the <a href="https://newgrf-specs.tt-wiki.net/wiki/Main_Page">Official OpenTTD NewGRF Specifications</a>, as implemented in this patchpack.</br>
This feature does not match OpenTTD PR #7955 in a number of key areas, this feature may not necessarily match implementations of NewGRF road stops in other patches, branches, etc.</br>
This feature as implemented here MAY also be present in other patchpacks.</p>
<p>See the <a href="newgrf-additions.html">NewGRF additions</a> document for background information on additions to the NewGRF specifications.</p>
<p>The functionality listed below is also supported in a fork of NML, see the associated <a href="newgrf-roadstops-nml.html">NML road stops</a> and <a href="newgrf-additions-nml.html">NML additions</a> documents for more details.</p>
<p>NewGRFs which use this feature MAY use the <a href="newgrf-additions.html#feature-test">feature testing</a> mechanism to check whether/which extensions to the road stop feature are supported.</p>
<p>NewGRFs which use this feature MAY use the <a href="newgrf-additions.html#feature-id-mapping">feature ID mapping</a> mechanism to map the road stop feature to local feature ID 0x14 to additionally support earlier
versions of this patchpack before the feature was added to the specification, otherwise feature ID 0x14 may be used without any mapping (as per the specification).</p>
<p>These extensions are indicated by the feature name: <font face="monospace">road_stops</font>, version 1.<br />
<p>A subset of the functionality listed below is also supported in a fork of NML, see the associated <a href="newgrf-roadstops-nml.html">NML road stops</a> and <a href="newgrf-additions-nml.html">NML additions</a> documents for more details.</p>
<p>NewGRFs which use this feature SHOULD use the <a href="newgrf-additions.html#feature-test">feature testing</a> mechanism to check whether the road stop feature and/or feature ID mapping is supported.</p>
<p>NewGRFs which use this feature MUST use the <a href="newgrf-additions.html#feature-id-mapping">feature ID mapping</a> mechanism to map the non-standard NewGRF road stop feature to a local feature ID.</p>
<p>This feature is indicated by the feature name: <font face="monospace">road_stops</font>, version 1.<br />
The feature name to use for feature ID mapping is <font face="monospace">road_stops</font>.<br />
Features/properties/variables which require a higher version will indicate the required version. Unless indicated otherwise these will fall back to doing nothing on versions which do not support them.</p>
@ -37,26 +36,26 @@
<h3 id="a0roadstops">Action 0 - Road Stops</h3>
<p>See the <a href="https://newgrf-specs.tt-wiki.net/wiki/Action0/Road_Stops">Action 0 Roadstops Specification</a> for background information.</p>
<p>See the <a href="https://newgrf-specs.tt-wiki.net/wiki/Action0">Action 0 Specification</a> for background information.</p>
<b>Properties:</b>
<table>
<tr><th>Number</th><th>Mappable name</th><th>Size in bytes</th><th>Description</th><th>Difference to specification</th></tr>
<tr><td><a href="#roadstop_class_id">08</a></td><td><a href="#roadstop_class_id">roadstop_class_id</a></td><td>4</td><td>Class ID</td><td>WAYP (road waypoints)</td></tr>
<tr><td><a href="#roadstop_stop_type">09</a></td><td><a href="#roadstop_stop_type">roadstop_stop_type</a></td><td>1</td><td>Stop type availability</td><td></td></tr>
<tr><td><a href="#roadstop_stop_name">0A</a></td><td><a href="#roadstop_stop_name">roadstop_stop_name</a></td><td>2</td><td>Name</td><td></td></tr>
<tr><td><a href="#roadstop_class_name">0B</a></td><td><a href="#roadstop_class_name">roadstop_class_name</a></td><td>2</td><td>Class name</td><td></td></tr>
<tr><td><a href="#roadstop_draw_mode">0C</a></td><td><a href="#roadstop_draw_mode">roadstop_draw_mode</a></td><td>1</td><td>Draw mode</td><td>Bit 2</td></tr>
<tr><td><a href="#roadstop_random_trigger_cargoes">0D</a></td><td><a href="#roadstop_random_trigger_cargoes">roadstop_random_trigger_cargoes</a></td><td>4</td><td>Random trigger cargoes</td><td></td></tr>
<tr><td><a href="#roadstop_animation_info">0E</a></td><td><a href="#roadstop_animation_info">roadstop_animation_info</a></td><td>2</td><td>Animation info</td><td></td></tr>
<tr><td><a href="#roadstop_animation_speed">0F</a></td><td><a href="#roadstop_animation_speed">roadstop_animation_speed</a></td><td>1</td><td>Animation speed</td><td></td></tr>
<tr><td><a href="#roadstop_animation_triggers">10</a></td><td><a href="#roadstop_animation_triggers">roadstop_animation_triggers</a></td><td>2</td><td>Animation triggers</td><td></td></tr>
<tr><td><a href="#roadstop_callback_mask">11</a></td><td><a href="#roadstop_callback_mask">roadstop_callback_mask</a></td><td>1</td><td>Callback flags</td><td></td></tr>
<tr><td><a href="#roadstop_general_flags">12</a></td><td><a href="#roadstop_general_flags">roadstop_general_flags</a></td><td>4</td><td>General flags</td><td>Bits 1, 7, 8</td></tr>
<tr><td><a href="#roadstop_min_bridge_height">13</a></td><td><a href="#roadstop_min_bridge_height">roadstop_min_bridge_height</a></td><td>6</td><td>Minimum bridge heights</td><td>Not in spec</td></tr>
<tr><td><a href="#roadstop_disallowed_bridge_pillars">14</a></td><td><a href="#roadstop_disallowed_bridge_pillars">roadstop_disallowed_bridge_pillars</a></td><td>6</td><td>Disallowed bridge pillars</td><td>Not in spec</td></tr>
<tr><td><a href="#roadstop_cost_multipliers">15</a></td><td><a href="#roadstop_cost_multipliers">roadstop_cost_multipliers</a></td><td>2</td><td>Cost multipliers</td><td></td></tr>
<tr><td><a href="#roadstop_height">16</a></td><td><a href="#roadstop_height">roadstop_height</a></td><td>1</td><td>Height (for build window)</td><td>Not in spec</td></tr>
<tr><th>Number</th><th>Mappable name</th><th>Size in bytes</th><th>Description</th></tr>
<tr><td><a href="#roadstop_class_id">08</a></td><td><a href="#roadstop_class_id">roadstop_class_id</a></td><td>4</td><td>Class ID</td></tr>
<tr><td><a href="#roadstop_stop_type">09</a></td><td><a href="#roadstop_stop_type">roadstop_stop_type</a></td><td>1</td><td>Stop type availability</td></tr>
<tr><td><a href="#roadstop_stop_name">0A</a></td><td><a href="#roadstop_stop_name">roadstop_stop_name</a></td><td>2</td><td>Name</td></tr>
<tr><td><a href="#roadstop_class_name">0B</a></td><td><a href="#roadstop_class_name">roadstop_class_name</a></td><td>2</td><td>Class name</td></tr>
<tr><td><a href="#roadstop_draw_mode">0C</a></td><td><a href="#roadstop_draw_mode">roadstop_draw_mode</a></td><td>1</td><td>Draw mode</td></tr>
<tr><td><a href="#roadstop_random_trigger_cargoes">0D</a></td><td><a href="#roadstop_random_trigger_cargoes">roadstop_random_trigger_cargoes</a></td><td>4</td><td>Random trigger cargoes</td></tr>
<tr><td><a href="#roadstop_animation_info">0E</a></td><td><a href="#roadstop_animation_info">roadstop_animation_info</a></td><td>2</td><td>Animation info</td></tr>
<tr><td><a href="#roadstop_animation_speed">0F</a></td><td><a href="#roadstop_animation_speed">roadstop_animation_speed</a></td><td>1</td><td>Animation speed</td></tr>
<tr><td><a href="#roadstop_animation_triggers">10</a></td><td><a href="#roadstop_animation_triggers">roadstop_animation_triggers</a></td><td>2</td><td>Animation triggers</td></tr>
<tr><td><a href="#roadstop_callback_mask">11</a></td><td><a href="#roadstop_callback_mask">roadstop_callback_mask</a></td><td>1</td><td>Callback flags</td></tr>
<tr><td><a href="#roadstop_general_flags">12</a></td><td><a href="#roadstop_general_flags">roadstop_general_flags</a></td><td>4</td><td>General flags</td></tr>
<tr><td><a href="#roadstop_min_bridge_height">13</a></td><td><a href="#roadstop_min_bridge_height">roadstop_min_bridge_height</a></td><td>6</td><td>Minimum bridge heights</td></tr>
<tr><td><a href="#roadstop_disallowed_bridge_pillars">14</a></td><td><a href="#roadstop_disallowed_bridge_pillars">roadstop_disallowed_bridge_pillars</a></td><td>6</td><td>Disallowed bridge pillars</td></tr>
<tr><td><a href="#roadstop_cost_multipliers">15</a></td><td><a href="#roadstop_cost_multipliers">roadstop_cost_multipliers</a></td><td>2</td><td>Cost multipliers</td></tr>
<tr><td><a href="#roadstop_height">16</a></td><td><a href="#roadstop_height">roadstop_height</a></td><td>1</td><td>Height (for build window)</td></tr>
</table>
<h4 id="roadstop_class_id">Road stop class ID (08, or mappable property: roadstop_class_id)</h4>
@ -66,7 +65,7 @@
<table>
<tr><th>Name</th><th>Class ID</th><th>Meaning</th></tr>
<tr><td>DFLT</td><td>44 46 4C 54</td><td>Default bus and lorry stops</td></tr>
<tr><td>WAYP</td><td>57 41 59 50</td><td>This class is used for road waypoints. This is reserved in the specification, but not implemented.</td></tr>
<tr><td>WAYP</td><td>57 41 59 50</td><td>This class is used for road waypoints</td></tr>
</table>
All classes except WAYP are used for bus and/or lorry stops.<br />
This functions the same way as <a href="https://newgrf-specs.tt-wiki.net/wiki/Action0/Stations#Station_class_.2808.29">station (feature 4) property 08</a>.<br />
@ -96,10 +95,7 @@
<tr><th>Bit</th><th>Value</th><th>Meaning</th></tr>
<tr><td>0</td><td>1</td><td>Bay stops: Draw road type ground sprite</td></tr>
<tr><td>1</td><td>2</td><td>Drive through stops: Draw road/tram type overlays</td></tr>
<tr><td>2</td><td>4</td><td>
Road waypoints: Draw sprite layout ground sprite on top of the underlying road (by default the sprite layout ground sprite is not used).<br />
This is not in the specification.
</td></tr>
<tr><td>2</td><td>4</td><td>Road waypoints: Draw sprite layout ground sprite on top of the underlying road (by default the sprite layout ground sprite is not used)</td></tr>
</table>
The default value is 3 (bits 0 and 1 both set).
</p>
@ -156,44 +152,41 @@
<table>
<tr><th>Bit</th><th>Value</th><th>Meaning</th></tr>
<tr><td>0</td><td>1</td><td>Callback 141 needs random bits in variable 10</td></tr>
<tr><td>1</td><td>2</td><td>Do not show one way road overlay sprites, this should only be set if different graphics are provided for the different one-way states using bits 0..1 of variable 50.<br />This is not in the specification.</td></tr>
<tr><td>1</td><td>2</td><td>Do not show one way road overlay sprites, this should only be set if different graphics are provided for the different one-way states using bits 0..1 of variable 50.</td></tr>
<tr><td>2</td><td>4</td><td>Do not show catenary graphics.</br>This requires <font face="monospace">road_stops</font>, version 2.</td></tr>
<tr><td>3</td><td>8</td><td>Only allow drive-through stops (not bay stops).</br>This requires <font face="monospace">road_stops</font>, version 2.</td></tr>
<tr><td>4</td><td>10</td><td>Do not automatically build connecting road pieces.</br>This requires <font face="monospace">road_stops</font>, version 3.</td></tr>
<tr><td>5</td><td>20</td><td>Only show in the road build menu (not tram).</br>This requires <font face="monospace">road_stops</font>, version 4.</td></tr>
<tr><td>6</td><td>40</td><td>Only show in the tram build menu (not road).</br>This requires <font face="monospace">road_stops</font>, version 4.</td></tr>
<tr><td>7</td><td>80</td><td>Use custom graphics for disabled road stop views.</br>This requires <font face="monospace">road_stops</font>, version 8.<br />This is not in the specification.</td></tr>
<tr><td>8</td><td>100</td><td>Read the road stop draw mode from variable 0x100, this overrides the <a href="#roadstop_draw_mode">roadstop_draw_mode</a> property.</br>This requires <font face="monospace">road_stops</font>, version 9.<br />This is not in the specification.</td></tr>
<tr><td>7</td><td>80</td><td>Use custom graphics for disabled road stop views.</br>This requires <font face="monospace">road_stops</font>, version 8.</td></tr>
<tr><td>8</td><td>100</td><td>Read the road stop draw mode from variable 0x100, this overrides the <a href="#roadstop_draw_mode">roadstop_draw_mode</a> property.</br>This requires <font face="monospace">road_stops</font>, version 9.</td></tr>
</table>
The default value is 0 (no flags enabled).
</p>
<h4 id="roadstop_min_bridge_height">Road stop minimum bridge heights (13, or mappable property: roadstop_min_bridge_height)</h4>
<p>This property allows or disallows building bridges over road stops.<br />
The bridge height property defines minimum clearances required for a bridge for each of the 6 views/rotations (or 0 to not allow any bridge). Values are given in height level units (1 level == 8px).<br />
Each height value is 1 byte, the total property length is 6 bytes.<br />
This property is not in the specification.
Each height value is 1 byte, the total property length is 6 bytes.
</p>
<h4 id="roadstop_disallowed_bridge_pillars">Road stop disallowed bridge pillars (14, or mappable property: roadstop_disallowed_bridge_pillars)</h4>
<p>This property describes which bridge pillars are not allowed on the road stop tile.<br />
It consists of a set of pillar flags, for each of the 6 road stop views/rotations.<br />
Each set of flags is 1 byte, the total property length is 6 bytes.<br />
Each set of flags has the format described in the <a href="newgrf-additions.html#bridge_pillar_flags">bridge_pillar_flags property section</a>.<br />
This property is not in the specification.
Each set of flags has the format described in the <a href="newgrf-additions.html#bridge_pillar_flags">bridge_pillar_flags property section</a>.
</p>
<h4 id="roadstop_cost_multipliers">Road stop cost multipliers (15, or mappable property: roadstop_cost_multipliers)</h4>
<p>This property sets the build and removal cost multipliers.<br />
The first byte is the build cost multiplier.<br />
The second byte is the removal cost multiplier.<br />
The total property length is 2 bytes.<br />
A value of 16 produces a build or removal cost the same as non-NewGRF road stops.
A value of 16 produces a build or removal cost the same as non-NewGRF road stops.</a>.
</p>
<h4 id="roadstop_height">Road stop height (in the build window) (16, or mappable property: roadstop_height)</h4>
<p>This property sets the height used to size the road stop build window previews.<br />
The nominal height for the road stop preview is set to at least: 32 + "value of this property" * 8.<br />
This similar to <a href="https://newgrf-specs.tt-wiki.net/wiki/Action0/Objects#Building_height_.2816.29">Object variable 16</a>.<br />
The total property length is 1 byte.<br />
This requires <font face="monospace">road_stops</font>, version 6.<br />
This property is not in the specification.
This requires <font face="monospace">road_stops</font>, version 6.
</p>
<p style="padding-top: 0.25em;">
@ -219,36 +212,36 @@
<h3 id="varaction2roadstops">Variational Action 2 - Road Stops</h3>
<p>See the <a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/Road_Stops">Variational Action 2 Road Stops Specification</a> for background information.</p>
<p>See the <a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2">Variational Action 2 Specification</a> for background information.</p>
<p>The parent scope for this feature is the road stop's station's town.</p>
<b>Variables:</b>
<table>
<tr><th>Number</th><th>Mappable name</th><th>Description</th><th>Difference to specification</th></tr>
<tr><td><a href="#roadstop_view">40</a></td><td><a href="#roadstop_view">roadstop_view</a></td><td>View/rotation</td><td></td></tr>
<tr><td><a href="#roadstop_type">41</a></td><td><a href="#roadstop_type">roadstop_type</a></td><td>Stop type</td><td>Road waypoint</td></tr>
<tr><td><a href="#roadstop_terrain_type">42</a></td><td><a href="#roadstop_terrain_type">roadstop_terrain_type</a></td><td>Terrain type</td><td></td></tr>
<tr><td><a href="#roadstop_road_type">43</a></td><td><a href="#roadstop_road_type">roadstop_road_type</a></td><td>Road type</td><td></td></tr>
<tr><td><a href="#roadstop_tram_type">44</a></td><td><a href="#roadstop_tram_type">roadstop_tram_type</a></td><td>Tram type</td><td></td></tr>
<tr><td><a href="#roadstop_town_zone">45</a></td><td><a href="#roadstop_town_zone">roadstop_town_zone</a></td><td>Town zone and Manhattan distance of town</td><td></td></tr>
<tr><td><a href="#roadstop_town_distance_squared">46</a></td><td><a href="#roadstop_town_distance_squared">roadstop_town_distance_squared</a></td><td>Square of Euclidean distance of town</td><td></td></tr>
<tr><td><a href="#roadstop_company_info">47</a></td><td><a href="#roadstop_company_info">roadstop_company_info</a></td><td>Player/company info</td><td></td></tr>
<tr><td><a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/BaseStation">48</a></td><td></td><td>Bitmask of accepted cargoes (BaseStation)</td><td></td></tr>
<tr><td><a href="#roadstop_animation_frame">49</a></td><td><a href="#roadstop_animation_frame">roadstop_animation_frame</a></td><td>Current animation frame</td><td></td></tr>
<tr><td><a href="#roadstop_misc_info">50</a></td><td><a href="#roadstop_misc_info">roadstop_misc_info</a></td><td>Miscellaneous info</td><td>Not in spec</td></tr>
<tr><td><a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/BaseStation">60</a></td><td></td><td>Amount of cargo waiting (BaseStation)</td><td></td></tr>
<tr><td><a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/BaseStation">61</a></td><td></td><td>Time since last cargo pickup (BaseStation)</td><td></td></tr>
<tr><td><a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/BaseStation">62</a></td><td></td><td>Rating of cargo (BaseStation)</td><td></td></tr>
<tr><td><a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/BaseStation">63</a></td><td></td><td>Time spent on route (BaseStation)</td><td></td></tr>
<tr><td><a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/BaseStation">64</a></td><td></td><td>Information about last vehicle picking cargo up (BaseStation)</td><td></td></tr>
<tr><td><a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/BaseStation">65</a></td><td></td><td>Amount of cargo acceptance (BaseStation)</td><td></td></tr>
<tr><td><a href="#roadstop_animation_frame_nearby_tiles">66</a></td><td><a href="#roadstop_animation_frame_nearby_tiles">roadstop_animation_frame_nearby_tiles</a></td><td>Animation frame of nearby tile</td><td></td></tr>
<tr><td><a href="#roadstop_land_info_nearby_tiles">67</a></td><td><a href="#roadstop_land_info_nearby_tiles">roadstop_land_info_nearby_tiles</a></td><td>Land info of nearby tiles</td><td></td></tr>
<tr><td><a href="#roadstop_road_stop_info_nearby_tiles">68</a></td><td><a href="#roadstop_road_stop_info_nearby_tiles">roadstop_road_stop_info_nearby_tiles</a></td><td>Road stop info of nearby tiles</td><td>Road waypoint, bits 24 - 31</td></tr>
<tr><td></td><td><a href="#roadstop_road_stop_info_nearby_tiles_v2">roadstop_road_stop_info_nearby_tiles_v2</a></td><td>Road stop info of nearby tiles (v2)</td><td>Not in spec</td></tr>
<tr><td><a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/BaseStation">69</a></td><td></td><td>Information about cargo accepted in the past (BaseStation)</td><td></td></tr>
<tr><td><a href="#roadstop_road_stop_grfid_nearby_tiles">6A</a></td><td><a href="#roadstop_road_stop_grfid_nearby_tiles">roadstop_road_stop_grfid_nearby_tiles</a></td><td>GRFID of nearby road stop tiles</td><td></td></tr>
<tr><td></td><td><a href="#roadstop_road_info_nearby_tiles">roadstop_road_info_nearby_tiles</a></td><td>Road info of nearby plain road tiles</td><td>Not in spec</td></tr>
<tr><th>Number</th><th>Mappable name</th><th>Description</th></tr>
<tr><td><a href="#roadstop_view">40</a></td><td><a href="#roadstop_view">roadstop_view</a></td><td>View/rotation</td></tr>
<tr><td><a href="#roadstop_type">41</a></td><td><a href="#roadstop_type">roadstop_type</a></td><td>Stop type</td></tr>
<tr><td><a href="#roadstop_terrain_type">42</a></td><td><a href="#roadstop_terrain_type">roadstop_terrain_type</a></td><td>Terrain type</td></tr>
<tr><td><a href="#roadstop_road_type">43</a></td><td><a href="#roadstop_road_type">roadstop_road_type</a></td><td>Road type</td></tr>
<tr><td><a href="#roadstop_tram_type">44</a></td><td><a href="#roadstop_tram_type">roadstop_tram_type</a></td><td>Tram type</td></tr>
<tr><td><a href="#roadstop_town_zone">45</a></td><td><a href="#roadstop_town_zone">roadstop_town_zone</a></td><td>Town zone and Manhattan distance of town</td></tr>
<tr><td><a href="#roadstop_town_distance_squared">46</a></td><td><a href="#roadstop_town_distance_squared">roadstop_town_distance_squared</a></td><td>Square of Euclidean distance of town</td></tr>
<tr><td><a href="#roadstop_company_info">47</a></td><td><a href="#roadstop_company_info">roadstop_company_info</a></td><td>Player/company info</td></tr>
<tr><td><a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/BaseStation">48</a></td><td></td><td>Bitmask of accepted cargoes (BaseStation)</td></tr>
<tr><td><a href="#roadstop_animation_frame">49</a></td><td><a href="#roadstop_animation_frame">roadstop_animation_frame</a></td><td>Current animation frame</td></tr>
<tr><td><a href="#roadstop_misc_info">50</a></td><td><a href="#roadstop_misc_info">roadstop_misc_info</a></td><td>Miscellaneous info</td></tr>
<tr><td><a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/BaseStation">60</a></td><td></td><td>Amount of cargo waiting (BaseStation)</td></tr>
<tr><td><a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/BaseStation">61</a></td><td></td><td>Time since last cargo pickup (BaseStation)</td></tr>
<tr><td><a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/BaseStation">62</a></td><td></td><td>Rating of cargo (BaseStation)</td></tr>
<tr><td><a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/BaseStation">63</a></td><td></td><td>Time spent on route (BaseStation)</td></tr>
<tr><td><a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/BaseStation">64</a></td><td></td><td>Information about last vehicle picking cargo up (BaseStation)</td></tr>
<tr><td><a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/BaseStation">65</a></td><td></td><td>Amount of cargo acceptance (BaseStation)</td></tr>
<tr><td><a href="#roadstop_animation_frame_nearby_tiles">66</a></td><td><a href="#roadstop_animation_frame_nearby_tiles">roadstop_animation_frame_nearby_tiles</a></td><td>Animation frame of nearby tile</td></tr>
<tr><td><a href="#roadstop_land_info_nearby_tiles">67</a></td><td><a href="#roadstop_land_info_nearby_tiles">roadstop_land_info_nearby_tiles</a></td><td>Land info of nearby tiles</td></tr>
<tr><td><a href="#roadstop_road_stop_info_nearby_tiles">68</a></td><td><a href="#roadstop_road_stop_info_nearby_tiles">roadstop_road_stop_info_nearby_tiles</a></td><td>Road stop info of nearby tiles</td></tr>
<tr><td></td><td><a href="#roadstop_road_stop_info_nearby_tiles_v2">roadstop_road_stop_info_nearby_tiles_v2</a></td><td>Road stop info of nearby tiles (v2)</td></tr>
<tr><td><a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/BaseStation">69</a></td><td></td><td>Information about cargo accepted in the past (BaseStation)</td></tr>
<tr><td><a href="#roadstop_road_stop_grfid_nearby_tiles">6A</a></td><td><a href="#roadstop_road_stop_grfid_nearby_tiles">roadstop_road_stop_grfid_nearby_tiles</a></td><td>GRFID of nearby road stop tiles</td></tr>
<tr><td><a href="#roadstop_road_info_nearby_tiles">6B</a></td><td><a href="#roadstop_road_info_nearby_tiles">roadstop_road_info_nearby_tiles</a></td><td>Road info of nearby plain road tiles</td></tr>
</table>
<h4 id="roadstop_view">Road stop view/rotation (40, or mappable variable: roadstop_view)</h4>
@ -268,20 +261,13 @@
</p>
<h4 id="roadstop_terrain_type">Road stop tile terrain type (42, or mappable variable: roadstop_terrain_type)</h4>
<p>This has the same value as bits 0 - 15 of <a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/Objects#Tile_information_.2841.29">object (feature F) variable 41</a>.
<p>This has the same value as bits 0 - 7 of <a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/Objects#Tile_information_.2841.29">object (feature F) variable 41</a>.
<table>
<tr><th>Bit</th><th>Meaning</th></tr>
<tr><td>0 - 7</td><td>
Terrain type:<br />
0 - Normal<br />
1 - Desert<br />
2 - Rainforest<br />
3 - On or above snowline
</td></tr>
<tr><td>8 - 15</td><td>
Tile slope<br />
This requires <font face="monospace">road_stops</font>, version 10.
</td></tr>
<tr><th>Value</th><th>Meaning</th></tr>
<tr><td>0</td><td>Normal</td></tr>
<tr><td>1</td><td>Desert</td></tr>
<tr><td>2</td><td>Rainforest</td></tr>
<tr><td>4</td><td>On or above snowline</td></tr>
</table>
</p>
@ -339,8 +325,7 @@
</td></tr>
</table>
<br />
The remaining bits are reserved for future use and should be masked.<br />
This variable is not in the specification.
The remaining bits are reserved for future use and should be masked.
</p>
<h4 id="roadstop_animation_frame_nearby_tiles">Animation frame of nearby tile (66, or mappable variable: roadstop_animation_frame_nearby_tiles)</h4>
@ -371,7 +356,7 @@
<tr><td>16 - 19</td><td>
0 - Passenger/bus stop<br />
1 - Freight/lorry stop<br />
2 - Road waypoint (not in specification)
2 - Road waypoint
</td></tr>
<tr><td>20</td><td>Set if the stop type (passenger/bus, freight/lorry or road waypoint) is the same as the current tile</td></tr>
<tr><td>21 - 22</td><td>
@ -386,8 +371,7 @@
This can be ignored if this GRF does not have any road stop setIDs greater than 255 (does not define more than 256 road stop types).<br />
This requires <font face="monospace">road_stops</font>, version 7.<br />
<br />
If the <font face="monospace">road_stops</font> feature is not tested for, this is set to 0.<br />
This is not in the specification.
If the <font face="monospace">road_stops</font> feature is not tested for, this is set to 0.
</td></tr>
</table>
<br />
@ -424,14 +408,13 @@
</table>
<br />
The remaining bits are reserved for future use and should be masked.<br />
This requires <font face="monospace">road_stops</font>, version 7.<br />
This variable is not in the specification.
This requires <font face="monospace">road_stops</font>, version 7.
</p>
<h4 id="roadstop_road_stop_grfid_nearby_tiles">GRFID of nearby road stop tile (6A, or mappable variable: roadstop_road_stop_grfid_nearby_tiles)</h4>
<p>This has the same value as <a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/Stations#GRFID_of_nearby_station_tile_.286A.29">station (feature 4) variable 6A</a>.</p>
<h4 id="roadstop_road_info_nearby_tiles">Road info of nearby plain road tiles (mappable variable: roadstop_road_info_nearby_tiles)</h4>
<h4 id="roadstop_road_info_nearby_tiles">Road info of nearby plain road tiles (6B, or mappable variable: roadstop_road_info_nearby_tiles)</h4>
The returned value is 0xFFFFFFFF if the selected tile isn't a plain road tile.<br /><br />
@ -461,17 +444,13 @@
<br />
The remaining bits are reserved for future use and should be masked.
<br />
This requires <font face="monospace">road_stops</font>, version 5.<br />
This variable is not in the specification.
This requires <font face="monospace">road_stops</font>, version 5.
</p>
<br />
<h3 id="randomaction2roadstops">Random Action 2 - Road Stops</h3>
<p>See the <a href="https://newgrf-specs.tt-wiki.net/wiki/RandomAction2#Road_stops">Random Action 2 Road Stops Specification</a> for information.</p>
<details>
<summary>Same as standard specification</summary>
<p>See the <a href="https://newgrf-specs.tt-wiki.net/wiki/RandomAction2">Random Action 2 Specification</a> for background information.</p>
<p>Road stops have 16+8 random bits. Bits 0 to 15 are a property of the station as a whole, and bits 16 to 23 are different for each tile.
@ -491,7 +470,6 @@
Triggers 04, 08, and 10 only affect the tile on which they occur, as well as the random bits of the station, but not other tiles.
</p>
<br />
</details>
<h3 id="a3roadstops">Action 3 - Road Stops</h3>

@ -74,7 +74,7 @@
<ul>
<li>The number of houses in the town changes</li>
<li>When the game is loaded</li>
<li>When settings, NewGRFs or other relevant game configuration is changed</li>
<li>When settings, NewGRFs or other relavant game configuration is changed</li>
</ul>
</p>

@ -105,7 +105,7 @@
<ul>
<li>The number of houses in the town changes</li>
<li>When the game is loaded</li>
<li>When settings, NewGRFs or other relevant game configuration is changed</li>
<li>When settings, NewGRFs or other relavant game configuration is changed</li>
</ul>
</p>

@ -1,6 +1,6 @@
.\" Hey, EMACS: -*- nroff -*-
.\" Please adjust this date whenever revising the manpage.
.Dd August 12, 2023
.Dd October 13, 2014
.Dt OPENTTD 6
.Os
.Sh NAME
@ -8,17 +8,18 @@
.Nd open source clone of the Microprose game \(lqTransport Tycoon Deluxe\(rq
.Sh SYNOPSIS
.Nm
.Op Fl efhQxX
.Op Fl efhx
.Op Fl b Ar blitter
.Op Fl c Ar config_file
.Op Fl d Op Ar level | Ar cat Ns = Ns Ar lvl Ns Op , Ns Ar ...
.Op Fl D Oo Ar host Oc Ns Op : Ns Ar port
.Op Fl g Op Ar file
.Op Fl g Op Ar savegame
.Op Fl G Ar seed
.Op Fl I Ar graphicsset
.Op Fl l Ar host Ns Op : Ns Ar port
.Op Fl m Ar driver
.Op Fl M Ar musicset
.Op Fl n Ar host Ns Oo : Ns Ar port Oc Ns Op # Ns Ar company
.Op Fl n Ar host Ns Oo : Ns Ar port Oc Ns Op # Ns Ar player
.Op Fl p Ar password
.Op Fl P Ar password
.Op Fl q Ar savegame
@ -28,7 +29,7 @@
.Op Fl t Ar year
.Op Fl v Ar driver
.Sh OPTIONS
.Bl -tag -width "-n host[:port][#company]"
.Bl -tag -width "-n host[:port][#player]"
.It Fl b Ar blitter
Select the blitter
.Ar blitter ;
@ -62,11 +63,11 @@ Start in world editor mode.
.It Fl f
Fork into background (dedicated server only, see
.Fl D ) .
.It Fl g Op Ar file
.It Fl g Op Ar savegame
Load
.Ar file
(can be either a savegame, scenario, or heightmap) at start or start a new game if omitted.
.Ar file
.Ar savegame
at start or start a new game if omitted.
.Ar savegame
must be either an absolute path or one relative to the current path or one of
the search paths.
.It Fl G Ar seed
@ -81,6 +82,11 @@ Select the graphics set
see
.Fl h
for a full list.
.It Fl l Ar host Ns Op : Ns Ar port
Redirect
.Fn DEBUG
output; see
.Fl D .
.It Fl m Ar driver
Select the music driver
.Ar driver ;
@ -93,8 +99,8 @@ Select the music set
see
.Fl h
for a full list.
.It Fl n Ar host Ns Oo : Ns Ar port Oc Ns Op # Ns Ar company
Join a network game, optionally specifying a port to connect to and company to
.It Fl n Ar host Ns Oo : Ns Ar port Oc Ns Op # Ns Ar player
Join a network game, optionally specifying a port to connect to and player to
play as.
.It Fl p Ar password
Password used to join server.
@ -106,14 +112,6 @@ Only useful with
.Fl n .
.It Fl q Ar savegame
Write some information about the specified savegame and exit.
.It Fl Q
Don't scan for/load NewGRF files on startup.
.Pp
Passing
.Fl Q
twice (so,
.Fl QQ
) will disable NewGRF scanning/loading entirely.
.It Fl r Ar width Ns x Ns Ar height
Set the resolution to
.Ar width
@ -143,8 +141,6 @@ see
for a full list.
.It Fl x
Do not automatically save to config file on exit.
.It Fl X
Do not use global folders to search for files.
.El
.Sh SEE ALSO
.Lk https://wiki.openttd.org "Wiki"

@ -1,214 +0,0 @@
# OpenTTD's Savegame Format
Last updated: 2021-06-15
## Outer container
Savegames for OpenTTD start with an outer container, to contain the compressed data for the rest of the savegame.
`[0..3]` - The first four bytes indicate what compression is used.
In ASCII, these values are possible:
- `OTTD` - Compressed with LZO (deprecated, only really old savegames would use this).
- `OTTN` - No compression.
- `OTTZ` - Compressed with zlib.
- `OTTX` - Compressed with LZMA.
`[4..5]` - The next two bytes indicate which savegame version used.
`[6..7]` - The next two bytes can be ignored, and were only used in really old savegames.
`[8..N]` - Next follows a binary blob which is compressed with the indicated compression algorithm.
The rest of this document talks about this decompressed blob of data.
## Data types
The savegame is written in Big Endian, so when we talk about a 16-bit unsigned integer (`uint16`), we mean it is stored in Big Endian.
The following types are valid:
- `1` - `int8` / `SLE_FILE_I8` -8-bit signed integer
- `2` - `uint8` / `SLE_FILE_U8` - 8-bit unsigned integer
- `3` - `int16` / `SLE_FILE_I16` - 16-bit signed integer
- `4` - `uint16` / `SLE_FILE_U16` - 16-bit unsigned integer
- `5` - `int32` / `SLE_FILE_I32` - 32-bit signed integer
- `6` - `uint32` / `SLE_FILE_U32` - 32-bit unsigned integer
- `7` - `int64` / `SLE_FILE_I64` - 64-bit signed integer
- `8` - `uint64` / `SLE_FILE_U64` - 64-bit unsigned integer
- `9` - `StringID` / `SLE_FILE_STRINGID` - a StringID inside the OpenTTD's string table
- `10` - `str` / `SLE_FILE_STRING` - a string (prefixed with a length-field)
- `11` - `struct` / `SLE_FILE_STRUCT` - a struct
### Gamma value
There is also a field-type called `gamma`.
This is most often used for length-fields, and uses as few bytes as possible to store an integer.
For values <= 127, it uses a single byte.
For values > 127, it uses two bytes and sets the highest bit to high.
For values > 32767, it uses three bytes and sets the two highest bits to high.
And this continues till the value fits.
In a more visual approach:
```
0xxxxxxx
10xxxxxx xxxxxxxx
110xxxxx xxxxxxxx xxxxxxxx
1110xxxx xxxxxxxx xxxxxxxx xxxxxxxx
11110--- xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx
```
## Chunks
Savegames for OpenTTD store their data in chunks.
Each chunk contains data for a certain part of the game, for example "Companies", "Vehicles", etc.
`[0..3]` - Each chunk starts with four bytes to indicate the tag.
If the tag is `\x00\x00\x00\x00` it means the end of the savegame is reached.
An example of a valid tag is `PLYR` when looking at it via ASCII, which contains the information of all the companies.
`[4..4]` - Next follows a byte where the lower 4 bits contain the type.
The possible valid types are:
- `0` - `CH_RIFF` - This chunk is a binary blob.
- `1` - `CH_ARRAY` - This chunk is a list of items.
- `2` - `CH_SPARSE_ARRAY` - This chunk is a list of items.
- `3` - `CH_TABLE` - This chunk is self-describing list of items.
- `4` - `CH_SPARSE_TABLE` - This chunk is self-describing list of items.
Now per type the format is (slightly) different.
### CH_RIFF
(since savegame version 295, this chunk type is only used for MAP-chunks, containing bit-information about each tile on the map)
A `CH_RIFF` starts with an `uint24` which together with the upper-bits of the type defines the length of the chunk.
In pseudo-code:
```
type = read uint8
if type == 0
length = read uint24
length |= ((type >> 4) << 24)
```
The next `length` bytes are part of the chunk.
What those bytes mean depends on the tag of the chunk; further details per chunk can be found in the source-code.
### CH_ARRAY / CH_SPARSE_ARRAY
(this chunk type is deprecated since savegame version 295 and is no longer in use)
`[0..G1]` - A `CH_ARRAY` / `CH_SPARSE_ARRAY` starts with a `gamma`, indicating the size of the next item plus one.
If this size value is zero, it indicates the end of the list.
This indicates the full length of the next item minus one.
In psuedo-code:
```
loop
size = read gamma - 1
if size == -1
break loop
read <size> bytes
```
`[]` - For `CH_ARRAY` there is an implicit index.
The loop starts at zero, and every iteration adds one to the index.
For entries in the game that were not allocated, the `size` will be zero.
`[G1+1..G2]` - For `CH_SPARSE_ARRAY` there is an explicit index.
The `gamma` following the size indicates the index.
The content of the item is a binary blob, and similar to `CH_RIFF`, it depends on the tag of the chunk what it means.
Please check the source-code for further details.
### CH_TABLE / CH_SPARSE_TABLE
(this chunk type only exists since savegame version 295)
Both `CH_TABLE` and `CH_SPARSE_TABLE` are very similar to `CH_ARRAY` / `CH_SPARSE_ARRAY` respectively.
The only change is that the chunk starts with a header.
This header describes the chunk in details; with the header you know the meaning of each byte in the binary blob that follows.
`[0..G]` - The header starts with a `gamma` to indicate the size of all the headers in this chunk plus one.
If this size value is zero, it means there is no header, which should never be the case.
Next follows a list of `(type, key)` pairs:
- `[0..0]` - Type of the field.
- `[1..G]` - `gamma` to indicate length of key.
- `[G+1..N]` - Key (in UTF-8) of the field.
If at any point `type` is zero, the list stops (and no `key` follows).
The `type`'s lower 4 bits indicate the data-type (see chapter above).
The `type`'s 5th bit (so `0x10`) indicates if the field is a list, and if this field in every record starts with a `gamma` to indicate how many times the `type` is repeated.
If the `type` indicates either a `struct` or `str`, the `0x10` flag is also always set.
As the savegame format allows (list of) structs in structs, if any `struct` type is found, this header will be followed by a header of that struct.
This nesting of structs is stored depth-first, so given this table:
```
type | key
-----------------
uint8 | counter
struct | substruct1
struct | substruct2
```
With `substruct1` being like:
```
type | key
-----------------
uint8 | counter
struct | substruct3
```
The headers will be, in order: `table`, `substruct1`, `substruct3`, `substruct2`, each ending with a `type` is zero field.
After reading all the fields of all the headers, there is a list of records.
To read this, see `CH_ARRAY` / `CH_SPARSE_ARRAY` for details.
As each `type` has a well defined length, you can read the records even without knowing anything about the chunk-tag yourself.
Do remember, that if the `type` had the `0x10` flag active, the field in the record first has a `gamma` to indicate how many times that `type` is repeated.
#### Guidelines for network-compatible patch-packs
For network-compatible patch-packs (client-side patches that can play together with unpatched clients) we advise to prefix the field-name with `__<shortname>` when introducing new fields to an existing chunk.
Example: you have an extra setting called `auto_destroy_rivers` you want to store in the savegame for your patched client called `mypp`.
We advise you to call this setting `__mypp_auto_destroy_rivers` in the settings chunk.
Doing it this way ensures that a savegame created by these patch-packs can still safely be loaded by unpatched clients.
They will simply ignore the field and continue loading the savegame as usual.
The prefix is strongly advised to avoid conflicts with future-settings in an unpatched client or conflicts with other patch-packs.
## Scripts custom data format
Script chunks (`AIPL` and `GSDT`) use `CH_TABLE` chunk type.
At the end of each record there's an `uint8` to indicate if there's custom data (1) or not (0).
There are 6 data types for scripts, called `script-data-type`.
When saving, each `script-data-type` starts with the type marker saved as `uint8` followed by the actual data.
- `0` - `SQSL_INT`:
- an `int64` with the actual value (`int32` before savegame version 296).
- `1` - `SQSL_STRING`:
- an `uint8` with the string length.
- a list of `int8` for the string itself.
- `2` - `SQSL_ARRAY`:
- each element saved as `script-data-type`.
- an `SQSL_ARRAY_TABLE_END` (0xFF) marker (`uint8`).
- `3` - `SQSL_TABLE`:
- for each element:
- key saved as `script-data-type`.
- value saved as `script-data-type`.
- an `SQSL_ARRAY_TABLE_END` (0xFF) marker (`uint8`).
- `4` - `SQSL_BOOL`:
- an `uint8` with 0 (false) or 1 (true).
- `5` - `SQSL_NULL`:
- (no data follows)
The first data type is always a `SQSL_TABLE`.

@ -104,14 +104,6 @@
<div class="code">static bool IsTownBuildableRoadType(RoadType roadtype)</div>
<div class="methodtext">Checks whether the given road type is buildable by towns.</div>
</div>
<div class="indent">
<div class="code">static RoadPieces GetRoadPieces(TileIndex tile, RoadTramTypes road_tram_type)</div>
<div class="methodtext">Get the RoadPieces that are on a tile.</div>
</div>
<div class="indent">
<div class="code">static OneWayInfo GetOneWayInfo(TileIndex tile)</div>
<div class="methodtext">Get info about the one-way state of a tile.</div>
</div>
</div>
<h3 id="company">Company: <a href="https://docs.openttd.org/gs-api/classGSCompany.html">GSCompany Class</a> and <a href="https://docs.openttd.org/ai-api/classAICompany.html">AICompany Class</a></h3>

@ -1,34 +0,0 @@
# OpenTTD's Symbol Server
For all official releases, OpenTTD collects the Breakpad Symbols (SYM-files) and Microsoft's Symbols (PDB-files), and publishes them on our own Symbol Server (https://symbols.openttd.org).
These symbol files are needed to analyze `crash.dmp` files as attached to issues by users.
A `crash.dmp` is created on Windows, Linux, and MacOS when a crash happens.
This combined with the `crash.log` should give a pretty good indication what was going on at the moment the game crashed.
## Analyzing a crash.dmp
### MSVC
In MSVC you can add the above URL as Symbol Server (and please enable MSVC's for all other libraries), allowing you to analyze `crash.dmp`.
Now simply open up the `crash.dmp`, and start debugging.
### All other platforms
The best tool to use is `minidump-stackwalk` as published in the Rust's cargo index:
```bash
cargo install --locked minidump-stackwalk
```
For how to install Rust, please see [here](https://doc.rust-lang.org/cargo/getting-started/installation.html).
Now run the tool like:
```bash
minidump-stackwalk <crash.dmp> --symbols-url https://symbols.openttd.org
```
For convenience, the above Symbol Server also check with Mozilla's Symbol Server in case any other library but OpenTTD is requested.
This means files like `libc`, `kernel32.dll`, etc are all available on the above mentioned Symbol Server.

@ -2,229 +2,6 @@
* * *
### v0.59.1 (2024-05-20)
* Fix crash when sorting by capacity in autoreplace window.
* Fix non-percentage servicing interval when using wallclock mode.
* Fix road vehicles skipping orders when using implicit orders.
* Fix setting default value for industry cargo scaling mode when loading old savegames.
* Fix setting display for industry cargo scaling.
* Fix crash which could occur when using autorenew/autoreplace wagon removal with leading engines longer than the train length limit.
* Fix crash which could occur with loading certain GRFs.
* Fix multiplayer desync when joining a server after previously loading a scenario.
* Fix keyboard input issues on Linux/SDL.
* Realistic braking:
* Fix accuracy issues with realistic acceleration and braking when a train is underpowered for ascending or descending a steep slope.
* Reduce sensitivity of train brakes overheated breakdown.
* Add setting to shorten vehicle view status text.
* Bump trunk base from commit bd7120bae41b6e7ac86c664c8220b59cd57242bb to commit 88cf99017a26f887230d2c14d057a97bbf077f7c.
### v0.59.0 (2024-05-05)
* Fix loading recent vanilla savegame versions resulting in incorrect industry cargoes.
* Fix incorrect station catchment/acceptance which could occur when an oil rig/water industry completed construction, which could cause multiplayer desyncs.
* Fix AI construction of block signals when using realistic braking.
* Fix incorrect train weights being used for calculating infrastructure sharing track fees.
* Fix vehicles leaving dots behind in viewport map mode in some cases.
* Fix NewGRF train motion animations for some NewGRFs which use articulated engines.
* Fix template-based train replacement not triggering replacements for companies nominally in debt when using the infinite money setting.
* Fix text filters in dual-pane train purchase window when using NewGRFs with variable vehicle names.
* Road vehicles no longer remaining loading when the next order is for the same station if the next order has a different required direction.
* Enable the cargo capacity/running cost sort mode in the dual pane train purchase window.
* The vehicle capacity sort modes in the build vehicle windows now take into account the selected refit cargo.
* Timekeeping:
* The day length factor setting is now enabled in wallclock timekeeping mode. This scales the economy speed, but not the calendar speed.
* Fix timing of engine preview offers in wallclock timekeeping mode.
* Scheduled dispatch:
* When using scheduled dispatch and timetable automation at the same time, vehicle lateness values are no longer reset when congestion is detected.
* The number of vehicles required text is now clarified to be an estimate.
* Further increase effect size of cargo dist effect of distance on demand setting for values greater than 100%.
* Further reduce the possibility of stuttering when playing sound effects on Windows.
* Bump trunk base from commit 3e625b5b1a81b00f774ca87b48d3e4f4e9d014c3 to commit bd7120bae41b6e7ac86c664c8220b59cd57242bb.
### v0.58.3 (2024-04-10)
* Fix stuttering when playing sound effects on Windows.
* Fix incorrect cargo payment calculations for cargo in the mail compartment of aircraft and in non-first parts of multi-part ships.
* Fix path-only signal cycle mode being ignored when using realistic braking.
* Template-based train replacement:
* Fix replacement failing when using NewGRFs with complex wagon attachment and/or start/stop restrictions.
* Fix incorrect cost estimation when using NewGRFs with complex start/stop restrictions.
* Wallclock timekeeping mode:
* Fix game units (tiles/second) being shown as tiles/day.
* Fix time units shown for past production in the industry window.
* Fix cargo dist effect of distance on demand setting for values greater than 100%. (The scaling/demand allocation algorithm has been adjusted in general).
* Fix velocity units used in cargo payments graph x-axis label.
* Fix click/tooltip alignment of cargo lines in the industry chains window.
* Fix changing sprite alignments in the sprite aligner window not being applied as expected.
### v0.58.2 (2024-03-28)
* Fix crash with some GRFs when the maximum sprite resolution setting was set to 2x.
* Fix crash which could occur when clearing a crashed road vehicle from a drive-through road stop.
* Fix crash when the autosave uses real time setting and the autosave interval were both disabled.
* Fix crash which could occur after removing road from a one-way road/tram road stop.
* Fix drawing of black text in some drop-down menus.
* Fix incorrect handling of invalid or empty dispatch schedules in the departure board window.
* Fix handling of missing last or next scheduled dispatch times.
* Fix changes to the title game zoom level when changing the UI scale setting.
* Fix vehicles leaving dots behind in viewport map mode in some cases.
* Fix incorrect sprites being shown for some GRFs.
* Fix crash in the engine preview window with certain GRFs.
* Fix road vehicles not remaining loading as expected when the next order is for the same station.
* Fix train unit numbers being incorrectly marked as in use after an autoreplace operation.
* Allow manually removing/setting train speed restrictions from the vehicle details window.
* Allow removing a vehicle from slots owned by the current company from the vehicle details window.
* Show viewport route step markers for go via station orders using a different tag.
* Add setting to show purchased land using clear tile ground sprites (dirt, grass, snow, desert, etc).
* Add ctrl-click scroll-to for stations referenced by conditional orders.
* Allow industry monthly production and transported totals to be greater than 64k.
* Allow engine reliability increases but not decreases after the no vehicles expire after year setting is reached.
* Remove setting to disable script parameter randomisation, because the feature has been removed.
* Fix signature validation for social/presence plugins.
* Bump trunk base from commit a602845d0a35331f1e012cd13ca921c6bc42b58d to commit 3e625b5b1a81b00f774ca87b48d3e4f4e9d014c3.
### v0.58.1 (2024-03-02)
* Fix multiplayer desync after joining a server with the flood from edges setting enabled.
* Fix timetabled waiting in depots.
* Fix incorrect accounting of company quarterly statistics.
* Fix trains failing to load at stations in some cases after leaving a conditional order loading loop at the previous station.
* Fix the company infrastructure window not being drawn as a company window and not being removed on company deletion.
* Fix main viewport crash or only partial redraw when changing the UI scale using the slider.
* Fix display of ships entering viewports on an aqueduct.
* Allow adding plans in the scenario editor.
* Add setting for whether to show vehicle running costs per calendar year.
* Add setting for whether to show speed before destination in vehicle status bar.
* Add setting to disable script parameter randomisation.
* Add "path signals only" mode to the signal cycle setting.
* Adjust display of period numbers in wallclock time-keeping mode.
* Stop engine reliability decay once the no vehicles expire after year setting is reached, instead of when the no vehicles expire and introduced after year settings are both reached.
* Add NewGRF custom signal style flag to draw signal sprites on both sides.
* Bump trunk base from commit 8bccb5805a94eb2acb0e581185ca34090f2b1397 to commit a602845d0a35331f1e012cd13ca921c6bc42b58d.
### v0.58.0 (2024-02-24)
* Fix crash when road vehicles change length in drive-through road stops (e.g. due to refits).
* Fix crash when showing the savegame file overwrite warning for a save with no readable version.
* Fix crash when joining a network server which used GRF custom town zones.
* Fix road vehicles being deleted in a bay road stop leaving the stop marked as occupied.
* Fix handling of airport noise/count limits in local authority permissive mode.
* Fix rail toolbar layout when polyrail button is hidden.
* Fix multi-cargo ship capacity display in the autoreplace and available ships windows.
* Fix displayed speed units in station rating tooltip.
* Fix warning messages when loading very old savegames.
* Fix crash which could occur on Windows when closing the game by closing its attached debug console.
* Fix clicking vehicle window drop-down menus hiding vehicle overlay lines/markers.
* Time-keeping:
* Add support for vanilla wallclock mode.
* No longer scale displayed running costs by the day length factor, show per original year.
* Fix news message durations being scaled by the day length factor.
* Add support for vanilla unbunching.
* Add setting to only spawn primary industries.
* Reduce flickering/sprite sorting problems for vehicles and catenary diagonally underneath bridges.
* Add road vehicle stop direction to the order window manage order dropdown.
* Disable company-only zoning overlay modes in spectator mode.
* Increase pathfinding limit for river generation.
* Bump trunk base from commit 6b21368bc2fdef6877ef5930f94e85719b670a76 to commit 8bccb5805a94eb2acb0e581185ca34090f2b1397.
### v0.57.1 (2024-02-04)
* Fix crashes or rendering problems which could occur in some cases when multiple viewports were active.
* Fix not being able to change both the hour and minute in the non-text timetable time dialog.
* Fix the picker tool not selecting the specific station/waypoint in a class, in the rail station, road stop and waypoint windows.
* Fix secondary colour vehicle-type default liveries not being updated when changing the company default.
* Fix vehicles leaving pixels behind on the viewport when zoomed out and moving left in some cases.
* Prevent dragging plan lines across viewports, as this causes erratic plans.
* Routing restrictions:
* Fix slot acquire on PBS reservation end on tunnel/bridge entrance signals.
* Wait at PBS signal on signals in the middle of a reservation is now only applied when reserving through the signal in the forward direction (not backwards PBS).
* Multi-cargo ships:
* Fix build and refit with multi-cargo ships only refitting the first part.
* Fix sort by total cargo in build ship window only considering the first part.
### v0.57.0 (2024-01-30)
* Fix crashes which could occur with some NewGRFs.
* Fix crash which could occur when trying to extend an invalidated reservation when using realistic braking.
* Fix crash when updating the timetable of a late train when the total timetable duration is 0.
* Fix road stops/waypoints not using road type custom one-way sprites.
* Fix incorrect time since pickup values in the station rating tooltip when using a day length other than 1.
* Fix incorrect date/time display after the year 79455.
* Fix pre-selected AIs not being loaded from the config file.
* Fix incorrect sorting of towns by distance in the scenario editor house picker town selector.
* Fix enabling the map edge water mode setting when edge tiles were not previously flat.
* Fix cargo icons not being shown in the dual-pane train purchase window.
* Fix ctrl-dragging onto the new group button in group list window not including all vehicles.
* Fix texts for the amount of rivers setting in the settings window.
* Fix various issues loading some very old savegames.
* Fix upgrading bridges partially clearing custom signal styles and routing restrictions.
* Fix cloning a train directly from the template replacement window not setting the default service interval and timetable modes.
* Fix vehicle timetables and train speed adaptation not being correctly updated in the scenario editor.
* Change town and industry cargo production scaling settings to be linear instead of exponential.
* Routing restrictions:
* No longer try to acquire slots a second time when the front of the train passes the signal, if this had already been done when reserving.
* Remove the try to acquire (on reserve) slot mode, it's now the same as try to acquire.
* Add a release on reserve slot mode.
* Reservations now support slot acquire and wait at PBS for reserve-through and backwards PBS signals in the middle of reservations (waiting happens at the reservation start signal).
* Fix prematurely acquiring slots on tunnel/bridge exit signals.
* Scheduled dispatch:
* Show when last/next departure time are more than 23 hours in the past/future.
* Add schedule and per-departure flags to allow departure slots to be used more than once.
* Allow tagging individual departure slots for testing with the last/next departure slot conditional order.
* Resetting the last dispatched time now clears it entirely instead of setting it to the start of the current schedule period.
* Orders:
* Fix duplicating orders not always preserving the order colour.
* Add order stop location to the manage order dropdown.
* Add a try to acquire slot non-conditional order.
* Improve handling of conditional orders with vehicle route lines
* Increase maximum distance from the shore for tunnels under water.
* Add setting for whether to show the rail polyline tool in the rail toolbar.
* Used a curved instead of a square area for water desert removal during map generation in tropical.
* Improve performance of drawing and scrolling when link graph lines are drawn over viewports in map mode.
* Add hotkey to toggle vehicle in tunnel transparency (ctrl-0).
* Linux: Provide a pre-built dedicated server binary. The generic linux build now uses a newer glibc, a legacy build is provided for older systems.
* Vanilla OpenTTD (and this patchpack) now requires C++20 to compile. (Minimum compiler versions: gcc 10, clang 15).
* Bump trunk base from commit feb94d233d8fdceff193a4c59298960d8148d470 to commit 6b21368bc2fdef6877ef5930f94e85719b670a76.
### v0.56.2 (2023-12-30)
* Fix signals incorrectly being considered always reserve through even after the program was modified to remove this, in some cases.
* Fix high-speed trains reversing at waypoints/behind signals failing to stop and reverse in some cases.
* Fix incorrect graphics/behaviour and blocked/wire/pylon states with certain rail station NewGRFs.
* Fix incorrect time conversions to/from minutes when using clock offsets in some cases.
* Fix infrastructure totals and road/tram type conversion behaviour when using road/tram bridges where the two ends have different road/tram owners.
* Fix online content downloads halting before completion or causing crashes in some cases.
* Add setting to allow auto-fill signal dragging to skip over stations/waypoints.
* Add setting for map edge behaviour, and whether to display the area outside map as water.
* Add a company setting to set the default dispatch schedule duration.
* Increase sign text length limit.
* Remove "Show cargo type filter in vehicle lists" setting, now always enabled.
* Enable the opt-in OpenTTD survey functionality: https://survey.openttd.org/participate.
* Bump trunk base from commit ab535c0a8665e6380c5037d7b6f0a507fc91d36a to commit feb94d233d8fdceff193a4c59298960d8148d470.
### v0.56.1 (2023-12-08)
* Fix crash which could occur when using some languages (which use grammatical gender).
* Fix crash which could occur when the config file is an older version or has missing sections.
* Fix PBS reservation overlays of the wrong track type on dual rail-type tiles.
* Fix profit/usage totals not being initially populated when opening the group/vehicle list window.
* Fix depot ctrl-right-click tooltip with multiple cargoes.
* Fix incorrect search path ordering in some cases when using the -c switch.
* Fix false positive desync warning messages after custom signal styles are removed.
* Fix incorrect title text in some query windows.
* Fix ctrl-click signal cycling not checking custom signal style restrictions.
* Routing restrictions: Slots are no longer considered "advanced".
* Change the settings for using default signal graphics and restricted signal post recolouring.
* Add unset hotkey to close order window.
* Link graph: Take vehicle timetables into account when estimating the travel time for order-based link refreshing.
* Scenario editor: Fix being able to remove towns referenced by waypoints.
* Bump trunk base from commit 2d3fef31131c2d9981265664c1581ca11dc2c2d3 to commit ab535c0a8665e6380c5037d7b6f0a507fc91d36a.
### v0.56.0 (2023-11-26)
* Fix crash which could occur in the sprite aligner window.
* Fix crash which could occur when laying out text in some cases.
* Fix crash which could occur when loading some very old save games.
* Fix vehicle lateness updates when using timetabled 0 wait times.
* Fix temporary link graph issues after loading vanilla or old patch pack save games.
* Improve train speed adaptation when used with realistic braking enabled.
* Add long reserve (unless stopping) routing restriction action.
* Add settings filter to only show non-vanilla settings.
* Add setting for whether water floods from map edges.
* Add setting for whether to hide default stop location.
* Remove "show order management button" setting.
* Bump trunk base from commit 3effb8931c36b8bbacae8fe77ad5b85406767d9f to commit 2d3fef31131c2d9981265664c1581ca11dc2c2d3.
### v0.55.3 (2023-09-24)
* Fix crash which could occur when using the autoreplace button in depot windows to do template replacements.
* Fix crash which could occur in the autoreplace window when clicking the right panel when no item is selected in the left panel.

@ -17,10 +17,6 @@ set(BASESET_OTHER_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/openttd.grf
${CMAKE_CURRENT_SOURCE_DIR}/opntitle.dat
${CMAKE_CURRENT_SOURCE_DIR}/orig_extra.grf
${CMAKE_CURRENT_SOURCE_DIR}/OpenTTD-Sans.ttf
${CMAKE_CURRENT_SOURCE_DIR}/OpenTTD-Serif.ttf
${CMAKE_CURRENT_SOURCE_DIR}/OpenTTD-Small.ttf
${CMAKE_CURRENT_SOURCE_DIR}/OpenTTD-Mono.ttf
${CMAKE_CURRENT_SOURCE_DIR}/innerhighlight.grf
${CMAKE_CURRENT_SOURCE_DIR}/progsignals.grf
${CMAKE_CURRENT_SOURCE_DIR}/extra_signals.grf
@ -63,7 +59,6 @@ foreach(BASESET_SOURCE_FILE IN LISTS BASESET_SOURCE_FILES)
MAIN_DEPENDENCY ${BASESET_SOURCE_FILE}
DEPENDS ${LANG_SOURCE_FILES}
${BASESET_EXTRAGRF_FILE}
${BASESET_EXTRAGRF_FILE}.hash
${CMAKE_SOURCE_DIR}/cmake/scripts/Baseset.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating ${BASESET_SOURCE_FILE_NAME} baseset metadata file"
@ -77,7 +72,7 @@ foreach(BASESET_OTHER_SOURCE_FILE IN LISTS BASESET_OTHER_SOURCE_FILES)
get_filename_component(BASESET_OTHER_SOURCE_FILE_NAME "${BASESET_OTHER_SOURCE_FILE}" NAME)
set(BASESET_OTHER_BINARY_FILE "${CMAKE_BINARY_DIR}/baseset/${BASESET_OTHER_SOURCE_FILE_NAME}")
add_custom_command_timestamp(OUTPUT ${BASESET_OTHER_BINARY_FILE}
add_custom_command(OUTPUT ${BASESET_OTHER_BINARY_FILE}
COMMAND ${CMAKE_COMMAND} -E copy
${BASESET_OTHER_SOURCE_FILE}
${BASESET_OTHER_BINARY_FILE}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -1,6 +0,0 @@
# OpenTTD TrueType font
The OpenTTD TrueType font was created by Zephyris and is maintained on [Github](https://github.com/zephyris/openttd-ttf).
It is licensed under GPL-2.0.
The currently included files correspond to release v0.6.

Binary file not shown.

@ -1 +0,0 @@
4f03553f614a06d86dc06376db3353c7

@ -5,47 +5,5 @@
# working on it / have the tools installed.
if(GRFCODEC_FOUND)
include(CreateGrfCommand)
create_grf_command(
NFO_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/airports.nfo
${CMAKE_CURRENT_SOURCE_DIR}/airport_preview.nfo
${CMAKE_CURRENT_SOURCE_DIR}/aqueduct.nfo
${CMAKE_CURRENT_SOURCE_DIR}/autorail.nfo
${CMAKE_CURRENT_SOURCE_DIR}/canals.nfo
${CMAKE_CURRENT_SOURCE_DIR}/chars.nfo
${CMAKE_CURRENT_SOURCE_DIR}/elrails.nfo
${CMAKE_CURRENT_SOURCE_DIR}/foundations.nfo
${CMAKE_CURRENT_SOURCE_DIR}/mono.nfo
${CMAKE_CURRENT_SOURCE_DIR}/oneway.nfo
${CMAKE_CURRENT_SOURCE_DIR}/openttd.nfo
${CMAKE_CURRENT_SOURCE_DIR}/openttdgui.nfo
${CMAKE_CURRENT_SOURCE_DIR}/palette.nfo
${CMAKE_CURRENT_SOURCE_DIR}/roadstops.nfo
${CMAKE_CURRENT_SOURCE_DIR}/signals.nfo
${CMAKE_CURRENT_SOURCE_DIR}/sloped_tracks.nfo
${CMAKE_CURRENT_SOURCE_DIR}/tramtracks.nfo
${CMAKE_CURRENT_SOURCE_DIR}/tunnel_portals.nfo
${CMAKE_CURRENT_SOURCE_DIR}/2ccmap.nfo
PNG_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/airports.png
${CMAKE_CURRENT_SOURCE_DIR}/airport_preview.png
${CMAKE_CURRENT_SOURCE_DIR}/aqueduct.png
${CMAKE_CURRENT_SOURCE_DIR}/autorail.png
${CMAKE_CURRENT_SOURCE_DIR}/canals.png
${CMAKE_CURRENT_SOURCE_DIR}/canal_locks.png
${CMAKE_CURRENT_SOURCE_DIR}/chars.png
${CMAKE_CURRENT_SOURCE_DIR}/elrails.png
${CMAKE_CURRENT_SOURCE_DIR}/foundations.png
${CMAKE_CURRENT_SOURCE_DIR}/mono.png
${CMAKE_CURRENT_SOURCE_DIR}/oneway.png
${CMAKE_CURRENT_SOURCE_DIR}/openttdgui.png
${CMAKE_CURRENT_SOURCE_DIR}/openttdgui_build_tram.png
${CMAKE_CURRENT_SOURCE_DIR}/openttdgui_convert_road.png
${CMAKE_CURRENT_SOURCE_DIR}/openttdgui_convert_tram.png
${CMAKE_CURRENT_SOURCE_DIR}/openttdgui_group_livery.png
${CMAKE_CURRENT_SOURCE_DIR}/roadstops.png
${CMAKE_CURRENT_SOURCE_DIR}/signals.png
${CMAKE_CURRENT_SOURCE_DIR}/sloped_tracks.png
${CMAKE_CURRENT_SOURCE_DIR}/tramtracks.png
${CMAKE_CURRENT_SOURCE_DIR}/tramtracks_bare_depot.png
${CMAKE_CURRENT_SOURCE_DIR}/tunnel_portals.png
)
create_grf_command()
endif()

Binary file not shown.

@ -1 +0,0 @@
5fdc049a7a0ada4c280239f15bc38174

@ -6,35 +6,9 @@
if(GRFCODEC_FOUND)
include(CreateGrfCommand)
create_grf_command(
NFO_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/rivers/arctic.nfo
${CMAKE_CURRENT_SOURCE_DIR}/rivers/rapids.nfo
${CMAKE_CURRENT_SOURCE_DIR}/rivers/temperate.nfo
${CMAKE_CURRENT_SOURCE_DIR}/rivers/toyland.nfo
${CMAKE_CURRENT_SOURCE_DIR}/rivers/toyland_rapids.nfo
${CMAKE_CURRENT_SOURCE_DIR}/rivers/tropic.nfo
${CMAKE_CURRENT_SOURCE_DIR}/airports_orig_extra.nfo
${CMAKE_CURRENT_SOURCE_DIR}/canals_extra.nfo
${CMAKE_CURRENT_SOURCE_DIR}/chars_orig_extra.nfo
${CMAKE_CURRENT_SOURCE_DIR}/fix_graphics.nfo
${CMAKE_CURRENT_SOURCE_DIR}/fix_gui_icons.nfo
${CMAKE_CURRENT_SOURCE_DIR}/orig_extra.nfo
${CMAKE_CURRENT_SOURCE_DIR}/shore.nfo
PNG_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/rivers/arctic_brown.png
${CMAKE_CURRENT_SOURCE_DIR}/rivers/arctic_snowy.png
${CMAKE_CURRENT_SOURCE_DIR}/rivers/rapids.png
${CMAKE_CURRENT_SOURCE_DIR}/rivers/rapids_shading.png
${CMAKE_CURRENT_SOURCE_DIR}/rivers/temperate.png
${CMAKE_CURRENT_SOURCE_DIR}/rivers/toyland.png
${CMAKE_CURRENT_SOURCE_DIR}/rivers/toyland_rapids.png
${CMAKE_CURRENT_SOURCE_DIR}/rivers/toyland_rapids_shading.png
${CMAKE_CURRENT_SOURCE_DIR}/rivers/tropic_desert.png
${CMAKE_CURRENT_SOURCE_DIR}/rivers/tropic_forest.png
${CMAKE_CURRENT_SOURCE_DIR}/fix_graphics.png
${CMAKE_CURRENT_SOURCE_DIR}/fix_gui_icons.png
${CMAKE_CURRENT_SOURCE_DIR}/shore.png
# We share some files with 'openttd' grf
${CMAKE_CURRENT_SOURCE_DIR}/../openttd/airports.png
${CMAKE_CURRENT_SOURCE_DIR}/../openttd/canals.png
${CMAKE_CURRENT_SOURCE_DIR}/../openttd/chars.png
# We share some files with 'openttd' grf
${CMAKE_CURRENT_SOURCE_DIR}/../openttd/airports.png
${CMAKE_CURRENT_SOURCE_DIR}/../openttd/canals.png
${CMAKE_CURRENT_SOURCE_DIR}/../openttd/chars.png
)
endif()

@ -79,7 +79,6 @@
#include "airports_orig_extra.nfo"
#include "canals_extra.nfo"
#include "rivers/rapids.nfo"
#include "rivers/toyland_rapids.nfo"
#include "rivers/temperate.nfo"
#include "rivers/arctic.nfo"
#include "rivers/tropic.nfo"

@ -5,243 +5,115 @@
//
-1 * 0 0C "Rapid graphics"
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 10 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 10 64 23 -31 0 normal
| sprites/rapids.png mask 10 10
-1 sprites/rapids.png 8bpp 90 10 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 10 64 39 -31 -8 normal
| sprites/rapids.png mask 90 10
-1 sprites/rapids.png 8bpp 170 10 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 10 64 23 -31 0 normal
| sprites/rapids.png mask 170 10
-1 sprites/rapids.png 8bpp 250 10 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 10 64 39 -31 -8 normal
| sprites/rapids.png mask 250 10
-1 sprites/rapids.png 8bpp 10 10 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 10 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 10 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 10 64 39 -31 -8 normal
-1 * 7 02 05 00 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 60 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 60 64 23 -31 0 normal
| sprites/rapids.png mask 10 60
-1 sprites/rapids.png 8bpp 90 60 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 60 64 39 -31 -8 normal
| sprites/rapids.png mask 90 60
-1 sprites/rapids.png 8bpp 170 60 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 60 64 23 -31 0 normal
| sprites/rapids.png mask 170 60
-1 sprites/rapids.png 8bpp 250 60 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 60 64 39 -31 -8 normal
| sprites/rapids.png mask 250 60
-1 sprites/rapids.png 8bpp 10 60 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 60 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 60 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 60 64 39 -31 -8 normal
-1 * 7 02 05 01 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 110 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 110 64 23 -31 0 normal
| sprites/rapids.png mask 10 110
-1 sprites/rapids.png 8bpp 90 110 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 110 64 39 -31 -8 normal
| sprites/rapids.png mask 90 110
-1 sprites/rapids.png 8bpp 170 110 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 110 64 23 -31 0 normal
| sprites/rapids.png mask 170 110
-1 sprites/rapids.png 8bpp 250 110 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 110 64 39 -31 -8 normal
| sprites/rapids.png mask 250 110
-1 sprites/rapids.png 8bpp 10 110 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 110 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 110 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 110 64 39 -31 -8 normal
-1 * 7 02 05 02 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 160 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 160 64 23 -31 0 normal
| sprites/rapids.png mask 10 160
-1 sprites/rapids.png 8bpp 90 160 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 160 64 39 -31 -8 normal
| sprites/rapids.png mask 90 160
-1 sprites/rapids.png 8bpp 170 160 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 160 64 23 -31 0 normal
| sprites/rapids.png mask 170 160
-1 sprites/rapids.png 8bpp 250 160 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 160 64 39 -31 -8 normal
| sprites/rapids.png mask 250 160
-1 sprites/rapids.png 8bpp 10 160 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 160 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 160 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 160 64 39 -31 -8 normal
-1 * 7 02 05 03 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 210 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 210 64 23 -31 0 normal
| sprites/rapids.png mask 10 210
-1 sprites/rapids.png 8bpp 90 210 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 210 64 39 -31 -8 normal
| sprites/rapids.png mask 90 210
-1 sprites/rapids.png 8bpp 170 210 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 210 64 23 -31 0 normal
| sprites/rapids.png mask 170 210
-1 sprites/rapids.png 8bpp 250 210 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 210 64 39 -31 -8 normal
| sprites/rapids.png mask 250 210
-1 sprites/rapids.png 8bpp 10 210 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 210 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 210 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 210 64 39 -31 -8 normal
-1 * 7 02 05 04 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 260 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 260 64 23 -31 0 normal
| sprites/rapids.png mask 10 260
-1 sprites/rapids.png 8bpp 90 260 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 260 64 39 -31 -8 normal
| sprites/rapids.png mask 90 260
-1 sprites/rapids.png 8bpp 170 260 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 260 64 23 -31 0 normal
| sprites/rapids.png mask 170 260
-1 sprites/rapids.png 8bpp 250 260 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 260 64 39 -31 -8 normal
| sprites/rapids.png mask 250 260
-1 sprites/rapids.png 8bpp 10 260 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 260 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 260 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 260 64 39 -31 -8 normal
-1 * 7 02 05 05 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 310 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 310 64 23 -31 0 normal
| sprites/rapids.png mask 10 310
-1 sprites/rapids.png 8bpp 90 310 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 310 64 39 -31 -8 normal
| sprites/rapids.png mask 90 310
-1 sprites/rapids.png 8bpp 170 310 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 310 64 23 -31 0 normal
| sprites/rapids.png mask 170 310
-1 sprites/rapids.png 8bpp 250 310 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 310 64 39 -31 -8 normal
| sprites/rapids.png mask 250 310
-1 sprites/rapids.png 8bpp 10 310 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 310 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 310 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 310 64 39 -31 -8 normal
-1 * 7 02 05 06 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 360 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 360 64 23 -31 0 normal
| sprites/rapids.png mask 10 360
-1 sprites/rapids.png 8bpp 90 360 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 360 64 39 -31 -8 normal
| sprites/rapids.png mask 90 360
-1 sprites/rapids.png 8bpp 170 360 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 360 64 23 -31 0 normal
| sprites/rapids.png mask 170 360
-1 sprites/rapids.png 8bpp 250 360 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 360 64 39 -31 -8 normal
| sprites/rapids.png mask 250 360
-1 sprites/rapids.png 8bpp 10 360 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 360 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 360 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 360 64 39 -31 -8 normal
-1 * 7 02 05 07 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 410 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 410 64 23 -31 0 normal
| sprites/rapids.png mask 10 410
-1 sprites/rapids.png 8bpp 90 410 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 410 64 39 -31 -8 normal
| sprites/rapids.png mask 90 410
-1 sprites/rapids.png 8bpp 170 410 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 410 64 23 -31 0 normal
| sprites/rapids.png mask 170 410
-1 sprites/rapids.png 8bpp 250 410 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 410 64 39 -31 -8 normal
| sprites/rapids.png mask 250 410
-1 sprites/rapids.png 8bpp 10 410 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 410 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 410 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 410 64 39 -31 -8 normal
-1 * 7 02 05 08 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 460 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 460 64 23 -31 0 normal
| sprites/rapids.png mask 10 460
-1 sprites/rapids.png 8bpp 90 460 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 460 64 39 -31 -8 normal
| sprites/rapids.png mask 90 460
-1 sprites/rapids.png 8bpp 170 460 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 460 64 23 -31 0 normal
| sprites/rapids.png mask 170 460
-1 sprites/rapids.png 8bpp 250 460 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 460 64 39 -31 -8 normal
| sprites/rapids.png mask 250 460
-1 sprites/rapids.png 8bpp 10 460 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 460 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 460 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 460 64 39 -31 -8 normal
-1 * 7 02 05 09 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 510 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 510 64 23 -31 0 normal
| sprites/rapids.png mask 10 510
-1 sprites/rapids.png 8bpp 90 510 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 510 64 39 -31 -8 normal
| sprites/rapids.png mask 90 510
-1 sprites/rapids.png 8bpp 170 510 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 510 64 23 -31 0 normal
| sprites/rapids.png mask 170 510
-1 sprites/rapids.png 8bpp 250 510 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 510 64 39 -31 -8 normal
| sprites/rapids.png mask 250 510
-1 sprites/rapids.png 8bpp 10 510 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 510 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 510 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 510 64 39 -31 -8 normal
-1 * 7 02 05 0A 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 560 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 560 64 23 -31 0 normal
| sprites/rapids.png mask 10 560
-1 sprites/rapids.png 8bpp 90 560 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 560 64 39 -31 -8 normal
| sprites/rapids.png mask 90 560
-1 sprites/rapids.png 8bpp 170 560 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 560 64 23 -31 0 normal
| sprites/rapids.png mask 170 560
-1 sprites/rapids.png 8bpp 250 560 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 560 64 39 -31 -8 normal
| sprites/rapids.png mask 250 560
-1 sprites/rapids.png 8bpp 10 560 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 560 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 560 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 560 64 39 -31 -8 normal
-1 * 7 02 05 0B 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 610 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 610 64 23 -31 0 normal
| sprites/rapids.png mask 10 610
-1 sprites/rapids.png 8bpp 90 610 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 610 64 39 -31 -8 normal
| sprites/rapids.png mask 90 610
-1 sprites/rapids.png 8bpp 170 610 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 610 64 23 -31 0 normal
| sprites/rapids.png mask 170 610
-1 sprites/rapids.png 8bpp 250 610 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 610 64 39 -31 -8 normal
| sprites/rapids.png mask 250 610
-1 sprites/rapids.png 8bpp 10 610 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 610 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 610 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 610 64 39 -31 -8 normal
-1 * 7 02 05 0C 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 660 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 660 64 23 -31 0 normal
| sprites/rapids.png mask 10 660
-1 sprites/rapids.png 8bpp 90 660 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 660 64 39 -31 -8 normal
| sprites/rapids.png mask 90 660
-1 sprites/rapids.png 8bpp 170 660 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 660 64 23 -31 0 normal
| sprites/rapids.png mask 170 660
-1 sprites/rapids.png 8bpp 250 660 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 660 64 39 -31 -8 normal
| sprites/rapids.png mask 250 660
-1 sprites/rapids.png 8bpp 10 660 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 660 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 660 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 660 64 39 -31 -8 normal
-1 * 7 02 05 0D 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 710 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 710 64 23 -31 0 normal
| sprites/rapids.png mask 10 710
-1 sprites/rapids.png 8bpp 90 710 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 710 64 39 -31 -8 normal
| sprites/rapids.png mask 90 710
-1 sprites/rapids.png 8bpp 170 710 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 710 64 23 -31 0 normal
| sprites/rapids.png mask 170 710
-1 sprites/rapids.png 8bpp 250 710 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 710 64 39 -31 -8 normal
| sprites/rapids.png mask 250 710
-1 sprites/rapids.png 8bpp 10 710 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 710 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 710 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 710 64 39 -31 -8 normal
-1 * 7 02 05 0E 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/rapids.png 8bpp 10 760 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 10 760 64 23 -31 0 normal
| sprites/rapids.png mask 10 760
-1 sprites/rapids.png 8bpp 90 760 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 90 760 64 39 -31 -8 normal
| sprites/rapids.png mask 90 760
-1 sprites/rapids.png 8bpp 170 760 64 23 -31 0 normal
| sprites/rapids_shading.png 32bpp 170 760 64 23 -31 0 normal
| sprites/rapids.png mask 170 760
-1 sprites/rapids.png 8bpp 250 760 64 39 -31 -8 normal
| sprites/rapids_shading.png 32bpp 250 760 64 39 -31 -8 normal
| sprites/rapids.png mask 250 760
-1 sprites/rapids.png 8bpp 10 760 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 90 760 64 39 -31 -8 normal
-1 sprites/rapids.png 8bpp 170 760 64 23 -31 0 normal
-1 sprites/rapids.png 8bpp 250 760 64 39 -31 -8 normal
-1 * 7 02 05 0F 01 00 00 00
-1 * 39 02 05 10 80 00 01 10

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

@ -3,7 +3,7 @@
// 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/>.
//
-1 * 0 0C "Toyland river graphics by zephyris (Richard Wheeler)"
-1 * 0 0C "Toyland river graphics by andythenorth (Andrew Parkhouse)"
-1 * 4 01 05 01 3C
-1 sprites/toyland.png 8bpp 10 10 38 19 -5 0 normal
-1 sprites/toyland.png 8bpp 58 10 38 18 -5 13 normal

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 16 KiB

@ -1,73 +0,0 @@
// 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/>.
//
-1 * 0 0C "Toyland rapid graphics by zephyris (Richard Wheeler)"
-1 * 4 01 05 01 04
-1 sprites/toyland_rapids.png 8bpp 10 10 64 23 -31 0 normal
| sprites/toyland_rapids_shading.png 32bpp 10 10 64 23 -31 0 normal
| sprites/toyland_rapids.png mask 10 10
-1 sprites/toyland_rapids.png 8bpp 90 10 64 39 -31 -8 normal
| sprites/toyland_rapids_shading.png 32bpp 90 10 64 39 -31 -8 normal
| sprites/toyland_rapids.png mask 90 10
-1 sprites/toyland_rapids.png 8bpp 170 10 64 23 -31 0 normal
| sprites/toyland_rapids_shading.png 32bpp 170 10 64 23 -31 0 normal
| sprites/toyland_rapids.png mask 170 10
-1 sprites/toyland_rapids.png 8bpp 250 10 64 39 -31 -8 normal
| sprites/toyland_rapids_shading.png 32bpp 250 10 64 39 -31 -8 normal
| sprites/toyland_rapids.png mask 250 10
-1 * 7 02 05 00 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/toyland_rapids.png 8bpp 10 60 64 23 -31 0 normal
| sprites/toyland_rapids_shading.png 32bpp 10 60 64 23 -31 0 normal
| sprites/toyland_rapids.png mask 10 60
-1 sprites/toyland_rapids.png 8bpp 90 60 64 39 -31 -8 normal
| sprites/toyland_rapids_shading.png 32bpp 90 60 64 39 -31 -8 normal
| sprites/toyland_rapids.png mask 90 60
-1 sprites/toyland_rapids.png 8bpp 170 60 64 23 -31 0 normal
| sprites/toyland_rapids_shading.png 32bpp 170 60 64 23 -31 0 normal
| sprites/toyland_rapids.png mask 170 60
-1 sprites/toyland_rapids.png 8bpp 250 60 64 39 -31 -8 normal
| sprites/toyland_rapids_shading.png 32bpp 250 60 64 39 -31 -8 normal
| sprites/toyland_rapids.png mask 250 60
-1 * 7 02 05 01 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/toyland_rapids.png 8bpp 10 110 64 23 -31 0 normal
| sprites/toyland_rapids_shading.png 32bpp 10 110 64 23 -31 0 normal
| sprites/toyland_rapids.png mask 10 110
-1 sprites/toyland_rapids.png 8bpp 90 110 64 39 -31 -8 normal
| sprites/toyland_rapids_shading.png 32bpp 90 110 64 39 -31 -8 normal
| sprites/toyland_rapids.png mask 90 110
-1 sprites/toyland_rapids.png 8bpp 170 110 64 23 -31 0 normal
| sprites/toyland_rapids_shading.png 32bpp 170 110 64 23 -31 0 normal
| sprites/toyland_rapids.png mask 170 110
-1 sprites/toyland_rapids.png 8bpp 250 110 64 39 -31 -8 normal
| sprites/toyland_rapids_shading.png 32bpp 250 110 64 39 -31 -8 normal
| sprites/toyland_rapids.png mask 250 110
-1 * 7 02 05 02 01 00 00 00
-1 * 4 01 05 01 04
-1 sprites/toyland_rapids.png 8bpp 10 160 64 23 -31 0 normal
| sprites/toyland_rapids_shading.png 32bpp 10 160 64 23 -31 0 normal
| sprites/toyland_rapids.png mask 10 160
-1 sprites/toyland_rapids.png 8bpp 90 160 64 39 -31 -8 normal
| sprites/toyland_rapids_shading.png 32bpp 90 160 64 39 -31 -8 normal
| sprites/toyland_rapids.png mask 90 160
-1 sprites/toyland_rapids.png 8bpp 170 160 64 23 -31 0 normal
| sprites/toyland_rapids_shading.png 32bpp 170 160 64 23 -31 0 normal
| sprites/toyland_rapids.png mask 170 160
-1 sprites/toyland_rapids.png 8bpp 250 160 64 39 -31 -8 normal
| sprites/toyland_rapids_shading.png 32bpp 250 160 64 39 -31 -8 normal
| sprites/toyland_rapids.png mask 250 160
-1 * 7 02 05 03 01 00 00 00
-1 * 39 02 05 10 80 00 01 04
00 00
01 00
02 00
03 00
-1 * 6 07 83 01 \7! 03 01
-1 * 7 03 05 01 05 00 10 00

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

@ -1,4 +1,7 @@
FROM emscripten/emsdk:3.1.42
FROM emscripten/emsdk:3.1.37
COPY emsdk-liblzma.patch /
RUN cd /emsdk/upstream/emscripten && patch -p1 < /emsdk-liblzma.patch
COPY emsdk-nlohmann-json.patch /
RUN cd /emsdk/upstream/emscripten && patch -p1 < /emsdk-nlohmann-json.patch

@ -4,6 +4,7 @@ Please use docker with the supplied `Dockerfile` to build for emscripten.
It takes care of a few things:
- Use a version of emscripten we know works
- Patch in LibLZMA support (as this is not supported by upstream)
- Patch in nlohmann-json support (as this is not supported by upstream)
First, build the docker image by navigating in the folder this `README.md` is in, and executing:
```

@ -0,0 +1,20 @@
# nlohmann-json is a custom addition to the emscripten SDK, so it is possible
# someone patched their SDK. Test out if the SDK supports nlohmann-json.
include(CheckCXXSourceCompiles)
set(CMAKE_REQUIRED_FLAGS "-sUSE_NLOHMANN_JSON=1")
check_cxx_source_compiles("
#include <nlohmann/json.hpp>
int main() { return 0; }"
NLOHMANN_JSON_FOUND
)
if (NLOHMANN_JSON_FOUND)
add_library(nlohmann_json INTERFACE IMPORTED)
set_target_properties(nlohmann_json PROPERTIES
INTERFACE_COMPILE_OPTIONS "-sUSE_NLOHMANN_JSON=1"
INTERFACE_LINK_LIBRARIES "-sUSE_NLOHMANN_JSON=1"
)
else()
message(WARNING "You are using an emscripten SDK without nlohmann-json support. Please apply 'emsdk-nlohmann_json.patch' to your local emsdk installation.")
endif()

@ -0,0 +1,93 @@
From 0edcedbea375e59f41df10acaee0c483d245751f Mon Sep 17 00:00:00 2001
From: Patric Stout <truebrain@openttd.org>
Date: Tue, 2 May 2023 21:48:08 +0200
Subject: [PATCH] Add nlohmmann-json port
---
src/settings.js | 4 ++++
tools/ports/nlohmann_json.py | 46 ++++++++++++++++++++++++++++++++++++
tools/settings.py | 1 +
3 files changed, 51 insertions(+)
create mode 100644 tools/ports/nlohmann_json.py
diff --git a/src/settings.js b/src/settings.js
index f93140d..39f4366 100644
--- a/src/settings.js
+++ b/src/settings.js
@@ -1483,6 +1483,10 @@ var USE_MPG123 = false;
// [compile+link]
var USE_FREETYPE = false;
+// 1 = use nlohmann-json from emscripten-ports
+// [compile+link]
+var USE_NLOHMANN_JSON = false;
+
// Specify the SDL_mixer version that is being linked against.
// Doesn't *have* to match USE_SDL, but a good idea.
// [compile+link]
diff --git a/tools/ports/nlohmann_json.py b/tools/ports/nlohmann_json.py
new file mode 100644
index 0000000..9e44297
--- /dev/null
+++ b/tools/ports/nlohmann_json.py
@@ -0,0 +1,46 @@
+# Copyright 2023 The Emscripten Authors. All rights reserved.
+# Emscripten is available under two separate licenses, the MIT license and the
+# University of Illinois/NCSA Open Source License. Both these licenses can be
+# found in the LICENSE file.
+
+import os
+
+TAG = '3.11.2'
+HASH = '99d9e6d588cabe8913a37437f86acb5d4b8b98bce12423e633c11c13b61e6c7f92ef8f9a4e991baa590329ee2b5c09ca9db9894bee1e54bdd68e8d09d83cc245'
+
+
+def needed(settings):
+ return settings.USE_NLOHMANN_JSON
+
+
+def get(ports, settings, shared):
+ ports.fetch_project('nlohmann_json',
+ f'https://github.com/nlohmann/json/releases/download/v{TAG}/include.zip',
+ sha512hash=HASH)
+
+ def create(final):
+ source_path = os.path.join(ports.get_dir(), 'nlohmann_json')
+ source_path_include = os.path.join(source_path, 'include', 'nlohmann')
+ ports.install_header_dir(source_path_include, 'nlohmann')
+
+ # write out a dummy cpp file, to create an empty library
+ # this is needed as emscripten ports expect this, even if it is not used
+ dummy_file = os.path.join(source_path, 'dummy.cpp')
+ shared.safe_ensure_dirs(os.path.dirname(dummy_file))
+ ports.write_file(dummy_file, 'static void dummy() {}')
+
+ ports.build_port(source_path, final, 'nlohmann_json', srcs=['dummy.cpp'])
+
+ return [shared.cache.get_lib('libnlohmann_json.a', create, what='port')]
+
+
+def clear(ports, settings, shared):
+ shared.cache.erase_lib('libnlohmann_json.a')
+
+
+def process_args(ports):
+ return []
+
+
+def show():
+ return 'nlohmann-json'
diff --git a/tools/settings.py b/tools/settings.py
index 10d6ca0..8536092 100644
--- a/tools/settings.py
+++ b/tools/settings.py
@@ -47,6 +47,7 @@ PORTS_SETTINGS = {
'USE_MPG123',
'USE_GIFLIB',
'USE_FREETYPE',
+ 'USE_NLOHMANN_JSON',
'SDL2_MIXER_FORMATS',
'SDL2_IMAGE_FORMATS',
'USE_SQLITE3',
--
2.34.1

@ -1,8 +1,8 @@
Module.arguments.push('-mnull', '-snull', '-vsdl');
Module.arguments.push('-mnull', '-snull', '-vsdl:relative_mode');
Module['websocket'] = { url: function(host, port, proto) {
/* openttd.org hosts a WebSocket proxy for the content service. */
if (host == "content.openttd.org" && port == 3978 && proto == "tcp") {
return "wss://bananas-server.openttd.org/";
return "wss://content.openttd.org/";
}
/* Everything else just tries to make a default WebSocket connection.
@ -30,47 +30,46 @@ Module.preRun.push(function() {
Module.addRunDependency('syncfs');
FS.syncfs(true, function (err) {
/* FS.mkdir() tends to fail if parent folders do not exist. */
if (!FS.analyzePath(content_download_dir).exists) {
FS.mkdir(content_download_dir);
}
if (!FS.analyzePath(content_download_dir + '/baseset').exists) {
FS.mkdir(content_download_dir + '/baseset');
}
/* Check if the OpenGFX baseset is already downloaded. */
if (!FS.analyzePath(content_download_dir + '/baseset/opengfx-0.6.0.tar').exists) {
window.openttd_downloaded_opengfx = true;
FS.createPreloadedFile(content_download_dir + '/baseset', 'opengfx-0.6.0.tar', 'https://installer.cdn.openttd.org/emscripten/opengfx-0.6.0.tar', true, true);
} else {
/* Fake dependency increase, so the counter is stable. */
Module.addRunDependency('opengfx');
Module.removeRunDependency('opengfx');
}
Module.removeRunDependency('syncfs');
});
window.openttd_syncfs_shown_warning = false;
window.openttd_syncfs = function(callback) {
window.openttd_syncfs = function() {
/* Copy the virtual FS to the persistent storage. */
FS.syncfs(false, function (err) {
/* On first time, warn the user about the volatile behaviour of
* persistent storage. */
if (!window.openttd_syncfs_shown_warning) {
window.openttd_syncfs_shown_warning = true;
Module.onWarningFs();
}
if (callback) callback();
});
FS.syncfs(false, function (err) { });
/* On first time, warn the user about the volatile behaviour of
* persistent storage. */
if (!window.openttd_syncfs_shown_warning) {
window.openttd_syncfs_shown_warning = true;
Module.onWarningFs();
}
}
window.openttd_exit = function() {
window.openttd_syncfs(Module.onExit);
Module.onExit();
}
window.openttd_abort = function() {
window.openttd_syncfs(Module.onAbort);
}
window.openttd_bootstrap = function(current, total) {
Module.onBootstrap(current, total);
}
window.openttd_bootstrap_failed = function() {
Module.onBootstrapFailed();
}
window.openttd_bootstrap_reload = function() {
window.openttd_syncfs(function() {
Module.onBootstrapReload();
setTimeout(function() {
location.reload();
}, 1000);
});
Module.onAbort();
}
window.openttd_server_list = function() {
@ -124,3 +123,11 @@ Module.preRun.push(function() {
return ret;
}
});
Module.postRun.push(function() {
/* Check if we downloaded OpenGFX; if so, sync the virtual FS back to the
* IDBFS so OpenGFX is stored persistent. */
if (window['openttd_downloaded_opengfx']) {
FS.syncfs(false, function (err) { });
}
});

@ -75,6 +75,7 @@
}
#message {
color: #101010;
height: 54px;
padding: 4px 4px;
}
@ -143,8 +144,6 @@
})(),
setStatus: function(text) {
if (document.getElementById("canvas").style.display == "none") return;
var m = text.match(/^([^(]+)\((\d+(\.\d+)?)\/(\d+)\)$/);
if (m) {
@ -172,27 +171,6 @@
document.getElementById("message").innerHTML = "Preparing game ...";
},
onBootstrap: function(current, total) {
document.getElementById("canvas").style.display = "none";
document.getElementById("title").innerHTML = "Missing base graphics";
document.getElementById("message").innerHTML = "OpenTTD is downloading base graphics.<br/><br/>" + current + " / " + total + " bytes downloaded.";
},
onBootstrapFailed: function(current, total) {
document.getElementById("canvas").style.display = "none";
document.getElementById("title").innerHTML = "Missing base graphics";
document.getElementById("message").innerHTML = "Failed to download base graphics.<br/>The game cannot start without base graphics.<br/><br/>Please check your Internet connection and/or the console log.<br/>Reload your browser to try again.";
},
onBootstrapReload: function() {
document.getElementById("canvas").style.display = "none";
document.getElementById("title").innerHTML = "Missing base graphics";
document.getElementById("message").innerHTML = "Downloading base graphics done.<br/><br/>Your browser will reload to start the game.";
},
onExit: function() {
document.getElementById("canvas").style.display = "none";

@ -1,10 +0,0 @@
--- a/usr/include/elf.h 2023-12-30 13:46:27.038645199 +0100
+++ b/usr/include/elf.h 2023-12-30 13:46:42.278641893 +0100
@@ -365,6 +365,7 @@
required */
#define SHF_GROUP (1 << 9) /* Section is member of a group. */
#define SHF_TLS (1 << 10) /* Section hold thread-local data. */
+#define SHF_COMPRESSED (1 << 11) /* Section with compressed data. */
#define SHF_MASKOS 0x0ff00000 /* OS-specific. */
#define SHF_MASKPROC 0xf0000000 /* Processor-specific */
#define SHF_ORDERED (1 << 30) /* Special ordering requirement

@ -15,6 +15,8 @@
</application>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!--This Id value indicates the application supports Windows Vista functionality -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!--This Id value indicates the application supports Windows 7 functionality-->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!--This Id value indicates the application supports Windows 8 functionality-->

@ -1,2 +1,18 @@
@echo off
pwsh -File "%~dp0sign_azure.ps1" %1
REM Signing script
REM Arguments: sign.bat exe_to_sign certificate_subject_name
REM This is a loose wrapper around the Microsoft signtool application (included in the Windows SDK).
REM See https://docs.microsoft.com/en-us/dotnet/framework/tools/signtool-exe for more details.
REM Path to signtool.exe
IF NOT DEFINED SIGNTOOL_PATH (SET SIGNTOOL_PATH=signtool)
REM URL of the timestamp server
IF NOT DEFINED SIGNTOOL_TIMESTAMP_URL (SET SIGNTOOL_TIMESTAMP_URL=http://timestamp.digicert.com)
REM Sign with SHA-1 for Windows 7 and below
"%SIGNTOOL_PATH%" sign -v -n %2 -t %SIGNTOOL_TIMESTAMP_URL% -fd sha1 %1
REM Sign with SHA-256 for Windows 8 and above
"%SIGNTOOL_PATH%" sign -v -n %2 -tr %SIGNTOOL_TIMESTAMP_URL% -fd sha256 -td sha256 -as %1

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save