From dec1aa850ba572f2d314f81704740d49f12fa5a4 Mon Sep 17 00:00:00 2001 From: MichaelFiber Date: Tue, 19 Sep 2023 16:50:54 -0400 Subject: [PATCH] Move shared function defs and some global var to rcore.h --- src/rcore.c | 23 ++++++----------------- src/rcore.h | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/rcore.c b/src/rcore.c index e4ab602d1..e2059c457 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -212,9 +212,9 @@ static int screenshotCounter = 0; // Screenshots counter #endif #if defined(SUPPORT_GIF_RECORDING) -static int gifFrameCounter = 0; // GIF frames counter -static bool gifRecording = false; // GIF recording state -static MsfGifState gifState = { 0 }; // MSGIF context state +int gifFrameCounter = 0; // GIF frames counter +bool gifRecording = false; // GIF recording state +MsfGifState gifState = { 0 }; // MSGIF context state #endif #if defined(SUPPORT_EVENTS_AUTOMATION) @@ -305,20 +305,9 @@ static bool eventsRecording = false; // Record events #endif //----------------------------------------------------------------------------------- -//---------------------------------------------------------------------------------- -// Other Modules Functions Declaration (required by core) -//---------------------------------------------------------------------------------- -#if defined(SUPPORT_MODULE_RTEXT) && defined(SUPPORT_DEFAULT_FONT) -extern void LoadFontDefault(void); // [Module: text] Loads default font on InitWindow() -extern void UnloadFontDefault(void); // [Module: text] Unloads default font from GPU memory -#endif - //---------------------------------------------------------------------------------- // Module specific Functions Declaration //---------------------------------------------------------------------------------- -static void InitTimer(void); // Initialize timer (hi-resolution if available) -static void SetupFramebuffer(int width, int height); // Setup main framebuffer -static void SetupViewport(int width, int height); // Set viewport for a provided width and height static void ScanDirectoryFiles(const char *basePath, FilePathList *list, const char *filter); // Scan all files and directories in a base path static void ScanDirectoryFilesRecursively(const char *basePath, FilePathList *list, const char *filter); // Scan all files and directories recursively from a base path @@ -2181,7 +2170,7 @@ int GetTouchPointCount(void) //---------------------------------------------------------------------------------- // Set viewport for a provided width and height -static void SetupViewport(int width, int height) +void SetupViewport(int width, int height) { CORE.Window.render.width = width; CORE.Window.render.height = height; @@ -2210,7 +2199,7 @@ static void SetupViewport(int width, int height) // Compute framebuffer size relative to screen size and display size // NOTE: Global variables CORE.Window.render.width/CORE.Window.render.height and CORE.Window.renderOffset.x/CORE.Window.renderOffset.y can be modified -static void SetupFramebuffer(int width, int height) +void SetupFramebuffer(int width, int height) { // Calculate CORE.Window.render.width and CORE.Window.render.height, we have the display size (input params) and the desired screen size (global var) if ((CORE.Window.screen.width > CORE.Window.display.width) || (CORE.Window.screen.height > CORE.Window.display.height)) @@ -2287,7 +2276,7 @@ static void SetupFramebuffer(int width, int height) } // Initialize hi-resolution timer -static void InitTimer(void) +void InitTimer(void) { // Setting a higher resolution can improve the accuracy of time-out intervals in wait functions. // However, it can also reduce overall system performance, because the thread scheduler switches tasks more often. diff --git a/src/rcore.h b/src/rcore.h index 18bd6fa80..1ecba0f8a 100644 --- a/src/rcore.h +++ b/src/rcore.h @@ -256,4 +256,25 @@ typedef struct CoreData { extern CoreData CORE; +#if defined(SUPPORT_GIF_RECORDING) +extern int gifFrameCounter = 0; // GIF frames counter +extern bool gifRecording = false; // GIF recording state +extern MsfGifState gifState = { 0 }; // MSGIF context state +#endif + + + +//---------------------------------------------------------------------------------- +// Function Definition +//---------------------------------------------------------------------------------- + +#if defined(SUPPORT_MODULE_RTEXT) && defined(SUPPORT_DEFAULT_FONT) +extern void LoadFontDefault(void); // [Module: text] Loads default font on InitWindow() +extern void UnloadFontDefault(void); // [Module: text] Unloads default font from GPU memory +#endif + +void InitTimer(void); // Initialize timer (hi-resolution if available) +void SetupFramebuffer(int width, int height); // Setup main framebuffer +void SetupViewport(int width, int height); // Set viewport for a provided width and height + #endif \ No newline at end of file