summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2021-07-01 21:43:13 +0200
committerraysan5 <[email protected]>2021-07-01 21:43:13 +0200
commitf81dfce19f5aa23e5bba51ad791d3edf214debf6 (patch)
tree313b2507daf5a0ccd36d12ffe26695f8be568dcb
parent1fe137db449cf26902cb21b0dee6ad3884076ff9 (diff)
downloadraylib-f81dfce19f5aa23e5bba51ad791d3edf214debf6.tar.gz
raylib-f81dfce19f5aa23e5bba51ad791d3edf214debf6.zip
Minor tweaks
-rw-r--r--src/core.c55
-rw-r--r--src/raudio.c4
2 files changed, 27 insertions, 32 deletions
diff --git a/src/core.c b/src/core.c
index a1e35c22..bf00cd30 100644
--- a/src/core.c
+++ b/src/core.c
@@ -6184,24 +6184,24 @@ static void *EventThread(void *arg)
// Basic movement
if (event.code == ABS_X)
{
- CORE.Input.Mouse.currentPosition.x = (event.value - worker->absRange.x)*CORE.Window.screen.width/worker->absRange.width; // Scale acording to absRange
- CORE.Input.Touch.position[0].x = (event.value - worker->absRange.x)*CORE.Window.screen.width/worker->absRange.width; // Scale acording to absRange
+ CORE.Input.Mouse.currentPosition.x = (event.value - worker->absRange.x)*CORE.Window.screen.width/worker->absRange.width; // Scale acording to absRange
+ CORE.Input.Touch.position[0].x = (event.value - worker->absRange.x)*CORE.Window.screen.width/worker->absRange.width; // Scale acording to absRange
- #if defined(SUPPORT_GESTURES_SYSTEM)
- touchAction = TOUCH_MOVE;
- gestureUpdate = true;
- #endif
+ #if defined(SUPPORT_GESTURES_SYSTEM)
+ touchAction = TOUCH_MOVE;
+ gestureUpdate = true;
+ #endif
}
if (event.code == ABS_Y)
{
- CORE.Input.Mouse.currentPosition.y = (event.value - worker->absRange.y)*CORE.Window.screen.height/worker->absRange.height; // Scale acording to absRange
- CORE.Input.Touch.position[0].y = (event.value - worker->absRange.y)*CORE.Window.screen.height/worker->absRange.height; // Scale acording to absRange
+ CORE.Input.Mouse.currentPosition.y = (event.value - worker->absRange.y)*CORE.Window.screen.height/worker->absRange.height; // Scale acording to absRange
+ CORE.Input.Touch.position[0].y = (event.value - worker->absRange.y)*CORE.Window.screen.height/worker->absRange.height; // Scale acording to absRange
- #if defined(SUPPORT_GESTURES_SYSTEM)
- touchAction = TOUCH_MOVE;
- gestureUpdate = true;
- #endif
+ #if defined(SUPPORT_GESTURES_SYSTEM)
+ touchAction = TOUCH_MOVE;
+ gestureUpdate = true;
+ #endif
}
// Multitouch movement
@@ -6236,20 +6236,20 @@ static void *EventThread(void *arg)
{
CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_LEFT] = 0;
- #if defined(SUPPORT_GESTURES_SYSTEM)
- touchAction = TOUCH_UP;
- gestureUpdate = true;
- #endif
+ #if defined(SUPPORT_GESTURES_SYSTEM)
+ touchAction = TOUCH_UP;
+ gestureUpdate = true;
+ #endif
}
if (event.value && !previousMouseLeftButtonState)
{
CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_LEFT] = 1;
- #if defined(SUPPORT_GESTURES_SYSTEM)
- touchAction = TOUCH_DOWN;
- gestureUpdate = true;
- #endif
+ #if defined(SUPPORT_GESTURES_SYSTEM)
+ touchAction = TOUCH_DOWN;
+ gestureUpdate = true;
+ #endif
}
}
@@ -6263,11 +6263,11 @@ static void *EventThread(void *arg)
{
CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_LEFT] = event.value;
- #if defined(SUPPORT_GESTURES_SYSTEM)
- if (event.value > 0) touchAction = TOUCH_DOWN;
- else touchAction = TOUCH_UP;
- gestureUpdate = true;
- #endif
+ #if defined(SUPPORT_GESTURES_SYSTEM)
+ if (event.value > 0) touchAction = TOUCH_DOWN;
+ else touchAction = TOUCH_UP;
+ gestureUpdate = true;
+ #endif
}
if (event.code == BTN_RIGHT) CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_RIGHT] = event.value;
@@ -6288,10 +6288,9 @@ static void *EventThread(void *arg)
if (CORE.Input.Mouse.currentPosition.y > CORE.Window.screen.height/CORE.Input.Mouse.scale.y) CORE.Input.Mouse.currentPosition.y = CORE.Window.screen.height/CORE.Input.Mouse.scale.y;
}
- // Gesture update
+#if defined(SUPPORT_GESTURES_SYSTEM)
if (gestureUpdate)
{
- #if defined(SUPPORT_GESTURES_SYSTEM)
GestureEvent gestureEvent = { 0 };
gestureEvent.pointCount = 0;
@@ -6313,8 +6312,8 @@ static void *EventThread(void *arg)
gestureEvent.position[3] = CORE.Input.Touch.position[3];
ProcessGestureEvent(gestureEvent);
- #endif
}
+#endif
}
WaitTime(5); // Sleep for 5ms to avoid hogging CPU time
diff --git a/src/raudio.c b/src/raudio.c
index 34b19f6e..b5c2477f 100644
--- a/src/raudio.c
+++ b/src/raudio.c
@@ -371,10 +371,6 @@ static void OnLog(ma_context *pContext, ma_device *pDevice, ma_uint32 logLevel,
static void OnSendAudioDataToDevice(ma_device *pDevice, void *pFramesOut, const void *pFramesInput, ma_uint32 frameCount);
static void MixAudioFrames(float *framesOut, const float *framesIn, ma_uint32 frameCount, float localVolume);
-#if defined(SUPPORT_FILEFORMAT_WAV)
-static int SaveWAV(Wave wave, const char *fileName); // Save wave data as WAV file
-#endif
-
#if defined(RAUDIO_STANDALONE)
static bool IsFileExtension(const char *fileName, const char *ext); // Check file extension
static const char *GetFileExtension(const char *fileName); // Get pointer to extension for a filename string (includes the dot: .png)