Reorganize defines check
This commit is contained in:
parent
836d3341a5
commit
16101ce3d8
1 changed files with 17 additions and 13 deletions
24
src/core.c
24
src/core.c
|
@ -198,6 +198,7 @@ static Matrix downscaleView; // Matrix to downscale view (in case
|
||||||
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB)
|
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB)
|
||||||
static const char *windowTitle; // Window text title...
|
static const char *windowTitle; // Window text title...
|
||||||
static bool cursorOnScreen = false; // Tracks if cursor is inside client area
|
static bool cursorOnScreen = false; // Tracks if cursor is inside client area
|
||||||
|
static bool cursorHidden = false; // Track if cursor is hidden
|
||||||
|
|
||||||
// Register mouse states
|
// Register mouse states
|
||||||
static char previousMouseState[3] = { 0 }; // Registers previous mouse button state
|
static char previousMouseState[3] = { 0 }; // Registers previous mouse button state
|
||||||
|
@ -213,8 +214,6 @@ static char currentGamepadState[MAX_GAMEPADS][MAX_GAMEPAD_BUTTONS]; // Curre
|
||||||
|
|
||||||
// Keyboard configuration
|
// Keyboard configuration
|
||||||
static int exitKey = KEY_ESCAPE; // Default exit key (ESC)
|
static int exitKey = KEY_ESCAPE; // Default exit key (ESC)
|
||||||
|
|
||||||
static bool cursorHidden; // Track if cursor is hidden
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Register keyboard states
|
// Register keyboard states
|
||||||
|
@ -1155,7 +1154,6 @@ void SetExitKey(int key)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB)
|
|
||||||
// NOTE: Gamepad support not implemented in emscripten GLFW3 (PLATFORM_WEB)
|
// NOTE: Gamepad support not implemented in emscripten GLFW3 (PLATFORM_WEB)
|
||||||
|
|
||||||
// Detect if a gamepad is available
|
// Detect if a gamepad is available
|
||||||
|
@ -1163,7 +1161,9 @@ bool IsGamepadAvailable(int gamepad)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
|
#if !defined(PLATFORM_ANDROID)
|
||||||
if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad]) result = true;
|
if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad]) result = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -1184,10 +1184,9 @@ float GetGamepadAxisMovement(int gamepad, int axis)
|
||||||
{
|
{
|
||||||
float value = 0;
|
float value = 0;
|
||||||
|
|
||||||
if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (axis < MAX_GAMEPAD_AXIS))
|
#if !defined(PLATFORM_ANDROID)
|
||||||
{
|
if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (axis < MAX_GAMEPAD_AXIS)) value = gamepadAxisState[gamepad][axis];
|
||||||
value = gamepadAxisState[gamepad][axis];
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
@ -1197,9 +1196,11 @@ bool IsGamepadButtonPressed(int gamepad, int button)
|
||||||
{
|
{
|
||||||
bool pressed = false;
|
bool pressed = false;
|
||||||
|
|
||||||
|
#if !defined(PLATFORM_ANDROID)
|
||||||
if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) &&
|
if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) &&
|
||||||
(currentGamepadState[gamepad][button] != previousGamepadState[gamepad][button]) &&
|
(currentGamepadState[gamepad][button] != previousGamepadState[gamepad][button]) &&
|
||||||
(currentGamepadState[gamepad][button] == 1)) pressed = true;
|
(currentGamepadState[gamepad][button] == 1)) pressed = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
return pressed;
|
return pressed;
|
||||||
}
|
}
|
||||||
|
@ -1209,8 +1210,10 @@ bool IsGamepadButtonDown(int gamepad, int button)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
|
#if !defined(PLATFORM_ANDROID)
|
||||||
if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) &&
|
if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) &&
|
||||||
(currentGamepadState[gamepad][button] == 1)) result = true;
|
(currentGamepadState[gamepad][button] == 1)) result = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -1220,9 +1223,11 @@ bool IsGamepadButtonReleased(int gamepad, int button)
|
||||||
{
|
{
|
||||||
bool released = false;
|
bool released = false;
|
||||||
|
|
||||||
|
#if !defined(PLATFORM_ANDROID)
|
||||||
if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) &&
|
if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) &&
|
||||||
(currentGamepadState[gamepad][button] != previousGamepadState[gamepad][button]) &&
|
(currentGamepadState[gamepad][button] != previousGamepadState[gamepad][button]) &&
|
||||||
(currentGamepadState[gamepad][button] == 0)) released = true;
|
(currentGamepadState[gamepad][button] == 0)) released = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
return released;
|
return released;
|
||||||
}
|
}
|
||||||
|
@ -1232,8 +1237,10 @@ bool IsGamepadButtonUp(int gamepad, int button)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
|
#if !defined(PLATFORM_ANDROID)
|
||||||
if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) &&
|
if ((gamepad < MAX_GAMEPADS) && gamepadReady[gamepad] && (button < MAX_GAMEPAD_BUTTONS) &&
|
||||||
(currentGamepadState[gamepad][button] == 0)) result = true;
|
(currentGamepadState[gamepad][button] == 0)) result = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -1244,9 +1251,6 @@ int GetGamepadButtonPressed(void)
|
||||||
return lastGamepadButtonPressed;
|
return lastGamepadButtonPressed;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB)
|
|
||||||
|
|
||||||
|
|
||||||
// Detect if a mouse button has been pressed once
|
// Detect if a mouse button has been pressed once
|
||||||
bool IsMouseButtonPressed(int button)
|
bool IsMouseButtonPressed(int button)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue