mirror of
https://github.com/raysan5/raylib.git
synced 2026-02-05 05:39:18 -05:00
Reviewed formating and spacing
This commit is contained in:
11
src/rcore.c
11
src/rcore.c
@ -3831,7 +3831,6 @@ void PlayAutomationEvent(AutomationEvent event)
|
||||
// Check if a key has been pressed once
|
||||
bool IsKeyPressed(int key)
|
||||
{
|
||||
|
||||
bool pressed = false;
|
||||
|
||||
if ((key > 0) && (key < MAX_KEYBOARD_KEYS))
|
||||
@ -4055,12 +4054,10 @@ bool IsMouseButtonPressed(int button)
|
||||
|
||||
if ((button >= 0) && (button <= MOUSE_BUTTON_BACK))
|
||||
{
|
||||
|
||||
if ((CORE.Input.Mouse.currentButtonState[button] == 1) && (CORE.Input.Mouse.previousButtonState[button] == 0)) pressed = true;
|
||||
|
||||
// Map touches to mouse buttons checking
|
||||
if ((CORE.Input.Touch.currentTouchState[button] == 1) && (CORE.Input.Touch.previousTouchState[button] == 0)) pressed = true;
|
||||
|
||||
}
|
||||
|
||||
return pressed;
|
||||
@ -4073,12 +4070,10 @@ bool IsMouseButtonDown(int button)
|
||||
|
||||
if ((button >= 0) && (button <= MOUSE_BUTTON_BACK))
|
||||
{
|
||||
|
||||
if (CORE.Input.Mouse.currentButtonState[button] == 1) down = true;
|
||||
|
||||
// NOTE: Touches are considered like mouse buttons
|
||||
if (CORE.Input.Touch.currentTouchState[button] == 1) down = true;
|
||||
|
||||
}
|
||||
|
||||
return down;
|
||||
@ -4091,12 +4086,10 @@ bool IsMouseButtonReleased(int button)
|
||||
|
||||
if ((button >= 0) && (button <= MOUSE_BUTTON_BACK))
|
||||
{
|
||||
|
||||
if ((CORE.Input.Mouse.currentButtonState[button] == 0) && (CORE.Input.Mouse.previousButtonState[button] == 1)) released = true;
|
||||
|
||||
// Map touches to mouse buttons checking
|
||||
if ((CORE.Input.Touch.currentTouchState[button] == 0) && (CORE.Input.Touch.previousTouchState[button] == 1)) released = true;
|
||||
|
||||
}
|
||||
|
||||
return released;
|
||||
@ -4109,12 +4102,10 @@ bool IsMouseButtonUp(int button)
|
||||
|
||||
if ((button >= 0) && (button <= MOUSE_BUTTON_BACK))
|
||||
{
|
||||
|
||||
if (CORE.Input.Mouse.currentButtonState[button] == 0) up = true;
|
||||
|
||||
// NOTE: Touches are considered like mouse buttons
|
||||
if (CORE.Input.Touch.currentTouchState[button] == 0) up = true;
|
||||
|
||||
}
|
||||
|
||||
return up;
|
||||
@ -4124,6 +4115,7 @@ bool IsMouseButtonUp(int button)
|
||||
int GetMouseX(void)
|
||||
{
|
||||
int mouseX = (int)((CORE.Input.Mouse.currentPosition.x + CORE.Input.Mouse.offset.x)*CORE.Input.Mouse.scale.x);
|
||||
|
||||
return mouseX;
|
||||
}
|
||||
|
||||
@ -4131,6 +4123,7 @@ int GetMouseX(void)
|
||||
int GetMouseY(void)
|
||||
{
|
||||
int mouseY = (int)((CORE.Input.Mouse.currentPosition.y + CORE.Input.Mouse.offset.y)*CORE.Input.Mouse.scale.y);
|
||||
|
||||
return mouseY;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user