Browse Source

Merge branch 'master' into blaze-controller-target-fixes

pull/6494/head
Blazej Mcszk 2 years ago
parent
commit
2b0dac944c
  1. 6
      .bettercodehub.yml
  2. 2
      .circleci/config.yml
  3. 43
      .devcontainer/Dockerfile
  4. 30
      .devcontainer/devcontainer.json
  5. 7
      .devcontainer/fluxbox/apps
  6. 20
      .devcontainer/fluxbox/menu
  7. 8
      .editorconfig
  8. 5
      .github/ISSUE_TEMPLATE/bug_report.yml
  9. 23
      .github/ISSUE_TEMPLATE/feature_request.yml
  10. 12
      .github/workflows/Android.yml
  11. 46
      .github/workflows/Linux_aarch64.yml
  12. 35
      .github/workflows/Linux_x86.yml
  13. 29
      .github/workflows/Linux_x86_64.yml
  14. 6
      .github/workflows/Linux_x86_64_SDL1.yml
  15. 6
      .github/workflows/Linux_x86_64_test.yml
  16. 7
      .github/workflows/PS4.yml
  17. 66
      .github/workflows/Windows9x_MinGW.yml
  18. 17
      .github/workflows/Windows_MSVC_x64.yml
  19. 8
      .github/workflows/Windows_MinGW_x64.yml
  20. 8
      .github/workflows/Windows_MinGW_x86.yml
  21. 2
      .github/workflows/cache-cleanup.yml
  22. 4
      .github/workflows/clang-format-check.yml
  23. 11
      .github/workflows/iOS.yml
  24. 7
      .github/workflows/macOS_x86_64.yml
  25. 7
      .github/workflows/miyoo_mini_release.yml
  26. 9
      .github/workflows/opendingux_release.yml
  27. 5
      .github/workflows/retrofw_release.yml
  28. 5
      .github/workflows/s390x_qemu_big_endian_tests.yml
  29. 9
      .github/workflows/src_dist_release.yml
  30. 4
      .github/workflows/translations.yml
  31. 9
      .github/workflows/xbox_nxdk.yml
  32. 7
      .github/workflows/xbox_one.yml
  33. 24
      3rdParty/Lua/CMakeLists.txt
  34. 4
      3rdParty/SDL2/CMakeLists.txt
  35. 5
      3rdParty/asio/CMakeLists.txt
  36. 18
      3rdParty/asio/asio_handle_exception.cpp
  37. 17
      3rdParty/asio/asio_handle_exception.hpp
  38. 20
      3rdParty/discord/CMakeLists.txt
  39. 5
      3rdParty/googletest/CMakeLists.txt
  40. 24
      3rdParty/libfmt/CMakeLists.txt
  41. 8
      3rdParty/libmpq/CMakeLists.txt
  42. 2
      3rdParty/libzt/CMakeLists.txt
  43. 13
      3rdParty/sol2/CMakeLists.txt
  44. 8
      3rdParty/sol2/sol_config/sol/config.hpp
  45. 36
      3rdParty/sol2/sol_config/sol/debug.hpp
  46. 2444
      3rdParty/tl/expected.hpp
  47. 25
      3rdParty/tolk/CMakeLists.txt
  48. 8
      3rdParty/zlib/CMakeLists.txt
  49. 27
      CMake/Assets.cmake
  50. 3
      CMake/Definitions.cmake
  51. 32
      CMake/Dependencies.cmake
  52. 10
      CMake/Platforms.cmake
  53. 17
      CMake/finders/FindSpeechd.cmake
  54. 27
      CMake/platforms/aarch64-linux-gnu-clang-static-libc++.toolchain.cmake
  55. 1
      CMake/platforms/aarch64-linux-gnu.toolchain.cmake
  56. 10
      CMake/platforms/debian-cross-pkg-config.sh
  57. 29
      CMake/platforms/mingw9x.toolchain.cmake
  58. 22
      CMake/platforms/mingw9x/include/windef.h
  59. 1
      CMake/platforms/mingwcc.toolchain.cmake
  60. 1
      CMake/platforms/mingwcc64.toolchain.cmake
  61. 2
      CMake/platforms/windows.cmake
  62. 38
      CMake/platforms/windows9x.cmake
  63. 1
      CMake/platforms/xbox_nxdk.cmake
  64. 35
      CMakeLists.txt
  65. 9
      Packaging/OpenDingux/build.sh
  66. 28
      Packaging/OpenDingux/devilutionx-from-disk.sh
  67. 5
      Packaging/OpenDingux/devilutionx-umount-opk-and-run.sh
  68. 6
      Packaging/OpenDingux/gkd350h-manual.txt
  69. 6
      Packaging/OpenDingux/lepus-manual.txt
  70. 8
      Packaging/OpenDingux/profile-generate.sh
  71. 6
      Packaging/OpenDingux/retrofw-manual.txt
  72. 6
      Packaging/OpenDingux/rg350-manual.txt
  73. 4
      Packaging/OpenDingux/rg99-manual.txt
  74. 55
      Packaging/OpenDingux/rg99-pgo.md
  75. 4
      Packaging/cpi-gamesh/readme.md
  76. 2
      Packaging/miyoo_mini/skeleton_MiniUI/Diablo/readme.txt
  77. 2
      Packaging/miyoo_mini/skeleton_OnionOS/readme.txt
  78. 2
      Packaging/nix/LinuxReleasePackaging.sh
  79. 6
      Packaging/nix/README.txt
  80. 20
      Packaging/nix/debian-cross-aarch64-prep.sh
  81. 16
      Packaging/nix/debian-cross-i386-prep.sh
  82. 14
      Packaging/nix/debian-host-prep.sh
  83. 17
      Packaging/nix/devilutionx.metainfo.xml
  84. 6
      Packaging/pi/README.txt
  85. 10
      Packaging/switch/README.txt
  86. 6
      Packaging/vita/README.txt
  87. 6
      Packaging/windows/README.txt
  88. 4
      Packaging/windows/mingw-prep.sh
  89. 48
      Packaging/windows/mingw9x-prep.sh
  90. 2
      README.md
  91. 4
      Source/.clang-format
  92. 5
      Source/.clang-tidy
  93. 71
      Source/CMakeLists.txt
  94. 3
      Source/DiabloUI/button.cpp
  95. 7
      Source/DiabloUI/credits.cpp
  96. 145
      Source/DiabloUI/diabloui.cpp
  97. 15
      Source/DiabloUI/diabloui.h
  98. 12
      Source/DiabloUI/dialogs.cpp
  99. 6
      Source/DiabloUI/dialogs.h
  100. 57
      Source/DiabloUI/hero/selhero.cpp
  101. Some files were not shown because too many files have changed in this diff Show More

6
.bettercodehub.yml

@ -1,6 +0,0 @@
exclude:
- /Packaging/.*
- /3rdParty/.*
languages:
- cpp
component_depth: 2

2
.circleci/config.yml

@ -30,7 +30,7 @@ jobs:
- store_artifacts: {path: ./build/devilutionx.cia, destination: devilutionx.cia}
amigaos-m68k:
docker:
- image: amigadev/crosstools:m68k-amigaos
- image: amigadev/crosstools:m68k-amigaos-gcc10
working_directory: ~/repo
steps:
- checkout

43
.devcontainer/Dockerfile

@ -0,0 +1,43 @@
ARG VARIANT=debian-12
FROM mcr.microsoft.com/devcontainers/base:${VARIANT}
USER root
# Install APT packages
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install tar curl zip unzip bash-completion build-essential ripgrep htop \
ninja-build ccache g++ mold gdb clang-format clang-tidy \
rpm pkg-config cmake git smpq gettext libsdl2-dev libsdl2-image-dev libsodium-dev \
libpng-dev libbz2-dev libfmt-dev libgtest-dev libgmock-dev libsimpleini-dev zsh \
qtbase5-dev qt6-base-dev ristretto \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
# Install devilutionx-graphics-tools
RUN git clone https://github.com/diasurgical/devilutionx-graphics-tools.git /tmp/devilutionx-graphics-tools && \
cd /tmp/devilutionx-graphics-tools && \
cmake -S. -Bbuild-rel -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF && \
cmake --build build-rel -j $(getconf _NPROCESSORS_ONLN) && \
cmake --install build-rel --component Binaries && \
rm -rf /tmp/devilutionx-graphics-tools
# Install devilutionx-mpq-tools
RUN git clone https://github.com/diasurgical/devilutionx-mpq-tools.git /tmp/devilutionx-mpq-tools && \
cd /tmp/devilutionx-mpq-tools && \
cmake -S. -Bbuild-rel -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF && \
cmake --build build-rel -j $(getconf _NPROCESSORS_ONLN) && \
cmake --install build-rel && \
rm -rf /tmp/devilutionx-mpq-tools
# Install d1-graphics-tool
RUN curl -O -L https://github.com/diasurgical/d1-graphics-tool/releases/latest/download/D1GraphicsTool-Linux-x64.deb && \
dpkg -i D1GraphicsTool-Linux-x64.deb && \
rm D1GraphicsTool-Linux-x64.deb
# Download spawn.mpq and fonts.mpq
RUN curl --create-dirs -O -L --output-dir /usr/local/share/diasurgical/devilutionx/ \
https://github.com/diasurgical/devilutionx-assets/releases/latest/download/spawn.mpq && \
curl --create-dirs -O -L --output-dir /usr/local/share/diasurgical/devilutionx/ \
https://github.com/diasurgical/devilutionx-assets/releases/latest/download/fonts.mpq && \
chown -R vscode: /usr/local/share/diasurgical/
# Desktop environment configuration
COPY fluxbox /home/vscode/.fluxbox/

30
.devcontainer/devcontainer.json

@ -0,0 +1,30 @@
{
"build": {
"dockerfile": "Dockerfile"
},
"customizations": {
"vscode": {
"extensions": [
"github.vscode-github-actions",
"ms-vscode.cmake-tools"
]
}
},
"features": {
// https://github.com/devcontainers/features/tree/main/src/desktop-lite
"ghcr.io/devcontainers/features/desktop-lite:1": {
"webPort": 6080,
"password": "vscode"
},
"ghcr.io/devcontainers-contrib/features/zsh-plugins:0": {},
"ghcr.io/stuartleeks/dev-container-features/shell-history:0": {}
},
"forwardPorts": [
6080
],
"portsAttributes": {
"6080": {
"label": "desktop"
}
}
}

7
.devcontainer/fluxbox/apps

@ -0,0 +1,7 @@
[transient] (role=GtkFileChooserDialog)
[Dimensions] {70% 70%}
[Position] (CENTER) {0 0}
[end]
[app] (name=AppRun) (class=tiled)
[Fullscreen] {yes}
[end]

20
.devcontainer/fluxbox/menu

@ -0,0 +1,20 @@
[begin] ( Application Menu )
[exec] (File Manager) { nautilus /workspaces/devilutionX } </usr/share/icons/gnome/32x32/apps/file-manager.png>
[exec] (D1 Graphics Tool) { D1GraphicsTool } <>
[exec] (Text Editor) { mousepad } <>
[exec] (Terminal) { tilix -w ~ -e $(readlink -f /proc/$$/exe) -il } <>
[exec] (Web Browser) { x-www-browser --disable-dev-shm-usage } <>
[submenu] (System) {}
[exec] (Set Resolution) { tilix -t "Set Resolution" -e bash /usr/local/bin/set-resolution } <>
[exec] (Edit Application Menu) { mousepad ~/.fluxbox/menu } <>
[exec] (Passwords and Keys) { seahorse } <>
[exec] (Top Processes) { tilix -t "Top" -e htop } <>
[exec] (Disk Utilization) { tilix -t "Disk Utilization" -e ncdu / } <>
[exec] (Editres) {editres} <>
[exec] (Xfontsel) {xfontsel} <>
[exec] (Xkill) {xkill} <>
[exec] (Xrefresh) {xrefresh} <>
[end]
[config] (Configuration)
[workspaces] (Workspaces)
[end]

8
.editorconfig

@ -17,6 +17,11 @@ end_of_line = lf
[*.po]
end_of_line = lf
[*.lua]
indent_style = space
indent_size = 2
end_of_line = lf
[*.py]
indent_style = space
indent_size = 4
@ -53,6 +58,9 @@ end_of_line = lf
[*.txt]
end_of_line = crlf
[*.tsv]
trim_trailing_whitespace = false
[AppRun]
end_of_line = lf

5
.github/ISSUE_TEMPLATE/bug_report.yml

@ -1,5 +1,7 @@
name: Bug report
description: Create a report to help us improve
title: "[Issue Report]: "
labels: ["issue report"]
body:
- type: dropdown
id: operating-system
@ -26,7 +28,8 @@ body:
attributes:
label: DevilutionX version
options:
- 1.5.0 (latest release)
- 1.5.1
- 1.5.0
- 1.4.1
- 1.4.0
- 1.3.0

23
.github/ISSUE_TEMPLATE/feature_request.yml

@ -0,0 +1,23 @@
name: Feature Request
description: Request a feature or improvement.
title: "[Feature Request]: "
labels: ["enhancement"]
body:
- type: dropdown
id: feature-type
attributes:
label: Feature Type
options:
- Quality of Life
- Touch Controls
- Gamepad Controls
- Other (please specify)
validations:
required: true
- type: textarea
id: description
attributes:
label: Describe
placeholder: A clear and concise description of the desired feature/change.
validations:
required: true

12
.github/workflows/Android.yml

@ -6,10 +6,12 @@ on:
- master
paths-ignore:
- '*.md'
- 'docs/**'
pull_request:
types: [ opened, synchronize ]
paths-ignore:
- '*.md'
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@ -23,12 +25,12 @@ jobs:
run: sudo apt-get update && sudo apt-get install -y gettext
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
@ -38,8 +40,8 @@ jobs:
uses: actions/cache@v3
with:
path: android-project/app/.cxx
key: ${{ github.workflow }}-v2-${{ github.sha }}
restore-keys: ${{ github.workflow }}-v2-
key: ${{ github.workflow }}-v4-${{ github.sha }}
restore-keys: ${{ github.workflow }}-v4-
- name: Build
working-directory: ${{github.workspace}}
@ -48,7 +50,7 @@ jobs:
- name: Upload-Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: devilutionx-debug.apk
path: android-project/app/build/outputs/apk/debug/app-debug.apk

46
.github/workflows/Linux_aarch64.yml

@ -6,14 +6,17 @@ on:
- master
paths-ignore:
- '*.md'
- 'docs/**'
pull_request:
types: [opened, synchronize]
paths-ignore:
- '*.md'
- 'docs/**'
release:
types: [published]
paths-ignore:
- '*.md'
- 'docs/**'
workflow_dispatch:
concurrency:
@ -25,23 +28,44 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create Build Environment
# Work around the somewhat broken packages in the GitHub Actions Ubuntu 20.04 image.
# https://github.com/actions/runner-images/issues/4620#issuecomment-981333260
- name: Work around broken packages
run: sudo apt-get -y install --allow-downgrades libpcre2-8-0=10.34-7
- name: Add clang repo
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
sudo tee /etc/apt/sources.list.d/clang.list <<LIST
deb [arch=amd64,arm64] http://apt.llvm.org/focal/ llvm-toolchain-focal main
deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal main
LIST
# Installs dependencies, including arm64 libraries (runs `sudo apt-get update` as part of it)
- name: Install dependencies
run: Packaging/nix/debian-cross-aarch64-prep.sh --no-gcc
- name: Install clang-18
run: |
# Work around the somewhat broken packages in the GitHub Actions Ubuntu 20.04 image.
# https://github.com/actions/runner-images/issues/4620#issuecomment-981333260
sudo apt-get -y install --allow-downgrades libpcre2-8-0=10.34-7
Packaging/nix/debian-cross-aarch64-prep.sh
sudo apt-get install -yq --no-install-recommends clang-18 lld-18 libc++-18-dev:arm64 \
libgcc-10-dev-arm64-cross binutils-aarch64-linux-gnu libc++1-18:arm64 libc++abi1-18:arm64 && \
sudo update-alternatives --install \
/usr/bin/clang++ clang++ /usr/bin/clang++-18 200 && \
sudo update-alternatives --install \
/usr/bin/clang clang /usr/bin/clang-18 200 \
--slave /usr/bin/lld lld /usr/bin/lld-18 \
--slave /usr/bin/ld.lld ld.lld /usr/bin/ld.lld-18
- name: Cache CMake build folder
uses: actions/cache@v3
with:
path: build
key: ${{ github.workflow }}-v2-${{ github.sha }}
restore-keys: ${{ github.workflow }}-v2-
key: ${{ github.workflow }}-v6-${{ github.sha }}
restore-keys: ${{ github.workflow }}-v6-
- name: Build
working-directory: ${{github.workspace}}
@ -51,7 +75,7 @@ jobs:
# We set DEVILUTIONX_SYSTEM_LIBFMT=OFF because its soversion changes frequently.
# We set DEVILUTIONX_SYSTEM_SIMPLEINI=OFF because we require v4.19+, still missing from many distributions.
run: |
cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE=../CMake/platforms/aarch64-linux-gnu.toolchain.cmake \
cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE=../CMake/platforms/aarch64-linux-gnu-clang-static-libc++.toolchain.cmake \
-DCMAKE_BUILD_TYPE=${{env.CMAKE_BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=/usr -DCPACK=ON \
-DDEVILUTIONX_SYSTEM_LIBFMT=OFF -DDEVILUTIONX_SYSTEM_SIMPLEINI=OFF && \
cmake --build build -j $(getconf _NPROCESSORS_ONLN) --target package
@ -65,7 +89,7 @@ jobs:
- name: Upload Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: devilutionx-aarch64-linux-gnu.tar.xz
path: devilutionx-aarch64-linux-gnu.tar.xz
@ -73,7 +97,7 @@ jobs:
# AppImage cross-packaging is not implemented yet.
# - name: Upload AppImage
# if: ${{ !env.ACT }}
# uses: actions/upload-artifact@v3
# uses: actions/upload-artifact@v4
# with:
# name: devilutionx-aarch64-linux-gnu.appimage
# path: devilutionx-aarch64-linux-gnu.appimage

35
.github/workflows/Linux_x86.yml

@ -6,14 +6,17 @@ on:
- master
paths-ignore:
- '*.md'
- 'docs/**'
pull_request:
types: [opened, synchronize]
paths-ignore:
- '*.md'
- 'docs/**'
release:
types: [published]
paths-ignore:
- '*.md'
- 'docs/**'
workflow_dispatch:
concurrency:
@ -25,23 +28,35 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create Build Environment
# Work around the somewhat broken packages in the GitHub Actions Ubuntu 20.04 image.
# https://github.com/actions/runner-images/issues/4620#issuecomment-981333260
- name: Work around broken packages
run: sudo apt-get -y install --allow-downgrades libpcre2-8-0=10.34-7
- name: Add gcc repo
run: sudo add-apt-repository ppa:ubuntu-toolchain-r/test
# Installs dependencies, including x86 libraries (runs `sudo apt-get update` as part of it)
- name: Install dependencies
run: Packaging/nix/debian-cross-i386-prep.sh --no-gcc
- name: Install gcc-13
run: |
# Work around the somewhat broken packages in the GitHub Actions Ubuntu 20.04 image.
# https://github.com/actions/runner-images/issues/4620#issuecomment-981333260
sudo apt-get -y install --allow-downgrades libpcre2-8-0=10.34-7
Packaging/nix/debian-cross-i386-prep.sh
sudo apt-get install -yq --no-install-recommends gcc-13 g++-13 g++-13-multilib && \
sudo update-alternatives --install \
/usr/bin/gcc gcc /usr/bin/gcc-13 13 \
--slave /usr/bin/g++ g++ /usr/bin/g++-13
- name: Cache CMake build folder
uses: actions/cache@v3
with:
path: build
key: ${{ github.workflow }}-v3-${{ github.sha }}
restore-keys: ${{ github.workflow }}-v3-
key: ${{ github.workflow }}-v5-${{ github.sha }}
restore-keys: ${{ github.workflow }}-v5-
- name: Build
working-directory: ${{github.workspace}}
@ -66,7 +81,7 @@ jobs:
- name: Upload Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: devilutionx-i386-linux-gnu.tar.xz
path: devilutionx-i386-linux-gnu.tar.xz
@ -74,7 +89,7 @@ jobs:
# AppImage cross-packaging is not implemented yet.
# - name: Upload AppImage
# if: ${{ !env.ACT }}
# uses: actions/upload-artifact@v3
# uses: actions/upload-artifact@v4
# with:
# name: devilutionx-i386-linux-gnu.appimage
# path: devilutionx-i386-linux-gnu.appimage

29
.github/workflows/Linux_x86_64.yml

@ -6,14 +6,17 @@ on:
- master
paths-ignore:
- '*.md'
- 'docs/**'
pull_request:
types: [opened, synchronize]
paths-ignore:
- '*.md'
- 'docs/**'
release:
types: [published]
paths-ignore:
- '*.md'
- 'docs/**'
workflow_dispatch:
concurrency:
@ -25,19 +28,33 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Add gcc repo
run: sudo add-apt-repository ppa:ubuntu-toolchain-r/test
# Installs dependencies and runs `sudo apt-get update` as part of it.
- name: Install dependencies
run: Packaging/nix/debian-host-prep.sh --no-gcc
- name: Install gcc-13
run: |
sudo apt-get install -yq --no-install-recommends gcc-13 g++-13 && \
sudo update-alternatives --install \
/usr/bin/gcc gcc /usr/bin/gcc-13 13 \
--slave /usr/bin/g++ g++ /usr/bin/g++-13
- name: Create Build Environment
run: Packaging/nix/debian-host-prep.sh
run: Packaging/nix/debian-host-prep.sh --no-gcc
- name: Cache CMake build folder
uses: actions/cache@v3
with:
path: build
key: ${{ github.workflow }}-v2-${{ github.sha }}
restore-keys: ${{ github.workflow }}-v2-
key: ${{ github.workflow }}-v5-${{ github.sha }}
restore-keys: ${{ github.workflow }}-v5-
- name: Build
working-directory: ${{github.workspace}}
@ -59,14 +76,14 @@ jobs:
- name: Upload Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: devilutionx-x86_64-linux-gnu.tar.xz
path: devilutionx-x86_64-linux-gnu.tar.xz
- name: Upload AppImage
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: devilutionx-x86_64-linux-gnu.appimage
path: devilutionx-x86_64-linux-gnu.appimage

6
.github/workflows/Linux_x86_64_SDL1.yml

@ -6,10 +6,12 @@ on:
- master
paths-ignore:
- '*.md'
- 'docs/**'
pull_request:
types: [ opened, synchronize ]
paths-ignore:
- '*.md'
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@ -20,7 +22,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
@ -52,7 +54,7 @@ jobs:
- name: Upload-Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: devilutionx_linux_x86_64_SDL1.tar.xz
path: devilutionx.tar.xz

6
.github/workflows/Linux_x86_64_test.yml

@ -6,10 +6,12 @@ on:
- master
paths-ignore:
- '*.md'
- 'docs/**'
pull_request:
types: [ opened, synchronize ]
paths-ignore:
- '*.md'
- 'docs/**'
workflow_dispatch:
concurrency:
@ -18,10 +20,10 @@ concurrency:
jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

7
.github/workflows/PS4.yml

@ -6,14 +6,17 @@ on:
- master
paths-ignore:
- '*.md'
- 'docs/**'
pull_request:
types: [opened, synchronize]
paths-ignore:
- '*.md'
- 'docs/**'
release:
types: [published]
paths-ignore:
- '*.md'
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@ -24,7 +27,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
@ -44,7 +47,7 @@ jobs:
- name: Upload-Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: devilutionx-ps4.pkg
path: build-ps4/devilutionx.pkg

66
.github/workflows/Windows9x_MinGW.yml

@ -0,0 +1,66 @@
name: Windows 9x MinGW
on:
push:
branches:
- master
paths-ignore:
- '*.md'
- 'docs/**'
pull_request:
types: [ opened, synchronize ]
paths-ignore:
- '*.md'
- 'docs/**'
release:
types: [published]
paths-ignore:
- '*.md'
- 'docs/**'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create Build Environment
run: >
sudo apt-get update &&
sudo apt-get install -y cmake gcc-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64-tools libz-mingw-w64-dev gettext dpkg-dev wget git sudo smpq &&
sudo rm /usr/i686-w64-mingw32/lib/libz.dll.a &&
sudo Packaging/windows/mingw9x-prep.sh
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}
run: cmake -S. -Bbuild-windows9x -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCPACK=ON -DCMAKE_TOOLCHAIN_FILE=../CMake/platforms/mingw9x.toolchain.cmake -DTARGET_PLATORM=windows9x
- name: Build
working-directory: ${{github.workspace}}
shell: bash
run: |
cmake --build build-windows9x -j $(nproc) --target package
mv build-windows9x/devilutionx.zip devilutionx-win9x.zip
- name: Upload-Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v4
with:
path: devilutionx-win9x.zip
- name: Update Release
if: ${{ github.event_name == 'release' && !env.ACT }}
uses: svenstaro/upload-release-action@v2
with:
file: devilutionx-win9x.zip
overwrite: true

17
.github/workflows/Windows_MSVC_x64.yml

@ -6,10 +6,19 @@ on:
- master
paths-ignore:
- '*.md'
- 'docs/**'
pull_request:
types: [ opened, synchronize ]
paths-ignore:
- '*.md'
- 'docs/**'
permissions:
contents: write
env:
VCPKG_FEATURE_FLAGS: dependencygraph
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@ -20,7 +29,7 @@ jobs:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
@ -31,9 +40,9 @@ jobs:
uses: lukka/get-cmake@latest
- name: Restore or setup vcpkg
uses: lukka/run-vcpkg@v11
uses: lukka/run-vcpkg@v11.4
with:
vcpkgGitCommitId: '78b61582c9e093fda56a01ebb654be15a0033897'
vcpkgGitCommitId: '16ee2ecb31788c336ace8bb14c21801efb6836e4'
- name: Fetch test data
run: |
@ -52,7 +61,7 @@ jobs:
- name: Upload-Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: devilutionx.exe
path: |

8
.github/workflows/Windows_MinGW_x64.yml

@ -6,10 +6,12 @@ on:
- master
paths-ignore:
- '*.md'
- 'docs/**'
pull_request:
types: [ opened, synchronize ]
paths-ignore:
- '*.md'
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@ -20,7 +22,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
@ -34,7 +36,7 @@ jobs:
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}
run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=OFF -DCPACK=ON -DCMAKE_TOOLCHAIN_FILE=../CMake/platforms/mingwcc64.toolchain.cmake -DDEVILUTIONX_SYSTEM_BZIP2=OFF -DDEVILUTIONX_STATIC_LIBSODIUM=ON -DDISCORD_INTEGRATION=ON
run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=OFF -DCPACK=ON -DCMAKE_TOOLCHAIN_FILE=../CMake/platforms/mingwcc64.toolchain.cmake -DDEVILUTIONX_SYSTEM_BZIP2=OFF -DDEVILUTIONX_STATIC_LIBSODIUM=ON -DDISCORD_INTEGRATION=ON -DSCREEN_READER_INTEGRATION=ON
- name: Build
working-directory: ${{github.workspace}}
@ -43,7 +45,7 @@ jobs:
- name: Upload-Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: devilutionx_x64.zip
path: build/devilutionx.zip

8
.github/workflows/Windows_MinGW_x86.yml

@ -6,10 +6,12 @@ on:
- master
paths-ignore:
- '*.md'
- 'docs/**'
pull_request:
types: [ opened, synchronize ]
paths-ignore:
- '*.md'
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@ -20,7 +22,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
@ -34,7 +36,7 @@ jobs:
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}
run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=OFF -DCPACK=ON -DCMAKE_TOOLCHAIN_FILE=../CMake/platforms/mingwcc.toolchain.cmake -DDEVILUTIONX_SYSTEM_BZIP2=OFF -DDEVILUTIONX_STATIC_LIBSODIUM=ON -DDISCORD_INTEGRATION=ON
run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=OFF -DCPACK=ON -DCMAKE_TOOLCHAIN_FILE=../CMake/platforms/mingwcc.toolchain.cmake -DDEVILUTIONX_SYSTEM_BZIP2=OFF -DDEVILUTIONX_STATIC_LIBSODIUM=ON -DDISCORD_INTEGRATION=ON -DSCREEN_READER_INTEGRATION=ON
- name: Build
working-directory: ${{github.workspace}}
@ -43,7 +45,7 @@ jobs:
- name: Upload-Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: devilutionx_x86.zip
path: build/devilutionx.zip

2
.github/workflows/cache-cleanup.yml

@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
# https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries
- name: Cleanup

4
.github/workflows/clang-format-check.yml

@ -6,10 +6,12 @@ on:
- master
paths-ignore:
- '*.md'
- 'docs/**'
pull_request:
types: [ opened, synchronize ]
paths-ignore:
- '*.md'
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@ -20,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

11
.github/workflows/iOS.yml

@ -6,14 +6,17 @@ on:
- master
paths-ignore:
- '*.md'
- 'docs/**'
pull_request:
types: [opened, synchronize]
paths-ignore:
- '*.md'
- 'docs/**'
release:
types: [published]
paths-ignore:
- '*.md'
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@ -28,7 +31,7 @@ jobs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
@ -36,8 +39,8 @@ jobs:
uses: actions/cache@v3
with:
path: build
key: ${{ github.workflow }}-v2-${{ github.sha }}
restore-keys: ${{ github.workflow }}-v2-
key: ${{ github.workflow }}-v3-${{ github.sha }}
restore-keys: ${{ github.workflow }}-v3-
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
@ -58,7 +61,7 @@ jobs:
- name: Upload-Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: devilutionx-iOS.ipa
path: build/devilutionx-iOS.ipa

7
.github/workflows/macOS_x86_64.yml

@ -6,14 +6,17 @@ on:
- master
paths-ignore:
- '*.md'
- 'docs/**'
pull_request:
types: [opened, synchronize]
paths-ignore:
- '*.md'
- 'docs/**'
release:
types: [published]
paths-ignore:
- '*.md'
- 'docs/**'
workflow_dispatch:
concurrency:
@ -24,7 +27,7 @@ jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
@ -51,7 +54,7 @@ jobs:
- name: Upload-Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: devilutionx-x86_64-macOS.dmg
path: build/devilutionx-x86_64-macOS.dmg

7
.github/workflows/miyoo_mini_release.yml

@ -5,6 +5,7 @@ on:
types: [published]
paths-ignore:
- '*.md'
- 'docs/**'
workflow_dispatch:
concurrency:
@ -16,7 +17,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
@ -30,14 +31,14 @@ jobs:
- name: Upload-OnionOS-Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: devilutionx-miyoo-mini-onion-os.zip
path: build-miyoo-mini/devilutionx-miyoo-mini-onion-os.zip
- name: Upload-miniUI-Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: devilutionx-miyoo-mini-miniui.zip
path: build-miyoo-mini/devilutionx-miyoo-mini-miniui.zip

9
.github/workflows/opendingux_release.yml

@ -5,6 +5,7 @@ on:
types: [published]
paths-ignore:
- '*.md'
- 'docs/**'
workflow_dispatch:
concurrency:
@ -16,7 +17,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
@ -38,7 +39,7 @@ jobs:
- name: Upload-Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: devilutionx-rg350.opk.zip
path: build-rg350/devilutionx-rg350.opk
@ -54,7 +55,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
@ -76,7 +77,7 @@ jobs:
- name: Upload-Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: devilutionx-lepus.opk.zip
path: build-lepus/devilutionx-lepus.opk

5
.github/workflows/retrofw_release.yml

@ -5,6 +5,7 @@ on:
types: [published]
paths-ignore:
- '*.md'
- 'docs/**'
workflow_dispatch:
concurrency:
@ -16,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
@ -38,7 +39,7 @@ jobs:
- name: Upload-Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: devilutionx-retrofw.opk.zip
path: build-retrofw/devilutionx-retrofw.opk

5
.github/workflows/s390x_qemu_big_endian_tests.yml

@ -6,6 +6,7 @@ on:
types: [published]
paths-ignore:
- '*.md'
- 'docs/**'
workflow_dispatch:
concurrency:
@ -17,7 +18,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
@ -33,7 +34,7 @@ jobs:
- name: Run tests
run: >
docker run --rm --interactive --mount type=bind,source=$(pwd),target=/host s390x/alpine sh -c
docker run run --platform linux/s390x --rm --interactive --mount type=bind,source=$(pwd),target=/host s390x/alpine sh -c
"
apk add --update-cache g++ ninja cmake ccache sdl2-dev sdl2_image-dev fmt-dev libpng-dev bzip2-dev gtest-dev wget &&
cd /host &&

9
.github/workflows/src_dist_release.yml

@ -5,6 +5,7 @@ on:
types: [published]
paths-ignore:
- '*.md'
- 'docs/**'
workflow_dispatch:
concurrency:
@ -16,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
@ -31,7 +32,7 @@ jobs:
- name: Upload-Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: devilutionx-src.tar.xz
path: devilutionx-src.tar.xz
@ -47,7 +48,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
@ -62,7 +63,7 @@ jobs:
- name: Upload-Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: devilutionx-src-fully-vendored.tar.xz
path: devilutionx-src-fully-vendored.tar.xz

4
.github/workflows/translations.yml

@ -6,10 +6,12 @@ on:
- master
paths-ignore:
- '*.md'
- 'docs/**'
pull_request:
types: [ opened, synchronize ]
paths-ignore:
- '*.md'
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@ -20,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

9
.github/workflows/xbox_nxdk.yml

@ -6,14 +6,17 @@ on:
- master
paths-ignore:
- '*.md'
- 'docs/**'
pull_request:
types: [opened, synchronize]
paths-ignore:
- '*.md'
- 'docs/**'
release:
types: [published]
paths-ignore:
- '*.md'
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@ -35,10 +38,10 @@ jobs:
- name: Build nxdk
shell: bash
run: PATH="${NXDK_DIR}/bin:$PATH" make -j $(nproc) -C "$NXDK_DIR" NXDK_ONLY=1 all cxbe
run: PATH="${NXDK_DIR}/bin:$PATH" make -j $(nproc) -C "$NXDK_DIR" NXDK_ONLY=1 CFLAGS=-O2 CXXFLAGS=-O2 all cxbe
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
@ -55,7 +58,7 @@ jobs:
- name: Upload-Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: devilutionx-xbox
path: build-xbox/pkg/

7
.github/workflows/xbox_one.yml

@ -6,14 +6,17 @@ on:
- master
paths-ignore:
- '*.md'
- 'docs/**'
pull_request:
types: [opened, synchronize]
paths-ignore:
- '*.md'
- 'docs/**'
release:
types: [published]
paths-ignore:
- '*.md'
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@ -24,7 +27,7 @@ jobs:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
@ -57,7 +60,7 @@ jobs:
- name: Upload-Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: devilutionx-xbox-one-series
if-no-files-found: error

24
3rdParty/Lua/CMakeLists.txt vendored

@ -0,0 +1,24 @@
include(functions/FetchContent_MakeAvailableExcludeFromAll)
set(LUA_ENABLE_TESTING OFF)
set(LUA_BUILD_COMPILER OFF)
if(DEVILUTIONX_STATIC_LUA)
set(LUA_ENABLE_SHARED OFF)
else()
set(LUA_ENABLE_SHARED ON)
endif()
include(FetchContent)
FetchContent_Declare(Lua
URL https://github.com/walterschell/Lua/archive/88246d621abf7b6fba9332f49229d507f020e450.tar.gz
URL_HASH MD5=03b76927cb5341ffc53bea12c37ddcca
)
FetchContent_MakeAvailableExcludeFromAll(Lua)
if(ANDROID AND ("${ANDROID_ABI}" STREQUAL "armeabi-v7a" OR "${ANDROID_ABI}" STREQUAL "x86"))
target_compile_definitions(lua_internal INTERFACE -DLUA_USE_C89)
elseif(NINTENDO_3DS OR VITA OR NINTENDO_SWITCH OR NXDK)
target_compile_definitions(lua_static PUBLIC -DLUA_USE_C89)
elseif(IOS)
target_compile_definitions(lua_static PUBLIC -DLUA_USE_IOS)
endif()

4
3rdParty/SDL2/CMakeLists.txt vendored

@ -15,7 +15,7 @@ set(SDL_TEST_ENABLED_BY_DEFAULT OFF)
include(functions/FetchContent_MakeAvailableExcludeFromAll)
include(FetchContent)
FetchContent_Declare(SDL2
URL https://github.com/libsdl-org/SDL/archive/8b39eb9b1ff885978816dd9663277608187e8676.tar.gz
URL_HASH MD5=3cf9bf5f20375aa5dcc529193c809967
URL https://github.com/libsdl-org/SDL/releases/download/release-2.28.5/SDL2-2.28.5.tar.gz
URL_HASH SHA256=332cb37d0be20cb9541739c61f79bae5a477427d79ae85e352089afdaf6666e4
)
FetchContent_MakeAvailableExcludeFromAll(SDL2)

5
3rdParty/asio/CMakeLists.txt vendored

@ -7,8 +7,9 @@ FetchContent_Declare(asio
)
FetchContent_MakeAvailableExcludeFromAll(asio)
add_library(asio INTERFACE)
target_include_directories(asio INTERFACE ${asio_SOURCE_DIR}/asio/include)
add_library(asio STATIC ${CMAKE_CURRENT_LIST_DIR}/asio_handle_exception.cpp)
target_compile_definitions(asio PUBLIC ASIO_NO_EXCEPTIONS)
target_include_directories(asio PUBLIC ${asio_SOURCE_DIR}/asio/include ${CMAKE_CURRENT_LIST_DIR})
if(NINTENDO_3DS OR NINTENDO_SWITCH)
include(asio_defs REQUIRED)

18
3rdParty/asio/asio_handle_exception.cpp vendored

@ -0,0 +1,18 @@
#include <string_view>
#define ErrAsio(message) devilution::ErrDlg("ASIO Error", message, __FILE__, __LINE__)
namespace devilution {
extern void ErrDlg(const char* title, std::string_view error, std::string_view logFilePath, int logLineNr);
} // namespace devilution
namespace asio::detail {
void fatal_exception(const char* message)
{
ErrAsio(message);
}
} // namespace asio::detail

17
3rdParty/asio/asio_handle_exception.hpp vendored

@ -0,0 +1,17 @@
#pragma once
#include <asio/detail/throw_exception.hpp>
namespace asio::detail {
void fatal_exception(const char *message);
template <typename Exception>
void throw_exception(
const Exception &e
ASIO_SOURCE_LOCATION_PARAM)
{
fatal_exception(e.what());
}
} // namespace asio::detail

20
3rdParty/discord/CMakeLists.txt vendored

@ -3,11 +3,21 @@ include(FetchContent)
find_package(Patch REQUIRED)
FetchContent_Declare(discordsrc
URL https://dl-game-sdk.discordapp.net/3.2.1/discord_game_sdk.zip
URL_HASH MD5=73e5e1b3f8413a2c7184ef17476822f2
PATCH_COMMAND "${Patch_EXECUTABLE}" -p1 -N < "${CMAKE_CURRENT_LIST_DIR}/fixes.patch" || true
)
set(Discord_SDK_URL "https://dl-game-sdk.discordapp.net/3.2.1/discord_game_sdk.zip")
set(Discord_SDK_HASH "73e5e1b3f8413a2c7184ef17476822f2")
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
FetchContent_Declare(discordsrc
URL ${Discord_SDK_URL}
URL_HASH MD5=${Discord_SDK_HASH}
)
else()
FetchContent_Declare(discordsrc
URL ${Discord_SDK_URL}
URL_HASH MD5=${Discord_SDK_HASH}
PATCH_COMMAND "${Patch_EXECUTABLE}" -p1 -N < "${CMAKE_CURRENT_LIST_DIR}/fixes.patch" || true
)
endif()
FetchContent_MakeAvailableExcludeFromAll(discordsrc)
file(GLOB discord_SRCS ${discordsrc_SOURCE_DIR}/cpp/*.cpp)

5
3rdParty/googletest/CMakeLists.txt vendored

@ -1,10 +1,9 @@
include(functions/FetchContent_MakeAvailableExcludeFromAll)
# branch: v1.12.x (master no longer supports C++11)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/58d77fa8070e8cec2dc1ed015d66b454c8d78850.tar.gz
URL_HASH MD5=22bdde3b84a8c506e7aba7b3c97dc760
URL https://github.com/google/googletest/archive/refs/tags/v1.14.0.tar.gz
URL_HASH MD5=c8340a482851ef6a3fe618a082304cfc
)
set(INSTALL_GTEST OFF)

24
3rdParty/libfmt/CMakeLists.txt vendored

@ -5,22 +5,22 @@ if(NOT WIN32 AND NOT APPLE AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL FreeBSD)
add_definitions(-D_POSIX_C_SOURCE=200809L)
endif()
# Disable fmt/os.h functionality.
# We do not use it and it is not supported on some systems.
set(FMT_OS OFF)
if(DEVILUTIONX_STATIC_LIBFMT)
set(BUILD_SHARED_LIBS OFF)
else()
set(BUILD_SHARED_LIBS ON)
endif()
include(FetchContent)
if(NXDK)
# branch: nxdk-v10.0.0
FetchContent_Declare(libfmt
URL https://github.com/diasurgical/fmt/archive/e421e854efcb21ee641349bab604d91b34af26b8.tar.gz
URL_HASH MD5=ebaac86fca56d4ef4a162ef125433f6f
)
else()
FetchContent_Declare(libfmt
URL https://github.com/fmtlib/fmt/archive/refs/tags/10.0.0.tar.gz
URL_HASH MD5=fa629bc1178918b7af4b2ea6b6a271dc
)
endif()
FetchContent_Declare(libfmt
URL https://github.com/fmtlib/fmt/archive/44f3d8a77cd7e05e9da92d68635abdb4da626e9e.tar.gz
URL_HASH MD5=b6eb4573962586cfbfb6e5e2986d292b
)
FetchContent_MakeAvailableExcludeFromAll(libfmt)
if(DEVILUTIONX_WINDOWS_NO_WCHAR)
target_compile_definitions(fmt PUBLIC FMT_WINDOWS_NO_WCHAR)
endif()

8
3rdParty/libmpq/CMakeLists.txt vendored

@ -10,8 +10,8 @@ include(functions/FetchContent_MakeAvailableExcludeFromAll)
include(FetchContent)
FetchContent_Declare(libmpq
URL https://github.com/diasurgical/libmpq/archive/b78d66c6fee6a501cc9b95d8556a129c68841b05.tar.gz
URL_HASH MD5=da531a1a6f719e89798a26e679ffc329
URL https://github.com/diasurgical/libmpq/archive/7c2924d4553513eba1a70bbdb558198dd8c2726a.tar.gz
URL_HASH MD5=315c88c02b45851cdfee8460322de044
)
FetchContent_MakeAvailableExcludeFromAll(libmpq)
@ -32,3 +32,7 @@ target_link_libraries(libmpq PRIVATE ZLIB::ZLIB BZip2::BZip2)
if(LIBMPQ_FILE_BUFFER_SIZE)
target_compile_definitions(libmpq PRIVATE "LIBMPQ_FILE_BUFFER_SIZE=${LIBMPQ_FILE_BUFFER_SIZE}")
endif()
if(DEVILUTIONX_WINDOWS_NO_WCHAR)
target_compile_definitions(libmpq PRIVATE LIBMPQ_WINDOWS_NO_WCHAR)
endif()

2
3rdParty/libzt/CMakeLists.txt vendored

@ -5,7 +5,7 @@ set(BUILD_HOST_SELFTEST OFF)
include(FetchContent)
FetchContent_Declare(libzt
GIT_REPOSITORY https://github.com/diasurgical/libzt.git
GIT_TAG d6c6a069a5041a3e89594c447ced3f15d77618b8)
GIT_TAG db7b642a4ce9f0f5e0ba7f293bd7ffa7897e4831)
FetchContent_MakeAvailableExcludeFromAll(libzt)
if(NOT ANDROID)

13
3rdParty/sol2/CMakeLists.txt vendored

@ -0,0 +1,13 @@
include(functions/FetchContent_MakeAvailableExcludeFromAll)
set(SOL2_ENABLE_INSTALL OFF)
include(FetchContent)
FetchContent_Declare(sol2
URL https://github.com/ThePhD/sol2/archive/9c882a28fdb6f4ad79a53a4191b43ce48a661175.tar.gz
URL_HASH MD5=2637c3fcdcce3ff34b36437c1d3b99d1
)
FetchContent_MakeAvailableExcludeFromAll(sol2)
target_include_directories(sol2 SYSTEM BEFORE INTERFACE ${CMAKE_CURRENT_LIST_DIR}/sol_config)
target_compile_definitions(sol2 INTERFACE SOL_NO_EXCEPTIONS=1)

8
3rdParty/sol2/sol_config/sol/config.hpp vendored

@ -0,0 +1,8 @@
#pragma once
#define SOL_SAFE_USERTYPE 1
#define SOL_SAFE_REFERENCES 1
#define SOL_SAFE_FUNCTION_CALLS 1
#define SOL_SAFE_FUNCTION 1
#define SOL_SAFE_NUMERICS 1
#define SOL_IN_DEBUG_DETECTED 0

36
3rdParty/sol2/sol_config/sol/debug.hpp vendored

@ -0,0 +1,36 @@
#pragma once
// sol2 uses std::cout for debug logging by default.
// We want to use SDL logging instead for better compatibility.
#include <cstddef>
#include <string>
#include <sol/stack.hpp>
namespace devilutionx {
void Sol2DebugPrintStack(lua_State *L);
void Sol2DebugPrintSection(const std::string &message, lua_State *L);
} // namespace devilutionx
namespace sol::detail::debug {
inline std::string dump_types(lua_State *L) {
std::string visual;
std::size_t size = lua_gettop(L) + 1;
for (std::size_t i = 1; i < size; ++i) {
if (i != 1) {
visual += " | ";
}
visual += type_name(L, stack::get<type>(L, static_cast<int>(i)));
}
return visual;
}
inline void print_stack(lua_State *L) { ::devilutionx::Sol2DebugPrintStack(L); }
inline void print_section(const std::string &message, lua_State *L) {
::devilutionx::Sol2DebugPrintSection(message, L);
}
} // namespace sol::detail::debug

2444
3rdParty/tl/expected.hpp vendored

File diff suppressed because it is too large Load Diff

25
3rdParty/tolk/CMakeLists.txt vendored

@ -0,0 +1,25 @@
include(functions/FetchContent_MakeAvailableExcludeFromAll)
include(FetchContent)
FetchContent_Declare(Tolk
URL https://github.com/sig-a11y/tolk/archive/89de98779e3b6365dc1688538d5de4ecba3fdbab.tar.gz
URL_HASH MD5=724f6022186573dd9c5c2c92ed9e21e6
)
FetchContent_MakeAvailableExcludeFromAll(Tolk)
target_include_directories(Tolk PUBLIC ${libTolk_SOURCE_DIR}/src)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(TOLK_LIB_DIR "${Tolk_SOURCE_DIR}/libs/x86")
else()
set(TOLK_LIB_DIR "${Tolk_SOURCE_DIR}/libs/x64")
endif()
file(GLOB TOLK_DLLS
LIST_DIRECTORIES false
"${TOLK_LIB_DIR}/*.dll"
"${TOLK_LIB_DIR}/*.ini")
foreach(_TOLK_DLL_PATH ${TOLK_DLLS})
install(FILES "${_TOLK_DLL_PATH}"
DESTINATION "."
)
endforeach()

8
3rdParty/zlib/CMakeLists.txt vendored

@ -4,10 +4,10 @@ set(CMAKE_POLICY_DEFAULT_CMP0048 NEW)
include(FetchContent)
FetchContent_Declare(zlib
URL https://www.zlib.net/zlib-1.2.13.tar.gz
https://www.zlib.net/fossils/zlib-1.2.13.tar.gz
https://github.com/madler/zlib/releases/download/v1.2.13/zlib-1.2.13.tar.gz
URL_HASH MD5=9b8aa094c4e5765dabf4da391f00d15c
URL https://www.zlib.net/zlib-1.3.tar.gz
https://www.zlib.net/fossils/zlib-1.3.tar.gz
https://github.com/madler/zlib/releases/download/v1.3/zlib-1.3.tar.gz
URL_HASH MD5=60373b133d630f74f4a1f94c1185a53f
)
FetchContent_MakeAvailableExcludeFromAll(zlib)

27
CMake/Assets.cmake

@ -114,6 +114,9 @@ set(devilutionx_assets
fonts/blue.trn
fonts/buttonface.trn
fonts/buttonpushed.trn
fonts/gamedialogwhite.trn
fonts/gamedialogyellow.trn
fonts/gamedialogred.trn
fonts/golduis.trn
fonts/goldui.trn
fonts/grayuis.trn
@ -137,10 +140,30 @@ set(devilutionx_assets
levels/l2data/bonechat.dun
levels/towndata/automap.dun
levels/towndata/automap.amp
lua_internal/get_lua_function_signature.lua
lua/devilutionx/events.lua
lua/inspect.lua
lua/repl_prelude.lua
nlevels/cutl5w.clx
nlevels/cutl6w.clx
nlevels/l5data/cornerstone.dun
nlevels/l5data/uberroom.dun
txtdata/Experience.tsv
txtdata/classes/barbarian/attributes.tsv
txtdata/classes/bard/attributes.tsv
txtdata/classes/monk/attributes.tsv
txtdata/classes/rogue/attributes.tsv
txtdata/classes/sorcerer/attributes.tsv
txtdata/classes/warrior/attributes.tsv
txtdata/items/item_prefixes.tsv
txtdata/items/item_suffixes.tsv
txtdata/items/itemdat.tsv
txtdata/items/unique_itemdat.tsv
txtdata/missiles/missile_sprites.tsv
txtdata/monsters/monstdat.tsv
txtdata/monsters/unique_monstdat.tsv
txtdata/sound/effects.tsv
txtdata/spells/spelldat.tsv
ui_art/diablo.pal
ui_art/hellfire.pal
ui_art/creditsw.clx
@ -161,7 +184,7 @@ endif()
if(APPLE)
foreach(asset_file ${devilutionx_assets})
set(src "${CMAKE_CURRENT_SOURCE_DIR}/Packaging/resources/assets/${asset_file}")
set(src "${CMAKE_CURRENT_SOURCE_DIR}/assets/${asset_file}")
get_filename_component(_asset_dir "${asset_file}" DIRECTORY)
set_source_files_properties("${src}" PROPERTIES
MACOSX_PACKAGE_LOCATION "Resources/${_asset_dir}"
@ -173,7 +196,7 @@ else()
# - If smpq is installed, devilutionx.mpq is built from these files.
# - If smpq is not installed, the game will load the assets directly from this directoy.
foreach(asset_file ${devilutionx_assets})
set(src "${CMAKE_CURRENT_SOURCE_DIR}/Packaging/resources/assets/${asset_file}")
set(src "${CMAKE_CURRENT_SOURCE_DIR}/assets/${asset_file}")
set(dst "${DEVILUTIONX_ASSETS_OUTPUT_DIRECTORY}/${asset_file}")
list(APPEND DEVILUTIONX_MPQ_FILES "${asset_file}")
list(APPEND DEVILUTIONX_OUTPUT_ASSETS_FILES "${dst}")

3
CMake/Definitions.cmake

@ -18,8 +18,10 @@ foreach(
DEVILUTIONX_RESAMPLER_SPEEX
DEVILUTIONX_RESAMPLER_SDL
DEVILUTIONX_PALETTE_TRANSPARENCY_BLACK_16_LUT
SCREEN_READER_INTEGRATION
UNPACKED_MPQS
UNPACKED_SAVES
DEVILUTIONX_WINDOWS_NO_WCHAR
)
if(${def_name})
list(APPEND DEVILUTIONX_DEFINITIONS ${def_name})
@ -90,6 +92,7 @@ foreach(
REMAP_KEYBOARD_KEYS
DEVILUTIONX_DEFAULT_RESAMPLER
STREAM_ALL_AUDIO_MIN_FILE_SIZE
DEVILUTIONX_DISPLAY_TEXTURE_FORMAT
)
if(DEFINED ${def_name} AND NOT ${def_name} STREQUAL "")
list(APPEND DEVILUTIONX_DEFINITIONS ${def_name}=${${def_name}})

32
CMake/Dependencies.cmake

@ -24,6 +24,38 @@ if(SUPPORTS_MPQ)
endif()
endif()
find_package(Lua 5.4 QUIET)
if(LUA_FOUND)
message("-- Found Lua ${LUA_VERSION_STRING}")
else()
if(NOT DEFINED DEVILUTIONX_SYSTEM_LUA)
message("-- Suitable system Lua package not found, will use Lua from source")
set(DEVILUTIONX_SYSTEM_LUA OFF)
endif()
endif()
dependency_options("lua" DEVILUTIONX_SYSTEM_LUA ON DEVILUTIONX_STATIC_LUA)
if(NOT DEVILUTIONX_SYSTEM_LUA)
add_subdirectory(3rdParty/Lua)
if(DEVILUTIONX_STATIC_LUA)
set(LUA_LIBRARIES lua_static)
else()
set(LUA_LIBRARIES lua_shared)
endif()
else()
find_package(Lua 5.4 REQUIRED)
include_directories(${LUA_INCLUDE_DIR})
endif()
add_subdirectory(3rdParty/sol2)
if(SCREEN_READER_INTEGRATION)
if(WIN32)
add_subdirectory(3rdParty/tolk)
else()
find_package(Speechd REQUIRED)
endif()
endif()
if(EMSCRIPTEN)
# We use `USE_PTHREADS=1` here to get a version of SDL2 that supports threads.
emscripten_system_library("SDL2" SDL2::SDL2 USE_SDL=2 USE_PTHREADS=1)

10
CMake/Platforms.cmake

@ -1,7 +1,3 @@
if(WIN32)
include(platforms/windows)
endif()
if(HAIKU)
include(platforms/haiku)
endif()
@ -18,7 +14,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD|OpenBSD|DragonFly|NetBSD")
endif()
set(TARGET_PLATFORM host CACHE STRING "Target platform")
set_property(CACHE TARGET_PLATFORM PROPERTY STRINGS host retrofw rg99 rg350 gkd350h cpigamesh miyoo_mini)
set_property(CACHE TARGET_PLATFORM PROPERTY STRINGS host retrofw rg99 rg350 gkd350h cpigamesh miyoo_mini windows9x)
if(TARGET_PLATFORM STREQUAL "retrofw")
include(platforms/retrofw)
elseif(TARGET_PLATFORM STREQUAL "rg99")
@ -33,6 +29,10 @@ elseif(TARGET_PLATFORM STREQUAL "lepus")
include(platforms/lepus)
elseif(TARGET_PLATFORM STREQUAL "miyoo_mini")
include(platforms/miyoo_mini)
elseif(TARGET_PLATORM STREQUAL "windows9x")
include(platforms/windows9x)
elseif(WIN32)
include(platforms/windows)
endif()
if(NINTENDO_SWITCH)

17
CMake/finders/FindSpeechd.cmake

@ -0,0 +1,17 @@
# find speech-dispatcher library and header if available
# Copyright (c) 2009, Jeremy Whiting <jpwhiting@kde.org>
# Copyright (c) 2011, Raphael Kubo da Costa <kubito@gmail.com>
# This module defines
# SPEECHD_INCLUDE_DIR, where to find libspeechd.h
# SPEECHD_LIBRARIES, the libraries needed to link against speechd
# SPEECHD_FOUND, If false, speechd was not found
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
find_path(SPEECHD_INCLUDE_DIR libspeechd.h PATH_SUFFIXES speech-dispatcher)
find_library(SPEECHD_LIBRARIES NAMES speechd)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Speechd REQUIRED_VARS SPEECHD_INCLUDE_DIR SPEECHD_LIBRARIES)

27
CMake/platforms/aarch64-linux-gnu-clang-static-libc++.toolchain.cmake

@ -0,0 +1,27 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(triple aarch64-linux-gnu)
set(CMAKE_C_COMPILER "/usr/bin/clang")
set(CMAKE_C_COMPILER_TARGET "${triple}")
set(CMAKE_CXX_COMPILER "/usr/bin/clang++")
set(CMAKE_CXX_FLAGS_INIT "-stdlib=libc++")
set(CMAKE_CXX_COMPILER_TARGET "${triple}")
set(CMAKE_ASM_COMPILER "/usr/bin/clang")
set(CMAKE_ASM_COMPILER_TARGET "${triple}")
set(CMAKE_EXE_LINKER_FLAGS_INIT "-fuse-ld=/usr/bin/ld.lld -static-libstdc++ -static-libgcc")
set(CMAKE_FIND_ROOT_PATH "/usr/aarch64-linux-gnu;/usr")
set(CMAKE_LIBRARY_ARCHITECTURE "${triple}")
set(CMAKE_STRIP "/usr/bin/aarch64-linux-gnu-strip")
set(PKG_CONFIG_EXECUTABLE "${CMAKE_CURRENT_LIST_DIR}/aarch64-linux-gnu-pkg-config" CACHE STRING "Path to pkg-config")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE arm64)

1
CMake/platforms/aarch64-linux-gnu.toolchain.cmake

@ -7,6 +7,7 @@ set(CMAKE_CXX_COMPILER "/usr/bin/aarch64-linux-gnu-g++")
set(CMAKE_FIND_ROOT_PATH "/usr/aarch64-linux-gnu;/usr")
set(CMAKE_LIBRARY_ARCHITECTURE aarch64-linux-gnu)
set(CMAKE_STRIP "/usr/bin/aarch64-linux-gnu-strip")
set(PKG_CONFIG_EXECUTABLE "${CMAKE_CURRENT_LIST_DIR}/aarch64-linux-gnu-pkg-config" CACHE STRING "Path to pkg-config")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

10
CMake/platforms/debian-cross-pkg-config.sh

@ -14,11 +14,13 @@ if [ x"${PKG_CONFIG_LIBDIR+set}" = x ]; then
# Normalized multiarch path if any, e.g. i386-linux-gnu for i386
multiarch="`dpkg-architecture -t"${triplet}" -qDEB_HOST_MULTIARCH 2>/dev/null`"
# Native multiarch path
native_multiarch="$(cat /usr/lib/pkg-config.multiarch)"
if [ -f /usr/lib/pkg-config.multiarch ]; then
native_multiarch="$(cat /usr/lib/pkg-config.multiarch)"
# This can be used for native builds as well, in that case, just exec pkg-config "$@" directly.
if [ "$native_multiarch" = "$multiarch" ]; then
exec pkg-config "$@"
# This can be used for native builds as well, in that case, just exec pkg-config "$@" directly.
if [ "$native_multiarch" = "$multiarch" ]; then
exec pkg-config "$@"
fi
fi
PKG_CONFIG_LIBDIR="/usr/local/${triplet}/lib/pkgconfig"

29
CMake/platforms/mingw9x.toolchain.cmake

@ -0,0 +1,29 @@
SET(MINGW_CROSS TRUE)
SET(CROSS_PREFIX "/usr" CACHE STRING "crosstool-NG prefix")
SET(CMAKE_SYSTEM_NAME Windows)
# workaround
list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "${CROSS_PREFIX}/i686-w64-mingw32/include")
list(PREPEND CMAKE_C_STANDARD_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_LIST_DIR}/mingw9x/include")
list(PREPEND CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_LIST_DIR}/mingw9x/include")
# work around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106103
set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "${CMAKE_CXX_FLAGS_MINSIZEREL_INIT} -fno-declone-ctor-dtor")
SET(CMAKE_C_COMPILER "i686-w64-mingw32-gcc")
SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-g++")
set(CMAKE_RC_COMPILER "i686-w64-mingw32-windres")
set(CMAKE_STRIP "${CROSS_PREFIX}/i686-w64-mingw32/bin/strip")
set(PKG_CONFIG_EXECUTABLE "${CROSS_PREFIX}/bin/i686-w64-mingw32-pkg-config" CACHE STRING "Path to pkg-config")
SET(CMAKE_FIND_ROOT_PATH "${CROSS_PREFIX}/i686-w64-mingw32" "${CROSS_PREFIX}/i686-w64-mingw32/i686-w64-mingw32")
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(WIN32_INSTALL_DLLS "${CROSS_PREFIX}/i686-w64-mingw32/bin/SDL.dll")

22
CMake/platforms/mingw9x/include/windef.h

@ -0,0 +1,22 @@
#ifndef _WINDEF_OVERRIDE_
#define _WINDEF_OVERRIDE_
#include_next <windef.h>
// MinGW does not define these when _WIN32_WINNT < 0x0400
// but it declares functions that use it unconditionally.
typedef enum _FINDEX_INFO_LEVELS {
FindExInfoStandard,
FindExInfoBasic,
FindExInfoMaxInfoLevel
} FINDEX_INFO_LEVELS;
typedef enum _FINDEX_SEARCH_OPS {
FindExSearchNameMatch,
FindExSearchLimitToDirectories,
FindExSearchLimitToDevices,
FindExSearchMaxSearchOp
} FINDEX_SEARCH_OPS;
typedef void* SOLE_AUTHENTICATION_SERVICE;
#endif /* _WINDEF_ */

1
CMake/platforms/mingwcc.toolchain.cmake

@ -10,6 +10,7 @@ list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "${CROSS_PREFIX}/i686-w64-min
SET(CMAKE_C_COMPILER "i686-w64-mingw32-gcc")
SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-g++")
set(CMAKE_RC_COMPILER "i686-w64-mingw32-windres")
set(CMAKE_STRIP "${CROSS_PREFIX}/i686-w64-mingw32/bin/strip")
set(PKG_CONFIG_EXECUTABLE "${CROSS_PREFIX}/bin/i686-w64-mingw32-pkg-config" CACHE STRING "Path to pkg-config")
SET(CMAKE_FIND_ROOT_PATH "${CROSS_PREFIX}/i686-w64-mingw32" "${CROSS_PREFIX}/i686-w64-mingw32/i686-w64-mingw32")

1
CMake/platforms/mingwcc64.toolchain.cmake

@ -10,6 +10,7 @@ list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "${CROSS_PREFIX}/x86_64-w64-m
SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-gcc")
SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-g++")
set(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres")
set(CMAKE_STRIP "${CROSS_PREFIX}/x86_64-w64-mingw32/bin/strip")
set(PKG_CONFIG_EXECUTABLE "${CROSS_PREFIX}/bin/x86_64-w64-mingw32-pkg-config" CACHE STRING "Path to pkg-config")
SET(CMAKE_FIND_ROOT_PATH "${CROSS_PREFIX}/x86_64-w64-mingw32" "${CROSS_PREFIX}/x86_64-w64-mingw32/x86_64-w64-mingw32")

2
CMake/platforms/windows.cmake

@ -10,6 +10,8 @@ list(APPEND DEVILUTIONX_PLATFORM_LINK_LIBRARIES
wininet
)
add_definitions(-DWINVER=0x0601 -D_WIN32_WINDOWS=0x0601 -D_WIN32_WINNT=0x0601)
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
list(APPEND DEVILUTIONX_PLATFORM_COMPILE_OPTIONS "/W3" "/Zc:__cplusplus" "/utf-8")
list(APPEND DEVILUTIONX_PLATFORM_COMPILE_DEFINITIONS _CRT_SECURE_NO_WARNINGS)

38
CMake/platforms/windows9x.cmake

@ -0,0 +1,38 @@
set(ASAN OFF)
set(UBSAN OFF)
set(DIST ON)
set(NONET ON)
set(DISABLE_ZERO_TIER ON)
set(USE_SDL1 ON)
set(DEVILUTIONX_SYSTEM_BZIP2 OFF)
set(DEVILUTIONX_SYSTEM_LIBFMT OFF)
set(DEVILUTIONX_STATIC_LIBSODIUM OFF)
# Compatibility with Windows 9x 8-bit mode and improved performance
set(SDL1_VIDEO_MODE_BPP 8)
set(SDL1_FORCE_DIRECT_RENDER ON)
set(DEVILUTIONX_WINDOWS_NO_WCHAR ON)
# `WINVER=0x0500` without `_WIN32_WINNT` is Windows 98.
# MinGW force-defines `_WIN32_WINNT=0xa00` if it isn't defined, so define it as 0.
add_definitions(-DWINVER=0x0500 -D_WIN32_WINDOWS=0x0500 -D_WIN32_WINNT=0)
list(APPEND DEVILUTIONX_PLATFORM_LINK_LIBRARIES
shlwapi
wsock32
ws2_32
wininet
)
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
list(APPEND DEVILUTIONX_PLATFORM_COMPILE_OPTIONS "/W3" "/Zc:__cplusplus" "/utf-8")
list(APPEND DEVILUTIONX_PLATFORM_COMPILE_DEFINITIONS _CRT_SECURE_NO_WARNINGS)
else()
list(APPEND DEVILUTIONX_PLATFORM_COMPILE_OPTIONS $<$<CONFIG:Debug>:-gstabs>)
endif()
if(MINGW_CROSS)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/mingw")
endif()

1
CMake/platforms/xbox_nxdk.cmake

@ -9,6 +9,7 @@ set(DEVILUTIONX_SYSTEM_LIBFMT OFF)
set(BUILD_ASSETS_MPQ OFF)
set(DEVILUTIONX_ASSETS_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/pkg/assets")
set(DEVILUTIONX_WINDOWS_NO_WCHAR ON)
set(DEVILUTIONX_RESAMPLER_SPEEX OFF)
set(DEFAULT_AUDIO_BUFFER_SIZE 5120)

35
CMakeLists.txt

@ -106,6 +106,12 @@ option(MACOSX_STANDALONE_APP_BUNDLE "Generate a portable app bundle to use on ot
cmake_dependent_option(DISABLE_TCP "Disable TCP multiplayer option" OFF "NOT NONET" ON)
cmake_dependent_option(DISABLE_ZERO_TIER "Disable ZeroTier multiplayer option" OFF "NOT NONET" ON)
# Graphics options
if(NOT USE_SDL1)
set(DEVILUTIONX_DISPLAY_TEXTURE_FORMAT "SDL_PIXELFORMAT_RGB888" CACHE STRING "Texture format for DevilutionX textures when using the GPU renderer")
mark_as_advanced(DEVILUTIONX_DISPLAY_TEXTURE_FORMAT)
endif()
# Sound options
option(NOSOUND "Disable sound support" OFF)
option(DEVILUTIONX_RESAMPLER_SPEEX "Build with Speex resampler" ON)
@ -124,7 +130,7 @@ set_property(CACHE DEVILUTIONX_DEFAULT_RESAMPLER PROPERTY STRINGS ${_resamplers}
option(DISABLE_LTO "Disable link-time optimization (by default enabled in release mode)" OFF)
option(PIE "Generate position-independent code" OFF)
cmake_dependent_option(DEVILUTIONX_DISABLE_RTTI "Disable RTTI" ON "NONET" OFF)
cmake_dependent_option(DEVILUTIONX_DISABLE_EXCEPTIONS "Disable exceptions" ON "NONET" OFF)
cmake_dependent_option(DEVILUTIONX_DISABLE_EXCEPTIONS "Disable exceptions" ON "DISABLE_ZERO_TIER" OFF)
RELEASE_OPTION(DEVILUTIONX_STATIC_CXX_STDLIB "Link C++ standard library statically (if available)")
option(DEVILUTIONX_PROFILE_GENERATE "Build a binary that generates the profile for PGO" OFF)
option(DEVILUTIONX_PROFILE_USE "Build with PGO using the given profile file" OFF)
@ -147,6 +153,8 @@ mark_as_advanced(DEVILUTIONX_PALETTE_TRANSPARENCY_BLACK_16_LUT)
# Additional features
option(DISABLE_DEMOMODE "Disable demo mode support" OFF)
option(DISCORD_INTEGRATION "Build with Discord SDK for rich presence support" OFF)
option(SCREEN_READER_INTEGRATION "Build with screen reader support" OFF)
mark_as_advanced(SCREEN_READER_INTEGRATION)
# If both UNPACKED_MPQS and UNPACKED_SAVES are enabled, we completely remove MPQ support.
if(UNPACKED_MPQS AND UNPACKED_SAVES)
@ -156,7 +164,7 @@ else()
endif()
# By default, devilutionx.mpq is built only if smpq is installed and MPQ support is enabled.
if(SUPPORTS_MPQ)
if(SUPPORTS_MPQ AND NOT UNPACKED_MPQS)
if(NOT DEFINED BUILD_ASSETS_MPQ AND NOT SRC_DIST)
find_program(SMPQ smpq)
elseif(BUILD_ASSETS_MPQ)
@ -263,6 +271,11 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_link_options("$<$<BOOL:${DEVILUTIONX_PROFILE_DIR}>:-fprofile-dir=${DEVILUTIONX_PROFILE_DIR};-fprofile-prefix-path=${CMAKE_CURRENT_BINARY_DIR}>")
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
# u8path() function is deprecated but there is no sensible alternative and it might even get un-deprecated.
add_definitions(-D_SILENCE_CXX20_U8PATH_DEPRECATION_WARNING)
endif()
# Not a genexp because CMake doesn't support it
# https://gitlab.kitware.com/cmake/cmake/-/issues/20546
if(NOT DISABLE_LTO)
@ -293,12 +306,9 @@ if(GPERF)
endif()
endif()
# Despite setting C++ standard to 20, features from this version are not being used.
# The oldest compiler used is GCC 6.5 - and that defines our C++ feature set (meaning most of C++17).
# It's present only to take advantage of fmt::format build time errors.
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # for clang-tidy
set(CMAKE_THREAD_PREFER_PTHREAD ON)
set(THREADS_PREFER_PTHREAD_FLAG ON)
@ -332,8 +342,7 @@ else()
add_custom_command(
TARGET ${BIN_TARGET} POST_BUILD
DEPENDS ${BIN_TARGET}
COMMAND $<$<CONFIG:Release>:${CMAKE_STRIP}>
$<$<CONFIG:MinSizeRel>:${CMAKE_STRIP}>
COMMAND $<$<OR:$<CONFIG:Release>,$<CONFIG:MinSizeRel>>:${CMAKE_STRIP}>
ARGS $<TARGET_FILE:${BIN_TARGET}>)
endif()
endif()
@ -438,7 +447,7 @@ if(VITA)
VERSION ${VITA_VERSION}
NAME ${VITA_APP_NAME}
FILE Packaging/vita/sce_sys sce_sys
FILE Packaging/resources/assets assets
FILE assets assets
${VITA_TRANSLATIONS_LIST}
)
endif()
@ -530,7 +539,7 @@ if(CPACK AND (APPLE OR BUILD_ASSETS_MPQ OR SRC_DIST))
DESTINATION "."
)
foreach(_SDL2_WIN32_DLL_PATH ${SDL2_WIN32_ALL_DLLS})
foreach(_SDL2_WIN32_DLL_PATH ${SDL2_WIN32_ALL_DLLS} ${WIN32_INSTALL_DLLS})
install(FILES "${_SDL2_WIN32_DLL_PATH}"
DESTINATION "."
)
@ -548,6 +557,12 @@ if(CPACK AND (APPLE OR BUILD_ASSETS_MPQ OR SRC_DIST))
)
endif()
if(SCREEN_READER_INTEGRATION)
install(FILES "${Tolk_BINARY_DIR}/libTolk.dll"
DESTINATION "."
)
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
string(TOLOWER ${PROJECT_NAME} project_name)
set(CPACK_PACKAGE_NAME ${project_name})

9
Packaging/OpenDingux/build.sh

@ -105,6 +105,13 @@ parse_args() {
>&2 echo "Error: at most one of --profile-use and --profile-generate is allowed"
exit 64
fi
if [[ $TARGET = rg99 ]]; then
OPK_EXTRA_FILES+=(
Packaging/OpenDingux/devilutionx-from-disk.sh
Packaging/OpenDingux/devilutionx-umount-opk-and-run.sh
)
OPK_DESKTOP_EXEC="devilutionx-from-disk.sh"
fi
if (( PROFILE_GENERATE )); then
CMAKE_CONFIGURE_OPTS+=(
"-DDEVILUTIONX_PROFILE_GENERATE=ON"
@ -112,7 +119,7 @@ parse_args() {
)
OPK_DESKTOP_NAME="DevilutionX PG"
OPK_DESKTOP_EXEC="profile-generate.sh"
OPK_EXTRA_FILES=(
OPK_EXTRA_FILES+=(
Packaging/OpenDingux/profile-generate.sh
test/fixtures/timedemo/WarriorLevel1to2/demo_0.dmo
)

28
Packaging/OpenDingux/devilutionx-from-disk.sh

@ -0,0 +1,28 @@
#!/bin/sh
# Unpacks the mounted OPK to disk before running it
# in order to avoid the memory overhead of squashfs.
OPK_DIR="${PWD}"
STORAGE="$(grep mmcblk /proc/mounts | cut -d' ' -f2 || echo /media/data/local/home)"
UNPACK_DIR="${STORAGE}/devilutionx-opk-on-disk"
set -e
set -x
DO_COPY=1
if [ -f "${UNPACK_DIR}/devilutionx" ]; then
INSTALLED_MD5="$(md5sum "${UNPACK_DIR}/devilutionx" | cut -d' ' -f1)"
OPK_MD5="$(md5sum "${PWD}/devilutionx" | cut -d' ' -f1)"
if [ "$INSTALLED_MD5" = "$OPK_MD5" ]; then
DO_COPY=0
fi
fi
if [ "$DO_COPY" = "1" ]; then
rm -rf "$UNPACK_DIR"
mkdir -p "$UNPACK_DIR"
cp -rf "$OPK_DIR"/* "$UNPACK_DIR"
fi
exec "${UNPACK_DIR}/devilutionx-umount-opk-and-run.sh" "${UNPACK_DIR}/devilutionx" "$@"

5
Packaging/OpenDingux/devilutionx-umount-opk-and-run.sh

@ -0,0 +1,5 @@
#!/bin/sh
set -x
echo | sudo -S umount -l "$PWD"
exec "$@"

6
Packaging/OpenDingux/gkd350h-manual.txt

@ -4,13 +4,13 @@ Copy diabdat.mpq from your CD (or GoG install folder) to:
For Hellfire, also copy hellfire.mpq, hfmonk.mpq, hfmusic.mpq, and hfvoice.mpq.
For Chinese, Japanese, and Korean text support copy:
https://github.com/diasurgical/devilutionx-assets/releases/download/v2/fonts.mpq
https://github.com/diasurgical/devilutionx-assets/releases/latest/download/fonts.mpq
For the Polish voice pack copy:
https://github.com/diasurgical/devilutionx-assets/releases/download/v2/pl.mpq
https://github.com/diasurgical/devilutionx-assets/releases/latest/download/pl.mpq
For the Russian voice pack copy:
https://github.com/diasurgical/devilutionx-assets/releases/download/v2/ru.mpq
https://github.com/diasurgical/devilutionx-assets/releases/latest/download/ru.mpq
Game saves and diablo.ini are located at:
/usr/local/home/.local/share/diasurgical/devilution/

6
Packaging/OpenDingux/lepus-manual.txt

@ -4,13 +4,13 @@ Copy diabdat.mpq from your CD (or GoG install folder) to:
For Hellfire, also copy hellfire.mpq, hfmonk.mpq, hfmusic.mpq, and hfvoice.mpq.
For Chinese, Japanese, and Korean text support copy:
https://github.com/diasurgical/devilutionx-assets/releases/download/v2/fonts.mpq
https://github.com/diasurgical/devilutionx-assets/releases/latest/download/fonts.mpq
For the Polish voice pack copy:
https://github.com/diasurgical/devilutionx-assets/releases/download/v2/pl.mpq
https://github.com/diasurgical/devilutionx-assets/releases/latest/download/pl.mpq
For the Russian voice pack copy:
https://github.com/diasurgical/devilutionx-assets/releases/download/v2/ru.mpq
https://github.com/diasurgical/devilutionx-assets/releases/latest/download/ru.mpq
Game saves and diablo.ini are located at:
~/.local/share/diasurgical/devilution

8
Packaging/OpenDingux/profile-generate.sh

@ -3,8 +3,10 @@
set -x
SAVE_DIR="$(mktemp -d)"
ln -s "${PWD}/demo_0_reference_spawn_0_sv" "${SAVE_DIR}/"
ln -s "${PWD}/demo_0.dmo" "${SAVE_DIR}/"
cp "${PWD}/demo_0_reference_spawn_0_sv" "${SAVE_DIR}/"
cp "${PWD}/demo_0.dmo" "${SAVE_DIR}/"
cp -r "${PWD}/spawn_0_sv" "${SAVE_DIR}/"
./devilutionx --diablo --spawn --demo 0 --timedemo --save-dir "$SAVE_DIR" --data-dir ~/.local/share/diasurgical/devilution
rm -rf "${HOME}/devilutionx-profile"
mkdir -p "${HOME}/devilutionx-profile"
./devilutionx-from-disk.sh --diablo --spawn --demo 0 --timedemo --save-dir "$SAVE_DIR" --data-dir ~/.local/share/diasurgical/devilution
rm -rf "$SAVE_DIR"

6
Packaging/OpenDingux/retrofw-manual.txt

@ -4,13 +4,13 @@ Copy diabdat.mpq from your CD (or GoG install folder) to:
For Hellfire, also copy hellfire.mpq, hfmonk.mpq, hfmusic.mpq, and hfvoice.mpq.
For Chinese, Japanese, and Korean text support copy:
https://github.com/diasurgical/devilutionx-assets/releases/download/v2/fonts.mpq
https://github.com/diasurgical/devilutionx-assets/releases/latest/download/fonts.mpq
For the Polish voice pack copy:
https://github.com/diasurgical/devilutionx-assets/releases/download/v2/pl.mpq
https://github.com/diasurgical/devilutionx-assets/releases/latest/download/pl.mpq
For the Russian voice pack copy:
https://github.com/diasurgical/devilutionx-assets/releases/download/v2/ru.mpq
https://github.com/diasurgical/devilutionx-assets/releases/latest/download/ru.mpq
Game saves and diablo.ini are located at:
~/.local/share/diasurgical/devilution

6
Packaging/OpenDingux/rg350-manual.txt

@ -4,13 +4,13 @@ Copy diabdat.mpq from your CD (or GoG install folder) to:
For Hellfire, also copy hellfire.mpq, hfmonk.mpq, hfmusic.mpq, and hfvoice.mpq.
For Chinese, Japanese, and Korean text support copy:
https://github.com/diasurgical/devilutionx-assets/releases/download/v2/fonts.mpq
https://github.com/diasurgical/devilutionx-assets/releases/latest/download/fonts.mpq
For the Polish voice pack copy:
https://github.com/diasurgical/devilutionx-assets/releases/download/v2/pl.mpq
https://github.com/diasurgical/devilutionx-assets/releases/latest/download/pl.mpq
For the Russian voice pack copy:
https://github.com/diasurgical/devilutionx-assets/releases/download/v2/ru.mpq
https://github.com/diasurgical/devilutionx-assets/releases/latest/download/ru.mpq
Game saves and diablo.ini are located at:
~/.local/share/diasurgical/devilution/

4
Packaging/OpenDingux/rg99-manual.txt

@ -4,10 +4,10 @@ Copy diabdat.mpq from your CD (or GoG install folder) to:
For Hellfire, also copy hellfire.mpq, hfmonk.mpq, hfmusic.mpq, and hfvoice.mpq.
For Chinese, Japanese, and Korean text support copy:
https://github.com/diasurgical/devilutionx-assets/releases/download/v1/fonts.mpq
https://github.com/diasurgical/devilutionx-assets/releases/latest/download/fonts.mpq
For the Polish voice pack copy:
https://github.com/diasurgical/devilutionx-assets/releases/download/v1/pl.mpq
https://github.com/diasurgical/devilutionx-assets/releases/latest/download/pl.mpq
Game saves and diablo.ini are located at:
~/.local/share/diasurgical/devilution

55
Packaging/OpenDingux/rg99-pgo.md

@ -35,3 +35,58 @@ Here are the instructions for producing a PGO'd build.
```
7. The final package is at `build-rg99/devilutionx-rg99.opk`.
## Remote Debugging with VS Code
If the demo crashes and you cannot reproduce this on PC, you can
use a remote debugger to diagnose the issue.
Unpack the package and copy it to the RG99:
```bash
cd build-rg99
rm -rf squashfs-root
unsquashfs devilutionx-rg99.opk
ssh rg99 'rm -rf /media/data/local/home/squashfs-root'
scp -r -O squashfs-root/ rg99:/media/data/local/home/squashfs-root
```
Then, on RG99, prepare the demo files and run `gdbserver`:
```bash
mkdir -p demo
cp -r squashfs-root/demo_0* demo
cp -r squashfs-root/spawn_0_sv demo
cd squashfs-root
gdbserver 10.1.1.1:8001 devilutionx --diablo --spawn --demo 0 --timedemo \
--save-dir ~/demo --data-dir ~/.local/share/diasurgical/devilution
```
Then, on the PC, add the following VS Code configuration to `.vscode/launch.json`:
```json
{
"name": "rg99 remote debug",
"type": "cppdbg",
"request": "launch",
"program": "build-rg99/devilutionx",
"stopAtEntry": true,
"miDebuggerPath": "/opt/rs90-toolchain/bin/mipsel-linux-gdb",
"miDebuggerArgs": "-ix /opt/rs90-toolchain/mipsel-rs90-linux-musl/sysroot/usr/share/buildroot/gdbinit",
"MIMode": "gdb",
"miDebuggerServerAddress": "10.1.1.3:8001",
"targetArchitecture": "mips",
"additionalSOLibSearchPath": "/opt/rs90-toolchain/mipsel-rs90-linux-musl/sysroot",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"externalConsole": false,
"cwd": "${workspaceFolder}"
}
```
Finally, run the configuration from the "Run and Debug" VS Code tab.

4
Packaging/cpi-gamesh/readme.md

@ -10,8 +10,8 @@ Once installed, 'X' pulls the updated code and does the compiling. Note that any
When the compile is finished and the diabdat.mpq is in place at '/home/cpi/.local/share/diasurgical/devilution/', you can play the game.
- To run the Diablo: Hellfire expansion you will need to also copy hellfire.mpq, hfmonk.mpq, hfmusic.mpq, hfvoice.mpq.
- For Chinese, Japanese, and Korean text support download https://github.com/diasurgical/devilutionx-assets/releases/download/v1/fonts.mpq and add it to the game folder.
- For the Polish voice pack download https://github.com/diasurgical/devilutionx-assets/releases/download/v1/pl.mpq.
- For Chinese, Japanese, and Korean text support download https://github.com/diasurgical/devilutionx-assets/releases/latest/download/fonts.mpq and add it to the game folder.
- For the Polish voice pack download https://github.com/diasurgical/devilutionx-assets/releases/latest/download/pl.mpq.
Enjoy!
For ClockworkOS v0.5, buster-backports are required to have updated libraries: https://backports.debian.org/Instructions/

2
Packaging/miyoo_mini/skeleton_MiniUI/Diablo/readme.txt

@ -11,7 +11,7 @@ For the full game:
- Optional: If you want to also play the Hellfire expansion, copy hellfire.mpq, hfmonk.mpq, hfmusic.mpq, hfvoice.mpq into this fodler aswell
For the free shareware version:
- Get the spawn.mpq (https://github.com/diasurgical/devilutionx-assets/releases/download/v2/spawn.mpq)
- Get the spawn.mpq (https://github.com/diasurgical/devilutionx-assets/releases/latest/download/spawn.mpq)
- Copy the spawn.mpq into this folder
Controls

2
Packaging/miyoo_mini/skeleton_OnionOS/readme.txt

@ -12,7 +12,7 @@ For the full game:
- Optional: If you want to also play the Hellfire expansion, copy hellfire.mpq, hfmonk.mpq, hfmusic.mpq, hfvoice.mpq into the same folder
For the free shareware version:
- Get the spawn.mpq (https://github.com/diasurgical/devilutionx-assets/releases/download/v2/spawn.mpq)
- Get the spawn.mpq (https://github.com/diasurgical/devilutionx-assets/releases/latest/download/spawn.mpq)
- Copy the spawn.mpq into Roms/PORTS/Binaries/Diablo.port/FILES_HERE
Controls

2
Packaging/nix/LinuxReleasePackaging.sh

@ -16,7 +16,7 @@ if [[ -f "${PKG_PATH}/lib/discord_game_sdk.so" ]]; then
cat <<'SH' > "${BUILD_DIR}/package/devilutionx.sh"
#!/bin/sh
BASEDIR="$(dirname "$(realpath "$0")")"
LD_LIBRARY_PATH="$BASEDIR" "$BASEDIR"/devilutionx
LD_LIBRARY_PATH="$BASEDIR" "$BASEDIR"/devilutionx "$@"
SH
chmod +x "${BUILD_DIR}/package/devilutionx.sh"
fi

6
Packaging/nix/README.txt

@ -13,9 +13,9 @@ For a full list of changes see our changelog: https://github.com/diasurgical/dev
- Install libsdl2
- Copy DIABDAT.MPQ from the CD or GOG-installation (or extract it from the GoG installer) to the DevilutionX folder.
- To run the Diablo: Hellfire expansion you will need to also copy hellfire.mpq, hfmonk.mpq, hfmusic.mpq, hfvoice.mpq.
- For Chinese, Japanese, and Korean text support download https://github.com/diasurgical/devilutionx-assets/releases/download/v2/fonts.mpq and add it to the game folder.
- For the Polish voice pack download https://github.com/diasurgical/devilutionx-assets/releases/download/v2/pl.mpq.
- For the Russian voice pack download https://github.com/diasurgical/devilutionx-assets/releases/download/v2/ru.mpq.
- For Chinese, Japanese, and Korean text support download https://github.com/diasurgical/devilutionx-assets/releases/latest/download/fonts.mpq and add it to the game folder.
- For the Polish voice pack download https://github.com/diasurgical/devilutionx-assets/releases/latest/download/pl.mpq.
- For the Russian voice pack download https://github.com/diasurgical/devilutionx-assets/releases/latest/download/ru.mpq.
- Run ./devilutionx
# Multiplayer

20
Packaging/nix/debian-cross-aarch64-prep.sh

@ -14,11 +14,23 @@ deb [arch=arm64] http://ports.ubuntu.com/ ${FLAVOR} multiverse
deb [arch=arm64] http://ports.ubuntu.com/ ${FLAVOR}-updates multiverse
deb [arch=arm64] http://ports.ubuntu.com/ ${FLAVOR}-backports main restricted universe multiverse
LIST
sudo sed -i 's/deb http/deb [arch=amd64,i386] http/' /etc/apt/sources.list
sudo sed -E -i 's/deb (http|file|mirror)/deb [arch=amd64,i386] \1/' /etc/apt/sources.list
cat /etc/apt/sources.list
fi
PACKAGES=(
cmake git smpq gettext dpkg-cross libc-dev-arm64-cross
libsdl2-dev:arm64 libsdl2-image-dev:arm64 libsodium-dev:arm64
libsimpleini-dev:arm64 libpng-dev:arm64 libbz2-dev:arm64 libfmt-dev:arm64
libspeechd-dev:arm64
)
if (( $# < 1 )) || [[ "$1" != --no-gcc ]]; then
PACKAGES+=(crossbuild-essential-arm64)
fi
sudo dpkg --add-architecture arm64
sudo apt-get update
sudo apt-get install -y cmake git smpq gettext crossbuild-essential-arm64 \
libsdl2-dev:arm64 libsdl2-image-dev:arm64 libsodium-dev:arm64 \
libsimpleini-dev:arm64 libpng-dev:arm64 libbz2-dev:arm64 libfmt-dev:arm64
sudo apt-get install -y "${PACKAGES[@]}"

16
Packaging/nix/debian-cross-i386-prep.sh

@ -2,9 +2,17 @@
set -euo pipefail
set -x
PACKAGES=(
cmake git smpq gettext
libsdl2-dev:i386 libsdl2-image-dev:i386 libsodium-dev:i386
libpng-dev:i386 libbz2-dev:i386 libfmt-dev:i386 libspeechd-dev:i386
)
if (( $# < 1 )) || [[ "$1" != --no-gcc ]]; then
PACKAGES+=(g++-multilib)
fi
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install --ignore-hold -y \
cmake g++-multilib git smpq gettext \
libsdl2-dev:i386 libsdl2-image-dev:i386 libsodium-dev:i386 \
libpng-dev:i386 libbz2-dev:i386 libfmt-dev:i386
sudo apt-get install --ignore-hold -y "${PACKAGES[@]}"

14
Packaging/nix/debian-host-prep.sh

@ -2,7 +2,15 @@
set -euo pipefail
set -x
PACKAGES=(
rpm pkg-config cmake git smpq gettext libsdl2-dev libsdl2-image-dev libsodium-dev
libpng-dev libbz2-dev libfmt-dev libspeechd-dev
)
if (( $# < 1 )) || [[ "$1" != --no-gcc ]]; then
PACKAGES+=(g++)
fi
sudo apt-get update
sudo apt-get install -y \
rpm pkg-config cmake g++ git smpq gettext libsdl2-dev libsdl2-image-dev libsodium-dev \
libpng-dev libbz2-dev libfmt-dev
sudo apt-get install -y "${PACKAGES[@]}"

17
Packaging/nix/devilutionx.metainfo.xml

@ -64,6 +64,23 @@
</screenshot>
</screenshots>
<releases>
<release version="1.5.1" date="2023-xx-xx">
<description>
<p>This is a primarily bugfix release, which includes the following updates:</p>
<ul>
<li>Resolve various gameplay and graphical issues</li>
<li>Revamped settings menu for better organization</li>
<li>Rectification of crashes identified in version 1.5.0</li>
<li>Reduced RAM usage for improved performance</li>
<li>Updates to PVP arenas</li>
<li>Increased reliability in multiplayer functionality</li>
<li>Improved translations</li>
<li>Fixed gameplay recording playback issues</li>
</ul>
<p>Please visit the full changelog for more detailed notes</p>
</description>
<url>https://github.com/diasurgical/devilutionX/releases/tag/1.5.1</url>
</release>
<release version="1.5.0" date="2023-06-13">
<description>
<p>This release includes a lot of features, such as:</p>

6
Packaging/pi/README.txt

@ -13,9 +13,9 @@ For a full list of changes see our changelog: https://github.com/diasurgical/dev
- Install libsdl2
- Copy DIABDAT.MPQ from the CD or GOG-installation (or extract it from the GoG installer) to the DevilutionX folder.
- To run the Diablo: Hellfire expansion you will need to also copy hellfire.mpq, hfmonk.mpq, hfmusic.mpq, hfvoice.mpq.
- For Chinese, Japanese, and Korean text support download https://github.com/diasurgical/devilutionx-assets/releases/download/v2/fonts.mpq and add it to the game folder.
- For the Polish voice pack download https://github.com/diasurgical/devilutionx-assets/releases/download/v2/pl.mpq.
- For the Russian voice pack download https://github.com/diasurgical/devilutionx-assets/releases/download/v2/ru.mpq.
- For Chinese, Japanese, and Korean text support download https://github.com/diasurgical/devilutionx-assets/releases/latest/download/fonts.mpq and add it to the game folder.
- For the Polish voice pack download https://github.com/diasurgical/devilutionx-assets/releases/latest/download/pl.mpq.
- For the Russian voice pack download https://github.com/diasurgical/devilutionx-assets/releases/latest/download/ru.mpq.
- Run ./devilutionx
# Raspberry Pi performance

10
Packaging/switch/README.txt

@ -1,12 +1,12 @@
# Nintendo Switch Port of DevilutionX (Diablo)
# How To Install:
- Put `devilutionx.nro` and `devilutionx.mpq` in into `/switch/devilutionx`
- Put `devilutionx.nro` into `/switch/devilutionx`
- Copy diabdat.mpq from your CD (or GoG install folder) to `/switch/devilutionx`.
- To run the Diablo: Hellfire expansion you will need to also copy hellfire.mpq, hfmonk.mpq, hfmusic.mpq, hfvoice.mpq.
- For Chinese, Japanese, and Korean text support download https://github.com/diasurgical/devilutionx-assets/releases/download/v2/fonts.mpq and add it to the game folder.
- For the Polish voice pack download https://github.com/diasurgical/devilutionx-assets/releases/download/v2/pl.mpq.
- For the Russian voice pack download https://github.com/diasurgical/devilutionx-assets/releases/download/v2/ru.mpq.
- For Chinese, Japanese, and Korean text support download https://github.com/diasurgical/devilutionx-assets/releases/latest/download/fonts.mpq and add it to the game folder.
- For the Polish voice pack download https://github.com/diasurgical/devilutionx-assets/releases/latest/download/pl.mpq.
- For the Russian voice pack download https://github.com/diasurgical/devilutionx-assets/releases/latest/download/ru.mpq.
- Launch `devilutionx.nro`. (Do not use album to launch; see the note below.)
- *Note:* Hold R on any installed game and launch it. Do not use album to launch. If you use album, the homebrew will only have a small amount memory available, and the touch keyboard won't work. This is true for all homebrew, not just DevilutionX.
@ -42,7 +42,7 @@ For a full list of changes see our changelog: https://github.com/diasurgical/dev
# Legal
DevilutionX is released to the Public Domain. The documentation and functionality provided by DevilutionX may only be utilized with assets provided by ownership of Diablo.
The source code in this repository is for non-commerical use only. If you use the source code you may not charge others for access to it or any derivative work thereof.
The source code in this repository is for non-commercial use only. If you use the source code you may not charge others for access to it or any derivative work thereof.
Diablo® - Copyright © 1996 Blizzard Entertainment, Inc. All rights reserved. Diablo and Blizzard Entertainment are trademarks or registered trademarks of Blizzard Entertainment, Inc. in the U.S. and/or other countries.

6
Packaging/vita/README.txt

@ -3,9 +3,9 @@
## How To Play:
- Install VPK
- Copy diabdat.mpq from your CD or GoG installation (or [extract it from the GoG installer](https://github.com/diasurgical/devilutionX/wiki/Extracting-the-.MPQs-from-the-GoG-installer)) to the `ux0:/data/diasurgical/devilution/`.
- For Chinese, Japanese, and Korean text support download https://github.com/diasurgical/devilutionx-assets/releases/download/v2/fonts.mpq and add it to the game folder.
- For the Polish voice pack download https://github.com/diasurgical/devilutionx-assets/releases/download/v2/pl.mpq.
- For the Russian voice pack download https://github.com/diasurgical/devilutionx-assets/releases/download/v2/ru.mpq.
- For Chinese, Japanese, and Korean text support download https://github.com/diasurgical/devilutionx-assets/releases/latest/download/fonts.mpq and add it to the game folder.
- For the Polish voice pack download https://github.com/diasurgical/devilutionx-assets/releases/latest/download/pl.mpq.
- For the Russian voice pack download https://github.com/diasurgical/devilutionx-assets/releases/latest/download/ru.mpq.
# Building from Source

6
Packaging/windows/README.txt

@ -12,9 +12,9 @@ For a full list of changes see our changelog: https://github.com/diasurgical/dev
- Extract the files in the zip
- Copy DIABDAT.MPQ from the CD or GOG-installation (or extract it from the GoG installer) to the DevilutionX folder.
- To run the Diablo: Hellfire expansion you will need to also copy hellfire.mpq, hfmonk.mpq, hfmusic.mpq, hfvoice.mpq.
- For Chinese, Japanese, and Korean text support download https://github.com/diasurgical/devilutionx-assets/releases/download/v2/fonts.mpq and add it to the game folder.
- For the Polish voice pack download https://github.com/diasurgical/devilutionx-assets/releases/download/v2/pl.mpq.
- For the Russian voice pack download https://github.com/diasurgical/devilutionx-assets/releases/download/v2/ru.mpq.
- For Chinese, Japanese, and Korean text support download https://github.com/diasurgical/devilutionx-assets/releases/latest/download/fonts.mpq and add it to the game folder.
- For the Polish voice pack download https://github.com/diasurgical/devilutionx-assets/releases/latest/download/pl.mpq.
- For the Russian voice pack download https://github.com/diasurgical/devilutionx-assets/releases/latest/download/ru.mpq.
- Run devilutionx.exe
# Multiplayer

4
Packaging/windows/mingw-prep.sh

@ -31,6 +31,10 @@ else
SUDO=""
fi
rm -rf "tmp-mingw-${MINGW_ARCH}-prep"
mkdir -p "tmp-mingw-${MINGW_ARCH}-prep"
cd "tmp-mingw-${MINGW_ARCH}-prep"
wget -q https://www.libsdl.org/release/SDL2-devel-${SDLDEV_VERS}-mingw.tar.gz -OSDL2-devel-${SDLDEV_VERS}-mingw.tar.gz
tar -xzf SDL2-devel-${SDLDEV_VERS}-mingw.tar.gz
$SUDO cp -r SDL2*/${MINGW_ARCH}/* ${MINGW_PREFIX}

48
Packaging/windows/mingw9x-prep.sh

@ -0,0 +1,48 @@
#!/usr/bin/env bash
SDLDEV_VERS=1.2.15
SODIUM_VERS=1.0.18
# exit when any command fails
set -euo pipefail
MINGW_ARCH=i686-w64-mingw32
SODIUM_ARCH=win32
# set MINGW_PREFIX
MINGW_PREFIX=/usr/${MINGW_ARCH}
if [ ! -d "${MINGW_PREFIX}" ]; then
echo "MinGW prefix not found (${MINGW_PREFIX})"
exit 1
else
echo "Installing to ${MINGW_PREFIX}"
fi
# only use sudo when necessary
if [ `id -u` -ne 0 ]; then
SUDO=sudo
else
SUDO=""
fi
rm -rf tmp-mingw9x-prep
mkdir -p tmp-mingw9x-prep
cd tmp-mingw9x-prep
curl --no-progress-meter -OL https://www.libsdl.org/release/SDL-devel-${SDLDEV_VERS}-mingw32.tar.gz
tar -xzf SDL-devel-${SDLDEV_VERS}-mingw32.tar.gz
$SUDO cp -r SDL-*/include/* ${MINGW_PREFIX}/include
$SUDO cp -r SDL-*/lib/* ${MINGW_PREFIX}/lib
$SUDO cp -r SDL-*/bin/* ${MINGW_PREFIX}/bin
wget -q https://github.com/jedisct1/libsodium/releases/download/${SODIUM_VERS}-RELEASE/libsodium-${SODIUM_VERS}-mingw.tar.gz -Olibsodium-${SODIUM_VERS}-mingw.tar.gz
tar -xzf libsodium-${SODIUM_VERS}-mingw.tar.gz --no-same-owner
$SUDO cp -r libsodium-${SODIUM_ARCH}/* ${MINGW_PREFIX}
# Fixup pkgconfig prefix:
find "${MINGW_PREFIX}/lib/pkgconfig/" -name '*.pc' -exec \
$SUDO sed -i "s|^prefix=.*|prefix=${MINGW_PREFIX}|" '{}' \;
# Fixup CMake prefix:
find "${MINGW_PREFIX}" -name '*.cmake' -exec \
$SUDO sed -i "s|/opt/local/${MINGW_ARCH}|${MINGW_PREFIX}|" '{}' \;

2
README.md

@ -24,7 +24,7 @@ For a full list of changes see our [changelog](docs/CHANGELOG.md).
# How to Install
Note: You'll need access to the data from the original game. If you don't have an original CD then you can [buy Diablo from GoG.com](https://www.gog.com/game/diablo). Alternately you can use `spawn.mpq` from the [shareware](https://github.com/diasurgical/devilutionx-assets/releases/download/v2/spawn.mpq) [[2]](http://ftp.blizzard.com/pub/demos/diablosw.exe) version, in place of `DIABDAT.MPQ`, to play the shareware portion of the game.
Note: You'll need access to the data from the original game. If you don't have an original CD then you can [buy Diablo from GoG.com](https://www.gog.com/game/diablo). Alternately you can use `spawn.mpq` from the [shareware](https://github.com/diasurgical/devilutionx-assets/releases/latest/download/spawn.mpq) [[2]](http://ftp.blizzard.com/pub/demos/diablosw.exe) version, in place of `DIABDAT.MPQ`, to play the shareware portion of the game.
Download the latest [DevilutionX release](https://github.com/diasurgical/devilutionX/releases/latest) and extract the contents to a location of your choosing or [build from source](#building-from-source).

4
Source/.clang-format

@ -1,7 +1,9 @@
BasedOnStyle: webkit
AlignTrailingComments: true
AllowShortBlocksOnASingleLine: true
AllowShortFunctionsOnASingleLine: None
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: WithoutElse
PointerAlignment: Right
TabWidth: 4
UseTab: ForIndentation

5
Source/.clang-tidy

@ -46,12 +46,15 @@ Checks: >
performance-*,
portability-*,
readability-*,
-readability-identifier-length,
-bugprone-easily-swappable-parameters,
-readability-magic-numbers,
-misc-non-private-member-variables-in-classes,
-modernize-avoid-c-arrays,
-modernize-use-trailing-return-type,
-modernize-concat-nested-namespaces,
-modernize-avoid-bind
-modernize-avoid-bind,
-modernize-use-constraints
HeaderFilterRegex: "^(Source|test)\\.h$"

71
Source/CMakeLists.txt

@ -12,9 +12,9 @@ set(libdevilutionx_SRCS
dead.cpp
debug.cpp
diablo.cpp
diablo_msg.cpp
doom.cpp
engine.cpp
error.cpp
gamemenu.cpp
gmenu.cpp
help.cpp
@ -68,6 +68,10 @@ set(libdevilutionx_SRCS
controls/modifier_hints.cpp
controls/plrctrls.cpp
data/file.cpp
data/parser.cpp
data/record_reader.cpp
DiabloUI/button.cpp
DiabloUI/credits.cpp
DiabloUI/credits_lines.cpp
@ -85,6 +89,7 @@ set(libdevilutionx_SRCS
DiabloUI/settingsmenu.cpp
DiabloUI/support_lines.cpp
DiabloUI/title.cpp
DiabloUI/text_input.cpp
dvlnet/abstract_net.cpp
dvlnet/base.cpp
@ -128,7 +133,29 @@ set(libdevilutionx_SRCS
levels/town.cpp
levels/trigs.cpp
lua/autocomplete.cpp
lua/lua.cpp
lua/modules/audio.cpp
lua/modules/dev.cpp
lua/modules/dev/display.cpp
lua/modules/dev/items.cpp
lua/modules/dev/level.cpp
lua/modules/dev/level/map.cpp
lua/modules/dev/level/warp.cpp
lua/modules/dev/monsters.cpp
lua/modules/dev/player.cpp
lua/modules/dev/player/gold.cpp
lua/modules/dev/player/spells.cpp
lua/modules/dev/player/stats.cpp
lua/modules/dev/quests.cpp
lua/modules/dev/search.cpp
lua/modules/dev/towners.cpp
lua/modules/log.cpp
lua/modules/render.cpp
lua/repl.cpp
panels/charpanel.cpp
panels/console.cpp
panels/info_box.cpp
panels/mainpanel.cpp
panels/spell_book.cpp
@ -157,17 +184,35 @@ set(libdevilutionx_SRCS
utils/language.cpp
utils/logged_fstream.cpp
utils/paths.cpp
utils/parse_int.cpp
utils/pcx_to_clx.cpp
utils/sdl_bilinear_scale.cpp
utils/sdl_thread.cpp
utils/str_cat.cpp
utils/str_case.cpp
utils/surface_to_clx.cpp
utils/timer.cpp
utils/utf8.cpp)
# These files are responsible for most of the runtime in Debug mode.
# Apply some optimizations to them even in Debug mode to get reasonable performance.
set(_optimize_in_debug_srcs
engine/render/clx_render.cpp
engine/render/dun_render.cpp
engine/render/text_render.cpp
utils/cel_to_clx.cpp
utils/cl2_to_clx.cpp
utils/pcx_to_clx.cpp)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_BUILD_TYPE STREQUAL "Debug")
set_source_files_properties(${_optimize_in_debug_srcs} PROPERTIES COMPILE_OPTIONS "-O2;--param=max-vartrack-size=900000000")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_BUILD_TYPE STREQUAL "Debug")
set_source_files_properties(${_optimize_in_debug_srcs} PROPERTIES COMPILE_OPTIONS "-O2")
endif()
if(SUPPORTS_MPQ)
list(APPEND libdevilutionx_DEPS libmpq)
list(APPEND libdevilutionx_SRCS
mpq/mpq_common.cpp
mpq/mpq_reader.cpp
mpq/mpq_sdl_rwops.cpp
mpq/mpq_writer.cpp)
@ -230,9 +275,19 @@ if(DISCORD_INTEGRATION)
)
endif()
if(SCREEN_READER_INTEGRATION)
list(APPEND libdevilutionx_SRCS
utils/screen_reader.cpp
)
endif()
add_devilutionx_library(libdevilutionx OBJECT ${libdevilutionx_SRCS})
target_include_directories(libdevilutionx PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
if(SCREEN_READER_INTEGRATION AND NOT WIN32)
target_include_directories(libdevilutionx PUBLIC ${Speechd_INCLUDE_DIRS})
endif()
# Use file GENERATE instead of configure_file because configure_file
# does not support generator expressions.
get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
@ -256,6 +311,12 @@ if(DISCORD_INTEGRATION)
target_link_libraries(libdevilutionx PRIVATE discord discord_game_sdk)
endif()
target_link_libraries(libdevilutionx PUBLIC ${LUA_LIBRARIES} sol2::sol2)
if(SCREEN_READER_INTEGRATION AND WIN32)
target_compile_definitions(libdevilutionx PRIVATE Tolk)
endif()
target_link_libraries(libdevilutionx PUBLIC
Threads::Threads
DevilutionX::SDL
@ -267,6 +328,14 @@ target_link_libraries(libdevilutionx PUBLIC
${libdevilutionx_DEPS}
)
if(SCREEN_READER_INTEGRATION)
if(WIN32)
target_link_libraries(libdevilutionx PUBLIC Tolk)
else()
target_link_libraries(libdevilutionx PUBLIC speechd)
endif()
endif()
if(NOT USE_SDL1)
target_link_libraries(libdevilutionx PUBLIC SDL2::SDL2_image)
endif()

3
Source/DiabloUI/button.cpp

@ -44,7 +44,8 @@ void RenderButton(const UiButton &button)
--textRect.position.y;
}
DrawString(out, button.GetText(), textRect, UiFlags::AlignCenter | UiFlags::FontSizeDialog | UiFlags::ColorDialogWhite);
DrawString(out, button.GetText(), textRect,
{ .flags = UiFlags::AlignCenter | UiFlags::FontSizeDialog | UiFlags::ColorDialogWhite });
}
bool HandleMouseEventButton(const SDL_Event &event, UiButton *button)

7
Source/DiabloUI/credits.cpp

@ -36,7 +36,7 @@ public:
CreditsRenderer(char const *const *text, std::size_t textLines)
{
for (size_t i = 0; i < textLines; i++) {
string_view orgText = _(text[i]);
std::string_view orgText = _(text[i]);
uint16_t offset = 0;
size_t indexFirstNotTab = 0;
@ -115,7 +115,7 @@ void CreditsRenderer::Render()
ScaleOutputRect(&viewport);
// We use unscaled coordinates for calculation throughout.
Sint16 destY = uiPosition.y + VIEWPORT.y - (offsetY - linesBegin * LINE_H);
Sint16 destY = static_cast<Sint16>(uiPosition.y + VIEWPORT.y - (offsetY - linesBegin * LINE_H));
for (std::size_t i = linesBegin; i < linesEnd; ++i, destY += LINE_H) {
Sint16 destX = uiPosition.x + VIEWPORT.x + 31;
@ -127,7 +127,8 @@ void CreditsRenderer::Render()
dstRect.y -= viewport.y;
const Surface &out = Surface(DiabloUiSurface(), viewport);
DrawString(out, lineContent.text, Point { dstRect.x, dstRect.y }, UiFlags::FontSizeDialog | UiFlags::ColorDialogWhite, -1);
DrawString(out, lineContent.text, Point { dstRect.x, dstRect.y },
{ .flags = UiFlags::FontSizeDialog | UiFlags::ColorDialogWhite, .spacing = -1 });
}
}

145
Source/DiabloUI/diabloui.cpp

@ -2,11 +2,14 @@
#include <algorithm>
#include <cstdint>
#include <memory>
#include <optional>
#include <string>
#include "DiabloUI/button.h"
#include "DiabloUI/dialogs.h"
#include "DiabloUI/scrollbar.h"
#include "DiabloUI/text_input.hpp"
#include "controls/controller.h"
#include "controls/input.h"
#include "controls/menu_controls.h"
@ -19,12 +22,15 @@
#include "engine/load_pcx.hpp"
#include "engine/render/clx_render.hpp"
#include "hwcursor.hpp"
#include "utils/algorithm/container.hpp"
#include "utils/display.h"
#include "utils/language.h"
#include "utils/log.hpp"
#include "utils/pcx_to_clx.hpp"
#include "utils/screen_reader.hpp"
#include "utils/sdl_compat.h"
#include "utils/sdl_geometry.h"
#include "utils/sdl_ptrs.h"
#include "utils/sdl_wrap.h"
#include "utils/str_cat.hpp"
#include "utils/stubs.h"
@ -54,7 +60,6 @@ OptionalOwnedClxSpriteList ArtBackgroundWidescreen;
OptionalOwnedClxSpriteList ArtBackground;
OptionalOwnedClxSpriteList ArtCursor;
bool textInputActive = true;
std::size_t SelectedItem = 0;
namespace {
@ -67,16 +72,16 @@ std::size_t SelectedItemMax;
std::size_t ListViewportSize = 1;
std::size_t listOffset = 0;
void (*gfnListFocus)(int value);
void (*gfnListSelect)(int value);
void (*gfnListFocus)(size_t value);
void (*gfnListSelect)(size_t value);
void (*gfnListEsc)();
void (*gfnFullscreen)();
bool (*gfnListYesNo)();
std::vector<UiItemBase *> gUiItems;
UiList *gUiList = nullptr;
bool UiItemsWraps;
char *UiTextInput;
int UiTextInputLen;
std::optional<TextInputState> UiTextInputState;
bool allowEmptyTextInput = false;
uint32_t fadeTc;
@ -103,7 +108,12 @@ void AdjustListOffset(std::size_t itemIndex)
} // namespace
void UiInitList(void (*fnFocus)(int value), void (*fnSelect)(int value), void (*fnEsc)(), const std::vector<std::unique_ptr<UiItemBase>> &items, bool itemsWraps, void (*fnFullscreen)(), bool (*fnYesNo)(), size_t selectedItem /*= 0*/)
bool IsTextInputActive()
{
return UiTextInputState.has_value();
}
void UiInitList(void (*fnFocus)(size_t value), void (*fnSelect)(size_t value), void (*fnEsc)(), const std::vector<std::unique_ptr<UiItemBase>> &items, bool itemsWraps, void (*fnFullscreen)(), bool (*fnYesNo)(), size_t selectedItem /*= 0*/)
{
SelectedItem = selectedItem;
SelectedItemMax = 0;
@ -124,13 +134,11 @@ void UiInitList(void (*fnFocus)(int value), void (*fnSelect)(int value), void (*
#ifndef __SWITCH__
SDL_StopTextInput(); // input is enabled by default
#endif
textInputActive = false;
UiScrollbar *uiScrollbar = nullptr;
for (const auto &item : items) {
if (item->IsType(UiType::Edit)) {
auto *pItemUIEdit = static_cast<UiEdit *>(item.get());
SDL_SetTextInputRect(&item->m_rect);
textInputActive = true;
allowEmptyTextInput = pItemUIEdit->m_allowEmpty;
#ifdef __SWITCH__
switch_start_text_input(pItemUIEdit->m_hint, pItemUIEdit->m_value, pItemUIEdit->m_max_length);
@ -141,8 +149,11 @@ void UiInitList(void (*fnFocus)(int value), void (*fnSelect)(int value), void (*
#else
SDL_StartTextInput();
#endif
UiTextInput = pItemUIEdit->m_value;
UiTextInputLen = pItemUIEdit->m_max_length;
UiTextInputState.emplace(TextInputState::Options {
.value = pItemUIEdit->m_value,
.cursor = &pItemUIEdit->m_cursor,
.maxLength = pItemUIEdit->m_max_length,
});
} else if (item->IsType(UiType::List)) {
auto *uiList = static_cast<UiList *>(item.get());
SelectedItemMax = std::max(uiList->m_vecItems.size() - 1, static_cast<size_t>(0));
@ -150,6 +161,7 @@ void UiInitList(void (*fnFocus)(int value), void (*fnSelect)(int value), void (*
gUiList = uiList;
if (selectedItem <= SelectedItemMax && HasAnyOf(uiList->GetItem(selectedItem)->uiFlags, UiFlags::NeedsNextElement))
AdjustListOffset(selectedItem + 1);
SpeakText(uiList->GetItem(selectedItem)->m_text);
} else if (item->IsType(UiType::Scrollbar)) {
uiScrollbar = static_cast<UiScrollbar *>(item.get());
}
@ -188,12 +200,12 @@ void UiInitList_clear()
void UiPlayMoveSound()
{
effects_play_sound(IS_TITLEMOV);
effects_play_sound(SfxID::MenuMove);
}
void UiPlaySelectSound()
{
effects_play_sound(IS_TITLSLCT);
effects_play_sound(SfxID::MenuSelect);
}
namespace {
@ -224,6 +236,7 @@ void UiFocus(std::size_t itemIndex, bool checkUp, bool ignoreItemsWraps = false)
}
pItem = gUiList->GetItem(itemIndex);
}
SpeakText(pItem->m_text);
if (HasAnyOf(pItem->uiFlags, UiFlags::NeedsNextElement))
AdjustListOffset(itemIndex + 1);
@ -287,14 +300,6 @@ void UiFocusPageDown()
}
}
void SelheroCatToName(const char *inBuf, char *outBuf, int cnt)
{
size_t outLen = strlen(outBuf);
char *dest = outBuf + outLen;
size_t destCount = cnt - outLen;
CopyUtf8(dest, inBuf, destCount);
}
bool HandleMenuAction(MenuAction menuAction)
{
switch (menuAction) {
@ -398,53 +403,8 @@ void UiFocusNavigation(SDL_Event *event)
}
#endif
if (textInputActive) {
switch (event->type) {
case SDL_KEYDOWN: {
switch (event->key.keysym.sym) {
#ifndef USE_SDL1
case SDLK_v:
if ((SDL_GetModState() & KMOD_CTRL) != 0) {
char *clipboard = SDL_GetClipboardText();
if (clipboard == nullptr) {
Log("{}", SDL_GetError());
} else {
SelheroCatToName(clipboard, UiTextInput, UiTextInputLen);
}
}
return;
#endif
case SDLK_BACKSPACE:
case SDLK_LEFT: {
UiTextInput[FindLastUtf8Symbols(UiTextInput)] = '\0';
return;
}
default:
break;
}
#ifdef USE_SDL1
if ((event->key.keysym.mod & KMOD_CTRL) == 0) {
std::string utf8;
AppendUtf8(event->key.keysym.unicode, utf8);
SelheroCatToName(utf8.c_str(), UiTextInput, UiTextInputLen);
}
#endif
break;
}
#ifndef USE_SDL1
case SDL_TEXTINPUT:
if (textInputActive) {
#ifdef __vita__
CopyUtf8(UiTextInput, event->text.text, UiTextInputLen);
#else
SelheroCatToName(event->text.text, UiTextInput, UiTextInputLen);
#endif
}
return;
#endif
default:
break;
}
if (UiTextInputState.has_value() && HandleTextInputEvent(*event, *UiTextInputState)) {
return;
}
if (event->type == SDL_MOUSEBUTTONDOWN || event->type == SDL_MOUSEBUTTONUP) {
@ -511,15 +471,14 @@ void UiHandleEvents(SDL_Event *event)
void UiFocusNavigationSelect()
{
UiPlaySelectSound();
if (textInputActive) {
if (!allowEmptyTextInput && strlen(UiTextInput) == 0) {
if (UiTextInputState.has_value()) {
if (!allowEmptyTextInput && UiTextInputState->empty()) {
return;
}
#ifndef __SWITCH__
SDL_StopTextInput();
#endif
UiTextInput = nullptr;
UiTextInputLen = 0;
UiTextInputState = std::nullopt;
}
if (gfnListSelect != nullptr)
gfnListSelect(SelectedItem);
@ -528,12 +487,11 @@ void UiFocusNavigationSelect()
void UiFocusNavigationEsc()
{
UiPlaySelectSound();
if (textInputActive) {
if (UiTextInputState.has_value()) {
#ifndef __SWITCH__
SDL_StopTextInput();
#endif
UiTextInput = nullptr;
UiTextInputLen = 0;
UiTextInputState = std::nullopt;
}
if (gfnListEsc != nullptr)
gfnListEsc();
@ -636,7 +594,7 @@ void UiDestroy()
UnloadUiGFX();
}
bool UiValidPlayerName(string_view name)
bool UiValidPlayerName(std::string_view name)
{
if (name.empty())
return false;
@ -651,10 +609,10 @@ bool UiValidPlayerName(string_view name)
// Only basic latin alphabet is supported for multiplayer characters to avoid rendering issues for players who do
// not have fonts.mpq installed
if (!std::all_of(name.begin(), name.end(), IsBasicLatin))
if (!c_all_of(name, IsBasicLatin))
return false;
string_view bannedNames[] = {
std::string_view bannedNames[] = {
"gvdl",
"dvou",
"tiju",
@ -669,8 +627,8 @@ bool UiValidPlayerName(string_view name)
for (char &character : buffer)
character++;
string_view tempName { buffer };
for (string_view bannedName : bannedNames) {
std::string_view tempName { buffer };
for (std::string_view bannedName : bannedNames) {
if (tempName.find(bannedName) != tempName.npos)
return false;
}
@ -810,13 +768,15 @@ namespace {
void Render(const UiText &uiText)
{
const Surface &out = Surface(DiabloUiSurface());
DrawString(out, uiText.GetText(), MakeRectangle(uiText.m_rect), uiText.GetFlags() | UiFlags::FontSizeDialog);
DrawString(out, uiText.GetText(), MakeRectangle(uiText.m_rect),
{ .flags = uiText.GetFlags() | UiFlags::FontSizeDialog });
}
void Render(const UiArtText &uiArtText)
{
const Surface &out = Surface(DiabloUiSurface());
DrawString(out, uiArtText.GetText(), MakeRectangle(uiArtText.m_rect), uiArtText.GetFlags(), uiArtText.GetSpacing(), uiArtText.GetLineHeight());
DrawString(out, uiArtText.GetText(), MakeRectangle(uiArtText.m_rect),
{ .flags = uiArtText.GetFlags(), .spacing = uiArtText.GetSpacing(), .lineHeight = uiArtText.GetLineHeight() });
}
void Render(const UiImageClx &uiImage)
@ -842,7 +802,7 @@ void Render(const UiImageAnimatedClx &uiImage)
void Render(const UiArtTextButton &uiButton)
{
const Surface &out = Surface(DiabloUiSurface());
DrawString(out, uiButton.GetText(), MakeRectangle(uiButton.m_rect), uiButton.GetFlags());
DrawString(out, uiButton.GetText(), MakeRectangle(uiButton.m_rect), { .flags = uiButton.GetFlags() });
}
void Render(const UiList &uiList)
@ -850,16 +810,19 @@ void Render(const UiList &uiList)
const Surface &out = Surface(DiabloUiSurface());
for (std::size_t i = listOffset; i < uiList.m_vecItems.size() && (i - listOffset) < ListViewportSize; ++i) {
SDL_Rect rect = uiList.itemRect(i - listOffset);
SDL_Rect rect = uiList.itemRect(static_cast<int>(i - listOffset));
const UiListItem &item = *uiList.GetItem(i);
if (i == SelectedItem)
DrawSelector(rect);
Rectangle rectangle = MakeRectangle(rect);
if (item.args.empty())
DrawString(out, item.m_text, rectangle, uiList.GetFlags() | item.uiFlags, uiList.GetSpacing());
else
DrawStringWithColors(out, item.m_text, item.args, rectangle, uiList.GetFlags() | item.uiFlags, uiList.GetSpacing());
if (item.args.empty()) {
DrawString(out, item.m_text, rectangle,
{ .flags = uiList.GetFlags() | item.uiFlags, .spacing = uiList.GetSpacing() });
} else {
DrawStringWithColors(out, item.m_text, item.args, rectangle,
{ .flags = uiList.GetFlags() | item.uiFlags, .spacing = uiList.GetSpacing() });
}
}
}
@ -906,7 +869,13 @@ void Render(const UiEdit &uiEdit)
Rectangle rect = MakeRectangle(uiEdit.m_rect).inset({ 43, 1 });
const Surface &out = Surface(DiabloUiSurface());
DrawString(out, uiEdit.m_value, rect, uiEdit.GetFlags() | UiFlags::TextCursor);
DrawString(out, uiEdit.m_value, rect,
{
.flags = uiEdit.GetFlags(),
.cursorPosition = static_cast<int>(uiEdit.m_cursor.position),
.highlightRange = { static_cast<int>(uiEdit.m_cursor.selection.begin), static_cast<int>(uiEdit.m_cursor.selection.end) },
.highlightColor = 126,
});
}
bool HandleMouseEventArtTextButton(const SDL_Event &event, const UiArtTextButton *uiButton)

15
Source/DiabloUI/diabloui.h

@ -1,10 +1,11 @@
#pragma once
#include <SDL.h>
#include <array>
#include <cstddef>
#include <cstdint>
#include <optional>
#include <SDL.h>
#include <function_ref.hpp>
#include "DiabloUI/ui_item.h"
@ -12,12 +13,12 @@
#include "engine/load_pcx.hpp" // IWYU pragma: export
#include "player.h"
#include "utils/display.h"
#include "utils/stdcompat/optional.hpp"
namespace devilution {
extern std::size_t SelectedItem;
extern bool textInputActive;
bool IsTextInputActive();
enum _artFocus : uint8_t {
FOCUS_SMALL,
@ -82,9 +83,9 @@ void UiDestroy();
void UiTitleDialog();
void UnloadUiGFX();
void UiInitialize();
bool UiValidPlayerName(string_view name); /* check */
void UiSelHeroMultDialog(bool (*fninfo)(bool (*fninfofunc)(_uiheroinfo *)), bool (*fncreate)(_uiheroinfo *), bool (*fnremove)(_uiheroinfo *), void (*fnstats)(unsigned int, _uidefaultstats *), _selhero_selections *dlgresult, uint32_t *saveNumber);
void UiSelHeroSingDialog(bool (*fninfo)(bool (*fninfofunc)(_uiheroinfo *)), bool (*fncreate)(_uiheroinfo *), bool (*fnremove)(_uiheroinfo *), void (*fnstats)(unsigned int, _uidefaultstats *), _selhero_selections *dlgresult, uint32_t *saveNumber, _difficulty *difficulty);
bool UiValidPlayerName(std::string_view name); /* check */
void UiSelHeroMultDialog(bool (*fninfo)(bool (*fninfofunc)(_uiheroinfo *)), bool (*fncreate)(_uiheroinfo *), bool (*fnremove)(_uiheroinfo *), void (*fnstats)(HeroClass, _uidefaultstats *), _selhero_selections *dlgresult, uint32_t *saveNumber);
void UiSelHeroSingDialog(bool (*fninfo)(bool (*fninfofunc)(_uiheroinfo *)), bool (*fncreate)(_uiheroinfo *), bool (*fnremove)(_uiheroinfo *), void (*fnstats)(HeroClass, _uidefaultstats *), _selhero_selections *dlgresult, uint32_t *saveNumber, _difficulty *difficulty);
bool UiCreditsDialog();
bool UiSupportDialog();
bool UiMainMenuDialog(const char *name, _mainmenu_selections *pdwResult, int attractTimeOut);
@ -107,7 +108,7 @@ void UiFocusNavigationSelect();
void UiFocusNavigationEsc();
void UiFocusNavigationYesNo();
void UiInitList(void (*fnFocus)(int value), void (*fnSelect)(int value), void (*fnEsc)(), const std::vector<std::unique_ptr<UiItemBase>> &items, bool wraps = false, void (*fnFullscreen)() = nullptr, bool (*fnYesNo)() = nullptr, size_t selectedItem = 0);
void UiInitList(void (*fnFocus)(size_t value), void (*fnSelect)(size_t value), void (*fnEsc)(), const std::vector<std::unique_ptr<UiItemBase>> &items, bool wraps = false, void (*fnFullscreen)() = nullptr, bool (*fnYesNo)() = nullptr, size_t selectedItem = 0);
void UiRenderListItems();
void UiInitList_clear();

12
Source/DiabloUI/dialogs.cpp

@ -1,6 +1,7 @@
#include "DiabloUI/dialogs.h"
#include <cstdint>
#include <string_view>
#include <utility>
#include "DiabloUI/button.h"
@ -17,7 +18,6 @@
#include "utils/display.h"
#include "utils/language.h"
#include "utils/log.hpp"
#include "utils/stdcompat/string_view.hpp"
namespace devilution {
@ -54,7 +54,7 @@ OptionalClxSprite LoadDialogSprite(bool hasCaption, bool isError)
return (*ownedDialogSprite)[0];
}
bool Init(string_view caption, string_view text, bool error, bool renderBehind)
bool Init(std::string_view caption, std::string_view text, bool error, bool renderBehind)
{
if (!renderBehind) {
if (!UiLoadBlackBackground()) {
@ -137,7 +137,7 @@ void DialogLoop(const std::vector<std::unique_ptr<UiItemBase>> &items, const std
} while (!dialogEnd);
}
void UiOkDialog(string_view caption, string_view text, bool error, const std::vector<std::unique_ptr<UiItemBase>> &renderBehind)
void UiOkDialog(std::string_view caption, std::string_view text, bool error, const std::vector<std::unique_ptr<UiItemBase>> &renderBehind)
{
static bool inDialog = false;
@ -183,17 +183,17 @@ void UiOkDialog(string_view caption, string_view text, bool error, const std::ve
} // namespace
void UiErrorOkDialog(string_view caption, string_view text, const std::vector<std::unique_ptr<UiItemBase>> &renderBehind)
void UiErrorOkDialog(std::string_view caption, std::string_view text, const std::vector<std::unique_ptr<UiItemBase>> &renderBehind)
{
UiOkDialog(caption, text, /*error=*/true, renderBehind);
}
void UiErrorOkDialog(string_view caption, string_view text, bool error)
void UiErrorOkDialog(std::string_view caption, std::string_view text, bool error)
{
UiOkDialog(caption, text, error, vecNULL);
}
void UiErrorOkDialog(string_view text, const std::vector<std::unique_ptr<UiItemBase>> &renderBehind)
void UiErrorOkDialog(std::string_view text, const std::vector<std::unique_ptr<UiItemBase>> &renderBehind)
{
UiErrorOkDialog({}, text, renderBehind);
}

6
Source/DiabloUI/dialogs.h

@ -1,13 +1,13 @@
#pragma once
#include <cstddef>
#include <string_view>
#include "DiabloUI/ui_item.h"
#include "utils/stdcompat/string_view.hpp"
namespace devilution {
void UiErrorOkDialog(string_view text, const std::vector<std::unique_ptr<UiItemBase>> &renderBehind);
void UiErrorOkDialog(string_view caption, string_view text, const std::vector<std::unique_ptr<UiItemBase>> &renderBehind);
void UiErrorOkDialog(std::string_view text, const std::vector<std::unique_ptr<UiItemBase>> &renderBehind);
void UiErrorOkDialog(std::string_view caption, std::string_view text, const std::vector<std::unique_ptr<UiItemBase>> &renderBehind);
} // namespace devilution

57
Source/DiabloUI/hero/selhero.cpp

@ -29,7 +29,7 @@ bool selhero_isMultiPlayer;
bool (*gfnHeroInfo)(bool (*fninfofunc)(_uiheroinfo *));
bool (*gfnHeroCreate)(_uiheroinfo *);
void (*gfnHeroStats)(unsigned int, _uidefaultstats *);
void (*gfnHeroStats)(HeroClass, _uidefaultstats *);
namespace {
@ -48,15 +48,15 @@ std::vector<std::unique_ptr<UiItemBase>> vecSelDlgItems;
UiImageClx *SELHERO_DIALOG_HERO_IMG;
void SelheroListFocus(int value);
void SelheroListSelect(int value);
void SelheroListFocus(size_t value);
void SelheroListSelect(size_t value);
void SelheroListEsc();
void SelheroLoadFocus(int value);
void SelheroLoadSelect(int value);
void SelheroNameSelect(int value);
void SelheroLoadFocus(size_t value);
void SelheroLoadSelect(size_t value);
void SelheroNameSelect(size_t value);
void SelheroNameEsc();
void SelheroClassSelectorFocus(int value);
void SelheroClassSelectorSelect(int value);
void SelheroClassSelectorFocus(size_t value);
void SelheroClassSelectorSelect(size_t value);
void SelheroClassSelectorEsc();
const char *SelheroGenerateName(HeroClass heroClass);
@ -118,12 +118,11 @@ bool SelHeroGetHeroInfo(_uiheroinfo *pInfo)
return true;
}
void SelheroListFocus(int value)
void SelheroListFocus(size_t value)
{
const auto index = static_cast<std::size_t>(value);
UiFlags baseFlags = UiFlags::AlignCenter | UiFlags::FontSize30;
if (selhero_SaveCount != 0 && index < selhero_SaveCount) {
memcpy(&selhero_heroInfo, &selhero_heros[index], sizeof(selhero_heroInfo));
if (selhero_SaveCount != 0 && value < selhero_SaveCount) {
memcpy(&selhero_heroInfo, &selhero_heros[value], sizeof(selhero_heroInfo));
SelheroSetStats();
SELLIST_DIALOG_DELETE_BUTTON->SetFlags(baseFlags | UiFlags::ColorUiGold);
selhero_isSavegame = true;
@ -144,7 +143,7 @@ bool SelheroListDeleteYesNo()
return selhero_navigateYesNo;
}
void SelheroListSelect(int value)
void SelheroListSelect(size_t value)
{
const Point uiPosition = GetUIRectangle().position;
@ -161,16 +160,16 @@ void SelheroListSelect(int value)
vecSelHeroDlgItems.push_back(std::make_unique<UiListItem>(_("Sorcerer"), static_cast<int>(HeroClass::Sorcerer)));
if (gbIsHellfire) {
vecSelHeroDlgItems.push_back(std::make_unique<UiListItem>(_("Monk"), static_cast<int>(HeroClass::Monk)));
}
if (gbBard || *sgOptions.Gameplay.testBard) {
vecSelHeroDlgItems.push_back(std::make_unique<UiListItem>(_("Bard"), static_cast<int>(HeroClass::Bard)));
}
if (gbBarbarian || *sgOptions.Gameplay.testBarbarian) {
vecSelHeroDlgItems.push_back(std::make_unique<UiListItem>(_("Barbarian"), static_cast<int>(HeroClass::Barbarian)));
if (gbBard || *sgOptions.Gameplay.testBard) {
vecSelHeroDlgItems.push_back(std::make_unique<UiListItem>(_("Bard"), static_cast<int>(HeroClass::Bard)));
}
if (gbBarbarian || *sgOptions.Gameplay.testBarbarian) {
vecSelHeroDlgItems.push_back(std::make_unique<UiListItem>(_("Barbarian"), static_cast<int>(HeroClass::Barbarian)));
}
}
if (vecSelHeroDlgItems.size() > 4)
itemH = 26;
int itemY = 246 + (176 - vecSelHeroDlgItems.size() * itemH) / 2;
int itemY = static_cast<int>(246 + (176 - vecSelHeroDlgItems.size() * itemH) / 2);
vecSelDlgItems.push_back(std::make_unique<UiList>(vecSelHeroDlgItems, vecSelHeroDlgItems.size(), uiPosition.x + 264, (uiPosition.y + itemY), 320, itemH, UiFlags::AlignCenter | UiFlags::FontSize24 | UiFlags::ColorUiGold));
SDL_Rect rect2 = { (Sint16)(uiPosition.x + 279), (Sint16)(uiPosition.y + 429), 140, 35 };
@ -221,12 +220,12 @@ void SelheroListEsc()
selhero_result = SELHERO_PREVIOUS;
}
void SelheroClassSelectorFocus(int value)
void SelheroClassSelectorFocus(size_t value)
{
const auto heroClass = static_cast<HeroClass>(vecSelHeroDlgItems[value]->m_value);
_uidefaultstats defaults;
gfnHeroStats(static_cast<unsigned int>(heroClass), &defaults);
gfnHeroStats(heroClass, &defaults);
selhero_heroInfo.level = 1;
selhero_heroInfo.heroclass = heroClass;
@ -260,7 +259,7 @@ void AddSelHeroBackground()
std::make_unique<UiImageClx>((*ArtBackground)[0], MakeSdlRect(0, GetUIRectangle().position.y, 0, 0), UiFlags::AlignCenter));
}
void SelheroClassSelectorSelect(int value)
void SelheroClassSelectorSelect(size_t value)
{
auto hClass = static_cast<HeroClass>(vecSelHeroDlgItems[value]->m_value);
if (gbIsSpawn && (hClass == HeroClass::Rogue || hClass == HeroClass::Sorcerer || (hClass == HeroClass::Bard && !gbBard))) {
@ -306,7 +305,7 @@ void SelheroClassSelectorEsc()
SelheroListEsc();
}
void SelheroNameSelect(int /*value*/)
void SelheroNameSelect(size_t /*value*/)
{
// only check names in multiplayer, we don't care about them in single
if (selhero_isMultiPlayer && !UiValidPlayerName(selhero_heroInfo.name)) {
@ -330,11 +329,11 @@ void SelheroNameEsc()
SelheroListSelect(selhero_SaveCount);
}
void SelheroLoadFocus(int value)
void SelheroLoadFocus(size_t value)
{
}
void SelheroLoadSelect(int value)
void SelheroLoadSelect(size_t value)
{
UiInitList_clear();
selhero_endMenu = true;
@ -546,7 +545,7 @@ void selhero_List_Init()
static void UiSelHeroDialog(
bool (*fninfo)(bool (*fninfofunc)(_uiheroinfo *)),
bool (*fncreate)(_uiheroinfo *),
void (*fnstats)(unsigned int, _uidefaultstats *),
void (*fnstats)(HeroClass, _uidefaultstats *),
bool (*fnremove)(_uiheroinfo *),
_selhero_selections *dlgresult,
uint32_t *saveNumber)
@ -607,7 +606,7 @@ void UiSelHeroSingDialog(
bool (*fninfo)(bool (*fninfofunc)(_uiheroinfo *)),
bool (*fncreate)(_uiheroinfo *),
bool (*fnremove)(_uiheroinfo *),
void (*fnstats)(unsigned int, _uidefaultstats *),
void (*fnstats)(HeroClass, _uidefaultstats *),
_selhero_selections *dlgresult,
uint32_t *saveNumber,
_difficulty *difficulty)
@ -621,7 +620,7 @@ void UiSelHeroMultDialog(
bool (*fninfo)(bool (*fninfofunc)(_uiheroinfo *)),
bool (*fncreate)(_uiheroinfo *),
bool (*fnremove)(_uiheroinfo *),
void (*fnstats)(unsigned int, _uidefaultstats *),
void (*fnstats)(HeroClass, _uidefaultstats *),
_selhero_selections *dlgresult,
uint32_t *saveNumber)
{

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

Loading…
Cancel
Save