Changing MAX_TOUCH_POINTS define to RL_MAX_TOUCH_POINTS.

This commit is contained in:
Marco Lizza 2018-12-20 16:09:05 +01:00
parent 8cea5f28b0
commit 8579d1386d
4 changed files with 10 additions and 10 deletions

View File

@ -58,7 +58,7 @@ int main()
ClearBackground(RAYWHITE);
// Multitouch
for (int i = 0; i < MAX_TOUCH_POINTS; ++i)
for (int i = 0; i < RL_MAX_TOUCH_POINTS; ++i)
{
TouchPos = GetTouchPosition(i); // Get the touch point

View File

@ -336,7 +336,7 @@ static Vector2 mousePosition; // Mouse position on screen
static float mouseScale = 1.0f; // Mouse default scale
static bool cursorHidden = false; // Track if cursor is hidden
static bool cursorOnScreen = false; // Tracks if cursor is inside client area
static Vector2 touchPosition[MAX_TOUCH_POINTS]; // Touch position on screen
static Vector2 touchPosition[RL_MAX_TOUCH_POINTS]; // Touch position on screen
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) || defined(PLATFORM_UWP)
static char previousMouseState[3] = { 0 }; // Registers previous mouse button state
@ -2157,8 +2157,8 @@ Vector2 GetTouchPosition(int index)
Vector2 position = { -1.0f, -1.0f };
#if defined(PLATFORM_ANDROID) || defined(PLATFORM_WEB)
if (index < MAX_TOUCH_POINTS) position = touchPosition[index];
else TraceLog(LOG_WARNING, "Required touch point out of range (Max touch points: %i)", MAX_TOUCH_POINTS);
if (index < RL_MAX_TOUCH_POINTS) position = touchPosition[index];
else TraceLog(LOG_WARNING, "Required touch point out of range (Max touch points: %i)", RL_MAX_TOUCH_POINTS);
if ((screenWidth > displayWidth) || (screenHeight > displayHeight))
{
@ -3896,7 +3896,7 @@ static void InitMouse(void)
struct dirent *entity;
// Reset variables
for (int i = 0; i < MAX_TOUCH_POINTS; ++i)
for (int i = 0; i < RL_MAX_TOUCH_POINTS; ++i)
{
touchPosition[i].x = -1;
touchPosition[i].y = -1;
@ -4179,19 +4179,19 @@ static void *EventThread(void *arg)
if (event.code == ABS_MT_POSITION_X)
{
if (worker->touchSlot < MAX_TOUCH_POINTS)
if (worker->touchSlot < RL_MAX_TOUCH_POINTS)
touchPosition[worker->touchSlot].x = (event.value - worker->absRange.x)*screenWidth/worker->absRange.width; // Scale acording to absRange
}
if (event.code == ABS_MT_POSITION_Y)
{
if (worker->touchSlot < MAX_TOUCH_POINTS)
if (worker->touchSlot < RL_MAX_TOUCH_POINTS)
touchPosition[worker->touchSlot].y = (event.value - worker->absRange.y)*screenHeight/worker->absRange.height; // Scale acording to absRange
}
if (event.code == ABS_MT_TRACKING_ID)
{
if ( (event.value < 0) && (worker->touchSlot < MAX_TOUCH_POINTS) )
if ( (event.value < 0) && (worker->touchSlot < RL_MAX_TOUCH_POINTS) )
{
// Touch has ended for this point
touchPosition[worker->touchSlot].x = -1;

View File

@ -91,7 +91,7 @@
typedef enum { TOUCH_UP, TOUCH_DOWN, TOUCH_MOVE } TouchAction;
// Gesture events
// NOTE: MAX_TOUCH_POINTS fixed to 4
// NOTE: RL_MAX_TOUCH_POINTS fixed to 4
typedef struct {
int touchAction;
int pointCount;

View File

@ -91,7 +91,7 @@
#define RL_DEG2RAD (RL_PI/180.0f)
#define RL_RAD2DEG (180.0f/RL_PI)
#define MAX_TOUCH_POINTS 10 // Maximum number of touch points supported
#define RL_MAX_TOUCH_POINTS 10 // Maximum number of touch points supported
// Shader and material limits
#define MAX_SHADER_LOCATIONS 32 // Maximum number of predefined locations stored in shader struct