mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5cadb5923d | ||
|
|
f51b428de4 | ||
|
|
7fb49b5e01 | ||
|
|
5a735395da | ||
|
|
dda4e4b5c9 | ||
|
|
6d76ce9f5e | ||
|
|
e0ed28543b | ||
|
|
1afe496fed | ||
|
|
31685557d2 | ||
|
|
cf92349436 | ||
|
|
8a74695a74 | ||
|
|
ebb9e3fc8e | ||
|
|
01b127b7f3 | ||
|
|
422839dea4 | ||
|
|
a2e93687f6 | ||
|
|
fab4340461 | ||
|
|
b7a607b765 | ||
|
|
4669337a3f | ||
|
|
7b11b129f7 | ||
|
|
b18eb6b649 | ||
|
|
0879154432 | ||
|
|
f1698ae721 | ||
|
|
ad50070aba | ||
|
|
449a2ebc70 | ||
|
|
be70a5a123 | ||
|
|
d1bbba626d | ||
|
|
2141922ee3 | ||
|
|
c2ec2f2cc3 | ||
|
|
207df24ffd | ||
|
|
0966633d2a | ||
|
|
50bc007d46 | ||
|
|
941b48b802 | ||
|
|
cbc89b8af4 | ||
|
|
9cd2f6e784 | ||
|
|
64ebfa222e | ||
|
|
0129959d7b | ||
|
|
3ebfdb3928 | ||
|
|
bb386e25a0 | ||
|
|
4d3c39224c | ||
|
|
0b16bced84 | ||
|
|
b7d7a2d9bf | ||
|
|
fa702ed90c | ||
|
|
7e10b1315e | ||
|
|
cae9c27c62 | ||
|
|
cd4ee56d48 | ||
|
|
790d36bfbc | ||
|
|
da793a5bf2 | ||
|
|
69edc89292 | ||
|
|
a93f011253 | ||
|
|
4c670ad342 | ||
|
|
d9d6dbdf51 | ||
|
|
da04b7f859 | ||
|
|
8e0b482b23 | ||
|
|
d3933591b5 | ||
|
|
f31674a12e | ||
|
|
c474a82a94 | ||
|
|
71c2c94ece | ||
|
|
75bc685360 | ||
|
|
200aaf7be8 | ||
|
|
f33f994adc | ||
|
|
b1eea9ca76 | ||
|
|
1475e6af7b | ||
|
|
25887952c9 | ||
|
|
137ca0de12 | ||
|
|
a5059beaeb | ||
|
|
4d1ddff798 | ||
|
|
bbfa903a99 | ||
|
|
6ff3be97de | ||
|
|
466a716222 | ||
|
|
185e761f78 | ||
|
|
ea8809ddd0 | ||
|
|
13035d72a4 | ||
|
|
136a928883 | ||
|
|
0c2a51c9f4 | ||
|
|
d74699740e | ||
|
|
542feb038e | ||
|
|
b0ca99f18c | ||
|
|
53faf37dc1 | ||
|
|
63ffddb67b | ||
|
|
4a57bdbc5f | ||
|
|
0ec23b34ba | ||
|
|
d0caa0f78c | ||
|
|
51af06463f | ||
|
|
17dd587241 | ||
|
|
57cb5d2b51 | ||
|
|
24d8d47ab2 | ||
|
|
aa1b0108f4 | ||
|
|
e0731a194c | ||
|
|
0455c0f053 | ||
|
|
5984bdea19 | ||
|
|
2bb149b367 | ||
|
|
7458760c75 | ||
|
|
dcc38678a6 | ||
|
|
f201a494d2 | ||
|
|
6af9227293 | ||
|
|
36f31463f3 | ||
|
|
da76b32433 | ||
|
|
00403e452f | ||
|
|
03a33628cb | ||
|
|
60673fac35 | ||
|
|
72f6fd158c | ||
|
|
2e4710c6c2 | ||
|
|
1f3ca038a8 | ||
|
|
791064e870 | ||
|
|
3ef3e7a239 | ||
|
|
0d4e554ac6 | ||
|
|
a933d73589 | ||
|
|
a38b9daa6d | ||
|
|
120562952c | ||
|
|
fc309f5eaa | ||
|
|
e87d7c6954 | ||
|
|
8b2b12dbe8 | ||
|
|
c2199dddcf | ||
|
|
cc3e015f12 | ||
|
|
a383b4b330 | ||
|
|
df81f97e43 | ||
|
|
e60ca15ae6 | ||
|
|
84b9b4218a | ||
|
|
6fd7fc3a9d | ||
|
|
51a6d9d926 | ||
|
|
4b36181ee2 | ||
|
|
5e17828cc4 | ||
|
|
d2a11f1476 | ||
|
|
f8f00e6d9b | ||
|
|
2d8bc175fe | ||
|
|
5de6a9ac8f | ||
|
|
03a597d44c | ||
|
|
139a240ed3 | ||
|
|
26321c9a17 | ||
|
|
888b8fe24a | ||
|
|
53e76c5aeb | ||
|
|
f64cf9d56d | ||
|
|
43ebcd0305 | ||
|
|
07ac8c2a1b | ||
|
|
b54542494e | ||
|
|
eae50e33e3 | ||
|
|
04e5ac449d | ||
|
|
50b06bff0b | ||
|
|
3a86bdf2dc | ||
|
|
78f0525ec0 | ||
|
|
a3add6092b | ||
|
|
a39a9a58e9 | ||
|
|
7bf60f6771 | ||
|
|
63c293f78a | ||
|
|
57d4e62ed0 | ||
|
|
877d7f732b | ||
|
|
47e98e8ee9 | ||
|
|
65870f3c07 | ||
|
|
464c55fcbb | ||
|
|
8ac7dc6b7d | ||
|
|
e484e0ba82 | ||
|
|
f32bccc5b9 | ||
|
|
c7aafb65fd | ||
|
|
6ff53d4827 | ||
|
|
73c468d5cf | ||
|
|
74afca9bf7 | ||
|
|
3590cfa118 | ||
|
|
c2e1c56413 | ||
|
|
e2fb954d99 | ||
|
|
63def6f8df | ||
|
|
eb208233e2 | ||
|
|
291973fffe | ||
|
|
01ae001de5 | ||
|
|
788c74a19e | ||
|
|
711b02be55 | ||
|
|
41e35ff3ee | ||
|
|
513e89c073 | ||
|
|
0eaa533f25 |
@@ -1 +1 @@
|
|||||||
libusb-dev libusb-1.0-0-dev libsdl2-dev libsdl2-net-dev libpng-dev libglew-dev libzip-dev zipcmp zipmerge ziptool nlohmann-json3-dev libtinyxml2-dev libspdlog-dev ninja-build
|
libusb-dev libusb-1.0-0-dev libsdl2-dev libsdl2-net-dev libpng-dev libglew-dev nlohmann-json3-dev libtinyxml2-dev libspdlog-dev ninja-build
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Call the original gtar executable with sudo for macports cache restoration to root folder
|
||||||
|
exec sudo /opt/homebrew/bin/gtar.orig "$@"
|
||||||
+182
-218
@@ -98,74 +98,8 @@ jobs:
|
|||||||
# source-dir: _packages
|
# source-dir: _packages
|
||||||
# destination-dir: ./
|
# destination-dir: ./
|
||||||
|
|
||||||
# generate-2ship-otr:
|
generate-2ship-otr:
|
||||||
# runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
# steps:
|
|
||||||
# - uses: actions/checkout@v4
|
|
||||||
# with:
|
|
||||||
# submodules: true
|
|
||||||
# - name: ccache
|
|
||||||
# uses: hendrikmuhs/ccache-action@v1.2.11
|
|
||||||
# with:
|
|
||||||
# key: ${{ runner.os }}-otr-ccache-${{ github.ref }}-${{ github.sha }}
|
|
||||||
# restore-keys: |
|
|
||||||
# ${{ runner.os }}-otr-ccache-${{ github.ref }}
|
|
||||||
# ${{ runner.os }}-otr-ccache
|
|
||||||
# - name: Install dependencies
|
|
||||||
# run: |
|
|
||||||
# sudo apt-get update
|
|
||||||
# sudo apt-get install -y $(cat .github/workflows/apt-deps.txt)
|
|
||||||
# - name: Cache build folders
|
|
||||||
# uses: actions/cache@v4
|
|
||||||
# with:
|
|
||||||
# key: ${{ runner.os }}-otr-build-${{ github.ref }}-${{ github.sha }}
|
|
||||||
# restore-keys: |
|
|
||||||
# ${{ runner.os }}-otr-build-${{ github.ref }}
|
|
||||||
# ${{ runner.os }}-otr-build
|
|
||||||
# path: |
|
|
||||||
# build-cmake
|
|
||||||
# SDL2-2.28.5
|
|
||||||
# tinyxml2-10.0.0
|
|
||||||
# - name: Install latest SDL
|
|
||||||
# run: |
|
|
||||||
# export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
|
||||||
# if [ ! -d "SDL2-2.28.5" ]; then
|
|
||||||
# wget https://www.libsdl.org/release/SDL2-2.28.5.tar.gz
|
|
||||||
# tar -xzf SDL2-2.28.5.tar.gz
|
|
||||||
# fi
|
|
||||||
# cd SDL2-2.28.5
|
|
||||||
# ./configure --enable-hidapi-libusb
|
|
||||||
# make -j 10
|
|
||||||
# sudo make install
|
|
||||||
# sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/
|
|
||||||
# - name: Install latest tinyxml2
|
|
||||||
# run: |
|
|
||||||
# sudo apt-get remove libtinyxml2-dev
|
|
||||||
# export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
|
||||||
# if [ ! -d "tinyxml2-10.0.0" ]; then
|
|
||||||
# wget https://github.com/leethomason/tinyxml2/archive/refs/tags/10.0.0.tar.gz
|
|
||||||
# tar -xzf 10.0.0.tar.gz
|
|
||||||
# fi
|
|
||||||
# cd tinyxml2-10.0.0
|
|
||||||
# mkdir -p build
|
|
||||||
# cd build
|
|
||||||
# cmake ..
|
|
||||||
# make
|
|
||||||
# sudo make install
|
|
||||||
# - name: Generate 2ship.o2r
|
|
||||||
# run: |
|
|
||||||
# export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
|
||||||
# cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release
|
|
||||||
# cmake --build build-cmake --config Release --target Generate2ShipOtr -j3
|
|
||||||
# - uses: actions/upload-artifact@v4
|
|
||||||
# with:
|
|
||||||
# name: 2ship.o2r
|
|
||||||
# path: 2ship.o2r
|
|
||||||
# retention-days: 1
|
|
||||||
|
|
||||||
build-macos:
|
|
||||||
# needs: generate-2ship-otr
|
|
||||||
runs-on: macos-14
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@@ -173,105 +107,30 @@ jobs:
|
|||||||
- name: ccache
|
- name: ccache
|
||||||
uses: hendrikmuhs/ccache-action@v1.2.13
|
uses: hendrikmuhs/ccache-action@v1.2.13
|
||||||
with:
|
with:
|
||||||
create-symlink: true
|
key: ${{ runner.os }}-otr-ccache-${{ github.ref }}-${{ github.sha }}
|
||||||
key: ${{ runner.os }}-14-ccache-${{ github.ref }}-${{ github.sha }}
|
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-14-ccache-${{ github.ref }}
|
${{ runner.os }}-otr-ccache-${{ github.ref }}
|
||||||
${{ runner.os }}-14-ccache
|
${{ runner.os }}-otr-ccache-
|
||||||
- name: Cache MacPorts
|
|
||||||
id: cache-macports
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: /opt/local/
|
|
||||||
key: ${{ runner.os }}-macports-${{ hashFiles('.github/workflows/macports-deps.txt') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-macports
|
|
||||||
- name: Install MacPorts (if necessary)
|
|
||||||
run: |
|
|
||||||
if [ -d /opt/local/ ]; then
|
|
||||||
echo "MacPorts already installed"
|
|
||||||
else
|
|
||||||
wget https://github.com/macports/macports-base/releases/download/v2.9.3/MacPorts-2.9.3-14-Sonoma.pkg
|
|
||||||
sudo installer -pkg ./MacPorts-2.9.3-14-Sonoma.pkg -target /
|
|
||||||
fi
|
|
||||||
echo "/opt/local/bin:/opt/local/sbin" >> $GITHUB_PATH
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
brew uninstall --ignore-dependencies libpng
|
|
||||||
sudo port install $(cat .github/workflows/macports-deps.txt)
|
|
||||||
brew install ninja
|
|
||||||
# - name: Download 2ship.o2r
|
|
||||||
# uses: actions/download-artifact@v4
|
|
||||||
# with:
|
|
||||||
# name: 2ship.o2r
|
|
||||||
# path: build-cmake/mm
|
|
||||||
- name: Build 2Ship
|
|
||||||
run: |
|
|
||||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
|
||||||
cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
|
|
||||||
cmake --build build-cmake --config Release --target Generate2ShipOtr --parallel 10
|
|
||||||
cmake --build build-cmake --config Release --parallel 10
|
|
||||||
(cd build-cmake && cpack)
|
|
||||||
|
|
||||||
mv _packages/*.dmg 2Ship.dmg
|
|
||||||
mv README.md readme.txt
|
|
||||||
# - name: Upload build
|
|
||||||
# if: ${{ startsWith(github.ref, 'refs/heads/develop') }}
|
|
||||||
# uses: actions/upload-artifact@v4
|
|
||||||
# with:
|
|
||||||
# name: 2ship-mac
|
|
||||||
# path: |
|
|
||||||
# 2Ship.dmg
|
|
||||||
# readme.txt
|
|
||||||
- name: Zip build
|
|
||||||
run: |
|
|
||||||
mkdir -p _release
|
|
||||||
zip -qq _release/2ship-mac.zip 2ship.dmg readme.txt
|
|
||||||
- name: Upload build
|
|
||||||
if: ${{ startsWith(github.ref, 'refs/heads/develop') }}
|
|
||||||
uses: ryand56/r2-upload-action@latest
|
|
||||||
with:
|
|
||||||
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
|
|
||||||
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
|
|
||||||
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
|
||||||
r2-bucket: ${{ secrets.R2_BUCKET }}
|
|
||||||
source-dir: _release
|
|
||||||
destination-dir: ./
|
|
||||||
|
|
||||||
build-linux:
|
|
||||||
# needs: generate-2ship-otr
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y $(cat .github/workflows/apt-deps.txt)
|
sudo apt-get install -y $(cat .github/workflows/apt-deps.txt) libzip-dev zipcmp zipmerge ziptool
|
||||||
- name: ccache
|
|
||||||
uses: hendrikmuhs/ccache-action@v1.2.11
|
|
||||||
with:
|
|
||||||
key: linux-ccache-${{ github.ref }}-${{ github.sha }}
|
|
||||||
restore-keys: |
|
|
||||||
linux-ccache-${{ github.ref }}
|
|
||||||
linux-ccache
|
|
||||||
- name: Cache build folders
|
- name: Cache build folders
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
key: linux-build-${{ github.ref }}-${{ github.sha }}
|
key: ${{ runner.os }}-otr-build-${{ github.ref }}-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
linux-build-${{ github.ref }}
|
${{ runner.os }}-otr-build-${{ github.ref }}
|
||||||
linux-build
|
${{ runner.os }}-otr-build-
|
||||||
path: |
|
path: |
|
||||||
|
build-cmake
|
||||||
SDL2-2.28.5
|
SDL2-2.28.5
|
||||||
SDL2_net-2.2.0
|
|
||||||
tinyxml2-10.0.0
|
tinyxml2-10.0.0
|
||||||
- name: Install latest SDL
|
- name: Install latest SDL
|
||||||
run: |
|
run: |
|
||||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||||
if [ ! -d "SDL2-2.28.5" ]; then
|
if [ ! -d "SDL2-2.28.5" ]; then
|
||||||
wget https://www.libsdl.org/release/SDL2-2.28.5.tar.gz
|
wget https://github.com/libsdl-org/SDL/releases/download/release-2.28.5/SDL2-2.28.5.tar.gz
|
||||||
tar -xzf SDL2-2.28.5.tar.gz
|
tar -xzf SDL2-2.28.5.tar.gz
|
||||||
fi
|
fi
|
||||||
cd SDL2-2.28.5
|
cd SDL2-2.28.5
|
||||||
@@ -293,28 +152,162 @@ jobs:
|
|||||||
cmake ..
|
cmake ..
|
||||||
make
|
make
|
||||||
sudo make install
|
sudo make install
|
||||||
- name: Install latest SDL_net
|
- name: Generate 2ship.o2r
|
||||||
run: |
|
run: |
|
||||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||||
if [ ! -d "SDL2_net-2.2.0" ]; then
|
cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release
|
||||||
wget https://www.libsdl.org/projects/SDL_net/release/SDL2_net-2.2.0.tar.gz
|
cmake --build build-cmake --config Release --target Generate2ShipOtr -j3
|
||||||
tar -xzf SDL2_net-2.2.0.tar.gz
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: 2ship.o2r
|
||||||
|
path: 2ship.o2r
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
build-macos:
|
||||||
|
needs: generate-2ship-otr
|
||||||
|
runs-on: macos-14
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: ccache
|
||||||
|
uses: hendrikmuhs/ccache-action@v1.2.13
|
||||||
|
with:
|
||||||
|
create-symlink: true
|
||||||
|
key: ${{ runner.os }}-14-ccache-${{ github.ref }}-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-14-ccache-${{ github.ref }}
|
||||||
|
${{ runner.os }}-14-ccache-
|
||||||
|
# Needed to apply sudo for macports cache restore
|
||||||
|
- name: Install gtar wrapper
|
||||||
|
run: |
|
||||||
|
sudo mv /opt/homebrew/bin/gtar /opt/homebrew/bin/gtar.orig
|
||||||
|
sudo cp .github/workflows/gtar /opt/homebrew/bin/gtar
|
||||||
|
sudo chmod +x /opt/homebrew/bin/gtar
|
||||||
|
- name: Cache MacPorts
|
||||||
|
id: cache-macports
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: /opt/local/
|
||||||
|
key: ${{ runner.os }}-14-macports-${{ hashFiles('.github/workflows/macports-deps.txt') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-14-macports-
|
||||||
|
# Updated PATH applies to the next step and onwards
|
||||||
|
- name: Install MacPorts (if necessary)
|
||||||
|
run: |
|
||||||
|
if command -v /opt/local/bin/port 2>&1 >/dev/null; then
|
||||||
|
echo "MacPorts already installed"
|
||||||
|
else
|
||||||
|
echo "Installing MacPorts"
|
||||||
|
wget https://github.com/macports/macports-base/releases/download/v2.9.3/MacPorts-2.9.3-14-Sonoma.pkg
|
||||||
|
sudo installer -pkg ./MacPorts-2.9.3-14-Sonoma.pkg -target /
|
||||||
fi
|
fi
|
||||||
cd SDL2_net-2.2.0
|
echo "/opt/local/bin:/opt/local/sbin" >> "$GITHUB_PATH"
|
||||||
./configure
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
brew uninstall --ignore-dependencies libpng
|
||||||
|
sudo port install $(cat .github/workflows/macports-deps.txt)
|
||||||
|
brew install ninja
|
||||||
|
- name: Download 2ship.o2r
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: 2ship.o2r
|
||||||
|
path: build-cmake/mm
|
||||||
|
- name: Build 2Ship
|
||||||
|
run: |
|
||||||
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||||
|
cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
|
||||||
|
cmake --build build-cmake --config Release --parallel 10
|
||||||
|
(cd build-cmake && cpack)
|
||||||
|
|
||||||
|
mv _packages/*.dmg 2Ship.dmg
|
||||||
|
mv README.md readme.txt
|
||||||
|
- name: Upload build
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: 2ship-mac
|
||||||
|
path: |
|
||||||
|
2Ship.dmg
|
||||||
|
readme.txt
|
||||||
|
|
||||||
|
build-linux:
|
||||||
|
needs: generate-2ship-otr
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y $(cat .github/workflows/apt-deps.txt)
|
||||||
|
- name: ccache
|
||||||
|
uses: hendrikmuhs/ccache-action@v1.2.13
|
||||||
|
with:
|
||||||
|
key: linux-ccache-${{ github.ref }}-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
linux-ccache-${{ github.ref }}
|
||||||
|
linux-ccache-
|
||||||
|
- name: Cache build folders
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
key: linux-build-${{ github.ref }}-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
linux-build-${{ github.ref }}
|
||||||
|
linux-build-
|
||||||
|
path: |
|
||||||
|
SDL2-2.30.3
|
||||||
|
tinyxml2-10.0.0
|
||||||
|
libzip-1.10.1
|
||||||
|
- name: Install latest SDL
|
||||||
|
run: |
|
||||||
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||||
|
if [ ! -d "SDL2-2.30.3" ]; then
|
||||||
|
wget https://github.com/libsdl-org/SDL/releases/download/release-2.30.3/SDL2-2.30.3.tar.gz
|
||||||
|
tar -xzf SDL2-2.30.3.tar.gz
|
||||||
|
fi
|
||||||
|
cd SDL2-2.30.3
|
||||||
|
./configure --enable-hidapi-libusb
|
||||||
make -j 10
|
make -j 10
|
||||||
sudo make install
|
sudo make install
|
||||||
sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/
|
sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/
|
||||||
# - name: Download 2ship.o2r
|
- name: Install latest tinyxml2
|
||||||
# uses: actions/download-artifact@v4
|
run: |
|
||||||
# with:
|
sudo apt-get remove libtinyxml2-dev
|
||||||
# name: 2ship.o2r
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||||
# path: build-cmake/mm
|
if [ ! -d "tinyxml2-10.0.0" ]; then
|
||||||
|
wget https://github.com/leethomason/tinyxml2/archive/refs/tags/10.0.0.tar.gz
|
||||||
|
tar -xzf 10.0.0.tar.gz
|
||||||
|
fi
|
||||||
|
cd tinyxml2-10.0.0
|
||||||
|
mkdir -p build
|
||||||
|
cd build
|
||||||
|
cmake ..
|
||||||
|
make
|
||||||
|
sudo make install
|
||||||
|
- name: Install libzip without crypto
|
||||||
|
run: |
|
||||||
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||||
|
if [ ! -d "libzip-1.10.1" ]; then
|
||||||
|
wget https://github.com/nih-at/libzip/releases/download/v1.10.1/libzip-1.10.1.tar.gz
|
||||||
|
tar -xzf libzip-1.10.1.tar.gz
|
||||||
|
fi
|
||||||
|
cd libzip-1.10.1
|
||||||
|
mkdir -p build
|
||||||
|
cd build
|
||||||
|
cmake .. -DENABLE_COMMONCRYPTO=OFF -DENABLE_GNUTLS=OFF -DENABLE_MBEDTLS=OFF -DENABLE_OPENSSL=OFF
|
||||||
|
make
|
||||||
|
sudo make install
|
||||||
|
sudo cp -av /usr/local/lib/libzip* /lib/x86_64-linux-gnu/
|
||||||
|
- name: Download 2ship.o2r
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: 2ship.o2r
|
||||||
|
path: build-cmake/mm
|
||||||
- name: Build 2Ship
|
- name: Build 2Ship
|
||||||
run: |
|
run: |
|
||||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||||
cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_REMOTE_CONTROL=1
|
cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_REMOTE_CONTROL=1
|
||||||
cmake --build build-cmake --config Release --target Generate2ShipOtr -j3
|
|
||||||
cmake --build build-cmake --config Release -j3
|
cmake --build build-cmake --config Release -j3
|
||||||
(cd build-cmake && cpack -G External)
|
(cd build-cmake && cpack -G External)
|
||||||
|
|
||||||
@@ -323,32 +316,16 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
CC: gcc-12
|
CC: gcc-12
|
||||||
CXX: g++-12
|
CXX: g++-12
|
||||||
# Temporarily replaced with an upload to R2 until we go public
|
|
||||||
# - name: Upload build
|
|
||||||
# uses: actions/upload-artifact@v4
|
|
||||||
# with:
|
|
||||||
# name: 2ship-linux
|
|
||||||
# path: |
|
|
||||||
# 2ship.appimage
|
|
||||||
# readme.txt
|
|
||||||
# Remove Zip step when uploading directly to GH artifactory
|
|
||||||
- name: Zip build
|
|
||||||
run: |
|
|
||||||
mkdir -p _release
|
|
||||||
zip -qq _release/2ship-linux.zip 2ship.appimage readme.txt
|
|
||||||
- name: Upload build
|
- name: Upload build
|
||||||
if: ${{ startsWith(github.ref, 'refs/heads/develop') }}
|
uses: actions/upload-artifact@v4
|
||||||
uses: ryand56/r2-upload-action@latest
|
|
||||||
with:
|
with:
|
||||||
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
|
name: 2ship-linux
|
||||||
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
|
path: |
|
||||||
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
2ship.appimage
|
||||||
r2-bucket: ${{ secrets.R2_BUCKET }}
|
readme.txt
|
||||||
source-dir: _release
|
|
||||||
destination-dir: ./
|
|
||||||
|
|
||||||
build-windows:
|
build-windows:
|
||||||
# needs: generate-2ship-otr
|
needs: generate-2ship-otr
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
@@ -359,60 +336,47 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- name: ccache
|
- name: ccache
|
||||||
uses: hendrikmuhs/ccache-action@v1.2.11
|
uses: hendrikmuhs/ccache-action@v1.2.13
|
||||||
with:
|
with:
|
||||||
variant: sccache
|
variant: sccache
|
||||||
max-size: "1G"
|
max-size: "1G"
|
||||||
key: ${{ runner.os }}-ccache-${{ github.ref }}-${{ github.sha }}
|
key: ${{ runner.os }}-ccache1-${{ github.ref }}-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-ccache-${{ github.ref }}
|
${{ runner.os }}-ccache1-${{ github.ref }}
|
||||||
${{ runner.os }}-ccache
|
${{ runner.os }}-ccache1-
|
||||||
- name: Cache build folder
|
- name: Cache build folder
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
save-always: true
|
save-always: true
|
||||||
key: ${{ runner.os }}-build-${{ github.ref }}-${{ github.sha }}
|
key: ${{ runner.os }}-build1-${{ github.ref }}-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-build-${{ github.ref }}
|
${{ runner.os }}-build1-${{ github.ref }}
|
||||||
${{ runner.os }}-build
|
${{ runner.os }}-build1-
|
||||||
path: |
|
path: |
|
||||||
build-windows
|
build-windows
|
||||||
vcpkg
|
vcpkg
|
||||||
- name: Configure Developer Command Prompt
|
- name: Configure Developer Command Prompt
|
||||||
uses: ilammy/msvc-dev-cmd@v1
|
uses: ilammy/msvc-dev-cmd@v1
|
||||||
# - name: Download 2ship.o2r
|
- name: Download 2ship.o2r
|
||||||
# uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
# with:
|
with:
|
||||||
# name: 2ship.o2r
|
name: 2ship.o2r
|
||||||
# path: build-windows/mm
|
path: build-windows/mm
|
||||||
- name: Build 2Ship
|
- name: Build 2Ship
|
||||||
env:
|
env:
|
||||||
VCPKG_ROOT: ${{github.workspace}}/vcpkg
|
VCPKG_ROOT: ${{github.workspace}}/vcpkg
|
||||||
run: |
|
run: |
|
||||||
set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH"
|
set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH"
|
||||||
cmake -S . -B build-windows -G Ninja -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_BUILD_TYPE:STRING=Release
|
cmake -S . -B build-windows -G Ninja -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
|
||||||
cmake --build build-windows --config Release --target Generate2ShipOtr --parallel 10
|
|
||||||
cmake --build build-windows --config Release --parallel 10
|
cmake --build build-windows --config Release --parallel 10
|
||||||
|
|
||||||
(cd build-windows && cpack)
|
(cd build-windows && cpack)
|
||||||
cd ..
|
cd ..
|
||||||
mv _packages/*.zip _packages/2ship-windows.zip
|
mv _packages/*.zip _packages/2ship-windows.zip
|
||||||
# Temporarily replaced with an upload to R2 until we go public
|
- name: Unzip package
|
||||||
# - name: Unzip package
|
run: Expand-Archive -Path _packages/2ship-windows.zip -DestinationPath 2ship-windows
|
||||||
# run: Expand-Archive -Path _packages/2ship-windows.zip -DestinationPath 2ship-windows
|
|
||||||
# - name: Upload build
|
|
||||||
# if: ${{ startsWith(github.ref, 'refs/heads/develop') }}
|
|
||||||
# uses: actions/upload-artifact@v4
|
|
||||||
# with:
|
|
||||||
# name: 2ship-windows
|
|
||||||
# path: 2ship-windows
|
|
||||||
- name: Upload build
|
- name: Upload build
|
||||||
if: ${{ startsWith(github.ref, 'refs/heads/develop') }}
|
uses: actions/upload-artifact@v4
|
||||||
uses: ryand56/r2-upload-action@latest
|
|
||||||
with:
|
with:
|
||||||
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
|
name: 2ship-windows
|
||||||
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
|
path: 2ship-windows
|
||||||
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
|
||||||
r2-bucket: ${{ secrets.R2_BUCKET }}
|
|
||||||
source-dir: _packages
|
|
||||||
destination-dir: ./
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ jobs:
|
|||||||
if: ${{ github.event.workflow_run.event == 'pull_request' }}
|
if: ${{ github.event.workflow_run.event == 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- id: 'pr-number'
|
- id: 'pr-number'
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
result-encoding: string
|
result-encoding: string
|
||||||
script: |
|
script: |
|
||||||
@@ -20,8 +20,9 @@ jobs:
|
|||||||
const pullHeadSHA = '${{github.event.workflow_run.head_sha}}';
|
const pullHeadSHA = '${{github.event.workflow_run.head_sha}}';
|
||||||
const pullUserId = ${{github.event.sender.id}};
|
const pullUserId = ${{github.event.sender.id}};
|
||||||
const prNumber = await (async () => {
|
const prNumber = await (async () => {
|
||||||
const pulls = await github.rest.pulls.list({owner, repo});
|
for await (const { data } of github.paginate.iterator(
|
||||||
for await (const {data} of github.paginate.iterator(pulls)) {
|
github.rest.pulls.list, { owner, repo }
|
||||||
|
)) {
|
||||||
for (const pull of data) {
|
for (const pull of data) {
|
||||||
if (pull.head.sha === pullHeadSHA && pull.user.id === pullUserId) {
|
if (pull.head.sha === pullHeadSHA && pull.user.id === pullUserId) {
|
||||||
return pull.number;
|
return pull.number;
|
||||||
@@ -36,7 +37,7 @@ jobs:
|
|||||||
|
|
||||||
return prNumber;
|
return prNumber;
|
||||||
- id: 'artifacts-text'
|
- id: 'artifacts-text'
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
result-encoding: string
|
result-encoding: string
|
||||||
script: |
|
script: |
|
||||||
@@ -48,12 +49,13 @@ jobs:
|
|||||||
|
|
||||||
return allArtifacts.data.artifacts.reduce((acc, item) => {
|
return allArtifacts.data.artifacts.reduce((acc, item) => {
|
||||||
if (item.name === "assets") return acc;
|
if (item.name === "assets") return acc;
|
||||||
|
if (item.name === "2ship.o2r") return acc;
|
||||||
acc += `
|
acc += `
|
||||||
- [${item.name}.zip](https://nightly.link/${context.repo.owner}/${context.repo.repo}/actions/artifacts/${item.id}.zip?h=20a00267c7ffeb2eb80ab31f356f2ba5f120f43c)`;
|
- [${item.name}.zip](https://nightly.link/${context.repo.owner}/${context.repo.repo}/actions/artifacts/${item.id}.zip)`;
|
||||||
return acc;
|
return acc;
|
||||||
}, '### Build Artifacts');
|
}, '### Build Artifacts');
|
||||||
- id: 'add-to-pr'
|
- id: 'add-to-pr'
|
||||||
uses: garrettjoecox/pr-section@3.1.0
|
uses: garrettjoecox/pr-section@4.0.0
|
||||||
with:
|
with:
|
||||||
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
pr-number: ${{ steps.pr-number.outputs.result }}
|
pr-number: ${{ steps.pr-number.outputs.result }}
|
||||||
|
|||||||
@@ -66,3 +66,4 @@ _packages/
|
|||||||
|
|
||||||
/mm/src/boot/build.c
|
/mm/src/boot/build.c
|
||||||
/mm/windows/properties.h
|
/mm/windows/properties.h
|
||||||
|
/clang-format.exe
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ android {
|
|||||||
}
|
}
|
||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
targetSdkVersion 31
|
targetSdkVersion 31
|
||||||
versionCode 1
|
versionCode 4
|
||||||
versionName "1.0.0.0"
|
versionName "1.1.1"
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
//ndkBuild {
|
//ndkBuild {
|
||||||
// arguments "APP_PLATFORM=android-23"
|
// arguments "APP_PLATFORM=android-23"
|
||||||
@@ -79,7 +79,7 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
task wrapper(type: Wrapper) {
|
task wrapper(type: Wrapper) {
|
||||||
gradleVersion = '7.3'
|
gradleVersion = '7.0.3'
|
||||||
}
|
}
|
||||||
|
|
||||||
task prepareKotlinBuildScriptModel {
|
task prepareKotlinBuildScriptModel {
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
-->
|
-->
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.dishii.mm"
|
package="com.dishii.mm"
|
||||||
android:versionCode="1"
|
android:versionCode="4"
|
||||||
android:versionName="1.0.0.1"
|
android:versionName="1.1.1"
|
||||||
android:installLocation="auto">
|
android:installLocation="auto">
|
||||||
|
|
||||||
<!-- OpenGL ES 3.0 -->
|
<!-- OpenGL ES 3.0 -->
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
# Extractor Assets Copied by CMake during buildtime
|
# Extractor Assets Copied by CMake during buildtime
|
||||||
assets/
|
assets/
|
||||||
2ship.o2r
|
|
||||||
|
|||||||
@@ -277,6 +277,7 @@ public class HIDDeviceManager {
|
|||||||
0x044f, // Thrustmaster
|
0x044f, // Thrustmaster
|
||||||
0x045e, // Microsoft
|
0x045e, // Microsoft
|
||||||
0x0738, // Mad Catz
|
0x0738, // Mad Catz
|
||||||
|
0x0b05, // ASUS
|
||||||
0x0e6f, // PDP
|
0x0e6f, // PDP
|
||||||
0x0f0d, // Hori
|
0x0f0d, // Hori
|
||||||
0x10f5, // Turtle Beach
|
0x10f5, // Turtle Beach
|
||||||
@@ -590,7 +591,13 @@ public class HIDDeviceManager {
|
|||||||
} else {
|
} else {
|
||||||
flags = 0;
|
flags = 0;
|
||||||
}
|
}
|
||||||
mUsbManager.requestPermission(usbDevice, PendingIntent.getBroadcast(mContext, 0, new Intent(HIDDeviceManager.ACTION_USB_PERMISSION), flags));
|
if (Build.VERSION.SDK_INT >= 33 /* Android 14.0 (U) */) {
|
||||||
|
Intent intent = new Intent(HIDDeviceManager.ACTION_USB_PERMISSION);
|
||||||
|
intent.setPackage(mContext.getPackageName());
|
||||||
|
mUsbManager.requestPermission(usbDevice, PendingIntent.getBroadcast(mContext, 0, intent, flags));
|
||||||
|
} else {
|
||||||
|
mUsbManager.requestPermission(usbDevice, PendingIntent.getBroadcast(mContext, 0, new Intent(HIDDeviceManager.ACTION_USB_PERMISSION), flags));
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.v(TAG, "Couldn't request permission for USB device " + usbDevice);
|
Log.v(TAG, "Couldn't request permission for USB device " + usbDevice);
|
||||||
HIDDeviceOpenResult(deviceID, false);
|
HIDDeviceOpenResult(deviceID, false);
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ public class SDL {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void loadLibrary(String libraryName) throws UnsatisfiedLinkError, SecurityException, NullPointerException {
|
public static void loadLibrary(String libraryName) throws UnsatisfiedLinkError, SecurityException, NullPointerException {
|
||||||
|
loadLibrary(libraryName, mContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void loadLibrary(String libraryName, Context context) throws UnsatisfiedLinkError, SecurityException, NullPointerException {
|
||||||
|
|
||||||
if (libraryName == null) {
|
if (libraryName == null) {
|
||||||
throw new NullPointerException("No library name provided.");
|
throw new NullPointerException("No library name provided.");
|
||||||
@@ -53,10 +57,10 @@ public class SDL {
|
|||||||
// To use ReLinker, just add it as a dependency. For more information, see
|
// To use ReLinker, just add it as a dependency. For more information, see
|
||||||
// https://github.com/KeepSafe/ReLinker for ReLinker's repository.
|
// https://github.com/KeepSafe/ReLinker for ReLinker's repository.
|
||||||
//
|
//
|
||||||
Class<?> relinkClass = mContext.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker");
|
Class<?> relinkClass = context.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker");
|
||||||
Class<?> relinkListenerClass = mContext.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker$LoadListener");
|
Class<?> relinkListenerClass = context.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker$LoadListener");
|
||||||
Class<?> contextClass = mContext.getClassLoader().loadClass("android.content.Context");
|
Class<?> contextClass = context.getClassLoader().loadClass("android.content.Context");
|
||||||
Class<?> stringClass = mContext.getClassLoader().loadClass("java.lang.String");
|
Class<?> stringClass = context.getClassLoader().loadClass("java.lang.String");
|
||||||
|
|
||||||
// Get a 'force' instance of the ReLinker, so we can ensure libraries are reinstalled if
|
// Get a 'force' instance of the ReLinker, so we can ensure libraries are reinstalled if
|
||||||
// they've changed during updates.
|
// they've changed during updates.
|
||||||
@@ -66,7 +70,7 @@ public class SDL {
|
|||||||
|
|
||||||
// Actually load the library!
|
// Actually load the library!
|
||||||
Method loadMethod = relinkInstanceClass.getDeclaredMethod("loadLibrary", contextClass, stringClass, stringClass, relinkListenerClass);
|
Method loadMethod = relinkInstanceClass.getDeclaredMethod("loadLibrary", contextClass, stringClass, stringClass, relinkListenerClass);
|
||||||
loadMethod.invoke(relinkInstance, mContext, libraryName, null, null);
|
loadMethod.invoke(relinkInstance, context, libraryName, null, null);
|
||||||
}
|
}
|
||||||
catch (final Throwable e) {
|
catch (final Throwable e) {
|
||||||
// Fall back
|
// Fall back
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
private static final String TAG = "SDL";
|
private static final String TAG = "SDL";
|
||||||
private static final int SDL_MAJOR_VERSION = 2;
|
private static final int SDL_MAJOR_VERSION = 2;
|
||||||
private static final int SDL_MINOR_VERSION = 30;
|
private static final int SDL_MINOR_VERSION = 30;
|
||||||
private static final int SDL_MICRO_VERSION = 3;
|
private static final int SDL_MICRO_VERSION = 5;
|
||||||
/*
|
/*
|
||||||
// Display InputType.SOURCE/CLASS of events and devices
|
// Display InputType.SOURCE/CLASS of events and devices
|
||||||
//
|
//
|
||||||
@@ -281,7 +281,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
// Load the .so
|
// Load the .so
|
||||||
public void loadLibraries() {
|
public void loadLibraries() {
|
||||||
for (String lib : getLibraries()) {
|
for (String lib : getLibraries()) {
|
||||||
SDL.loadLibrary(lib);
|
SDL.loadLibrary(lib, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -995,8 +995,8 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
/* No valid hint, nothing is explicitly allowed */
|
/* No valid hint, nothing is explicitly allowed */
|
||||||
if (!is_portrait_allowed && !is_landscape_allowed) {
|
if (!is_portrait_allowed && !is_landscape_allowed) {
|
||||||
if (resizable) {
|
if (resizable) {
|
||||||
/* All orientations are allowed */
|
/* All orientations are allowed, respecting user orientation lock setting */
|
||||||
req = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR;
|
req = ActivityInfo.SCREEN_ORIENTATION_FULL_USER;
|
||||||
} else {
|
} else {
|
||||||
/* Fixed window and nothing specified. Get orientation from w/h of created window */
|
/* Fixed window and nothing specified. Get orientation from w/h of created window */
|
||||||
req = (w > h ? ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE : ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
|
req = (w > h ? ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE : ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
|
||||||
@@ -1005,8 +1005,8 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
/* At least one orientation is allowed */
|
/* At least one orientation is allowed */
|
||||||
if (resizable) {
|
if (resizable) {
|
||||||
if (is_portrait_allowed && is_landscape_allowed) {
|
if (is_portrait_allowed && is_landscape_allowed) {
|
||||||
/* hint allows both landscape and portrait, promote to full sensor */
|
/* hint allows both landscape and portrait, promote to full user */
|
||||||
req = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR;
|
req = ActivityInfo.SCREEN_ORIENTATION_FULL_USER;
|
||||||
} else {
|
} else {
|
||||||
/* Use the only one allowed "orientation" */
|
/* Use the only one allowed "orientation" */
|
||||||
req = (is_landscape_allowed ? orientation_landscape : orientation_portrait);
|
req = (is_landscape_allowed ? orientation_landscape : orientation_portrait);
|
||||||
|
|||||||
@@ -8,5 +8,10 @@ if(MSVC)
|
|||||||
|
|
||||||
set_target_properties("${PROPS_TARGET}" PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
|
set_target_properties("${PROPS_TARGET}" PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
|
||||||
set_config_specific_property("DEFAULT_CXX_EXCEPTION_HANDLING" "/EHsc")
|
set_config_specific_property("DEFAULT_CXX_EXCEPTION_HANDLING" "/EHsc")
|
||||||
set_config_specific_property("DEFAULT_CXX_DEBUG_INFORMATION_FORMAT" "/Zi")
|
|
||||||
endif()
|
if (CMAKE_C_COMPILER_LAUNCHER MATCHES "ccache|sccache")
|
||||||
|
set_config_specific_property("DEFAULT_CXX_DEBUG_INFORMATION_FORMAT" "/Z7")
|
||||||
|
else()
|
||||||
|
set_config_specific_property("DEFAULT_CXX_DEBUG_INFORMATION_FORMAT" "/Zi")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ execute_process(
|
|||||||
--executable=$<TARGET_FILE:2ship>
|
--executable=$<TARGET_FILE:2ship>
|
||||||
$<$<BOOL:$<TARGET_PROPERTY:2ship,APPIMAGE_DESKTOP_FILE>>:--desktop-file=$<TARGET_PROPERTY:2ship,APPIMAGE_DESKTOP_FILE>>
|
$<$<BOOL:$<TARGET_PROPERTY:2ship,APPIMAGE_DESKTOP_FILE>>:--desktop-file=$<TARGET_PROPERTY:2ship,APPIMAGE_DESKTOP_FILE>>
|
||||||
$<$<BOOL:$<TARGET_PROPERTY:2ship,APPIMAGE_ICON_FILE>>:--icon-file=$<TARGET_PROPERTY:2ship,APPIMAGE_ICON_FILE>>
|
$<$<BOOL:$<TARGET_PROPERTY:2ship,APPIMAGE_ICON_FILE>>:--icon-file=$<TARGET_PROPERTY:2ship,APPIMAGE_ICON_FILE>>
|
||||||
--exclude-library "*libcrypto*"
|
|
||||||
--output=appimage
|
--output=appimage
|
||||||
# --verbosity=2
|
# --verbosity=2
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ if(SYSTEM_NAME MATCHES "Windows")
|
|||||||
if(NOT ONLY2SHIPOTR AND EXISTS ${SOURCE_DIR}/OTRExporter/mm.zip)
|
if(NOT ONLY2SHIPOTR AND EXISTS ${SOURCE_DIR}/OTRExporter/mm.zip)
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy mm.zip ${TARGET_DIR}/mm.o2r)
|
execute_process(COMMAND ${CMAKE_COMMAND} -E copy mm.zip ${TARGET_DIR}/mm.o2r)
|
||||||
endif()
|
endif()
|
||||||
if(EXISTS ${SOURCE_DIR}/OTRExporter/o2r)
|
if(EXISTS ${SOURCE_DIR}/OTRExporter/2ship.o2r)
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy 2ship.o2r ${TARGET_DIR})
|
execute_process(COMMAND ${CMAKE_COMMAND} -E copy 2ship.o2r ${TARGET_DIR})
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
set(CVAR_VSYNC_ENABLED "${CVAR_PREFIX_SETTING}.VsyncEnabled" CACHE STRING "")
|
set(CVAR_VSYNC_ENABLED "${CVAR_PREFIX_SETTING}.VsyncEnabled" CACHE STRING "")
|
||||||
set(CVAR_Z_FIGHTING_MODE "${CVAR_PREFIX_SETTING}.ZFightingMode" CACHE STRING "")
|
set(CVAR_Z_FIGHTING_MODE "${CVAR_PREFIX_SETTING}.ZFightingMode" CACHE STRING "")
|
||||||
set(CVAR_DISABLE_CLOSE_COLOR_WRAP "${CVAR_PREFIX_SETTING}.DisableCloseColorWrap" CACHE STRING "")
|
|
||||||
set(CVAR_NEW_FILE_DROPPED "${CVAR_PREFIX_GENERAL}.NewFileDropped" CACHE STRING "")
|
set(CVAR_NEW_FILE_DROPPED "${CVAR_PREFIX_GENERAL}.NewFileDropped" CACHE STRING "")
|
||||||
set(CVAR_DROPPED_FILE "${CVAR_PREFIX_GENERAL}.DroppedFile" CACHE STRING "")
|
set(CVAR_DROPPED_FILE "${CVAR_PREFIX_GENERAL}.DroppedFile" CACHE STRING "")
|
||||||
set(CVAR_INTERNAL_RESOLUTION "${CVAR_PREFIX_SETTING}.InternalResolution" CACHE STRING "")
|
set(CVAR_INTERNAL_RESOLUTION "${CVAR_PREFIX_SETTING}.InternalResolution" CACHE STRING "")
|
||||||
@@ -17,7 +16,6 @@ set(CVAR_STATS_WINDOW_OPEN "${CVAR_PREFIX_WINDOW}.Stats" CACHE STRING "")
|
|||||||
set(CVAR_ENABLE_MULTI_VIEWPORTS "${CVAR_PREFIX_SETTING}.EnableMultiViewports" CACHE STRING "")
|
set(CVAR_ENABLE_MULTI_VIEWPORTS "${CVAR_PREFIX_SETTING}.EnableMultiViewports" CACHE STRING "")
|
||||||
set(CVAR_LOW_RES_MODE "${CVAR_PREFIX_SETTING}.LowResMode" CACHE STRING "")
|
set(CVAR_LOW_RES_MODE "${CVAR_PREFIX_SETTING}.LowResMode" CACHE STRING "")
|
||||||
set(CVAR_SIMULATED_INPUT_LAG "${CVAR_PREFIX_SETTING}.SimulatedInputLag" CACHE STRING "")
|
set(CVAR_SIMULATED_INPUT_LAG "${CVAR_PREFIX_SETTING}.SimulatedInputLag" CACHE STRING "")
|
||||||
set(CVAR_ALT_ASSETS "${CVAR_PREFIX_ENHANCEMENT}.AltAssets" CACHE STRING "")
|
|
||||||
set(CVAR_GAME_OVERLAY_FONT "${CVAR_PREFIX_SETTING}.OverlayFont" CACHE STRING "")
|
set(CVAR_GAME_OVERLAY_FONT "${CVAR_PREFIX_SETTING}.OverlayFont" CACHE STRING "")
|
||||||
set(CVAR_MENU_BAR_OPEN "${CVAR_PREFIX_SETTING}.OpenMenuBar" CACHE STRING "")
|
set(CVAR_MENU_BAR_OPEN "${CVAR_PREFIX_SETTING}.OpenMenuBar" CACHE STRING "")
|
||||||
set(CVAR_PREFIX_CONTROLLERS "${CVAR_PREFIX_SETTING}.Controllers" CACHE STRING "")
|
set(CVAR_PREFIX_CONTROLLERS "${CVAR_PREFIX_SETTING}.Controllers" CACHE STRING "")
|
||||||
|
|||||||
+17
-6
@@ -5,16 +5,23 @@ set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")
|
|||||||
|
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
|
||||||
|
|
||||||
project(2s2h VERSION 1.0.0 LANGUAGES C CXX)
|
project(2s2h VERSION 1.1.1 LANGUAGES C CXX)
|
||||||
include(CMake/2ship-cvars.cmake)
|
include(CMake/2ship-cvars.cmake)
|
||||||
include(CMake/lus-cvars.cmake)
|
include(CMake/lus-cvars.cmake)
|
||||||
set(PROJECT_BUILD_NAME "Rika Alfa" CACHE STRING "")
|
set(PROJECT_BUILD_NAME "Satoko Bravo" CACHE STRING "" FORCE)
|
||||||
set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "")
|
set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "" FORCE)
|
||||||
|
|
||||||
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT 2ship)
|
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT 2ship)
|
||||||
|
|
||||||
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:/MP>)
|
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:/MP>)
|
||||||
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:/utf-8>)
|
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:/utf-8>)
|
||||||
|
|
||||||
|
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
|
if (CMAKE_C_COMPILER_LAUNCHER MATCHES "ccache|sccache")
|
||||||
|
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT Embedded)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if (CMAKE_SYSTEM_NAME MATCHES "Windows|Linux")
|
if (CMAKE_SYSTEM_NAME MATCHES "Windows|Linux")
|
||||||
if(NOT DEFINED BUILD_CROWD_CONTROL)
|
if(NOT DEFINED BUILD_CROWD_CONTROL)
|
||||||
set(BUILD_CROWD_CONTROL OFF)
|
set(BUILD_CROWD_CONTROL OFF)
|
||||||
@@ -24,6 +31,9 @@ endif()
|
|||||||
# Enable the Gfx debugger in LUS to use libgfxd from ZAPDTR
|
# Enable the Gfx debugger in LUS to use libgfxd from ZAPDTR
|
||||||
set(GFX_DEBUG_DISASSEMBLER ON)
|
set(GFX_DEBUG_DISASSEMBLER ON)
|
||||||
|
|
||||||
|
# Tell LUS we're using F3DEX_GBI_2 (in a way that doesn't break libgfxd)
|
||||||
|
set(GBI_UCODE F3DEX_GBI_2)
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Set target arch type if empty. Visual studio solution generator provides it.
|
# Set target arch type if empty. Visual studio solution generator provides it.
|
||||||
################################################################################
|
################################################################################
|
||||||
@@ -52,6 +62,7 @@ elseif ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
|
|||||||
set(VCPKG_TRIPLET x64-windows-static)
|
set(VCPKG_TRIPLET x64-windows-static)
|
||||||
set(VCPKG_TARGET_TRIPLET x64-windows-static)
|
set(VCPKG_TARGET_TRIPLET x64-windows-static)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
vcpkg_bootstrap()
|
vcpkg_bootstrap()
|
||||||
vcpkg_install_packages(zlib bzip2 libzip libpng sdl2 sdl2-net glew glfw3 nlohmann-json tinyxml2 spdlog)
|
vcpkg_install_packages(zlib bzip2 libzip libpng sdl2 sdl2-net glew glfw3 nlohmann-json tinyxml2 spdlog)
|
||||||
endif()
|
endif()
|
||||||
@@ -111,7 +122,7 @@ set_property(TARGET 2ship PROPERTY APPIMAGE_ICON_FILE "${CMAKE_BINARY_DIR}/2s2hI
|
|||||||
|
|
||||||
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
||||||
install(PROGRAMS "${CMAKE_BINARY_DIR}/linux/2s2h.sh" DESTINATION . COMPONENT appimage)
|
install(PROGRAMS "${CMAKE_BINARY_DIR}/linux/2s2h.sh" DESTINATION . COMPONENT appimage)
|
||||||
install(FILES "${CMAKE_SOURCE_DIR}/2ship.o2r" DESTINATION . COMPONENT ship)
|
install(FILES "${CMAKE_BINARY_DIR}/mm/2ship.o2r" DESTINATION . COMPONENT ship)
|
||||||
install(TARGETS ZAPD DESTINATION ./assets/extractor COMPONENT extractor)
|
install(TARGETS ZAPD DESTINATION ./assets/extractor COMPONENT extractor)
|
||||||
install(DIRECTORY "${CMAKE_SOURCE_DIR}/mm/assets/extractor/" DESTINATION ./assets/extractor COMPONENT extractor)
|
install(DIRECTORY "${CMAKE_SOURCE_DIR}/mm/assets/extractor/" DESTINATION ./assets/extractor COMPONENT extractor)
|
||||||
install(DIRECTORY "${CMAKE_SOURCE_DIR}/mm/assets/xml/" DESTINATION ./assets/extractor/xmls COMPONENT extractor)
|
install(DIRECTORY "${CMAKE_SOURCE_DIR}/mm/assets/xml/" DESTINATION ./assets/extractor/xmls COMPONENT extractor)
|
||||||
@@ -148,7 +159,7 @@ add_custom_target(
|
|||||||
# CMake versions prior to 3.17 do not have the rm command, use remove instead for older versions
|
# CMake versions prior to 3.17 do not have the rm command, use remove instead for older versions
|
||||||
COMMAND ${CMAKE_COMMAND} -E $<IF:$<VERSION_LESS:${CMAKE_VERSION},3.17>,remove,rm> -f mm.zip 2ship.o2r
|
COMMAND ${CMAKE_COMMAND} -E $<IF:$<VERSION_LESS:${CMAKE_VERSION},3.17>,remove,rm> -f mm.zip 2ship.o2r
|
||||||
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$<TARGET_FILE:ZAPD>" --non-interactive --xml-root ../mm/assets/xml --custom-otr-file 2ship.o2r "--custom-assets-path" ${CMAKE_CURRENT_SOURCE_DIR}/mm/assets/custom --port-ver "${CMAKE_PROJECT_VERSION}"
|
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$<TARGET_FILE:ZAPD>" --non-interactive --xml-root ../mm/assets/xml --custom-otr-file 2ship.o2r "--custom-assets-path" ${CMAKE_CURRENT_SOURCE_DIR}/mm/assets/custom --port-ver "${CMAKE_PROJECT_VERSION}"
|
||||||
COMMAND ${CMAKE_COMMAND} -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DTARGET_DIR="$<TARGET_FILE_DIR:ZAPD>" -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DBINARY_DIR=${CMAKE_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/copy-existing-otrs.cmake
|
COMMAND ${CMAKE_COMMAND} -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DTARGET_DIR="$<TARGET_FILE_DIR:ZAPD>" -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DBINARY_DIR=${CMAKE_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/CMake/copy-existing-otrs.cmake
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter
|
||||||
COMMENT "Running asset extraction..."
|
COMMENT "Running asset extraction..."
|
||||||
DEPENDS ZAPD
|
DEPENDS ZAPD
|
||||||
@@ -170,7 +181,7 @@ add_custom_target(
|
|||||||
# CMake versions prior to 3.17 do not have the rm command, use remove instead for older versions
|
# CMake versions prior to 3.17 do not have the rm command, use remove instead for older versions
|
||||||
COMMAND ${CMAKE_COMMAND} -E $<IF:$<VERSION_LESS:${CMAKE_VERSION},3.17>,remove,rm> -f 2ship.o2r
|
COMMAND ${CMAKE_COMMAND} -E $<IF:$<VERSION_LESS:${CMAKE_VERSION},3.17>,remove,rm> -f 2ship.o2r
|
||||||
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$<TARGET_FILE:ZAPD>" --norom --custom-otr-file 2ship.o2r "--custom-assets-path" ${CMAKE_CURRENT_SOURCE_DIR}/mm/assets/custom --port-ver "${CMAKE_PROJECT_VERSION}"
|
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$<TARGET_FILE:ZAPD>" --norom --custom-otr-file 2ship.o2r "--custom-assets-path" ${CMAKE_CURRENT_SOURCE_DIR}/mm/assets/custom --port-ver "${CMAKE_PROJECT_VERSION}"
|
||||||
COMMAND ${CMAKE_COMMAND} -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DTARGET_DIR="$<TARGET_FILE_DIR:ZAPD>" -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DBINARY_DIR=${CMAKE_BINARY_DIR} -DONLY2SHIPOTR=On -P ${CMAKE_CURRENT_SOURCE_DIR}/copy-existing-otrs.cmake
|
COMMAND ${CMAKE_COMMAND} -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DTARGET_DIR="$<TARGET_FILE_DIR:ZAPD>" -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DBINARY_DIR=${CMAKE_BINARY_DIR} -DONLY2SHIPOTR=On -P ${CMAKE_CURRENT_SOURCE_DIR}/CMake/copy-existing-otrs.cmake
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter
|
||||||
COMMENT "Generating 2ship.o2r..."
|
COMMENT "Generating 2ship.o2r..."
|
||||||
DEPENDS ZAPD
|
DEPENDS ZAPD
|
||||||
|
|||||||
+1
-1
Submodule OTRExporter updated: 5495b80e35...1cbb1b65dd
@@ -32,13 +32,12 @@ Q: The GUI scaling is too big/too small. <br>
|
|||||||
A: There is no GUI scaling option implemented yet. This will come in a future update. <br><br>
|
A: There is no GUI scaling option implemented yet. This will come in a future update. <br><br>
|
||||||
|
|
||||||
Q: Gyro Aim? <br>
|
Q: Gyro Aim? <br>
|
||||||
A: Working on it. <br> <br>
|
A: It will come once it works in the base 2 Ship 2 Harkinian. <br> <br>
|
||||||
|
|
||||||
Q: My controller is not doing anything. <br>
|
Q: My controller is not doing anything. <br>
|
||||||
A: Close the Enhancements Menu. If the Enhancements Menu is not open, open it with the Android back button and check if it is detected in Settings->Controller->Controller Mapping. If it is, press refresh. <br><br>
|
A: Close the Enhancements Menu. If the Enhancements Menu is not open, open it with the Android back button and check if it is detected in Settings->Controller->Controller Mapping. If it is, press refresh. <br><br>
|
||||||
|
|
||||||
<b>Known Bugs</b>:<br>
|
<b>Known Bugs</b>:<br>
|
||||||
Re-connected controllers do not open the GUI anymore. Use the back button or restart the app.<br>
|
|
||||||
Orientation Lock does not work. https://github.com/libsdl-org/SDL/issues/6090<br>
|
Orientation Lock does not work. https://github.com/libsdl-org/SDL/issues/6090<br>
|
||||||
Near-plane clipping when the camera is close to walls.<br>
|
Near-plane clipping when the camera is close to walls.<br>
|
||||||
Picto box images render black. <br>
|
Picto box images render black. <br>
|
||||||
@@ -46,5 +45,3 @@ Picto box images render black. <br>
|
|||||||
<h3>Build Instructions:</h3>
|
<h3>Build Instructions:</h3>
|
||||||
1. Edit the app/build.gradle file to point to your ndk folder. NDK 26+ tested as working.<br>
|
1. Edit the app/build.gradle file to point to your ndk folder. NDK 26+ tested as working.<br>
|
||||||
2. Open the project in android studio and build.<br>
|
2. Open the project in android studio and build.<br>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
Submodule ZAPDTR updated: 7d257b0d7d...24ca939d54
@@ -0,0 +1,239 @@
|
|||||||
|
# Building 2 Ship 2 Harkinian
|
||||||
|
|
||||||
|
## Windows
|
||||||
|
|
||||||
|
Requires:
|
||||||
|
* At least 8GB of RAM (machines with 4GB have seen complier failures)
|
||||||
|
* Visual Studio 2022 Community Edition with the C++ feature set
|
||||||
|
* One of the Windows SDKs that comes with Visual Studio, for example the current Windows 10 version 10.0.19041.0
|
||||||
|
* The `MSVC v143 - VS 2022 C++ build tools` component of Visual Studio
|
||||||
|
* Python 3 (can be installed manually or as part of Visual Studio)
|
||||||
|
* Git (can be installed manually or as part of Visual Studio)
|
||||||
|
* Cmake (can be installed via chocolatey or manually)
|
||||||
|
|
||||||
|
During installation, check the "Desktop development with C++" feature set:
|
||||||
|
|
||||||
|

|
||||||
|
Doing so should also check one of the Windows SDKs by default. Then, in the installation details in the right-hand column, make sure you also check the v143 toolset. This is often done by default.
|
||||||
|
|
||||||
|
It is recommended that you install Python and Git standalone, the install process in VS Installer has given some issues in the past.
|
||||||
|
|
||||||
|
1. Clone the 2 Ship 2 Harkinian repository
|
||||||
|
|
||||||
|
_Note: Be sure to either clone with the ``--recursive`` flag or do ``git submodule update --init`` after cloning to pull in the libultraship submodule!_
|
||||||
|
|
||||||
|
2. After setup and initial build, use the built-in O2R extraction to make your mm.o2r file.
|
||||||
|
|
||||||
|
_Note: Instructions assume using powershell_
|
||||||
|
```powershell
|
||||||
|
# Navigate to the 2ship2harkinian repo within powershell. ie: cd "C:\yourpath\2ship2harkinian"
|
||||||
|
cd 2ship2harkinian
|
||||||
|
|
||||||
|
# Setup cmake project
|
||||||
|
# Add `-DCMAKE_BUILD_TYPE:STRING=Release` if you're packaging
|
||||||
|
& 'C:\Program Files\CMake\bin\cmake' -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64
|
||||||
|
|
||||||
|
# Generate 2ship.o2r
|
||||||
|
& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64 --target Generate2ShipOtr
|
||||||
|
|
||||||
|
# Compile project
|
||||||
|
# Add `--config Release` if you're packaging
|
||||||
|
& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64
|
||||||
|
|
||||||
|
# Now you can run the executable in .\build\x64 or run in Visual Studio
|
||||||
|
```
|
||||||
|
|
||||||
|
### Developing 2S2H
|
||||||
|
With the cmake build system you have two options for working on the project:
|
||||||
|
|
||||||
|
#### Visual Studio
|
||||||
|
To develop using Visual Studio you only need to use cmake to generate the solution file:
|
||||||
|
```powershell
|
||||||
|
# Generates 2s2h.sln at `build/x64` for Visual Studio 2022
|
||||||
|
& 'C:\Program Files\CMake\bin\cmake' -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Visual Studio Code or another editor
|
||||||
|
To develop using Visual Studio Code or another editor you only need to open the repository in it.
|
||||||
|
To build you'll need to follow the instructions from the building section.
|
||||||
|
|
||||||
|
_Note: If you're using Visual Studio Code, the [cpack plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) makes it very easy to just press run and debug._
|
||||||
|
|
||||||
|
_Experimental: You can also use another build system entirely rather than MSVC like [Ninja](https://ninja-build.org/) for possibly better performance._
|
||||||
|
|
||||||
|
|
||||||
|
### Generating the distributable
|
||||||
|
After compiling the project you can generate the distributable by running:
|
||||||
|
```powershell
|
||||||
|
# Go to build folder
|
||||||
|
cd "build/x64"
|
||||||
|
# Generate
|
||||||
|
& 'C:\Program Files\CMake\bin\cpack.exe' -G ZIP
|
||||||
|
```
|
||||||
|
|
||||||
|
### Additional CMake Targets
|
||||||
|
#### Clean
|
||||||
|
```powershell
|
||||||
|
# If you need to clean the project you can run
|
||||||
|
C:\Program Files\CMake\bin\cmake.exe --build build-cmake --target clean
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Regenerate Asset Headers
|
||||||
|
```powershell
|
||||||
|
# If you need to regenerate the asset headers to check them into source
|
||||||
|
C:\Program Files\CMake\bin\cmake.exe --build build-cmake --target ExtractAssetHeaders
|
||||||
|
```
|
||||||
|
|
||||||
|
## Linux
|
||||||
|
### Install dependencies
|
||||||
|
#### Debian/Ubuntu
|
||||||
|
```sh
|
||||||
|
# using gcc
|
||||||
|
apt-get install gcc g++ git cmake ninja-build lsb-release libsdl2-dev libpng-dev libsdl2-net-dev libzip-dev zipcmp zipmerge ziptool nlohmann-json3-dev libtinyxml2-dev libspdlog-dev libboost-dev libopengl-dev
|
||||||
|
|
||||||
|
# or using clang
|
||||||
|
apt-get install clang git cmake ninja-build lsb-release libsdl2-dev libpng-dev libsdl2-net-dev libzip-dev zipcmp zipmerge ziptool nlohmann-json3-dev libtinyxml2-dev libspdlog-dev libboost-dev libopengl-dev
|
||||||
|
```
|
||||||
|
#### Arch
|
||||||
|
```sh
|
||||||
|
# using gcc
|
||||||
|
pacman -S gcc git cmake ninja lsb-release sdl2 libpng libzip nlohmann-json tinyxml2 spdlog sdl2_net boost
|
||||||
|
|
||||||
|
# or using clang
|
||||||
|
pacman -S clang git cmake ninja lsb-release sdl2 libpng libzip nlohmann-json tinyxml2 spdlog sdl2_net boost
|
||||||
|
```
|
||||||
|
#### Fedora
|
||||||
|
```sh
|
||||||
|
# using gcc
|
||||||
|
dnf install gcc gcc-c++ git cmake ninja-build lsb_release SDL2-devel libpng-devel libzip-devel libzip-tools nlohmann-json-devel tinyxml2-devel spdlog-devel boost-devel
|
||||||
|
|
||||||
|
# or using clang
|
||||||
|
dnf install clang git cmake ninja-build lsb_release SDL2-devel libpng-devel libzip-devel libzip-tools nlohmann-json-devel tinyxml2-devel spdlog-devel boost-devel
|
||||||
|
```
|
||||||
|
#### openSUSE
|
||||||
|
```sh
|
||||||
|
# using gcc
|
||||||
|
zypper in gcc gcc-c++ git cmake ninja SDL2-devel libpng16-devel libzip-devel libzip-tools nlohmann_json-devel tinyxml2-devel spdlog-devel
|
||||||
|
|
||||||
|
# or using clang
|
||||||
|
zypper in clang libstdc++-devel git cmake ninja SDL2-devel libpng16-devel libzip-devel libzip-tools nlohmann_json-devel tinyxml2-devel spdlog-devel
|
||||||
|
```
|
||||||
|
|
||||||
|
### Build
|
||||||
|
|
||||||
|
_Note: If you're using Visual Studio Code, the [CMake Tools plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) makes it very easy to just press run and debug._
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Clone the repo and enter the directory
|
||||||
|
git clone https://github.com/HarbourMasters/2ship2harkinian.git
|
||||||
|
cd 2ship2harkinian
|
||||||
|
|
||||||
|
# Clone the submodules
|
||||||
|
git submodule update --init
|
||||||
|
|
||||||
|
# Generate Ninja project
|
||||||
|
# Add `-DCMAKE_BUILD_TYPE:STRING=Release` if you're packaging
|
||||||
|
# Add `-DPython3_EXECUTABLE=$(which python3)` if you are using non-standard Python installations such as PyEnv
|
||||||
|
cmake -H. -Bbuild-cmake -GNinja
|
||||||
|
|
||||||
|
# Generate 2ship.o2r
|
||||||
|
cmake --build build-cmake --target Generate2ShipOtr
|
||||||
|
|
||||||
|
# Compile the project
|
||||||
|
# Add `--config Release` if you're packaging
|
||||||
|
cmake --build build-cmake
|
||||||
|
|
||||||
|
# Now you can run the executable in ./build-cmake/mm/2s2h.elf
|
||||||
|
# To develop the project open the repository in VSCode (or your preferred editor)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Generate a distributable
|
||||||
|
After compiling the project you can generate a distributable by running of the following:
|
||||||
|
```bash
|
||||||
|
# Go to build folder
|
||||||
|
cd build-cmake
|
||||||
|
# Generate
|
||||||
|
cpack -G DEB
|
||||||
|
cpack -G ZIP
|
||||||
|
cpack -G External (creates appimage)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Additional CMake Targets
|
||||||
|
#### Clean
|
||||||
|
```bash
|
||||||
|
# If you need to clean the project you can run
|
||||||
|
cmake --build build-cmake --target clean
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Regenerate Asset Headers
|
||||||
|
```bash
|
||||||
|
# If you need to regenerate the asset headers to check them into source
|
||||||
|
cmake --build build-cmake --target ExtractAssetHeaders
|
||||||
|
```
|
||||||
|
|
||||||
|
## macOS
|
||||||
|
Requires Xcode (or xcode-tools) && `sdl2, libpng, glew, ninja, cmake, nlohmann-json, libzip` (can be installed via homebrew, macports, etc)
|
||||||
|
|
||||||
|
**Important: For maximum performance make sure you have ninja build tools installed!**
|
||||||
|
|
||||||
|
_Note: If you're using Visual Studio Code, the [cpack plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) makes it very easy to just press run and debug._
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Clone the repo
|
||||||
|
git clone https://github.com/HarbourMasters/2ship2harkinian.git
|
||||||
|
cd 2ship2harkinian
|
||||||
|
# Clone the submodule libultraship
|
||||||
|
git submodule update --init
|
||||||
|
|
||||||
|
# Generate Ninja project
|
||||||
|
# Add `-DCMAKE_BUILD_TYPE:STRING=Release` if you're packaging
|
||||||
|
cmake -H. -Bbuild-cmake -GNinja
|
||||||
|
|
||||||
|
# Generate 2ship.o2r
|
||||||
|
cmake --build build-cmake --target Generate2ShipOtr
|
||||||
|
|
||||||
|
# Compile the project
|
||||||
|
# Add `--config Release` if you're packaging
|
||||||
|
cmake --build build-cmake
|
||||||
|
|
||||||
|
# Now you can run the executable file:
|
||||||
|
./build-cmake/mm/2s2h-macos
|
||||||
|
# To develop the project open the repository in VSCode (or your preferred editor)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Generating a distributable
|
||||||
|
After compiling the project you can generate a distributable by running of the following:
|
||||||
|
```bash
|
||||||
|
# Go to build folder
|
||||||
|
cd build-cmake
|
||||||
|
# Generate
|
||||||
|
cpack
|
||||||
|
```
|
||||||
|
|
||||||
|
### Additional CMake Targets
|
||||||
|
#### Clean
|
||||||
|
```bash
|
||||||
|
# If you need to clean the project you can run
|
||||||
|
cmake --build build-cmake --target clean
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Regenerate Asset Headers
|
||||||
|
```bash
|
||||||
|
# If you need to regenerate the asset headers to check them into source
|
||||||
|
cmake --build build-cmake --target ExtractAssetHeaders
|
||||||
|
```
|
||||||
|
|
||||||
|
# Compatible Roms
|
||||||
|
See [`supportedHashes.json`](supportedHashes.json)
|
||||||
|
|
||||||
|
## Getting CI to work on your fork
|
||||||
|
|
||||||
|
The CI works via [Github Actions](https://github.com/features/actions) where we mostly make use of machines hosted by Github; except for the very first step of the CI process called "Extract assets". This steps extracts assets from the game file and generates an "assets" folder in `mm/`.
|
||||||
|
|
||||||
|
To get this step working on your fork, you'll need to add a machine to your own repository as a self-hosted runner via "Settings > Actions > Runners" in your repository settings. Make sure to add the 'asset-builder' tag to your newly added runner to assign it to run this step. To setup your runner as a service read the docs [here](https://docs.github.com/en/actions/hosting-your-own-runners/configuring-the-self-hosted-runner-application-as-a-service?platform=linux).
|
||||||
|
|
||||||
|
### Runner on Windows
|
||||||
|
You'll have to enable the ability to run unsigned scripts through PowerShell. To do this, open Powershell as administrator and run `set-executionpolicy remotesigned`. Most dependencies get installed as part of the CI process. You will also need to separately install 7z and add it to the PATH so `7z` can be run as a command. [Chocolatey](https://chocolatey.org/) or other package managers can be used to install it easily.
|
||||||
|
|
||||||
|
### Runner on UNIX systems
|
||||||
|
If you're on macOS or Linux take a look at `macports-deps.txt` or `apt-deps.txt` to see the dependencies expected to be on your machine.
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user