mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb1378429f | ||
|
|
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: |
|
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
|
||||||
@@ -192,15 +192,17 @@ jobs:
|
|||||||
key: ${{ runner.os }}-14-macports-${{ hashFiles('.github/workflows/macports-deps.txt') }}
|
key: ${{ runner.os }}-14-macports-${{ hashFiles('.github/workflows/macports-deps.txt') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-14-macports-
|
${{ runner.os }}-14-macports-
|
||||||
|
# Updated PATH applies to the next step and onwards
|
||||||
- name: Install MacPorts (if necessary)
|
- name: Install MacPorts (if necessary)
|
||||||
run: |
|
run: |
|
||||||
if [ command -v port &>/dev/null ]; then
|
if command -v /opt/local/bin/port 2>&1 >/dev/null; then
|
||||||
echo "MacPorts already installed"
|
echo "MacPorts already installed"
|
||||||
else
|
else
|
||||||
|
echo "Installing MacPorts"
|
||||||
wget https://github.com/macports/macports-base/releases/download/v2.9.3/MacPorts-2.9.3-14-Sonoma.pkg
|
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 /
|
sudo installer -pkg ./MacPorts-2.9.3-14-Sonoma.pkg -target /
|
||||||
fi
|
fi
|
||||||
echo "/opt/local/bin:/opt/local/sbin" >> $GITHUB_PATH
|
echo "/opt/local/bin:/opt/local/sbin" >> "$GITHUB_PATH"
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
brew uninstall --ignore-dependencies libpng
|
brew uninstall --ignore-dependencies libpng
|
||||||
@@ -261,7 +263,7 @@ jobs:
|
|||||||
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.30.3" ]; then
|
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
|
tar -xzf SDL2-2.30.3.tar.gz
|
||||||
fi
|
fi
|
||||||
cd SDL2-2.30.3
|
cd SDL2-2.30.3
|
||||||
|
|||||||
@@ -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: |
|
||||||
@@ -54,7 +55,7 @@ jobs:
|
|||||||
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 2
|
versionCode 4
|
||||||
versionName "1.0.1"
|
versionName "1.1.1"
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
//ndkBuild {
|
//ndkBuild {
|
||||||
// arguments "APP_PLATFORM=android-23"
|
// arguments "APP_PLATFORM=android-23"
|
||||||
@@ -75,11 +75,11 @@ android {
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
implementation 'androidx.core:core:1.7.0' // Use the latest version
|
implementation 'androidx.core:core:1.7.0' // Use the latest version
|
||||||
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||||
}
|
}
|
||||||
|
|
||||||
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="2"
|
android:versionCode="4"
|
||||||
android:versionName="1.0.1"
|
android:versionName="1.1.1"
|
||||||
android:installLocation="auto">
|
android:installLocation="auto">
|
||||||
|
|
||||||
<!-- OpenGL ES 3.0 -->
|
<!-- OpenGL ES 3.0 -->
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.dishii.mm;
|
||||||
|
|
||||||
|
public class ControllerButtons {
|
||||||
|
// Xbox Buttons
|
||||||
|
public static final int BUTTON_A = 0;
|
||||||
|
public static final int BUTTON_B = 1;
|
||||||
|
public static final int BUTTON_X = 2;
|
||||||
|
public static final int BUTTON_Y = 3;
|
||||||
|
public static final int BUTTON_LB = 9; // Left Bumper
|
||||||
|
public static final int BUTTON_RB = -5; // Right Bumper
|
||||||
|
public static final int BUTTON_BACK = 4;
|
||||||
|
public static final int BUTTON_START = 6;
|
||||||
|
public static final int BUTTON_DPAD_UP = 11;
|
||||||
|
public static final int BUTTON_DPAD_DOWN = 12;
|
||||||
|
public static final int BUTTON_DPAD_LEFT = 13;
|
||||||
|
public static final int BUTTON_DPAD_RIGHT = 14;
|
||||||
|
|
||||||
|
// Xbox Axis (Joysticks and Triggers)
|
||||||
|
public static final int AXIS_LX = 0; // Left stick X
|
||||||
|
public static final int AXIS_LY = 1; // Left stick Y
|
||||||
|
public static final int AXIS_RX = 2; // Right stick X
|
||||||
|
public static final int AXIS_RY = 3; // Right stick Y
|
||||||
|
public static final int AXIS_LT = -2; // Left Trigger (negative axis)
|
||||||
|
public static final int AXIS_RT = -4; // Right Trigger (negative axis)
|
||||||
|
}
|
||||||
|
|
||||||
@@ -20,15 +20,29 @@ import androidx.core.app.ActivityCompat;
|
|||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
//This class is the main SDLActivity and just sets up a bunch of default files
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.FrameLayout;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.MotionEvent;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
|
||||||
|
//This class is the main SDLActivity and just sets up a bunch of default files and the input overlay
|
||||||
public class MainActivity extends SDLActivity{
|
public class MainActivity extends SDLActivity{
|
||||||
|
|
||||||
private static final int STORAGE_PERMISSION_REQUEST_CODE = 1;
|
private static final int STORAGE_PERMISSION_REQUEST_CODE = 1;
|
||||||
|
|
||||||
|
SharedPreferences preferences;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
preferences = getSharedPreferences("com.dishii.mm.prefs",Context.MODE_PRIVATE);
|
||||||
|
|
||||||
|
setupControllerOverlay();
|
||||||
|
|
||||||
// Check if storage permissions are granted
|
// Check if storage permissions are granted
|
||||||
if (hasStoragePermission()) {
|
if (hasStoragePermission()) {
|
||||||
doVersionCheck();
|
doVersionCheck();
|
||||||
@@ -36,10 +50,10 @@ public class MainActivity extends SDLActivity{
|
|||||||
} else {
|
} else {
|
||||||
requestStoragePermission();
|
requestStoragePermission();
|
||||||
}
|
}
|
||||||
|
attachController();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doVersionCheck(){
|
private void doVersionCheck(){
|
||||||
SharedPreferences preferences = getSharedPreferences("com.dishii.mm.prefs",Context.MODE_PRIVATE);
|
|
||||||
int currentVersion = BuildConfig.VERSION_CODE; // Use your app's version code
|
int currentVersion = BuildConfig.VERSION_CODE; // Use your app's version code
|
||||||
int storedVersion = preferences.getInt("appVersion", 1);
|
int storedVersion = preferences.getInt("appVersion", 1);
|
||||||
|
|
||||||
@@ -184,4 +198,258 @@ public class MainActivity extends SDLActivity{
|
|||||||
return Environment.MEDIA_MOUNTED.equals(state);
|
return Environment.MEDIA_MOUNTED.equals(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public native void attachController();
|
||||||
|
// Native method for setting button state
|
||||||
|
public native void setButton(int button, boolean value);
|
||||||
|
public native void setCameraState(int axis, float value);
|
||||||
|
|
||||||
|
// Native method for setting joystick axis value
|
||||||
|
public native void setAxis(int axis, short value);
|
||||||
|
|
||||||
|
private Button button1, button2, button3, button4;
|
||||||
|
private Button buttonA, buttonB, buttonX, buttonY;
|
||||||
|
private Button buttonDpadUp, buttonDpadDown, buttonDpadLeft, buttonDpadRight;
|
||||||
|
private Button buttonLB, buttonRB, buttonZ, buttonStart, buttonBack;
|
||||||
|
private Button buttonToggle;
|
||||||
|
private FrameLayout leftJoystick;
|
||||||
|
private ImageView leftJoystickKnob;
|
||||||
|
private View overlayView;
|
||||||
|
|
||||||
|
// Function to set up the controller overlay (inflate layout and initialize buttons)
|
||||||
|
private void setupControllerOverlay() {
|
||||||
|
// Inflate the touchcontrol_overlay layout
|
||||||
|
LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
|
||||||
|
overlayView = inflater.inflate(R.layout.touchcontrol_overlay, null);
|
||||||
|
|
||||||
|
// Set layout params for overlayView to control positioning and sizing
|
||||||
|
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(
|
||||||
|
FrameLayout.LayoutParams.MATCH_PARENT,
|
||||||
|
FrameLayout.LayoutParams.MATCH_PARENT
|
||||||
|
);
|
||||||
|
overlayView.setLayoutParams(layoutParams);
|
||||||
|
// Add overlay view to the main layout (you may need to add it to a container like FrameLayout)
|
||||||
|
ViewGroup view = (ViewGroup) getContentView();
|
||||||
|
view.addView(overlayView);
|
||||||
|
|
||||||
|
final ViewGroup buttonGroup = overlayView.findViewById(R.id.button_group);
|
||||||
|
|
||||||
|
buttonA = overlayView.findViewById(R.id.buttonA);
|
||||||
|
buttonB = overlayView.findViewById(R.id.buttonB);
|
||||||
|
buttonX = overlayView.findViewById(R.id.buttonX);
|
||||||
|
buttonY = overlayView.findViewById(R.id.buttonY);
|
||||||
|
|
||||||
|
buttonDpadUp = overlayView.findViewById(R.id.buttonDpadUp);
|
||||||
|
buttonDpadDown = overlayView.findViewById(R.id.buttonDpadDown);
|
||||||
|
buttonDpadLeft = overlayView.findViewById(R.id.buttonDpadLeft);
|
||||||
|
buttonDpadRight = overlayView.findViewById(R.id.buttonDpadRight);
|
||||||
|
|
||||||
|
buttonLB = overlayView.findViewById(R.id.buttonLB);
|
||||||
|
buttonRB = overlayView.findViewById(R.id.buttonRB);
|
||||||
|
buttonZ = overlayView.findViewById(R.id.buttonZ);
|
||||||
|
|
||||||
|
buttonStart = overlayView.findViewById(R.id.buttonStart);
|
||||||
|
buttonBack = overlayView.findViewById(R.id.buttonBack);
|
||||||
|
|
||||||
|
buttonToggle = overlayView.findViewById(R.id.buttonToggle);
|
||||||
|
|
||||||
|
// Initialize joysticks and joystick knobs from the inflated layout
|
||||||
|
leftJoystick = overlayView.findViewById(R.id.left_joystick);
|
||||||
|
leftJoystickKnob = overlayView.findViewById(R.id.left_joystick_knob);
|
||||||
|
|
||||||
|
FrameLayout rightScreenArea = overlayView.findViewById(R.id.right_screen_area);
|
||||||
|
|
||||||
|
// Set OnTouchListeners for the Xbox controller buttons
|
||||||
|
addTouchListener(buttonA, ControllerButtons.BUTTON_A); // SDL Button 0 (A)
|
||||||
|
addTouchListener(buttonB, ControllerButtons.BUTTON_B); // SDL Button 1 (B)
|
||||||
|
addTouchListener(buttonX, ControllerButtons.BUTTON_X); // SDL Button 2 (X)
|
||||||
|
addTouchListener(buttonY, ControllerButtons.BUTTON_Y); // SDL Button 3 (Y)
|
||||||
|
|
||||||
|
addTouchListener(buttonDpadUp, ControllerButtons.BUTTON_DPAD_UP); // SDL Button 10 (D-Pad Up)
|
||||||
|
addTouchListener(buttonDpadDown, ControllerButtons.BUTTON_DPAD_DOWN); // SDL Button 11 (D-Pad Down)
|
||||||
|
addTouchListener(buttonDpadLeft, ControllerButtons.BUTTON_DPAD_LEFT); // SDL Button 12 (D-Pad Left)
|
||||||
|
addTouchListener(buttonDpadRight, ControllerButtons.BUTTON_DPAD_RIGHT); // SDL Button 13 (D-Pad Right)
|
||||||
|
|
||||||
|
addTouchListener(buttonLB, ControllerButtons.BUTTON_LB); // SDL Button 4 (LB)
|
||||||
|
addTouchListener(buttonRB, ControllerButtons.BUTTON_RB); // SDL Button 5 (RB)
|
||||||
|
addTouchListener(buttonZ, ControllerButtons.AXIS_RT); // SDL Button 5 (Z)
|
||||||
|
|
||||||
|
addTouchListener(buttonStart, ControllerButtons.BUTTON_START); // SDL Button 7 (Start)
|
||||||
|
addTouchListener(buttonBack, ControllerButtons.BUTTON_BACK); // SDL Button 6 (Back)
|
||||||
|
|
||||||
|
|
||||||
|
// Setup joystick movement
|
||||||
|
setupJoystick(leftJoystick, leftJoystickKnob, true); // Left joystick
|
||||||
|
|
||||||
|
setupLookAround(rightScreenArea);
|
||||||
|
|
||||||
|
setupToggleButton(buttonToggle,buttonGroup);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupToggleButton(Button button, ViewGroup uiGroup){
|
||||||
|
boolean isHidden = preferences.getBoolean("controlsVisible", false); // Default to 'false' (visible)
|
||||||
|
uiGroup.setVisibility(isHidden ? View.INVISIBLE : View.VISIBLE); // Set the initial visibility based on the saved state
|
||||||
|
button.setOnClickListener(new View.OnClickListener() {
|
||||||
|
boolean isHidden = false;
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (isHidden) {
|
||||||
|
uiGroup.setVisibility(View.VISIBLE); // Show UI elements
|
||||||
|
} else {
|
||||||
|
uiGroup.setVisibility(View.INVISIBLE); // Hide UI elements
|
||||||
|
}
|
||||||
|
preferences.edit().putBoolean("controlsVisible", !isHidden).apply();
|
||||||
|
isHidden = !isHidden; // Toggle state
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Function to set a touch listener for each button
|
||||||
|
private void addTouchListener(Button button, int buttonNum) {
|
||||||
|
button.setOnTouchListener(new View.OnTouchListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onTouch(View v, MotionEvent event) {
|
||||||
|
switch (event.getAction()) {
|
||||||
|
case MotionEvent.ACTION_DOWN:
|
||||||
|
setButton(buttonNum, true);
|
||||||
|
button.setPressed(true);
|
||||||
|
return true;
|
||||||
|
case MotionEvent.ACTION_UP:
|
||||||
|
setButton(buttonNum, false);
|
||||||
|
button.setPressed(false);
|
||||||
|
return true;
|
||||||
|
case MotionEvent.ACTION_CANCEL:
|
||||||
|
setButton(buttonNum, false);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean TouchAreaEnabled = true;
|
||||||
|
|
||||||
|
void DisableTouchArea(){
|
||||||
|
TouchAreaEnabled = false;
|
||||||
|
}
|
||||||
|
void EnableTouchArea(){
|
||||||
|
TouchAreaEnabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupLookAround(FrameLayout rightScreenArea) {
|
||||||
|
rightScreenArea.setOnTouchListener(new View.OnTouchListener() {
|
||||||
|
private float lastX = 0;
|
||||||
|
private float lastY = 0;
|
||||||
|
private boolean isTouching = false;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onTouch(View v, MotionEvent event) {
|
||||||
|
switch (event.getAction()) {
|
||||||
|
case MotionEvent.ACTION_DOWN:
|
||||||
|
// Start tracking the finger's position
|
||||||
|
lastX = event.getX();
|
||||||
|
lastY = event.getY();
|
||||||
|
isTouching = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MotionEvent.ACTION_MOVE:
|
||||||
|
if (isTouching) {
|
||||||
|
// Calculate the change in position (delta)
|
||||||
|
float deltaX = event.getX() - lastX;
|
||||||
|
float deltaY = event.getY() - lastY;
|
||||||
|
|
||||||
|
// Update the last position
|
||||||
|
lastX = event.getX();
|
||||||
|
lastY = event.getY();
|
||||||
|
|
||||||
|
// Increase sensitivity by using a larger multiplier
|
||||||
|
// Adjust these multipliers to suit your needs
|
||||||
|
float sensitivityMultiplier = 15; // Higher value for more sensitivity
|
||||||
|
float rx = (deltaX * sensitivityMultiplier);
|
||||||
|
float ry = (deltaY * sensitivityMultiplier);
|
||||||
|
|
||||||
|
// Send the mapped values to the joystick axes
|
||||||
|
setCameraState(0, rx); // Right stick X axis
|
||||||
|
setCameraState(1, ry); // Right stick Y axis
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MotionEvent.ACTION_UP:
|
||||||
|
case MotionEvent.ACTION_CANCEL:
|
||||||
|
// Stop tracking the finger's position and reset joystick input
|
||||||
|
isTouching = false;
|
||||||
|
setCameraState(0, 0.0f); // Reset right stick X axis
|
||||||
|
setCameraState(1, 0.0f); // Reset right stick Y axis
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return TouchAreaEnabled; // Event full handled
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Function to set joystick movement with reset to center when not touched
|
||||||
|
private void setupJoystick(FrameLayout joystickLayout, ImageView joystickKnob, boolean isLeft) {
|
||||||
|
joystickLayout.post(() -> {
|
||||||
|
// Calculate the joystick center once, before any events
|
||||||
|
final float joystickCenterX = joystickLayout.getWidth() / 2f;
|
||||||
|
final float joystickCenterY = joystickLayout.getHeight() / 2f;
|
||||||
|
|
||||||
|
joystickLayout.setOnTouchListener(new View.OnTouchListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onTouch(View v, MotionEvent event) {
|
||||||
|
switch (event.getAction()) {
|
||||||
|
case MotionEvent.ACTION_DOWN:
|
||||||
|
case MotionEvent.ACTION_MOVE:
|
||||||
|
// Calculate the joystick movement and move the knob
|
||||||
|
float deltaX = event.getX() - joystickCenterX;
|
||||||
|
float deltaY = event.getY() - joystickCenterY;
|
||||||
|
|
||||||
|
// Clamp the joystick movement to prevent it from going outside the area
|
||||||
|
float maxRadius = joystickLayout.getWidth() / 2f - joystickKnob.getWidth() / 2f;
|
||||||
|
float distance = (float) Math.sqrt(deltaX * deltaX + deltaY * deltaY);
|
||||||
|
if (distance > maxRadius) {
|
||||||
|
float scale = maxRadius / distance;
|
||||||
|
deltaX *= scale;
|
||||||
|
deltaY *= scale;
|
||||||
|
}
|
||||||
|
|
||||||
|
joystickKnob.setX(joystickCenterX + deltaX - joystickKnob.getWidth() / 2f);
|
||||||
|
joystickKnob.setY(joystickCenterY + deltaY - joystickKnob.getHeight() / 2f);
|
||||||
|
|
||||||
|
// Send joystick values to native C code
|
||||||
|
short x = (short) (deltaX / maxRadius * Short.MAX_VALUE);
|
||||||
|
short y = (short) (deltaY / maxRadius * Short.MAX_VALUE);
|
||||||
|
|
||||||
|
// Send X-axis and Y-axis values
|
||||||
|
setAxis(isLeft ? ControllerButtons.AXIS_LX : ControllerButtons.AXIS_RX, x); // X-axis
|
||||||
|
setAxis(isLeft ? ControllerButtons.AXIS_LY : ControllerButtons.AXIS_RY, y); // Y-axis
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MotionEvent.ACTION_UP:
|
||||||
|
case MotionEvent.ACTION_CANCEL:
|
||||||
|
// Reset joystick knob to the center position (ensure it's placed correctly)
|
||||||
|
joystickKnob.setX(joystickCenterX - joystickKnob.getWidth() / 2f);
|
||||||
|
joystickKnob.setY(joystickCenterY - joystickKnob.getHeight() / 2f);
|
||||||
|
|
||||||
|
// Reset joystick values to 0 when released or canceled
|
||||||
|
setAxis(isLeft ? ControllerButtons.AXIS_LX : ControllerButtons.AXIS_RX, (short) 0); // X-axis
|
||||||
|
setAxis(isLeft ? ControllerButtons.AXIS_LY : ControllerButtons.AXIS_RY, (short) 0); // Y-axis
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- Pressed state -->
|
||||||
|
<item android:state_pressed="true">
|
||||||
|
<shape android:shape="oval">
|
||||||
|
<solid android:color="#10FFFFFF" /> <!-- Darker color when pressed -->
|
||||||
|
<stroke
|
||||||
|
android:width="2.5dp"
|
||||||
|
android:color="#20FFFFFF" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<!-- Default state -->
|
||||||
|
<item>
|
||||||
|
<shape android:shape="oval">
|
||||||
|
<solid android:color="#20FFFFFF" />
|
||||||
|
<stroke
|
||||||
|
android:width="2.5dp"
|
||||||
|
android:color="#25FFFFFF" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<vector android:alpha="1.0" android:height="221.78dp"
|
||||||
|
android:viewportHeight="221.78" android:viewportWidth="221.78"
|
||||||
|
android:width="221.78dp"
|
||||||
|
xmlns:aapt="http://schemas.android.com/aapt" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillAlpha="1.0"
|
||||||
|
android:fillColor="#20FFFFFF"
|
||||||
|
android:pathData="M221.78,87.07v47.64a11.53,11.53 0,0 1,-11.5 11.5H151.62a5.42,5.42 0,0 0,-5.41 5.41v58.66a11.53,11.53 0,0 1,-11.5 11.5H87.07a11.53,11.53 0,0 1,-11.5 -11.5V151.61a5.41,5.41 0,0 0,-5.41 -5.41H11.5A11.53,11.53 0,0 1,0 134.7V87.05a11.53,11.53 0,0 1,11.5 -11.5H70.16a5.41,5.41 0,0 0,5.41 -5.41V11.5A11.53,11.53 0,0 1,87.07 0h47.64a11.53,11.53 0,0 1,11.5 11.5V70.16a5.41,5.41 0,0 0,5.41 5.41h58.66A11.53,11.53 0,0 1,221.78 87.07Z"
|
||||||
|
android:strokeWidth="2.5"
|
||||||
|
android:strokeColor="#25FFFFFF"
|
||||||
|
android:strokeAlpha="1.0" />
|
||||||
|
<path android:fillColor="#25FFFFFF" android:fillAlpha="1.0"
|
||||||
|
android:pathData="M195.47,110.32l-16.26,-9.38a0.65,0.65 0,0 0,-1 0.56v18.78a0.66,0.66 0,0 0,1 0.57l16.26,-9.39A0.66,0.66 0,0 0,195.47 110.32Z" />
|
||||||
|
<path android:fillColor="#25FFFFFF" android:fillAlpha="1.0"
|
||||||
|
android:pathData="M26.31,110.32l16.26,-9.38a0.65,0.65 0,0 1,1 0.56v18.78a0.66,0.66 0,0 1,-1 0.57l-16.26,-9.39A0.66,0.66 0,0 1,26.31 110.32Z" />
|
||||||
|
<path android:fillColor="#25FFFFFF" android:fillAlpha="1.0"
|
||||||
|
android:pathData="M110.32,26.31l-9.38,16.26a0.65,0.65 0,0 0,0.56 1h18.78a0.66,0.66 0,0 0,0.57 -1l-9.39,-16.26A0.66,0.66 0,0 0,110.32 26.31Z" />
|
||||||
|
<path android:fillColor="#25FFFFFF" android:fillAlpha="1.0"
|
||||||
|
android:pathData="M110.32,195.47l-9.38,-16.26a0.65,0.65 0,0 1,0.56 -1h18.78a0.66,0.66 0,0 1,0.57 1l-9.39,16.26A0.66,0.66 0,0 1,110.32 195.47Z" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- Pressed state -->
|
||||||
|
<item android:state_pressed="true">
|
||||||
|
<layer-list>
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#10FFFFFF" /> <!-- Darker color when pressed -->
|
||||||
|
<stroke
|
||||||
|
android:width="2dp"
|
||||||
|
android:color="#25FFFFFF" />
|
||||||
|
<size
|
||||||
|
android:width="25dp"
|
||||||
|
android:height="25dp" />
|
||||||
|
<corners android:radius="10dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<!-- Default state -->
|
||||||
|
<item>
|
||||||
|
<layer-list>
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#20FFFFFF" /> <!-- Default color -->
|
||||||
|
<stroke
|
||||||
|
android:width="2dp"
|
||||||
|
android:color="#25FFFFFF" />
|
||||||
|
<size
|
||||||
|
android:width="25dp"
|
||||||
|
android:height="25dp" />
|
||||||
|
<corners android:radius="10dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
||||||
|
</item>
|
||||||
|
</selector>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="#20FFFFFF"
|
||||||
|
android:pathData="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item>
|
||||||
|
<shape android:shape="oval">
|
||||||
|
<solid android:color="#10FFFFFF" />
|
||||||
|
<stroke
|
||||||
|
android:width="2dp"
|
||||||
|
android:color="#25FFFFFF" />
|
||||||
|
<size
|
||||||
|
android:width="25dp"
|
||||||
|
android:height="25dp" />
|
||||||
|
<padding
|
||||||
|
android:bottom="10dp"
|
||||||
|
android:left="10dp"
|
||||||
|
android:right="10dp"
|
||||||
|
android:top="10dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<shape android:shape="oval">
|
||||||
|
<solid android:color="#30000000" />
|
||||||
|
<size
|
||||||
|
android:width="30dp"
|
||||||
|
android:height="30dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- Pressed state -->
|
||||||
|
<item android:state_pressed="true">
|
||||||
|
<layer-list>
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#10FFFFFF" /> <!-- Darker color when pressed -->
|
||||||
|
<stroke
|
||||||
|
android:width="2dp"
|
||||||
|
android:color="#25FFFFFF" />
|
||||||
|
<size
|
||||||
|
android:width="25dp"
|
||||||
|
android:height="25dp" />
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="10dp"
|
||||||
|
android:bottomRightRadius="10dp"
|
||||||
|
android:topLeftRadius="50dp"
|
||||||
|
android:topRightRadius="10dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<!-- Default state -->
|
||||||
|
<item>
|
||||||
|
<layer-list>
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#20FFFFFF" /> <!-- Default color -->
|
||||||
|
<stroke
|
||||||
|
android:width="2dp"
|
||||||
|
android:color="#25FFFFFF" />
|
||||||
|
<size
|
||||||
|
android:width="25dp"
|
||||||
|
android:height="25dp" />
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="10dp"
|
||||||
|
android:bottomRightRadius="10dp"
|
||||||
|
android:topLeftRadius="50dp"
|
||||||
|
android:topRightRadius="10dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
||||||
|
</item>
|
||||||
|
</selector>
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- Pressed state -->
|
||||||
|
<item android:state_pressed="true">
|
||||||
|
<layer-list>
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#10FFFFFF" /> <!-- Darker color when pressed -->
|
||||||
|
<stroke
|
||||||
|
android:width="2dp"
|
||||||
|
android:color="#25FFFFFF" />
|
||||||
|
<size
|
||||||
|
android:width="25dp"
|
||||||
|
android:height="25dp" />
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="10dp"
|
||||||
|
android:bottomRightRadius="10dp"
|
||||||
|
android:topLeftRadius="10dp"
|
||||||
|
android:topRightRadius="50dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<!-- Default state -->
|
||||||
|
<item>
|
||||||
|
<layer-list>
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#20FFFFFF" /> <!-- Default color -->
|
||||||
|
<stroke
|
||||||
|
android:width="2dp"
|
||||||
|
android:color="#25FFFFFF" />
|
||||||
|
<size
|
||||||
|
android:width="25dp"
|
||||||
|
android:height="25dp" />
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="10dp"
|
||||||
|
android:bottomRightRadius="10dp"
|
||||||
|
android:topLeftRadius="10dp"
|
||||||
|
android:topRightRadius="50dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
||||||
|
</item>
|
||||||
|
</selector>
|
||||||
@@ -0,0 +1,213 @@
|
|||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@android:color/transparent">
|
||||||
|
|
||||||
|
<!-- New Grouping Layout -->
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/button_group"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<!-- Left Joystick -->
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/left_joystick"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="150dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:background="@drawable/ic_stick"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
android:clipToPadding="false">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/left_joystick_knob"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:background="@drawable/ic_button" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/right_screen_area"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/left_joystick"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/imageView"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:src="@drawable/ic_cross"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/buttonDpadDown"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/buttonDpadRight"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/buttonDpadLeft"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/buttonDpadUp" />
|
||||||
|
|
||||||
|
<!-- D-Pad -->
|
||||||
|
<Button
|
||||||
|
android:id="@+id/buttonDpadUp"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/buttonDpadRight"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/buttonDpadRight"
|
||||||
|
android:background="@android:color/transparent"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/buttonDpadDown"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/buttonDpadLeft"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/buttonDpadLeft"
|
||||||
|
android:background="@android:color/transparent" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/buttonDpadLeft"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginEnd="60dp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/left_joystick"
|
||||||
|
app:layout_constraintEnd_toEndOf="@id/left_joystick"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/left_joystick"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/buttonLB"
|
||||||
|
android:background="@android:color/transparent"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/buttonDpadRight"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/buttonDpadDown"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/buttonDpadDown"
|
||||||
|
android:background="@android:color/transparent"/>
|
||||||
|
|
||||||
|
<!-- Action Buttons (A, B, X, Y) -->
|
||||||
|
<Button
|
||||||
|
android:id="@+id/buttonB"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:background="@drawable/ic_button"
|
||||||
|
android:text="B"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/buttonA"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/buttonA"
|
||||||
|
android:textColor="#25FFFFFF"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/buttonA"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_marginEnd="30dp"
|
||||||
|
android:background="@drawable/ic_button"
|
||||||
|
android:text="A"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/buttonZ"
|
||||||
|
android:textColor="#25FFFFFF"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/buttonY"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:background="@drawable/ic_button"
|
||||||
|
android:text="Y"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/buttonB"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/buttonB"
|
||||||
|
android:textColor="#25FFFFFF"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/buttonX"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:background="@drawable/ic_button"
|
||||||
|
android:text="X"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/buttonA"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/buttonA"
|
||||||
|
android:textColor="#25FFFFFF"/>
|
||||||
|
|
||||||
|
<!-- Shoulder Buttons -->
|
||||||
|
<Button
|
||||||
|
android:id="@+id/buttonLB"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:background="@drawable/ic_trigger_button_left"
|
||||||
|
android:text="LB"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:textColor="#25FFFFFF"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/buttonRB"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:background="@drawable/ic_trigger_button_right"
|
||||||
|
android:text="RB"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:textColor="#25FFFFFF"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/buttonZ"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:background="@drawable/ic_trigger_button_right"
|
||||||
|
android:text="Z"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/buttonRB"
|
||||||
|
android:textColor="#25FFFFFF"/>
|
||||||
|
|
||||||
|
<!-- Start and Back Buttons -->
|
||||||
|
<Button
|
||||||
|
android:id="@+id/buttonBack"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginEnd="100dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:background="@drawable/ic_rectangular_button"
|
||||||
|
android:text="Back"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
android:textColor="#25FFFFFF"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/buttonStart"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginStart="100dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:background="@drawable/ic_rectangular_button"
|
||||||
|
android:text="Start"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
android:textColor="#25FFFFFF"/>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<!-- Toggle Button -->
|
||||||
|
<Button
|
||||||
|
android:id="@+id/buttonToggle"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:background="@drawable/ic_show"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
+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")
|
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/2ship-cvars.cmake)
|
||||||
include(CMake/lus-cvars.cmake)
|
include(CMake/lus-cvars.cmake)
|
||||||
set(PROJECT_BUILD_NAME "Rika Bravo" 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)
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ endif()
|
|||||||
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)
|
# 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.
|
# Set target arch type if empty. Visual studio solution generator provides it.
|
||||||
|
|||||||
+1
-1
Submodule OTRExporter updated: e8f93ff692...1cbb1b65dd
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user