mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 07:21:14 +01:00
Merge pull request #8907 from JosJuice/android-overlay-stick-gate
Android: Use octagonal stick gate in overlay
This commit is contained in:
commit
87287181dd
@ -14,14 +14,10 @@ Main Stick/Up = `Axis 11`
|
||||
Main Stick/Down = `Axis 12`
|
||||
Main Stick/Left = `Axis 13`
|
||||
Main Stick/Right = `Axis 14`
|
||||
Main Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Main Stick/Center = 0,00 0,00
|
||||
C-Stick/Up = `Axis 16`
|
||||
C-Stick/Down = `Axis 17`
|
||||
C-Stick/Left = `Axis 18`
|
||||
C-Stick/Right = `Axis 19`
|
||||
C-Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
C-Stick/Center = 0,00 0,00
|
||||
Triggers/L = `Axis 20`
|
||||
Triggers/R = `Axis 21`
|
||||
Triggers/L-Analog = `Axis 20`
|
||||
@ -44,14 +40,10 @@ Main Stick/Up = `Axis 11`
|
||||
Main Stick/Down = `Axis 12`
|
||||
Main Stick/Left = `Axis 13`
|
||||
Main Stick/Right = `Axis 14`
|
||||
Main Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Main Stick/Center = 0,00 0,00
|
||||
C-Stick/Up = `Axis 16`
|
||||
C-Stick/Down = `Axis 17`
|
||||
C-Stick/Left = `Axis 18`
|
||||
C-Stick/Right = `Axis 19`
|
||||
C-Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
C-Stick/Center = 0,00 0,00
|
||||
Triggers/L = `Axis 20`
|
||||
Triggers/R = `Axis 21`
|
||||
Triggers/L-Analog = `Axis 20`
|
||||
@ -74,14 +66,10 @@ Main Stick/Up = `Axis 11`
|
||||
Main Stick/Down = `Axis 12`
|
||||
Main Stick/Left = `Axis 13`
|
||||
Main Stick/Right = `Axis 14`
|
||||
Main Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Main Stick/Center = 0,00 0,00
|
||||
C-Stick/Up = `Axis 16`
|
||||
C-Stick/Down = `Axis 17`
|
||||
C-Stick/Left = `Axis 18`
|
||||
C-Stick/Right = `Axis 19`
|
||||
C-Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
C-Stick/Center = 0,00 0,00
|
||||
Triggers/L = `Axis 20`
|
||||
Triggers/R = `Axis 21`
|
||||
Triggers/L-Analog = `Axis 20`
|
||||
@ -104,14 +92,10 @@ Main Stick/Up = `Axis 11`
|
||||
Main Stick/Down = `Axis 12`
|
||||
Main Stick/Left = `Axis 13`
|
||||
Main Stick/Right = `Axis 14`
|
||||
Main Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Main Stick/Center = 0,00 0,00
|
||||
C-Stick/Up = `Axis 16`
|
||||
C-Stick/Down = `Axis 17`
|
||||
C-Stick/Left = `Axis 18`
|
||||
C-Stick/Right = `Axis 19`
|
||||
C-Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
C-Stick/Center = 0,00 0,00
|
||||
Triggers/L = `Axis 20`
|
||||
Triggers/R = `Axis 21`
|
||||
Triggers/L-Analog = `Axis 20`
|
||||
|
@ -43,8 +43,6 @@ Nunchuk/Stick/Up = `Axis 203`
|
||||
Nunchuk/Stick/Down = `Axis 204`
|
||||
Nunchuk/Stick/Left = `Axis 205`
|
||||
Nunchuk/Stick/Right = `Axis 206`
|
||||
Nunchuk/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Nunchuk/Stick/Center = 0,00 0,00
|
||||
Nunchuk/Swing/Up = `Axis 208`
|
||||
Nunchuk/Swing/Down = `Axis 209`
|
||||
Nunchuk/Swing/Left = `Axis 210`
|
||||
@ -77,14 +75,10 @@ Classic/Left Stick/Up = `Axis 314`
|
||||
Classic/Left Stick/Down = `Axis 315`
|
||||
Classic/Left Stick/Left = `Axis 316`
|
||||
Classic/Left Stick/Right = `Axis 317`
|
||||
Classic/Left Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Classic/Left Stick/Center = 0,00 0,00
|
||||
Classic/Right Stick/Up = `Axis 319`
|
||||
Classic/Right Stick/Down = `Axis 320`
|
||||
Classic/Right Stick/Left = `Axis 321`
|
||||
Classic/Right Stick/Right = `Axis 322`
|
||||
Classic/Right Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Classic/Right Stick/Center = 0,00 0,00
|
||||
Classic/Triggers/L = `Axis 323`
|
||||
Classic/Triggers/R = `Axis 324`
|
||||
Classic/Triggers/Threshold = 90,000000
|
||||
@ -101,8 +95,6 @@ Guitar/Stick/Up = `Axis 410`
|
||||
Guitar/Stick/Down = `Axis 411`
|
||||
Guitar/Stick/Left = `Axis 412`
|
||||
Guitar/Stick/Right = `Axis 413`
|
||||
Guitar/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Guitar/Stick/Center = 0,00 0,00
|
||||
Guitar/Whammy/Bar = `Axis 414`
|
||||
Drums/Buttons/- = `Button 500`
|
||||
Drums/Buttons/+ = `Button 501`
|
||||
@ -116,8 +108,6 @@ Drums/Stick/Up = `Axis 509`
|
||||
Drums/Stick/Down = `Axis 510`
|
||||
Drums/Stick/Left = `Axis 511`
|
||||
Drums/Stick/Right = `Axis 512`
|
||||
Drums/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Drums/Stick/Center = 0,00 0,00
|
||||
Turntable/Buttons/Green Left = `Button 600`
|
||||
Turntable/Buttons/Red Left = `Button 601`
|
||||
Turntable/Buttons/Blue Left = `Button 602`
|
||||
@ -136,8 +126,6 @@ Turntable/Stick/Up = `Axis 617`
|
||||
Turntable/Stick/Down = `Axis 618`
|
||||
Turntable/Stick/Left = `Axis 619`
|
||||
Turntable/Stick/Right = `Axis 620`
|
||||
Turntable/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Turntable/Stick/Center = 0,00 0,00
|
||||
Turntable/Effect/Dial = `Axis 621`
|
||||
Turntable/Crossfade/Left = `Axis 623`
|
||||
Turntable/Crossfade/Right = `Axis 624`
|
||||
@ -200,8 +188,6 @@ Nunchuk/Stick/Up = `Axis 203`
|
||||
Nunchuk/Stick/Down = `Axis 204`
|
||||
Nunchuk/Stick/Left = `Axis 205`
|
||||
Nunchuk/Stick/Right = `Axis 206`
|
||||
Nunchuk/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Nunchuk/Stick/Center = 0,00 0,00
|
||||
Nunchuk/Swing/Up = `Axis 208`
|
||||
Nunchuk/Swing/Down = `Axis 209`
|
||||
Nunchuk/Swing/Left = `Axis 210`
|
||||
@ -234,14 +220,10 @@ Classic/Left Stick/Up = `Axis 314`
|
||||
Classic/Left Stick/Down = `Axis 315`
|
||||
Classic/Left Stick/Left = `Axis 316`
|
||||
Classic/Left Stick/Right = `Axis 317`
|
||||
Classic/Left Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Classic/Left Stick/Center = 0,00 0,00
|
||||
Classic/Right Stick/Up = `Axis 319`
|
||||
Classic/Right Stick/Down = `Axis 320`
|
||||
Classic/Right Stick/Left = `Axis 321`
|
||||
Classic/Right Stick/Right = `Axis 322`
|
||||
Classic/Right Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Classic/Right Stick/Center = 0,00 0,00
|
||||
Classic/Triggers/L = `Axis 323`
|
||||
Classic/Triggers/R = `Axis 324`
|
||||
Classic/Triggers/Threshold = 90,000000
|
||||
@ -258,8 +240,6 @@ Guitar/Stick/Up = `Axis 410`
|
||||
Guitar/Stick/Down = `Axis 411`
|
||||
Guitar/Stick/Left = `Axis 412`
|
||||
Guitar/Stick/Right = `Axis 413`
|
||||
Guitar/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Guitar/Stick/Center = 0,00 0,00
|
||||
Guitar/Whammy/Bar = `Axis 414`
|
||||
Drums/Buttons/- = `Button 500`
|
||||
Drums/Buttons/+ = `Button 501`
|
||||
@ -273,8 +253,6 @@ Drums/Stick/Up = `Axis 509`
|
||||
Drums/Stick/Down = `Axis 510`
|
||||
Drums/Stick/Left = `Axis 511`
|
||||
Drums/Stick/Right = `Axis 512`
|
||||
Drums/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Drums/Stick/Center = 0,00 0,00
|
||||
Turntable/Buttons/Green Left = `Button 600`
|
||||
Turntable/Buttons/Red Left = `Button 601`
|
||||
Turntable/Buttons/Blue Left = `Button 602`
|
||||
@ -293,8 +271,6 @@ Turntable/Stick/Up = `Axis 617`
|
||||
Turntable/Stick/Down = `Axis 618`
|
||||
Turntable/Stick/Left = `Axis 619`
|
||||
Turntable/Stick/Right = `Axis 620`
|
||||
Turntable/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Turntable/Stick/Center = 0,00 0,00
|
||||
Turntable/Effect/Dial = `Axis 621`
|
||||
Turntable/Crossfade/Left = `Axis 623`
|
||||
Turntable/Crossfade/Right = `Axis 624`
|
||||
@ -357,8 +333,6 @@ Nunchuk/Stick/Up = `Axis 203`
|
||||
Nunchuk/Stick/Down = `Axis 204`
|
||||
Nunchuk/Stick/Left = `Axis 205`
|
||||
Nunchuk/Stick/Right = `Axis 206`
|
||||
Nunchuk/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Nunchuk/Stick/Center = 0,00 0,00
|
||||
Nunchuk/Swing/Up = `Axis 208`
|
||||
Nunchuk/Swing/Down = `Axis 209`
|
||||
Nunchuk/Swing/Left = `Axis 210`
|
||||
@ -391,14 +365,10 @@ Classic/Left Stick/Up = `Axis 314`
|
||||
Classic/Left Stick/Down = `Axis 315`
|
||||
Classic/Left Stick/Left = `Axis 316`
|
||||
Classic/Left Stick/Right = `Axis 317`
|
||||
Classic/Left Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Classic/Left Stick/Center = 0,00 0,00
|
||||
Classic/Right Stick/Up = `Axis 319`
|
||||
Classic/Right Stick/Down = `Axis 320`
|
||||
Classic/Right Stick/Left = `Axis 321`
|
||||
Classic/Right Stick/Right = `Axis 322`
|
||||
Classic/Right Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Classic/Right Stick/Center = 0,00 0,00
|
||||
Classic/Triggers/L = `Axis 323`
|
||||
Classic/Triggers/R = `Axis 324`
|
||||
Classic/Triggers/Threshold = 90,000000
|
||||
@ -415,8 +385,6 @@ Guitar/Stick/Up = `Axis 410`
|
||||
Guitar/Stick/Down = `Axis 411`
|
||||
Guitar/Stick/Left = `Axis 412`
|
||||
Guitar/Stick/Right = `Axis 413`
|
||||
Guitar/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Guitar/Stick/Center = 0,00 0,00
|
||||
Guitar/Whammy/Bar = `Axis 414`
|
||||
Drums/Buttons/- = `Button 500`
|
||||
Drums/Buttons/+ = `Button 501`
|
||||
@ -430,8 +398,6 @@ Drums/Stick/Up = `Axis 509`
|
||||
Drums/Stick/Down = `Axis 510`
|
||||
Drums/Stick/Left = `Axis 511`
|
||||
Drums/Stick/Right = `Axis 512`
|
||||
Drums/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Drums/Stick/Center = 0,00 0,00
|
||||
Turntable/Buttons/Green Left = `Button 600`
|
||||
Turntable/Buttons/Red Left = `Button 601`
|
||||
Turntable/Buttons/Blue Left = `Button 602`
|
||||
@ -450,8 +416,6 @@ Turntable/Stick/Up = `Axis 617`
|
||||
Turntable/Stick/Down = `Axis 618`
|
||||
Turntable/Stick/Left = `Axis 619`
|
||||
Turntable/Stick/Right = `Axis 620`
|
||||
Turntable/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Turntable/Stick/Center = 0,00 0,00
|
||||
Turntable/Effect/Dial = `Axis 621`
|
||||
Turntable/Crossfade/Left = `Axis 623`
|
||||
Turntable/Crossfade/Right = `Axis 624`
|
||||
@ -514,8 +478,6 @@ Nunchuk/Stick/Up = `Axis 203`
|
||||
Nunchuk/Stick/Down = `Axis 204`
|
||||
Nunchuk/Stick/Left = `Axis 205`
|
||||
Nunchuk/Stick/Right = `Axis 206`
|
||||
Nunchuk/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Nunchuk/Stick/Center = 0,00 0,00
|
||||
Nunchuk/Swing/Up = `Axis 208`
|
||||
Nunchuk/Swing/Down = `Axis 209`
|
||||
Nunchuk/Swing/Left = `Axis 210`
|
||||
@ -548,14 +510,10 @@ Classic/Left Stick/Up = `Axis 314`
|
||||
Classic/Left Stick/Down = `Axis 315`
|
||||
Classic/Left Stick/Left = `Axis 316`
|
||||
Classic/Left Stick/Right = `Axis 317`
|
||||
Classic/Left Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Classic/Left Stick/Center = 0,00 0,00
|
||||
Classic/Right Stick/Up = `Axis 319`
|
||||
Classic/Right Stick/Down = `Axis 320`
|
||||
Classic/Right Stick/Left = `Axis 321`
|
||||
Classic/Right Stick/Right = `Axis 322`
|
||||
Classic/Right Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Classic/Right Stick/Center = 0,00 0,00
|
||||
Classic/Triggers/L = `Axis 323`
|
||||
Classic/Triggers/R = `Axis 324`
|
||||
Classic/Triggers/Threshold = 90,000000
|
||||
@ -572,8 +530,6 @@ Guitar/Stick/Up = `Axis 410`
|
||||
Guitar/Stick/Down = `Axis 411`
|
||||
Guitar/Stick/Left = `Axis 412`
|
||||
Guitar/Stick/Right = `Axis 413`
|
||||
Guitar/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Guitar/Stick/Center = 0,00 0,00
|
||||
Guitar/Whammy/Bar = `Axis 414`
|
||||
Drums/Buttons/- = `Button 500`
|
||||
Drums/Buttons/+ = `Button 501`
|
||||
@ -587,8 +543,6 @@ Drums/Stick/Up = `Axis 509`
|
||||
Drums/Stick/Down = `Axis 510`
|
||||
Drums/Stick/Left = `Axis 511`
|
||||
Drums/Stick/Right = `Axis 512`
|
||||
Drums/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Drums/Stick/Center = 0,00 0,00
|
||||
Turntable/Buttons/Green Left = `Button 600`
|
||||
Turntable/Buttons/Red Left = `Button 601`
|
||||
Turntable/Buttons/Blue Left = `Button 602`
|
||||
@ -607,8 +561,6 @@ Turntable/Stick/Up = `Axis 617`
|
||||
Turntable/Stick/Down = `Axis 618`
|
||||
Turntable/Stick/Left = `Axis 619`
|
||||
Turntable/Stick/Right = `Axis 620`
|
||||
Turntable/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Turntable/Stick/Center = 0,00 0,00
|
||||
Turntable/Effect/Dial = `Axis 621`
|
||||
Turntable/Crossfade/Left = `Axis 623`
|
||||
Turntable/Crossfade/Right = `Axis 624`
|
||||
|
@ -43,8 +43,6 @@ Nunchuk/Stick/Up = `Axis 203`
|
||||
Nunchuk/Stick/Down = `Axis 204`
|
||||
Nunchuk/Stick/Left = `Axis 205`
|
||||
Nunchuk/Stick/Right = `Axis 206`
|
||||
Nunchuk/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Nunchuk/Stick/Center = 0,00 0,00
|
||||
Nunchuk/Swing/Up = `Axis 208`
|
||||
Nunchuk/Swing/Down = `Axis 209`
|
||||
Nunchuk/Swing/Left = `Axis 210`
|
||||
@ -77,14 +75,10 @@ Classic/Left Stick/Up = `Axis 314`
|
||||
Classic/Left Stick/Down = `Axis 315`
|
||||
Classic/Left Stick/Left = `Axis 316`
|
||||
Classic/Left Stick/Right = `Axis 317`
|
||||
Classic/Left Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Classic/Left Stick/Center = 0,00 0,00
|
||||
Classic/Right Stick/Up = `Axis 319`
|
||||
Classic/Right Stick/Down = `Axis 320`
|
||||
Classic/Right Stick/Left = `Axis 321`
|
||||
Classic/Right Stick/Right = `Axis 322`
|
||||
Classic/Right Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Classic/Right Stick/Center = 0,00 0,00
|
||||
Classic/Triggers/L = `Axis 323`
|
||||
Classic/Triggers/R = `Axis 324`
|
||||
Classic/Triggers/Threshold = 90,000000
|
||||
@ -101,8 +95,6 @@ Guitar/Stick/Up = `Axis 410`
|
||||
Guitar/Stick/Down = `Axis 411`
|
||||
Guitar/Stick/Left = `Axis 412`
|
||||
Guitar/Stick/Right = `Axis 413`
|
||||
Guitar/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Guitar/Stick/Center = 0,00 0,00
|
||||
Guitar/Whammy/Bar = `Axis 414`
|
||||
Drums/Buttons/- = `Button 500`
|
||||
Drums/Buttons/+ = `Button 501`
|
||||
@ -116,8 +108,6 @@ Drums/Stick/Up = `Axis 509`
|
||||
Drums/Stick/Down = `Axis 510`
|
||||
Drums/Stick/Left = `Axis 511`
|
||||
Drums/Stick/Right = `Axis 512`
|
||||
Drums/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Drums/Stick/Center = 0,00 0,00
|
||||
Turntable/Buttons/Green Left = `Button 600`
|
||||
Turntable/Buttons/Red Left = `Button 601`
|
||||
Turntable/Buttons/Blue Left = `Button 602`
|
||||
@ -136,8 +126,6 @@ Turntable/Stick/Up = `Axis 617`
|
||||
Turntable/Stick/Down = `Axis 618`
|
||||
Turntable/Stick/Left = `Axis 619`
|
||||
Turntable/Stick/Right = `Axis 620`
|
||||
Turntable/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
|
||||
Turntable/Stick/Center = 0,00 0,00
|
||||
Turntable/Effect/Dial = `Axis 621`
|
||||
Turntable/Crossfade/Left = `Axis 623`
|
||||
Turntable/Crossfade/Right = `Axis 624`
|
||||
|
@ -269,6 +269,9 @@ public final class NativeLibrary
|
||||
public static native void SetMotionSensorsEnabled(boolean accelerometerEnabled,
|
||||
boolean gyroscopeEnabled);
|
||||
|
||||
// Angle is in radians and should be non-negative
|
||||
public static native double GetInputRadiusAtAngle(int emu_pad_id, int stick, double angle);
|
||||
|
||||
public static native void NewGameIniFile();
|
||||
|
||||
public static native void LoadGameIniFile(String gameId);
|
||||
|
@ -14,6 +14,8 @@ import android.graphics.Rect;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import org.dolphinemu.dolphinemu.NativeLibrary;
|
||||
|
||||
/**
|
||||
* Custom {@link BitmapDrawable} that is capable
|
||||
* of storing it's own ID.
|
||||
@ -214,21 +216,27 @@ public final class InputOverlayDrawableJoystick
|
||||
|
||||
private void SetInnerBounds()
|
||||
{
|
||||
int X = getVirtBounds().centerX() + (int) ((axises[1]) * (getVirtBounds().width() / 2));
|
||||
int Y = getVirtBounds().centerY() + (int) ((axises[0]) * (getVirtBounds().height() / 2));
|
||||
double y = axises[0];
|
||||
double x = axises[1];
|
||||
|
||||
if (X > getVirtBounds().centerX() + (getVirtBounds().width() / 2))
|
||||
X = getVirtBounds().centerX() + (getVirtBounds().width() / 2);
|
||||
if (X < getVirtBounds().centerX() - (getVirtBounds().width() / 2))
|
||||
X = getVirtBounds().centerX() - (getVirtBounds().width() / 2);
|
||||
if (Y > getVirtBounds().centerY() + (getVirtBounds().height() / 2))
|
||||
Y = getVirtBounds().centerY() + (getVirtBounds().height() / 2);
|
||||
if (Y < getVirtBounds().centerY() - (getVirtBounds().height() / 2))
|
||||
Y = getVirtBounds().centerY() - (getVirtBounds().height() / 2);
|
||||
double angle = Math.atan2(y, x) + Math.PI + Math.PI;
|
||||
double radius = Math.hypot(y, x);
|
||||
double maxRadius = NativeLibrary.GetInputRadiusAtAngle(0, mJoystickType, angle);
|
||||
if (radius > maxRadius)
|
||||
{
|
||||
y = maxRadius * Math.sin(angle);
|
||||
x = maxRadius * Math.cos(angle);
|
||||
axises[0] = (float) y;
|
||||
axises[1] = (float) x;
|
||||
}
|
||||
|
||||
int pixelX = getVirtBounds().centerX() + (int) (x * (getVirtBounds().width() / 2));
|
||||
int pixelY = getVirtBounds().centerY() + (int) (y * (getVirtBounds().height() / 2));
|
||||
|
||||
int width = mPressedStateInnerBitmap.getBounds().width() / 2;
|
||||
int height = mPressedStateInnerBitmap.getBounds().height() / 2;
|
||||
mDefaultStateInnerBitmap.setBounds(X - width, Y - height, X + width, Y + height);
|
||||
mDefaultStateInnerBitmap.setBounds(pixelX - width, pixelY - height, pixelX + width,
|
||||
pixelY + height);
|
||||
mPressedStateInnerBitmap.setBounds(mDefaultStateInnerBitmap.getBounds());
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ public final class DirectoryInitialization
|
||||
"org.dolphinemu.dolphinemu.DIRECTORY_INITIALIZATION";
|
||||
|
||||
public static final String EXTRA_STATE = "directoryState";
|
||||
private static final int WiimoteNewVersion = 4; // Last changed in PR 8503
|
||||
private static final int WiimoteNewVersion = 5; // Last changed in PR 8907
|
||||
private static volatile DirectoryInitializationState directoryState = null;
|
||||
private static String userPath;
|
||||
private static String internalPath;
|
||||
|
@ -201,6 +201,8 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_onGamePadMov
|
||||
JNIEnv* env, jobject obj, jstring jDevice, jint Axis, jfloat Value);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetMotionSensorsEnabled(
|
||||
JNIEnv* env, jobject obj, jboolean accelerometer_enabled, jboolean gyroscope_enabled);
|
||||
JNIEXPORT double JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetInputRadiusAtAngle(
|
||||
JNIEnv* env, jobject obj, int emu_pad_id, int stick, double angle);
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_org_dolphinemu_dolphinemu_NativeLibrary_GetVersionString(JNIEnv* env, jobject obj);
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetGitRevision(JNIEnv* env,
|
||||
@ -315,6 +317,13 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetMotionSen
|
||||
ciface::Android::SetMotionSensorsEnabled(accelerometer_enabled, gyroscope_enabled);
|
||||
}
|
||||
|
||||
JNIEXPORT double JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetInputRadiusAtAngle(
|
||||
JNIEnv* env, jobject obj, int emu_pad_id, int stick, double angle)
|
||||
{
|
||||
const auto casted_stick = static_cast<ButtonManager::ButtonType>(stick);
|
||||
return ButtonManager::GetInputRadiusAtAngle(emu_pad_id, casted_stick, angle);
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetVersionString(JNIEnv* env,
|
||||
jobject obj)
|
||||
{
|
||||
|
@ -8,10 +8,22 @@
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "Common/Assert.h"
|
||||
#include "Common/FileUtil.h"
|
||||
#include "Common/IniFile.h"
|
||||
#include "Common/StringUtil.h"
|
||||
#include "Common/Thread.h"
|
||||
|
||||
#include "Core/Core.h"
|
||||
#include "Core/HW/GCPad.h"
|
||||
#include "Core/HW/GCPadEmu.h"
|
||||
#include "Core/HW/Wiimote.h"
|
||||
#include "Core/HW/WiimoteEmu/Extension/Classic.h"
|
||||
#include "Core/HW/WiimoteEmu/Extension/Nunchuk.h"
|
||||
#include "Core/HW/WiimoteEmu/WiimoteEmu.h"
|
||||
|
||||
#include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h"
|
||||
#include "InputCommon/ControllerEmu/StickGate.h"
|
||||
#include "InputCommon/ControllerInterface/Touch/ButtonManager.h"
|
||||
|
||||
namespace ButtonManager
|
||||
@ -688,6 +700,39 @@ float GetAxisValue(int pad_id, ButtonType axis)
|
||||
return value;
|
||||
}
|
||||
|
||||
double GetInputRadiusAtAngle(int pad_id, ButtonType stick, double angle)
|
||||
{
|
||||
// To avoid a crash, don't access controllers before they've been initialized by the boot process
|
||||
if (!Core::IsRunningAndStarted())
|
||||
return 0;
|
||||
|
||||
ControllerEmu::ControlGroup* group;
|
||||
|
||||
switch (stick)
|
||||
{
|
||||
case STICK_MAIN:
|
||||
group = Pad::GetGroup(pad_id, PadGroup::MainStick);
|
||||
break;
|
||||
case STICK_C:
|
||||
group = Pad::GetGroup(pad_id, PadGroup::CStick);
|
||||
break;
|
||||
case NUNCHUK_STICK:
|
||||
group = Wiimote::GetNunchukGroup(pad_id, WiimoteEmu::NunchukGroup::Stick);
|
||||
break;
|
||||
case CLASSIC_STICK_LEFT:
|
||||
group = Wiimote::GetClassicGroup(pad_id, WiimoteEmu::ClassicGroup::LeftStick);
|
||||
break;
|
||||
case CLASSIC_STICK_RIGHT:
|
||||
group = Wiimote::GetClassicGroup(pad_id, WiimoteEmu::ClassicGroup::RightStick);
|
||||
break;
|
||||
default:
|
||||
ASSERT(false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return static_cast<ControllerEmu::ReshapableInput*>(group)->GetInputRadiusAtAngle(angle);
|
||||
}
|
||||
|
||||
bool GamepadEvent(const std::string& dev, int button, int action)
|
||||
{
|
||||
auto it = m_controllers.find(dev);
|
||||
|
@ -268,9 +268,16 @@ public:
|
||||
};
|
||||
|
||||
void Init(const std::string&);
|
||||
|
||||
// pad_id is numbered 0 to 3 for GC pads and 4 to 7 for Wiimotes
|
||||
bool GetButtonPressed(int pad_id, ButtonType button);
|
||||
float GetAxisValue(int pad_id, ButtonType axis);
|
||||
|
||||
// emu_pad_id is numbered 0 to 3 for both GC pads and Wiimotes
|
||||
double GetInputRadiusAtAngle(int emu_pad_id, ButtonType stick, double angle);
|
||||
|
||||
bool GamepadEvent(const std::string& dev, int button, int action);
|
||||
void GamepadAxisEvent(const std::string& dev, int axis, float value);
|
||||
|
||||
void Shutdown();
|
||||
} // namespace ButtonManager
|
||||
|
Loading…
x
Reference in New Issue
Block a user