mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
[split] rcore, rcore_web and rcore_desktop changes (batch 2) (#3334)
* Fix formatting * Reapply commit9d230d7(#3305) that was missing * Reapplies commits719365f(#3309) and8a1779b(#3312) that were missing * Reapply commit5c9cc3f(#3323) that was missing * Reapply commita2b3b1ethat was missing * Revert commitcef25c6to fix macro redefined warning * Move rcore.h #include to after config.h to fix macro redefinitions warnings
This commit is contained in:
25
src/rcore.c
25
src/rcore.c
@ -99,13 +99,14 @@
|
||||
**********************************************************************************************/
|
||||
|
||||
#include "raylib.h" // Declares module functions
|
||||
#include "rcore.h"
|
||||
|
||||
// Check if config flags have been externally provided on compilation line
|
||||
#if !defined(EXTERNAL_CONFIG_FLAGS)
|
||||
#include "config.h" // Defines module configuration flags
|
||||
#endif
|
||||
|
||||
#include "rcore.h"
|
||||
|
||||
#define RLGL_IMPLEMENTATION
|
||||
#include "rlgl.h" // OpenGL abstraction layer to OpenGL 1.1, 3.3+ or ES2
|
||||
|
||||
@ -1691,10 +1692,12 @@ unsigned char *CompressData(const unsigned char *data, int dataSize, int *compDa
|
||||
|
||||
#if defined(SUPPORT_COMPRESSION_API)
|
||||
// Compress data and generate a valid DEFLATE stream
|
||||
struct sdefl sdefl = { 0 };
|
||||
int bounds = sdefl_bound(dataSize);
|
||||
struct sdefl *sdefl = RL_CALLOC(1, sizeof(struct sdefl)); // WARNING: Possible stack overflow, struct sdefl is almost 1MB
|
||||
int bounds = dataSize*2;//sdefl_bound(dataSize);
|
||||
compData = (unsigned char *)RL_CALLOC(bounds, 1);
|
||||
*compDataSize = sdeflate(&sdefl, compData, data, dataSize, COMPRESSION_QUALITY_DEFLATE); // Compression level 8, same as stbiw
|
||||
|
||||
*compDataSize = sdeflate(sdefl, compData, data, dataSize, COMPRESSION_QUALITY_DEFLATE); // Compression level 8, same as stbiw
|
||||
RL_FREE(sdefl);
|
||||
|
||||
TRACELOG(LOG_INFO, "SYSTEM: Compress data: Original size: %i -> Comp. size: %i", dataSize, *compDataSize);
|
||||
#endif
|
||||
@ -3366,15 +3369,11 @@ static void *EventThread(void *arg)
|
||||
gestureEvent.touchAction = touchAction;
|
||||
gestureEvent.pointCount = CORE.Input.Touch.pointCount;
|
||||
|
||||
gestureEvent.pointId[0] = 0;
|
||||
gestureEvent.pointId[1] = 1;
|
||||
gestureEvent.pointId[2] = 2;
|
||||
gestureEvent.pointId[3] = 3;
|
||||
|
||||
gestureEvent.position[0] = CORE.Input.Touch.position[0];
|
||||
gestureEvent.position[1] = CORE.Input.Touch.position[1];
|
||||
gestureEvent.position[2] = CORE.Input.Touch.position[2];
|
||||
gestureEvent.position[3] = CORE.Input.Touch.position[3];
|
||||
for (int i = 0; i < MAX_TOUCH_POINTS; i++)
|
||||
{
|
||||
gestureEvent.pointId[i] = i;
|
||||
gestureEvent.position[i] = CORE.Input.Touch.position[i];
|
||||
}
|
||||
|
||||
ProcessGestureEvent(gestureEvent);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user