summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRay <[email protected]>2023-05-15 11:30:31 +0200
committerRay <[email protected]>2023-05-15 11:30:31 +0200
commite17cf9ecd7e770e349a74211bc61170f4d23f8e8 (patch)
tree3f4cbff3f71eb6061718d65f7450cf83bd331628 /src
parent3f8ef4e05f1bb4ca61c43dbcb87f9a9bc0d26f0d (diff)
downloadraylib-e17cf9ecd7e770e349a74211bc61170f4d23f8e8.tar.gz
raylib-e17cf9ecd7e770e349a74211bc61170f4d23f8e8.zip
REVIEWED: Formating
Diffstat (limited to 'src')
-rw-r--r--src/rcamera.h10
-rw-r--r--src/rcore.c5
2 files changed, 10 insertions, 5 deletions
diff --git a/src/rcamera.h b/src/rcamera.h
index 22a468cf..c1b048e0 100644
--- a/src/rcamera.h
+++ b/src/rcamera.h
@@ -448,8 +448,9 @@ void UpdateCamera(Camera *camera, int mode)
if (IsKeyDown(KEY_E)) CameraRoll(camera, CAMERA_ROTATION_SPEED);
// Camera movement
-
- if (!IsGamepadAvailable(0)){
+ if (!IsGamepadAvailable(0))
+ {
+ // Mouse/Keyboard support
CameraYaw(camera, -mousePositionDelta.x*CAMERA_MOUSE_MOVE_SENSITIVITY, rotateAroundTarget);
CameraPitch(camera, -mousePositionDelta.y*CAMERA_MOUSE_MOVE_SENSITIVITY, lockView, rotateAroundTarget, rotateUp);
@@ -458,8 +459,9 @@ void UpdateCamera(Camera *camera, int mode)
if (IsKeyDown(KEY_S)) CameraMoveForward(camera, -CAMERA_MOVE_SPEED, moveInWorldPlane);
if (IsKeyDown(KEY_D)) CameraMoveRight(camera, CAMERA_MOVE_SPEED, moveInWorldPlane);
}
- else {
- // Simple Controller Support
+ else
+ {
+ // Gamepad controller support
CameraYaw(camera, -(GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_X) * 2)*CAMERA_MOUSE_MOVE_SENSITIVITY, rotateAroundTarget);
CameraPitch(camera, -(GetGamepadAxisMovement(0, GAMEPAD_AXIS_RIGHT_Y) * 2)*CAMERA_MOUSE_MOVE_SENSITIVITY, lockView, rotateAroundTarget, rotateUp);
diff --git a/src/rcore.c b/src/rcore.c
index 881739c7..31a06f7c 100644
--- a/src/rcore.c
+++ b/src/rcore.c
@@ -1785,7 +1785,10 @@ int GetCurrentMonitor(void)
monitor = monitors[i];
glfwGetMonitorWorkarea(monitor, &mx, &my, &width, &height);
- if (x >= mx && x < (mx + width) && y >= my && y < (my + height))
+ if ((x >= mx) &&
+ (x < (mx + width)) &&
+ (y >= my) &&
+ (y < (my + height)))
{
index = i;
break;