WIP Android SDL

This commit is contained in:
TheBrokenRail
2023-11-02 15:02:58 -04:00
committed by iProgramInCpp
parent 811bc7a6fa
commit 0559f66102
46 changed files with 631 additions and 276 deletions

View File

@@ -13,7 +13,7 @@ bool Controller::isTouchedValues[2];
float Controller::stickValuesX[2];
float Controller::stickValuesY[2];
#ifndef __ANDROID__
#if !defined(ANDROID) || defined(USE_SDL)
const float Controller_unk_1[3] = { 0.0f, 0.64f, -0.64f };
#endif
@@ -52,7 +52,7 @@ void Controller::feed(int stickNo, int touched, float x, float y)
if (!isValidStick(stickNo))
return;
#ifdef __ANDROID__
#if defined(ANDROID) && !defined(USE_SDL)
int index = stickNo - 1;
#else
int index = (x >= 0.0f) ? 1 : 0;
@@ -61,7 +61,7 @@ void Controller::feed(int stickNo, int touched, float x, float y)
// maybe the 2 'touch sticks' are actually internally 1 single surface??
isTouchedValues[index] = touched != 0;
#ifdef __ANDROID__
#if defined(ANDROID) && !defined(USE_SDL)
stickValuesX[index] = x;
#else
stickValuesX[index] = linearTransform(x + Controller_unk_1[index + 1], 0.0f, 2.78f, true);