Merge pull request #7921 from zackhow/fixir

Android: Fix touch IR
This commit is contained in:
JMC47 2019-03-31 23:15:04 -04:00 committed by GitHub
commit 42964e8531
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 33 additions and 47 deletions

View File

@ -1,10 +1,4 @@
# RMCE01, RMCJ01, RMCK01, RMCP01 - Mario Kart Wii # RMCE01, RMCJ01, RMCK01, RMCP01 - Mario Kart Wii
[Controls]
IRHeight = 50
IRWidth = 30
IRCenter = 50
[Core] [Core]
# Values set here will override the main Dolphin settings. # Values set here will override the main Dolphin settings.

View File

@ -1,10 +1,4 @@
# RMGE01, RMGJ01, RMGK01, RMGP01 - SUPER MARIO GALAXY # RMGE01, RMGJ01, RMGK01, RMGP01 - SUPER MARIO GALAXY
[Controls]
IRHeight = 50
IRWidth = 30
IRCenter = 50
[Core] [Core]
# Values set here will override the main Dolphin settings. # Values set here will override the main Dolphin settings.

View File

@ -1,9 +1,4 @@
# RODE01, RODJ01, RODK01, RODP01 - WarioWare: Smooth Moves # RODE01, RODJ01, RODK01, RODP01 - WarioWare: Smooth Moves
[Controls]
IRHeight = 71
IRWidth = 64
IRCenter = 99
[Core] [Core]
# Values set here will override the main Dolphin settings. # Values set here will override the main Dolphin settings.

View File

@ -1,9 +1,4 @@
# RUUE01, RUUJ01, RUUK01, RUUP01 - Animal Crossing Wii # RUUE01, RUUJ01, RUUK01, RUUP01 - Animal Crossing Wii
[Controls]
IRHeight = 50
IRWidth = 30
IRCenter = 50
[Core] [Core]
# Values set here will override the main Dolphin settings. # Values set here will override the main Dolphin settings.

View File

@ -1,9 +1,4 @@
# RZDE01, RZDJ01, RZDK01, RZDP01 - The Legend of Zelda: Twilight Princess [Wii] # RZDE01, RZDJ01, RZDK01, RZDP01 - The Legend of Zelda: Twilight Princess [Wii]
[Controls]
IRHeight = 39
IRWidth = 37
IRCenter = 91
[Core] [Core]
# Values set here will override the main Dolphin settings. # Values set here will override the main Dolphin settings.

View File

@ -1,9 +1,4 @@
# SB4E01, SB4J01, SB4P01 - Super Mario Galaxy 2 # SB4E01, SB4J01, SB4P01 - Super Mario Galaxy 2
[Controls]
IRHeight = 50
IRWidth = 30
IRCenter = 50
[Core] [Core]
# Values set here will override the main Dolphin settings. # Values set here will override the main Dolphin settings.

View File

@ -19,7 +19,7 @@ IR/Forward = `Axis 116`
IR/Backward = `Axis 117` IR/Backward = `Axis 117`
IR/Hide = `Button 118` IR/Hide = `Button 118`
IR/Height = 50 IR/Height = 50
IR/Width = 30 IR/Width = 50
IR/Center = 50 IR/Center = 50
Swing/Up = `Axis 120` Swing/Up = `Axis 120`
Swing/Down = `Axis 121` Swing/Down = `Axis 121`
@ -158,7 +158,7 @@ IR/Forward = `Axis 116`
IR/Backward = `Axis 117` IR/Backward = `Axis 117`
IR/Hide = `Button 118` IR/Hide = `Button 118`
IR/Height = 50 IR/Height = 50
IR/Width = 30 IR/Width = 50
IR/Center = 50 IR/Center = 50
Swing/Up = `Axis 120` Swing/Up = `Axis 120`
Swing/Down = `Axis 121` Swing/Down = `Axis 121`
@ -297,7 +297,7 @@ IR/Forward = `Axis 116`
IR/Backward = `Axis 117` IR/Backward = `Axis 117`
IR/Hide = `Button 118` IR/Hide = `Button 118`
IR/Height = 50 IR/Height = 50
IR/Width = 30 IR/Width = 50
IR/Center = 50 IR/Center = 50
Swing/Up = `Axis 120` Swing/Up = `Axis 120`
Swing/Down = `Axis 121` Swing/Down = `Axis 121`
@ -436,7 +436,7 @@ IR/Forward = `Axis 116`
IR/Backward = `Axis 117` IR/Backward = `Axis 117`
IR/Hide = `Button 118` IR/Hide = `Button 118`
IR/Height = 50 IR/Height = 50
IR/Width = 30 IR/Width = 50
IR/Center = 50 IR/Center = 50
Swing/Up = `Axis 120` Swing/Up = `Axis 120`
Swing/Down = `Axis 121` Swing/Down = `Axis 121`

View File

@ -19,7 +19,7 @@ IR/Forward = `Axis 116`
IR/Backward = `Axis 117` IR/Backward = `Axis 117`
IR/Hide = `Button 118` IR/Hide = `Button 118`
IR/Height = 50 IR/Height = 50
IR/Width = 30 IR/Width = 50
IR/Center = 50 IR/Center = 50
Swing/Up = `Axis 120` Swing/Up = `Axis 120`
Swing/Down = `Axis 121` Swing/Down = `Axis 121`

View File

@ -298,12 +298,14 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
if (!pressed && overlayPointer != null) if (!pressed && overlayPointer != null)
{ {
overlayPointer.onTouch(event); overlayPointer.onTouch(event);
float[] axises = overlayPointer.getAxisValues(); float[] axes = overlayPointer.getAxisValues();
NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice, ButtonType.WIIMOTE_IR + 2, for (int i = 0; i < 4; i++)
axises[0]); {
NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice, ButtonType.WIIMOTE_IR + 4, NativeLibrary
axises[1]); .onGamePadMoveEvent(NativeLibrary.TouchScreenDevice, ButtonType.WIIMOTE_IR_UP + i,
axes[i]);
}
} }
invalidate(); invalidate();

View File

@ -127,9 +127,11 @@ public class InputOverlayPointer
public float[] getAxisValues() public float[] getAxisValues()
{ {
float[] ir = {0f, 0f}; float[] iraxes = {0f, 0f, 0f, 0f};
ir[0] = axes[0]; iraxes[1] = axes[0];
ir[1] = axes[1]; iraxes[0] = axes[0];
return axes; iraxes[3] = axes[1];
iraxes[2] = axes[1];
return iraxes;
} }
} }

View File

@ -34,6 +34,7 @@ public final class DirectoryInitialization
"org.dolphinemu.dolphinemu.DIRECTORY_INITIALIZATION"; "org.dolphinemu.dolphinemu.DIRECTORY_INITIALIZATION";
public static final String EXTRA_STATE = "directoryState"; public static final String EXTRA_STATE = "directoryState";
private static final Integer WiimoteNewVersion = 2;
private static volatile DirectoryInitializationState directoryState = null; private static volatile DirectoryInitializationState directoryState = null;
private static String userPath; private static String userPath;
private static String internalPath; private static String internalPath;
@ -145,7 +146,20 @@ public final class DirectoryInitialization
createWiimoteProfileDirectory(profileDirectory); createWiimoteProfileDirectory(profileDirectory);
copyAsset("GCPadNew.ini", new File(configDirectory, "GCPadNew.ini"), true, context); copyAsset("GCPadNew.ini", new File(configDirectory, "GCPadNew.ini"), true, context);
copyAsset("WiimoteNew.ini", new File(configDirectory, "WiimoteNew.ini"), false, context);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
if (prefs.getInt("WiimoteNewVersion", 0) != WiimoteNewVersion)
{
copyAsset("WiimoteNew.ini", new File(configDirectory, "WiimoteNew.ini"), true, context);
SharedPreferences.Editor sPrefsEditor = prefs.edit();
sPrefsEditor.putInt("WiimoteNewVersion", WiimoteNewVersion);
sPrefsEditor.apply();
}
else
{
copyAsset("WiimoteNew.ini", new File(configDirectory, "WiimoteNew.ini"), false, context);
}
copyAsset("WiimoteProfile.ini", new File(profileDirectory, "WiimoteProfile.ini"), true, copyAsset("WiimoteProfile.ini", new File(profileDirectory, "WiimoteProfile.ini"), true,
context); context);
} }