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 | ||
|
|
b54542494e | ||
|
|
eae50e33e3 | ||
|
|
04e5ac449d | ||
|
|
50b06bff0b | ||
|
|
e484e0ba82 | ||
|
|
291973fffe | ||
|
|
01ae001de5 | ||
|
|
711b02be55 | ||
|
|
513e89c073 |
@@ -130,7 +130,7 @@ jobs:
|
||||
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
|
||||
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
|
||||
fi
|
||||
cd SDL2-2.28.5
|
||||
@@ -192,15 +192,17 @@ jobs:
|
||||
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 port &>/dev/null ]; then
|
||||
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
|
||||
echo "/opt/local/bin:/opt/local/sbin" >> $GITHUB_PATH
|
||||
echo "/opt/local/bin:/opt/local/sbin" >> "$GITHUB_PATH"
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
brew uninstall --ignore-dependencies libpng
|
||||
@@ -261,7 +263,7 @@ jobs:
|
||||
run: |
|
||||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||
if [ ! -d "SDL2-2.30.3" ]; then
|
||||
wget https://www.libsdl.org/release/SDL2-2.30.3.tar.gz
|
||||
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
|
||||
|
||||
@@ -12,7 +12,7 @@ jobs:
|
||||
if: ${{ github.event.workflow_run.event == 'pull_request' }}
|
||||
steps:
|
||||
- id: 'pr-number'
|
||||
uses: actions/github-script@v6
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
result-encoding: string
|
||||
script: |
|
||||
@@ -20,8 +20,9 @@ jobs:
|
||||
const pullHeadSHA = '${{github.event.workflow_run.head_sha}}';
|
||||
const pullUserId = ${{github.event.sender.id}};
|
||||
const prNumber = await (async () => {
|
||||
const pulls = await github.rest.pulls.list({owner, repo});
|
||||
for await (const {data} of github.paginate.iterator(pulls)) {
|
||||
for await (const { data } of github.paginate.iterator(
|
||||
github.rest.pulls.list, { owner, repo }
|
||||
)) {
|
||||
for (const pull of data) {
|
||||
if (pull.head.sha === pullHeadSHA && pull.user.id === pullUserId) {
|
||||
return pull.number;
|
||||
@@ -36,7 +37,7 @@ jobs:
|
||||
|
||||
return prNumber;
|
||||
- id: 'artifacts-text'
|
||||
uses: actions/github-script@v6
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
result-encoding: string
|
||||
script: |
|
||||
@@ -54,7 +55,7 @@ jobs:
|
||||
return acc;
|
||||
}, '### Build Artifacts');
|
||||
- id: 'add-to-pr'
|
||||
uses: garrettjoecox/pr-section@3.1.0
|
||||
uses: garrettjoecox/pr-section@4.0.0
|
||||
with:
|
||||
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||
pr-number: ${{ steps.pr-number.outputs.result }}
|
||||
|
||||
@@ -66,3 +66,4 @@ _packages/
|
||||
|
||||
/mm/src/boot/build.c
|
||||
/mm/windows/properties.h
|
||||
/clang-format.exe
|
||||
|
||||
@@ -16,8 +16,8 @@ android {
|
||||
}
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 31
|
||||
versionCode 2
|
||||
versionName "1.0.1"
|
||||
versionCode 4
|
||||
versionName "1.1.1"
|
||||
externalNativeBuild {
|
||||
//ndkBuild {
|
||||
// arguments "APP_PLATFORM=android-23"
|
||||
@@ -79,7 +79,7 @@ dependencies {
|
||||
}
|
||||
|
||||
task wrapper(type: Wrapper) {
|
||||
gradleVersion = '7.3'
|
||||
gradleVersion = '7.0.3'
|
||||
}
|
||||
|
||||
task prepareKotlinBuildScriptModel {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.dishii.mm"
|
||||
android:versionCode="2"
|
||||
android:versionName="1.0.1"
|
||||
android:versionCode="4"
|
||||
android:versionName="1.1.1"
|
||||
android:installLocation="auto">
|
||||
|
||||
<!-- OpenGL ES 3.0 -->
|
||||
|
||||
@@ -277,6 +277,7 @@ public class HIDDeviceManager {
|
||||
0x044f, // Thrustmaster
|
||||
0x045e, // Microsoft
|
||||
0x0738, // Mad Catz
|
||||
0x0b05, // ASUS
|
||||
0x0e6f, // PDP
|
||||
0x0f0d, // Hori
|
||||
0x10f5, // Turtle Beach
|
||||
@@ -590,7 +591,13 @@ public class HIDDeviceManager {
|
||||
} else {
|
||||
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) {
|
||||
Log.v(TAG, "Couldn't request permission for USB device " + usbDevice);
|
||||
HIDDeviceOpenResult(deviceID, false);
|
||||
|
||||
@@ -38,6 +38,10 @@ public class SDL {
|
||||
}
|
||||
|
||||
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) {
|
||||
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
|
||||
// https://github.com/KeepSafe/ReLinker for ReLinker's repository.
|
||||
//
|
||||
Class<?> relinkClass = mContext.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker");
|
||||
Class<?> relinkListenerClass = mContext.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker$LoadListener");
|
||||
Class<?> contextClass = mContext.getClassLoader().loadClass("android.content.Context");
|
||||
Class<?> stringClass = mContext.getClassLoader().loadClass("java.lang.String");
|
||||
Class<?> relinkClass = context.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker");
|
||||
Class<?> relinkListenerClass = context.getClassLoader().loadClass("com.getkeepsafe.relinker.ReLinker$LoadListener");
|
||||
Class<?> contextClass = context.getClassLoader().loadClass("android.content.Context");
|
||||
Class<?> stringClass = context.getClassLoader().loadClass("java.lang.String");
|
||||
|
||||
// Get a 'force' instance of the ReLinker, so we can ensure libraries are reinstalled if
|
||||
// they've changed during updates.
|
||||
@@ -66,7 +70,7 @@ public class SDL {
|
||||
|
||||
// Actually load the library!
|
||||
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) {
|
||||
// Fall back
|
||||
|
||||
@@ -61,7 +61,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
private static final String TAG = "SDL";
|
||||
private static final int SDL_MAJOR_VERSION = 2;
|
||||
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
|
||||
//
|
||||
@@ -281,7 +281,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
// Load the .so
|
||||
public void loadLibraries() {
|
||||
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 */
|
||||
if (!is_portrait_allowed && !is_landscape_allowed) {
|
||||
if (resizable) {
|
||||
/* All orientations are allowed */
|
||||
req = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR;
|
||||
/* All orientations are allowed, respecting user orientation lock setting */
|
||||
req = ActivityInfo.SCREEN_ORIENTATION_FULL_USER;
|
||||
} else {
|
||||
/* 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);
|
||||
@@ -1005,8 +1005,8 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
/* At least one orientation is allowed */
|
||||
if (resizable) {
|
||||
if (is_portrait_allowed && is_landscape_allowed) {
|
||||
/* hint allows both landscape and portrait, promote to full sensor */
|
||||
req = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR;
|
||||
/* hint allows both landscape and portrait, promote to full user */
|
||||
req = ActivityInfo.SCREEN_ORIENTATION_FULL_USER;
|
||||
} else {
|
||||
/* Use the only one allowed "orientation" */
|
||||
req = (is_landscape_allowed ? orientation_landscape : orientation_portrait);
|
||||
|
||||
+4
-4
@@ -5,11 +5,11 @@ 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")
|
||||
|
||||
project(2s2h VERSION 1.0.1 LANGUAGES C CXX)
|
||||
project(2s2h VERSION 1.1.1 LANGUAGES C CXX)
|
||||
include(CMake/2ship-cvars.cmake)
|
||||
include(CMake/lus-cvars.cmake)
|
||||
set(PROJECT_BUILD_NAME "Rika Bravo" CACHE STRING "")
|
||||
set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "")
|
||||
set(PROJECT_BUILD_NAME "Satoko Bravo" CACHE STRING "" FORCE)
|
||||
set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "" FORCE)
|
||||
|
||||
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT 2ship)
|
||||
|
||||
@@ -32,7 +32,7 @@ endif()
|
||||
set(GFX_DEBUG_DISASSEMBLER ON)
|
||||
|
||||
# Tell LUS we're using F3DEX_GBI_2 (in a way that doesn't break libgfxd)
|
||||
set(USE_F3DEX2 ON)
|
||||
set(GBI_UCODE F3DEX_GBI_2)
|
||||
|
||||
################################################################################
|
||||
# Set target arch type if empty. Visual studio solution generator provides it.
|
||||
|
||||
+1
-1
Submodule OTRExporter updated: e8f93ff692...1cbb1b65dd
@@ -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.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 208 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 206 KiB |
@@ -0,0 +1,10 @@
|
||||
[
|
||||
{
|
||||
"name": "NTSC-U 1.0",
|
||||
"sha1": "d6133ace5afaa0882cf214cf88daba39e266c078"
|
||||
},
|
||||
{
|
||||
"name": "NTSC-U GC",
|
||||
"sha1": "9743aa026e9269b339eb0e3044cd5830a440c1fd"
|
||||
}
|
||||
]
|
||||
+1
-1
Submodule libultraship updated: 7dd40ea028...7a303818b3
+42
-14
@@ -8,6 +8,7 @@
|
||||
#include <Fast3D/gfx_pc.h>
|
||||
#include "UIWidgets.hpp"
|
||||
#include "HudEditor.h"
|
||||
#include "Notification.h"
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include "graphic/Fast3D/gfx_metal.h"
|
||||
@@ -20,6 +21,9 @@
|
||||
#include "include/global.h"
|
||||
#include "include/z64audio.h"
|
||||
|
||||
#include "Enhancements/Trackers/ItemTracker.h"
|
||||
#include "Enhancements/Trackers/ItemTrackerSettings.h"
|
||||
|
||||
namespace BenGui {
|
||||
// MARK: - Delegates
|
||||
|
||||
@@ -27,7 +31,6 @@ std::shared_ptr<BenMenuBar> mBenMenuBar;
|
||||
|
||||
std::shared_ptr<Ship::GuiWindow> mConsoleWindow;
|
||||
std::shared_ptr<Ship::GuiWindow> mStatsWindow;
|
||||
std::shared_ptr<Ship::GuiWindow> mInputEditorWindow;
|
||||
std::shared_ptr<Ship::GuiWindow> mGfxDebuggerWindow;
|
||||
|
||||
std::shared_ptr<SaveEditorWindow> mSaveEditorWindow;
|
||||
@@ -35,6 +38,11 @@ std::shared_ptr<HudEditorWindow> mHudEditorWindow;
|
||||
std::shared_ptr<ActorViewerWindow> mActorViewerWindow;
|
||||
std::shared_ptr<CollisionViewerWindow> mCollisionViewerWindow;
|
||||
std::shared_ptr<EventLogWindow> mEventLogWindow;
|
||||
std::shared_ptr<BenMenu> mBenMenu;
|
||||
std::shared_ptr<BenInputEditorWindow> mBenInputEditorWindow;
|
||||
std::shared_ptr<Notification::Window> mNotificationWindow;
|
||||
std::shared_ptr<ItemTrackerWindow> mItemTrackerWindow;
|
||||
std::shared_ptr<ItemTrackerSettingsWindow> mItemTrackerSettingsWindow;
|
||||
|
||||
void SetupGuiElements() {
|
||||
auto gui = Ship::Context::GetInstance()->GetWindow()->GetGui();
|
||||
@@ -47,7 +55,7 @@ void SetupGuiElements() {
|
||||
mBenMenuBar = std::make_shared<BenMenuBar>(CVAR_MENU_BAR_OPEN, CVarGetInteger(CVAR_MENU_BAR_OPEN, 0));
|
||||
gui->SetMenuBar(std::reinterpret_pointer_cast<Ship::GuiMenuBar>(mBenMenuBar));
|
||||
|
||||
if (gui->GetMenuBar() && !gui->GetMenuBar()->IsVisible()) {
|
||||
if (!gui->GetMenuBar() && !CVarGetInteger("gSettings.DisableMenuShortcutNotify", 0)) {
|
||||
#if defined(__SWITCH__) || defined(__WIIU__) || defined(__ANDROID__)
|
||||
gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Press - to access enhancements menu");
|
||||
#else
|
||||
@@ -55,6 +63,9 @@ void SetupGuiElements() {
|
||||
#endif
|
||||
}
|
||||
|
||||
mBenMenu = std::make_shared<BenMenu>("gWindows.Menu", "Settings Menu");
|
||||
gui->SetMenu(mBenMenu);
|
||||
|
||||
mStatsWindow = gui->GetGuiWindow("Stats");
|
||||
if (mStatsWindow == nullptr) {
|
||||
SPDLOG_ERROR("Could not find stats window");
|
||||
@@ -65,43 +76,60 @@ void SetupGuiElements() {
|
||||
SPDLOG_ERROR("Could not find console window");
|
||||
}
|
||||
|
||||
mInputEditorWindow = gui->GetGuiWindow("Input Editor");
|
||||
if (mInputEditorWindow == nullptr) {
|
||||
SPDLOG_ERROR("Could not find input editor window");
|
||||
}
|
||||
|
||||
mGfxDebuggerWindow = gui->GetGuiWindow("GfxDebuggerWindow");
|
||||
if (mGfxDebuggerWindow == nullptr) {
|
||||
SPDLOG_ERROR("Could not find input GfxDebuggerWindow");
|
||||
}
|
||||
|
||||
mSaveEditorWindow = std::make_shared<SaveEditorWindow>("gWindows.SaveEditor", "Save Editor");
|
||||
mBenInputEditorWindow = std::make_shared<BenInputEditorWindow>("gWindows.BenInputEditor", "2S2H Input Editor");
|
||||
gui->AddGuiWindow(mBenInputEditorWindow);
|
||||
|
||||
mSaveEditorWindow = std::make_shared<SaveEditorWindow>("gWindows.SaveEditor", "Save Editor", ImVec2(480, 600));
|
||||
gui->AddGuiWindow(mSaveEditorWindow);
|
||||
|
||||
mHudEditorWindow = std::make_shared<HudEditorWindow>("gWindows.HudEditor", "Hud Editor");
|
||||
mHudEditorWindow = std::make_shared<HudEditorWindow>("gWindows.HudEditor", "HUD Editor", ImVec2(480, 600));
|
||||
gui->AddGuiWindow(mHudEditorWindow);
|
||||
|
||||
mActorViewerWindow = std::make_shared<ActorViewerWindow>("gWindows.ActorViewer", "Actor Viewer");
|
||||
mActorViewerWindow = std::make_shared<ActorViewerWindow>("gWindows.ActorViewer", "Actor Viewer", ImVec2(520, 600));
|
||||
gui->AddGuiWindow(mActorViewerWindow);
|
||||
|
||||
mCollisionViewerWindow = std::make_shared<CollisionViewerWindow>("gWindows.CollisionViewer", "Collision Viewer");
|
||||
mCollisionViewerWindow =
|
||||
std::make_shared<CollisionViewerWindow>("gWindows.CollisionViewer", "Collision Viewer", ImVec2(390, 475));
|
||||
gui->AddGuiWindow(mCollisionViewerWindow);
|
||||
|
||||
mEventLogWindow = std::make_shared<EventLogWindow>("gWindows.EventLog", "Event Log");
|
||||
mEventLogWindow = std::make_shared<EventLogWindow>("gWindows.EventLog", "Event Log", ImVec2(520, 600));
|
||||
gui->AddGuiWindow(mEventLogWindow);
|
||||
|
||||
mItemTrackerWindow = std::make_shared<ItemTrackerWindow>("gWindows.ItemTracker", "Item Tracker");
|
||||
gui->AddGuiWindow(mItemTrackerWindow);
|
||||
|
||||
mItemTrackerSettingsWindow = std::make_shared<ItemTrackerSettingsWindow>("gWindows.ItemTrackerSettings",
|
||||
"Item Tracker Settings", ImVec2(800, 400));
|
||||
gui->AddGuiWindow(mItemTrackerSettingsWindow);
|
||||
gui->SetPadBtnTogglesMenu();
|
||||
|
||||
mNotificationWindow = std::make_shared<Notification::Window>("gWindows.Notifications", "Notifications Window");
|
||||
gui->AddGuiWindow(mNotificationWindow);
|
||||
mNotificationWindow->Show();
|
||||
}
|
||||
|
||||
void Destroy() {
|
||||
auto gui = Ship::Context::GetInstance()->GetWindow()->GetGui();
|
||||
|
||||
gui->RemoveAllGuiWindows();
|
||||
mBenMenuBar = nullptr;
|
||||
mBenMenu = nullptr;
|
||||
mStatsWindow = nullptr;
|
||||
mConsoleWindow = nullptr;
|
||||
mInputEditorWindow = nullptr;
|
||||
mBenInputEditorWindow = nullptr;
|
||||
mGfxDebuggerWindow = nullptr;
|
||||
mCollisionViewerWindow = nullptr;
|
||||
mEventLogWindow = nullptr;
|
||||
|
||||
mNotificationWindow = nullptr;
|
||||
mSaveEditorWindow = nullptr;
|
||||
mHudEditorWindow = nullptr;
|
||||
mActorViewerWindow = nullptr;
|
||||
mItemTrackerWindow = nullptr;
|
||||
mItemTrackerSettingsWindow = nullptr;
|
||||
}
|
||||
} // namespace BenGui
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include "DeveloperTools/ActorViewer.h"
|
||||
#include "DeveloperTools/CollisionViewer.h"
|
||||
#include "DeveloperTools/EventLog.h"
|
||||
#include "BenInputEditorWindow.h"
|
||||
#include "Menu.h"
|
||||
|
||||
namespace BenGui {
|
||||
void SetupHooks();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,90 @@
|
||||
#pragma once
|
||||
|
||||
#include "stdint.h"
|
||||
#include "window/gui/GuiWindow.h"
|
||||
#ifndef IMGUI_DEFINE_MATH_OPERATORS
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#endif
|
||||
#include <imgui.h>
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include "controller/controldevice/controller/Controller.h"
|
||||
|
||||
class BenInputEditorWindow : public Ship::GuiWindow {
|
||||
public:
|
||||
using Ship::GuiWindow::GuiWindow;
|
||||
~BenInputEditorWindow();
|
||||
|
||||
void DrawButton(const char* label, int32_t n64Btn, int32_t currentPort, int32_t* btnReading);
|
||||
|
||||
void DrawInputChip(const char* buttonName, ImVec4 color);
|
||||
void DrawAnalogPreview(const char* label, ImVec2 stick, float deadzone = 0, bool gyro = false);
|
||||
void DrawControllerSchema();
|
||||
bool TestingRumble();
|
||||
void DrawFullContents();
|
||||
void DrawPortTabContents(uint8_t portIndex);
|
||||
|
||||
protected:
|
||||
void InitElement() override;
|
||||
void DrawElement() override;
|
||||
void UpdateElement() override;
|
||||
|
||||
private:
|
||||
void DrawStickDirectionLine(const char* axisDirectionName, uint8_t port, uint8_t stick, Ship::Direction direction,
|
||||
ImVec4 color);
|
||||
void DrawButtonLine(const char* buttonName, uint8_t port, CONTROLLERBUTTONS_T bitmask, ImVec4 color);
|
||||
void DrawButtonLineEditMappingButton(uint8_t port, CONTROLLERBUTTONS_T bitmask, std::string id);
|
||||
void DrawButtonLineAddMappingButton(uint8_t port, CONTROLLERBUTTONS_T bitmask);
|
||||
|
||||
void DrawStickDirectionLineEditMappingButton(uint8_t port, uint8_t stick, Ship::Direction direction,
|
||||
std::string id);
|
||||
void DrawStickDirectionLineAddMappingButton(uint8_t port, uint8_t stick, Ship::Direction direction);
|
||||
void DrawStickSection(uint8_t port, uint8_t stick, int32_t id, ImVec4 color);
|
||||
|
||||
void DrawRumbleSection(uint8_t port);
|
||||
void DrawRemoveRumbleMappingButton(uint8_t port, std::string id);
|
||||
void DrawAddRumbleMappingButton(uint8_t port);
|
||||
|
||||
void DrawLEDSection(uint8_t port);
|
||||
void DrawRemoveLEDMappingButton(uint8_t port, std::string id);
|
||||
void DrawAddLEDMappingButton(uint8_t port);
|
||||
|
||||
void DrawGyroSection(uint8_t port);
|
||||
void DrawRemoveGyroMappingButton(uint8_t port, std::string id);
|
||||
void DrawAddGyroMappingButton(uint8_t port);
|
||||
|
||||
int32_t mGameInputBlockTimer;
|
||||
int32_t mMappingInputBlockTimer;
|
||||
int32_t mRumbleTimer;
|
||||
std::shared_ptr<Ship::ControllerRumbleMapping> mRumbleMappingToTest;
|
||||
|
||||
// mBitmaskToMappingIds[port][bitmask] = { id0, id1, ... }
|
||||
std::unordered_map<uint8_t, std::unordered_map<CONTROLLERBUTTONS_T, std::vector<std::string>>> mBitmaskToMappingIds;
|
||||
|
||||
// mStickDirectionToMappingIds[port][stick][direction] = { id0, id1, ... }
|
||||
std::unordered_map<uint8_t,
|
||||
std::unordered_map<uint8_t, std::unordered_map<Ship::Direction, std::vector<std::string>>>>
|
||||
mStickDirectionToMappingIds;
|
||||
|
||||
void UpdateBitmaskToMappingIds(uint8_t port);
|
||||
void UpdateStickDirectionToMappingIds(uint8_t port);
|
||||
|
||||
void GetButtonColorsForShipDeviceIndex(Ship::ShipDeviceIndex lusIndex, ImVec4& buttonColor,
|
||||
ImVec4& buttonHoveredColor);
|
||||
void DrawPortTab(uint8_t portIndex);
|
||||
std::set<CONTROLLERBUTTONS_T> mButtonsBitmasks;
|
||||
std::set<CONTROLLERBUTTONS_T> mDpadBitmasks;
|
||||
void DrawButtonDeviceIcons(uint8_t portIndex, std::set<CONTROLLERBUTTONS_T> bitmasks);
|
||||
void DrawAnalogStickDeviceIcons(uint8_t portIndex, Ship::Stick stick);
|
||||
void DrawRumbleDeviceIcons(uint8_t portIndex);
|
||||
void DrawGyroDeviceIcons(uint8_t portIndex);
|
||||
void DrawLEDDeviceIcons(uint8_t portIndex);
|
||||
bool mInputEditorPopupOpen;
|
||||
void DrawSetDefaultsButton(uint8_t portIndex);
|
||||
void DrawClearAllButton(uint8_t portIndex);
|
||||
|
||||
std::map<Ship::ShipDeviceIndex, bool> mDeviceIndexVisiblity;
|
||||
void DrawDeviceVisibilityButtons();
|
||||
};
|
||||
+348
-80
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user