Compare commits
No commits in common. 'jgrpp' and 'jgrpp-0.55.3' have entirely different histories.
jgrpp
...
jgrpp-0.55
@ -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
|
@ -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 }}"}'
|
@ -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
|
@ -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 -
|
||||
|
@ -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,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,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`.
|
@ -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.
|
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
|
Binary file not shown.
@ -1 +0,0 @@
|
||||
5fdc049a7a0ada4c280239f15bc38174
|
Binary file not shown.
Before Width: | Height: | Size: 30 KiB |
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
|
||||
|
@ -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,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
|
@ -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…
Reference in New Issue