[split] rcore, rcore_web and rcore_desktop changes (batch 2) (#3334)

* Fix formatting

* Reapply commit 9d230d7 (#3305) that was missing

* Reapplies commits 719365f (#3309) and 8a1779b (#3312) that were missing

* Reapply commit 5c9cc3f (#3323) that was missing

* Reapply commit a2b3b1e that was missing

* Revert commit cef25c6 to fix macro redefined warning

* Move rcore.h #include to after config.h to fix macro redefinitions warnings
This commit is contained in:
ubkp
2023-09-21 18:47:43 -03:00
committed by GitHub
parent 7840e75a0b
commit 0ef3e09d7a
4 changed files with 97 additions and 129 deletions

View File

@ -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);
}