Renamed VirtualPadConstants to InputManagerConstants on Android.

This commit is contained in:
Jean-Philip Desjardins 2015-07-06 00:53:45 -04:00
parent 30df8672e8
commit b70b9f2048
6 changed files with 86 additions and 86 deletions

View File

@ -1,5 +1,5 @@
#include "PH_Android.h"
#include "com_virtualapplications_play_VirtualPadConstants.h"
#include "com_virtualapplications_play_InputManagerConstants.h"
CPH_Android::CPH_Android()
{
@ -41,46 +41,46 @@ void CPH_Android::SetButtonState(uint32 buttonId, bool pressed)
{
switch(buttonId)
{
case com_virtualapplications_play_VirtualPadConstants_BUTTON_START:
case com_virtualapplications_play_InputManagerConstants_BUTTON_START:
m_buttonStates[PS2::CControllerInfo::START] = pressed;
break;
case com_virtualapplications_play_VirtualPadConstants_BUTTON_SELECT:
case com_virtualapplications_play_InputManagerConstants_BUTTON_SELECT:
m_buttonStates[PS2::CControllerInfo::SELECT] = pressed;
break;
case com_virtualapplications_play_VirtualPadConstants_BUTTON_UP:
case com_virtualapplications_play_InputManagerConstants_BUTTON_UP:
m_buttonStates[PS2::CControllerInfo::DPAD_UP] = pressed;
break;
case com_virtualapplications_play_VirtualPadConstants_BUTTON_DOWN:
case com_virtualapplications_play_InputManagerConstants_BUTTON_DOWN:
m_buttonStates[PS2::CControllerInfo::DPAD_DOWN] = pressed;
break;
case com_virtualapplications_play_VirtualPadConstants_BUTTON_LEFT:
case com_virtualapplications_play_InputManagerConstants_BUTTON_LEFT:
m_buttonStates[PS2::CControllerInfo::DPAD_LEFT] = pressed;
break;
case com_virtualapplications_play_VirtualPadConstants_BUTTON_RIGHT:
case com_virtualapplications_play_InputManagerConstants_BUTTON_RIGHT:
m_buttonStates[PS2::CControllerInfo::DPAD_RIGHT] = pressed;
break;
case com_virtualapplications_play_VirtualPadConstants_BUTTON_TRIANGLE:
case com_virtualapplications_play_InputManagerConstants_BUTTON_TRIANGLE:
m_buttonStates[PS2::CControllerInfo::TRIANGLE] = pressed;
break;
case com_virtualapplications_play_VirtualPadConstants_BUTTON_CIRCLE:
case com_virtualapplications_play_InputManagerConstants_BUTTON_CIRCLE:
m_buttonStates[PS2::CControllerInfo::CIRCLE] = pressed;
break;
case com_virtualapplications_play_VirtualPadConstants_BUTTON_SQUARE:
case com_virtualapplications_play_InputManagerConstants_BUTTON_SQUARE:
m_buttonStates[PS2::CControllerInfo::SQUARE] = pressed;
break;
case com_virtualapplications_play_VirtualPadConstants_BUTTON_CROSS:
case com_virtualapplications_play_InputManagerConstants_BUTTON_CROSS:
m_buttonStates[PS2::CControllerInfo::CROSS] = pressed;
break;
case com_virtualapplications_play_VirtualPadConstants_BUTTON_L1:
case com_virtualapplications_play_InputManagerConstants_BUTTON_L1:
m_buttonStates[PS2::CControllerInfo::L1] = pressed;
break;
case com_virtualapplications_play_VirtualPadConstants_BUTTON_L2:
case com_virtualapplications_play_InputManagerConstants_BUTTON_L2:
m_buttonStates[PS2::CControllerInfo::L2] = pressed;
break;
case com_virtualapplications_play_VirtualPadConstants_BUTTON_R1:
case com_virtualapplications_play_InputManagerConstants_BUTTON_R1:
m_buttonStates[PS2::CControllerInfo::R1] = pressed;
break;
case com_virtualapplications_play_VirtualPadConstants_BUTTON_R2:
case com_virtualapplications_play_InputManagerConstants_BUTTON_R2:
m_buttonStates[PS2::CControllerInfo::R2] = pressed;
break;
}
@ -90,16 +90,16 @@ void CPH_Android::SetAxisState(uint32 buttonId, float value)
{
switch(buttonId)
{
case com_virtualapplications_play_VirtualPadConstants_ANALOG_LEFT_X:
case com_virtualapplications_play_InputManagerConstants_ANALOG_LEFT_X:
m_axisStates[PS2::CControllerInfo::ANALOG_LEFT_X] = value;
break;
case com_virtualapplications_play_VirtualPadConstants_ANALOG_LEFT_Y:
case com_virtualapplications_play_InputManagerConstants_ANALOG_LEFT_Y:
m_axisStates[PS2::CControllerInfo::ANALOG_LEFT_Y] = value;
break;
case com_virtualapplications_play_VirtualPadConstants_ANALOG_RIGHT_X:
case com_virtualapplications_play_InputManagerConstants_ANALOG_RIGHT_X:
m_axisStates[PS2::CControllerInfo::ANALOG_RIGHT_X] = value;
break;
case com_virtualapplications_play_VirtualPadConstants_ANALOG_RIGHT_Y:
case com_virtualapplications_play_InputManagerConstants_ANALOG_RIGHT_Y:
m_axisStates[PS2::CControllerInfo::ANALOG_RIGHT_Y] = value;
break;
}

View File

@ -0,0 +1,49 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class com_virtualapplications_play_InputManagerConstants */
#ifndef _Included_com_virtualapplications_play_InputManagerConstants
#define _Included_com_virtualapplications_play_InputManagerConstants
#ifdef __cplusplus
extern "C" {
#endif
#undef com_virtualapplications_play_InputManagerConstants_BUTTON_START
#define com_virtualapplications_play_InputManagerConstants_BUTTON_START 0L
#undef com_virtualapplications_play_InputManagerConstants_BUTTON_SELECT
#define com_virtualapplications_play_InputManagerConstants_BUTTON_SELECT 1L
#undef com_virtualapplications_play_InputManagerConstants_BUTTON_CROSS
#define com_virtualapplications_play_InputManagerConstants_BUTTON_CROSS 2L
#undef com_virtualapplications_play_InputManagerConstants_BUTTON_CIRCLE
#define com_virtualapplications_play_InputManagerConstants_BUTTON_CIRCLE 3L
#undef com_virtualapplications_play_InputManagerConstants_BUTTON_SQUARE
#define com_virtualapplications_play_InputManagerConstants_BUTTON_SQUARE 4L
#undef com_virtualapplications_play_InputManagerConstants_BUTTON_TRIANGLE
#define com_virtualapplications_play_InputManagerConstants_BUTTON_TRIANGLE 5L
#undef com_virtualapplications_play_InputManagerConstants_BUTTON_UP
#define com_virtualapplications_play_InputManagerConstants_BUTTON_UP 6L
#undef com_virtualapplications_play_InputManagerConstants_BUTTON_DOWN
#define com_virtualapplications_play_InputManagerConstants_BUTTON_DOWN 7L
#undef com_virtualapplications_play_InputManagerConstants_BUTTON_LEFT
#define com_virtualapplications_play_InputManagerConstants_BUTTON_LEFT 8L
#undef com_virtualapplications_play_InputManagerConstants_BUTTON_RIGHT
#define com_virtualapplications_play_InputManagerConstants_BUTTON_RIGHT 9L
#undef com_virtualapplications_play_InputManagerConstants_BUTTON_L1
#define com_virtualapplications_play_InputManagerConstants_BUTTON_L1 10L
#undef com_virtualapplications_play_InputManagerConstants_BUTTON_L2
#define com_virtualapplications_play_InputManagerConstants_BUTTON_L2 11L
#undef com_virtualapplications_play_InputManagerConstants_BUTTON_R1
#define com_virtualapplications_play_InputManagerConstants_BUTTON_R1 12L
#undef com_virtualapplications_play_InputManagerConstants_BUTTON_R2
#define com_virtualapplications_play_InputManagerConstants_BUTTON_R2 13L
#undef com_virtualapplications_play_InputManagerConstants_ANALOG_LEFT_X
#define com_virtualapplications_play_InputManagerConstants_ANALOG_LEFT_X 14L
#undef com_virtualapplications_play_InputManagerConstants_ANALOG_LEFT_Y
#define com_virtualapplications_play_InputManagerConstants_ANALOG_LEFT_Y 15L
#undef com_virtualapplications_play_InputManagerConstants_ANALOG_RIGHT_X
#define com_virtualapplications_play_InputManagerConstants_ANALOG_RIGHT_X 16L
#undef com_virtualapplications_play_InputManagerConstants_ANALOG_RIGHT_Y
#define com_virtualapplications_play_InputManagerConstants_ANALOG_RIGHT_Y 17L
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,49 +0,0 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class com_virtualapplications_play_VirtualPadConstants */
#ifndef _Included_com_virtualapplications_play_VirtualPadConstants
#define _Included_com_virtualapplications_play_VirtualPadConstants
#ifdef __cplusplus
extern "C" {
#endif
#undef com_virtualapplications_play_VirtualPadConstants_BUTTON_START
#define com_virtualapplications_play_VirtualPadConstants_BUTTON_START 0L
#undef com_virtualapplications_play_VirtualPadConstants_BUTTON_SELECT
#define com_virtualapplications_play_VirtualPadConstants_BUTTON_SELECT 1L
#undef com_virtualapplications_play_VirtualPadConstants_BUTTON_CROSS
#define com_virtualapplications_play_VirtualPadConstants_BUTTON_CROSS 2L
#undef com_virtualapplications_play_VirtualPadConstants_BUTTON_CIRCLE
#define com_virtualapplications_play_VirtualPadConstants_BUTTON_CIRCLE 3L
#undef com_virtualapplications_play_VirtualPadConstants_BUTTON_SQUARE
#define com_virtualapplications_play_VirtualPadConstants_BUTTON_SQUARE 4L
#undef com_virtualapplications_play_VirtualPadConstants_BUTTON_TRIANGLE
#define com_virtualapplications_play_VirtualPadConstants_BUTTON_TRIANGLE 5L
#undef com_virtualapplications_play_VirtualPadConstants_BUTTON_UP
#define com_virtualapplications_play_VirtualPadConstants_BUTTON_UP 6L
#undef com_virtualapplications_play_VirtualPadConstants_BUTTON_DOWN
#define com_virtualapplications_play_VirtualPadConstants_BUTTON_DOWN 7L
#undef com_virtualapplications_play_VirtualPadConstants_BUTTON_LEFT
#define com_virtualapplications_play_VirtualPadConstants_BUTTON_LEFT 8L
#undef com_virtualapplications_play_VirtualPadConstants_BUTTON_RIGHT
#define com_virtualapplications_play_VirtualPadConstants_BUTTON_RIGHT 9L
#undef com_virtualapplications_play_VirtualPadConstants_BUTTON_L1
#define com_virtualapplications_play_VirtualPadConstants_BUTTON_L1 10L
#undef com_virtualapplications_play_VirtualPadConstants_BUTTON_L2
#define com_virtualapplications_play_VirtualPadConstants_BUTTON_L2 11L
#undef com_virtualapplications_play_VirtualPadConstants_BUTTON_R1
#define com_virtualapplications_play_VirtualPadConstants_BUTTON_R1 12L
#undef com_virtualapplications_play_VirtualPadConstants_BUTTON_R2
#define com_virtualapplications_play_VirtualPadConstants_BUTTON_R2 13L
#undef com_virtualapplications_play_VirtualPadConstants_ANALOG_LEFT_X
#define com_virtualapplications_play_VirtualPadConstants_ANALOG_LEFT_X 14L
#undef com_virtualapplications_play_VirtualPadConstants_ANALOG_LEFT_Y
#define com_virtualapplications_play_VirtualPadConstants_ANALOG_LEFT_Y 15L
#undef com_virtualapplications_play_VirtualPadConstants_ANALOG_RIGHT_X
#define com_virtualapplications_play_VirtualPadConstants_ANALOG_RIGHT_X 16L
#undef com_virtualapplications_play_VirtualPadConstants_ANALOG_RIGHT_Y
#define com_virtualapplications_play_VirtualPadConstants_ANALOG_RIGHT_Y 17L
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,6 +1,6 @@
package com.virtualapplications.play;
public class VirtualPadConstants
public class InputManagerConstants
{
//Using public static final ints here because enums can't be
//translated to defines with javah

View File

@ -59,56 +59,56 @@ public class VirtualPadView extends SurfaceView
_items.add(new VirtualPadButton(
new RectF(startSelPadPosX + 0, startSelPadPosY + 0, startSelPadPosX + 128, startSelPadPosY + 64),
VirtualPadConstants.BUTTON_SELECT, select));
InputManagerConstants.BUTTON_SELECT, select));
_items.add(new VirtualPadButton(
new RectF(startSelPadPosX + 256, startSelPadPosY + 0, startSelPadPosX + 384, startSelPadPosY + 64),
VirtualPadConstants.BUTTON_START, start));
InputManagerConstants.BUTTON_START, start));
_items.add(new VirtualPadButton(
new RectF(dpadPosX + 128, dpadPosY + 0, dpadPosX + 256, dpadPosY + 192),
VirtualPadConstants.BUTTON_UP, up));
InputManagerConstants.BUTTON_UP, up));
_items.add(new VirtualPadButton(
new RectF(dpadPosX + 128, dpadPosY + 192, dpadPosX + 256, dpadPosY + 384),
VirtualPadConstants.BUTTON_DOWN, down));
InputManagerConstants.BUTTON_DOWN, down));
_items.add(new VirtualPadButton(
new RectF(dpadPosX + 0, dpadPosY + 128, dpadPosX + 192, dpadPosY + 256),
VirtualPadConstants.BUTTON_LEFT, left));
InputManagerConstants.BUTTON_LEFT, left));
_items.add(new VirtualPadButton(
new RectF(dpadPosX + 192, dpadPosY + 128, dpadPosX + 384, dpadPosY + 256),
VirtualPadConstants.BUTTON_RIGHT, right));
InputManagerConstants.BUTTON_RIGHT, right));
_items.add(new VirtualPadButton(
new RectF(leftButtonsPosX, leftButtonsPosY, leftButtonsPosX + lrButtonWidth, leftButtonsPosY + lrButtonHeight),
VirtualPadConstants.BUTTON_L2, lr, "L2"));
InputManagerConstants.BUTTON_L2, lr, "L2"));
_items.add(new VirtualPadButton(
new RectF(leftButtonsPosX, leftButtonsPosY + lrButtonHeight, leftButtonsPosX + lrButtonWidth, leftButtonsPosY + lrButtonHeight * 2),
VirtualPadConstants.BUTTON_L1, lr, "L1"));
InputManagerConstants.BUTTON_L1, lr, "L1"));
_items.add(new VirtualPadButton(
new RectF(rightButtonsPosX, rightButtonsPosY, rightButtonsPosX + lrButtonWidth, rightButtonsPosY + lrButtonHeight),
VirtualPadConstants.BUTTON_R2, lr, "R2"));
InputManagerConstants.BUTTON_R2, lr, "R2"));
_items.add(new VirtualPadButton(
new RectF(rightButtonsPosX, rightButtonsPosY + lrButtonHeight, rightButtonsPosX + lrButtonWidth, rightButtonsPosY + lrButtonHeight * 2),
VirtualPadConstants.BUTTON_R1, lr, "R1"));
InputManagerConstants.BUTTON_R1, lr, "R1"));
_items.add(new VirtualPadButton(
new RectF(actionPadPosX + 128, actionPadPosY + 0, actionPadPosX + 256, actionPadPosY + 128),
VirtualPadConstants.BUTTON_TRIANGLE, triangle));
InputManagerConstants.BUTTON_TRIANGLE, triangle));
_items.add(new VirtualPadButton(
new RectF(actionPadPosX + 128, actionPadPosY + 256, actionPadPosX + 256, actionPadPosY + 384),
VirtualPadConstants.BUTTON_CROSS, cross));
InputManagerConstants.BUTTON_CROSS, cross));
_items.add(new VirtualPadButton(
new RectF(actionPadPosX + 0, actionPadPosY + 128, actionPadPosX + 128, actionPadPosY + 256),
VirtualPadConstants.BUTTON_SQUARE, square));
InputManagerConstants.BUTTON_SQUARE, square));
_items.add(new VirtualPadButton(
new RectF(actionPadPosX + 256, actionPadPosY + 128, actionPadPosX + 384, actionPadPosY + 256),
VirtualPadConstants.BUTTON_CIRCLE, circle));
InputManagerConstants.BUTTON_CIRCLE, circle));
_items.add(new VirtualPadStick(
new RectF(leftAnalogStickPosX, analogStickPosY, leftAnalogStickPosX + analogStickSize, analogStickPosY + analogStickSize),
VirtualPadConstants.ANALOG_LEFT_X, VirtualPadConstants.ANALOG_LEFT_Y, analogStick));
InputManagerConstants.ANALOG_LEFT_X, InputManagerConstants.ANALOG_LEFT_Y, analogStick));
_items.add(new VirtualPadStick(
new RectF(rightAnalogStickPosX, analogStickPosY, rightAnalogStickPosX + analogStickSize, analogStickPosY + analogStickSize),
VirtualPadConstants.ANALOG_RIGHT_X, VirtualPadConstants.ANALOG_RIGHT_Y, analogStick));
InputManagerConstants.ANALOG_RIGHT_X, InputManagerConstants.ANALOG_RIGHT_Y, analogStick));
postInvalidate();
}

View File

@ -1,3 +1,3 @@
#!/bin/bash
set -e
"$JAVA_HOME/bin/javah" -classpath bin/classes com.virtualapplications.play.VirtualPadConstants
"$JAVA_HOME/bin/javah" -classpath bin/classes com.virtualapplications.play.InputManagerConstants