mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 16:49:58 -06:00
[Android] Change how the onTouchEvent native method works. Just pass in the correct Button ID and Action and it'll be pressed or not. Not actually rigged up to the Java code yet. Doesn't support anything with an Axis yet so no C stick, main stick, L and R triggers
This commit is contained in:
@ -61,32 +61,11 @@ namespace ButtonManager
|
||||
class Button
|
||||
{
|
||||
private:
|
||||
int m_tex;
|
||||
ButtonType m_button;
|
||||
ButtonState m_state;
|
||||
float m_coords[8];
|
||||
public:
|
||||
Button(std::string filename, ButtonType button, float *coords)
|
||||
{
|
||||
u32 width, height;
|
||||
char *image;
|
||||
// image = LoadPNG((std::string(DOLPHIN_DATA_DIR "/") + filename).c_str(), width, height);
|
||||
// XXX: Make platform specific drawing
|
||||
|
||||
m_button = button;
|
||||
memcpy(m_coords, coords, sizeof(float) * 8);
|
||||
m_state = BUTTON_RELEASED;
|
||||
}
|
||||
Button(ButtonType button)
|
||||
{
|
||||
m_button = button;
|
||||
m_state = BUTTON_RELEASED;
|
||||
}
|
||||
Button() : m_state(BUTTON_RELEASED) {}
|
||||
void SetState(ButtonState state) { m_state = state; }
|
||||
bool Pressed() { return m_state == BUTTON_PRESSED; }
|
||||
ButtonType GetButtonType() { return m_button; }
|
||||
GLuint GetTexture() { return m_tex; }
|
||||
float *GetCoords() { return m_coords; }
|
||||
|
||||
~Button() { }
|
||||
};
|
||||
@ -131,7 +110,7 @@ namespace ButtonManager
|
||||
void DrawButtons();
|
||||
bool GetButtonPressed(ButtonType button);
|
||||
float GetAxisValue(ButtonType axis);
|
||||
void TouchEvent(int action, float x, float y);
|
||||
void TouchEvent(int button, int action);
|
||||
void GamepadEvent(std::string dev, int button, int action);
|
||||
void GamepadAxisEvent(std::string dev, int axis, float value);
|
||||
void Shutdown();
|
||||
|
Reference in New Issue
Block a user