Minor tweaks
This commit is contained in:
parent
1fe137db44
commit
f81dfce19f
2 changed files with 27 additions and 32 deletions
55
src/core.c
55
src/core.c
|
@ -6184,24 +6184,24 @@ static void *EventThread(void *arg)
|
||||||
// Basic movement
|
// Basic movement
|
||||||
if (event.code == ABS_X)
|
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.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.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)
|
#if defined(SUPPORT_GESTURES_SYSTEM)
|
||||||
touchAction = TOUCH_MOVE;
|
touchAction = TOUCH_MOVE;
|
||||||
gestureUpdate = true;
|
gestureUpdate = true;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.code == ABS_Y)
|
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.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.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)
|
#if defined(SUPPORT_GESTURES_SYSTEM)
|
||||||
touchAction = TOUCH_MOVE;
|
touchAction = TOUCH_MOVE;
|
||||||
gestureUpdate = true;
|
gestureUpdate = true;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Multitouch movement
|
// Multitouch movement
|
||||||
|
@ -6236,20 +6236,20 @@ static void *EventThread(void *arg)
|
||||||
{
|
{
|
||||||
CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_LEFT] = 0;
|
CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_LEFT] = 0;
|
||||||
|
|
||||||
#if defined(SUPPORT_GESTURES_SYSTEM)
|
#if defined(SUPPORT_GESTURES_SYSTEM)
|
||||||
touchAction = TOUCH_UP;
|
touchAction = TOUCH_UP;
|
||||||
gestureUpdate = true;
|
gestureUpdate = true;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.value && !previousMouseLeftButtonState)
|
if (event.value && !previousMouseLeftButtonState)
|
||||||
{
|
{
|
||||||
CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_LEFT] = 1;
|
CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_LEFT] = 1;
|
||||||
|
|
||||||
#if defined(SUPPORT_GESTURES_SYSTEM)
|
#if defined(SUPPORT_GESTURES_SYSTEM)
|
||||||
touchAction = TOUCH_DOWN;
|
touchAction = TOUCH_DOWN;
|
||||||
gestureUpdate = true;
|
gestureUpdate = true;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6263,11 +6263,11 @@ static void *EventThread(void *arg)
|
||||||
{
|
{
|
||||||
CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_LEFT] = event.value;
|
CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_LEFT] = event.value;
|
||||||
|
|
||||||
#if defined(SUPPORT_GESTURES_SYSTEM)
|
#if defined(SUPPORT_GESTURES_SYSTEM)
|
||||||
if (event.value > 0) touchAction = TOUCH_DOWN;
|
if (event.value > 0) touchAction = TOUCH_DOWN;
|
||||||
else touchAction = TOUCH_UP;
|
else touchAction = TOUCH_UP;
|
||||||
gestureUpdate = true;
|
gestureUpdate = true;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.code == BTN_RIGHT) CORE.Input.Mouse.currentButtonStateEvdev[MOUSE_BUTTON_RIGHT] = event.value;
|
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;
|
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 (gestureUpdate)
|
||||||
{
|
{
|
||||||
#if defined(SUPPORT_GESTURES_SYSTEM)
|
|
||||||
GestureEvent gestureEvent = { 0 };
|
GestureEvent gestureEvent = { 0 };
|
||||||
|
|
||||||
gestureEvent.pointCount = 0;
|
gestureEvent.pointCount = 0;
|
||||||
|
@ -6313,8 +6312,8 @@ static void *EventThread(void *arg)
|
||||||
gestureEvent.position[3] = CORE.Input.Touch.position[3];
|
gestureEvent.position[3] = CORE.Input.Touch.position[3];
|
||||||
|
|
||||||
ProcessGestureEvent(gestureEvent);
|
ProcessGestureEvent(gestureEvent);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
WaitTime(5); // Sleep for 5ms to avoid hogging CPU time
|
WaitTime(5); // Sleep for 5ms to avoid hogging CPU time
|
||||||
|
|
|
@ -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 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);
|
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)
|
#if defined(RAUDIO_STANDALONE)
|
||||||
static bool IsFileExtension(const char *fileName, const char *ext); // Check file extension
|
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)
|
static const char *GetFileExtension(const char *fileName); // Get pointer to extension for a filename string (includes the dot: .png)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue