Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/1.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
ikonomov committed Dec 16, 2024
2 parents e40329a + 2b6ba8c commit 07b78f5
Show file tree
Hide file tree
Showing 44 changed files with 729 additions and 335 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ end_of_line = lf
[*.txt]
end_of_line = crlf

[*.plist]
end_of_line = lf

[AppRun]
end_of_line = lf

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/Android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ jobs:
distribution: 'adopt'
cache: gradle

- name: Install CMake
run: |
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "cmake;3.31.0"
- name: Cache CMake build folder
uses: actions/cache@v3
with:
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/PS4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,26 @@ concurrency:

jobs:
ps4:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Create Build Environment
run: >
sudo apt-get update &&
sudo apt-get install -y wget cmake git gettext smpq &&
wget https://github.com/PacBrew/pacbrew-pacman/releases/download/v1.1/pacbrew-pacman-1.1.deb &&
sudo dpkg -i pacbrew-pacman-1.1.deb && sudo pacbrew-pacman -Sy &&
sudo pacbrew-pacman --noconfirm -S ps4-openorbis ps4-openorbis-portlibs &&
run: |
sudo apt-get update && \
sudo apt-get install -y pacman-package-manager wget cmake git gettext smpq && \
sudo tee -a /etc/pacman.conf > /dev/null <<TEXT
[pacbrew]
SigLevel = Optional TrustAll
Server = https://pacman.mydedibox.fr/pacbrew/packages/
TEXT
- name: Setup pacman packages
run: |
sudo pacman --noconfirm -Sy && \
sudo pacman --noconfirm -S ps4-openorbis ps4-openorbis-portlibs && \
echo "#include <endian.h>" | sudo tee /opt/pacbrew/ps4/openorbis/include/sys/endian.h
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: macos-12
runs-on: macos-13

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macOS_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ concurrency:

jobs:
build:
runs-on: macos-12
runs-on: macos-13
steps:
- uses: actions/checkout@v4
with:
Expand Down
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ _pkginfo.txt
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# except for a top-level .cache directory (clangd uses /.cache/clangd for temporary files)
/.cache/

# Others
ClientBin/
Expand Down Expand Up @@ -435,7 +437,7 @@ DerivedData/

# End of https://www.gitignore.io/api/xcode

# Don't accidently commit the diabdat.mpq
# Don't accidently commit the diabdat.mpq or any other MPQ files
*.mpq

### Nintendo Switch ###
Expand All @@ -444,9 +446,6 @@ exefs/main

/docs/html/

# MPQ files
*.mpq

# ddraw wrapper configuration file
ddraw_settings.ini
Brewfile.lock.json
Expand Down
4 changes: 2 additions & 2 deletions 3rdParty/SDL2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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/releases/download/release-2.30.5/SDL2-2.30.5.tar.gz
URL_HASH SHA256=f374f3fa29c37dfcc20822d4a7d7dc57e58924d1a5f2ad511bfab4c8193de63b
URL https://github.com/libsdl-org/SDL/releases/download/release-2.30.9/SDL2-2.30.9.tar.gz
URL_HASH SHA256=24b574f71c87a763f50704bbb630cbe38298d544a1f890f099a4696b1d6beba4
)
FetchContent_MakeAvailableExcludeFromAll(SDL2)
2 changes: 2 additions & 0 deletions CMake/Definitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ foreach(
REMAP_KEYBOARD_KEYS
DEVILUTIONX_DEFAULT_RESAMPLER
STREAM_ALL_AUDIO_MIN_FILE_SIZE
DARWIN_MAJOR_VERSION
DARWIN_MINOR_VERSION
)
if(DEFINED ${def_name} AND NOT ${def_name} STREQUAL "")
list(APPEND DEVILUTIONX_DEFINITIONS ${def_name}=${${def_name}})
Expand Down
26 changes: 26 additions & 0 deletions CMake/Platforms.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,29 @@ endif()
if(NXDK)
include(platforms/xbox_nxdk)
endif()

if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
# Some notable Darwin (macOS kernel) versions are:
# 8.x == macOS 10.4 (Tiger)
# 9.x == macOS 10.5 (Leopard)
#
# Importantly, a lot of the APIs first appeared in version 9, including
# the feature availability API (the <Availability.h> header).
#
# For Darwin 8 and below, we have to rely on the kernel version
# to detect available APIs.
string(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1" DARWIN_MAJOR_VERSION "${CMAKE_SYSTEM_VERSION}")
string(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\2" DARWIN_MINOR_VERSION "${CMAKE_SYSTEM_VERSION}")

if(DARWIN_MAJOR_VERSION VERSION_EQUAL 8)
include(platforms/macos_tiger)
endif()

# For older macOS, we assume MacPorts because Homebrew only supports newer version
if(DARWIN_MAJOR_VERSION VERSION_LESS 11)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/platforms/macports/finders")

# On MacPorts, libfmt is in a subdirectory:
list(APPEND CMAKE_MODULE_PATH "/opt/local/lib/libfmt11/cmake")
endif()
endif()
20 changes: 20 additions & 0 deletions CMake/platforms/macos_tiger.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# ASAN and UBSAN are not supported by macports gcc14 on PowerPC.
set(ASAN OFF)
set(UBSAN OFF)

# SDL2 does not build for Tiger, so we use SDL1 instead.
set(USE_SDL1 ON)

# ZeroTier is yet to be tested.
set(DISABLE_ZERO_TIER ON)

# Use vendored libfmt until this issue is resolved:
# https://trac.macports.org/ticket/71503
set(DEVILUTIONX_SYSTEM_LIBFMT OFF)
set(DEVILUTIONX_STATIC_LIBFMT ON)

# https://trac.macports.org/ticket/71511
set(DEVILUTIONX_SYSTEM_GOOGLETEST OFF)
set(DEVILUTIONX_STATIC_GOOGLETEST OFF)
set(DEVILUTIONX_SYSTEM_BENCHMARK OFF)
set(DEVILUTIONX_STATIC_BENCHMARK OFF)
14 changes: 10 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@ else()
Source/main.cpp
Packaging/windows/devilutionx.exe.manifest
Packaging/windows/devilutionx.rc
Packaging/apple/AppIcon.icns
Packaging/apple/LaunchScreen.storyboard)

if(CMAKE_STRIP AND NOT DEVILUTIONX_DISABLE_STRIP)
Expand Down Expand Up @@ -365,7 +364,6 @@ include(functions/set_relative_file_macro)
set_relative_file_macro(${BIN_TARGET})

if(APPLE)
set_source_files_properties("./Packaging/apple/AppIcon.icns" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set(MACOSX_BUNDLE_GUI_IDENTIFIER com.diasurgical.devilutionx)
set(MACOSX_BUNDLE_COPYRIGHT Unlicense)
set(MACOSX_BUNDLE_BUNDLE_NAME devilutionx)
Expand All @@ -378,11 +376,19 @@ if(APPLE)
set(MACOSX_BUNDLE_REQUIRED_PLATFORM IPhoneOS)
set_target_properties(${BIN_TARGET} PROPERTIES XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2")
set(CMAKE_OSX_DEPLOYMENT_TARGET "9.0")
else()
elseif(DARWIN_MAJOR_VERSION GREATER_EQUAL 16)
set(MACOSX_BUNDLE_REQUIRED_PLATFORM Carbon)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12.0")
endif()
set_target_properties(${BIN_TARGET} PROPERTIES MACOSX_BUNDLE_ICON_FILE "AppIcon.icns")
if(DARWIN_MAJOR_VERSION VERSION_LESS 9)
# Finder on OSX Tiger can only handle icns files with up to 128x128 icons.
set(_icon_file AppIcon_128)
else()
set(_icon_file AppIcon)
endif()
target_sources(${BIN_TARGET} PRIVATE "Packaging/apple/${_icon_file}.icns")
set_source_files_properties("./Packaging/apple/${_icon_file}.icns" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set_target_properties(${BIN_TARGET} PROPERTIES MACOSX_BUNDLE_ICON_FILE "${_icon_file}.icns")
set_target_properties(${BIN_TARGET} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Packaging/apple/Info.plist")

install (TARGETS ${BIN_TARGET} DESTINATION ./)
Expand Down
Binary file added Packaging/apple/AppIcon_128.icns
Binary file not shown.
2 changes: 1 addition & 1 deletion Packaging/apple/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
<key>SDL_FILESYSTEM_BASE_DIR_TYPE</key>
<string>parent</string>
<string>resource</string>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
Expand Down
4 changes: 4 additions & 0 deletions Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ endif()

if(USE_SDL1)
list(APPEND libdevilutionx_SRCS utils/sdl2_to_1_2_backports.cpp)
if(APPLE)
enable_language(OBJC)
list(APPEND libdevilutionx_SRCS platform/macos_sdl1/SDL_filesystem.m)
endif()
endif()

if(NOT DISABLE_DEMOMODE)
Expand Down
2 changes: 1 addition & 1 deletion Source/DiabloUI/selstart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ std::vector<std::unique_ptr<UiItemBase>> vecDialog;
void ItemSelected(int value)
{
auto option = static_cast<StartUpGameMode>(vecDialogItems[value]->m_value);
sgOptions.StartUp.gameMode.SetValue(option);
sgOptions.GameMode.gameMode.SetValue(option);
SaveOptions();
endMenu = true;
}
Expand Down
Loading

0 comments on commit 07b78f5

Please sign in to comment.