diff --git a/examples/core/core_drop_files.c b/examples/core/core_drop_files.c index 5c3af6ab..129ced10 100644 --- a/examples/core/core_drop_files.c +++ b/examples/core/core_drop_files.c @@ -35,7 +35,7 @@ int main(void) //---------------------------------------------------------------------------------- if (IsFileDropped()) { - droppedFiles = GetDroppedFiles(&count); + droppedFiles = LoadDroppedFiles(&count); } //---------------------------------------------------------------------------------- @@ -67,7 +67,7 @@ int main(void) // De-Initialization //-------------------------------------------------------------------------------------- - ClearDroppedFiles(); // Clear internal buffers + UnloadDroppedFiles(); // Clear internal buffers CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- diff --git a/examples/models/models_loading.c b/examples/models/models_loading.c index f13b11ef..7d4543cd 100644 --- a/examples/models/models_loading.c +++ b/examples/models/models_loading.c @@ -68,7 +68,7 @@ int main(void) if (IsFileDropped()) { int count = 0; - char **droppedFiles = GetDroppedFiles(&count); + char **droppedFiles = LoadDroppedFiles(&count); if (count == 1) // Only support one file dropped { @@ -95,7 +95,7 @@ int main(void) } } - ClearDroppedFiles(); // Clear internal buffers + UnloadDroppedFiles(); // Clear internal buffers } // Select model on mouse click diff --git a/examples/models/models_skybox.c b/examples/models/models_skybox.c index dd202617..b5e0102d 100644 --- a/examples/models/models_skybox.c +++ b/examples/models/models_skybox.c @@ -98,7 +98,7 @@ int main(void) if (IsFileDropped()) { int count = 0; - char **droppedFiles = GetDroppedFiles(&count); + char **droppedFiles = LoadDroppedFiles(&count); if (count == 1) // Only support one file dropped { @@ -125,7 +125,7 @@ int main(void) } } - ClearDroppedFiles(); // Clear internal buffers + UnloadDroppedFiles(); // Clear internal buffers } //---------------------------------------------------------------------------------- diff --git a/examples/text/text_draw_3d.c b/examples/text/text_draw_3d.c index ff777abc..c82629de 100644 --- a/examples/text/text_draw_3d.c +++ b/examples/text/text_draw_3d.c @@ -142,7 +142,7 @@ int main(void) if (IsFileDropped()) { int count = 0; - char **droppedFiles = GetDroppedFiles(&count); + char **droppedFiles = LoadDroppedFiles(&count); // NOTE: We only support first ttf file dropped if (IsFileExtension(droppedFiles[0], ".ttf")) @@ -156,7 +156,7 @@ int main(void) font = LoadFont(droppedFiles[0]); fontSize = font.baseSize; } - ClearDroppedFiles(); + UnloadDroppedFiles(); } // Handle Events diff --git a/examples/text/text_font_filters.c b/examples/text/text_font_filters.c index 71213ced..5fb8fc47 100644 --- a/examples/text/text_font_filters.c +++ b/examples/text/text_font_filters.c @@ -80,14 +80,14 @@ int main(void) if (IsFileDropped()) { int count = 0; - char **droppedFiles = GetDroppedFiles(&count); + char **droppedFiles = LoadDroppedFiles(&count); // NOTE: We only support first ttf file dropped if (IsFileExtension(droppedFiles[0], ".ttf")) { UnloadFont(font); font = LoadFontEx(droppedFiles[0], (int)fontSize, 0, 0); - ClearDroppedFiles(); + UnloadDroppedFiles(); } } //---------------------------------------------------------------------------------- @@ -123,7 +123,7 @@ int main(void) // De-Initialization //-------------------------------------------------------------------------------------- - ClearDroppedFiles(); // Clear internal buffers + UnloadDroppedFiles(); // Clear internal buffers UnloadFont(font); // Font unloading diff --git a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h index 85b35a40..6e7f903e 100644 --- a/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h +++ b/projects/Notepad++/raylib_npp_parser/raylib_to_parse.h @@ -149,8 +149,8 @@ RLAPI char **GetDirectoryFiles(const char *dirPath, int *count); // Get filenam RLAPI void ClearDirectoryFiles(void); // Clear directory files paths buffers (free memory) RLAPI bool ChangeDirectory(const char *dir); // Change working directory, return true on success RLAPI bool IsFileDropped(void); // Check if a file has been dropped into window -RLAPI char **GetDroppedFiles(int *count); // Get dropped files names (memory should be freed) -RLAPI void ClearDroppedFiles(void); // Clear dropped files paths buffer (free memory) +RLAPI char **LoadDroppedFiles(int *count); // Get dropped files names (memory should be freed) +RLAPI void UnloadDroppedFiles(void); // Clear dropped files paths buffer (free memory) RLAPI long GetFileModTime(const char *fileName); // Get file modification time (last write time) // Compression/Encoding functionality diff --git a/src/raylib.h b/src/raylib.h index 3fad7fff..7b3000c0 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1,6 +1,6 @@ /********************************************************************************************** * -* raylib v4.1-dev - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com) +* raylib v4.2-dev - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com) * * FEATURES: * - NO external dependencies, all required libraries included with raylib @@ -80,7 +80,7 @@ #include // Required for: va_list - Only used by TraceLogCallback -#define RAYLIB_VERSION "4.1-dev" +#define RAYLIB_VERSION "4.2-dev" // Function specifiers in case library is build/used as a shared library (Windows) // NOTE: Microsoft specifiers to tell compiler that symbols are imported/exported from a .dll @@ -1058,11 +1058,11 @@ RLAPI const char *GetPrevDirectoryPath(const char *dirPath); // Get previou RLAPI const char *GetWorkingDirectory(void); // Get current working directory (uses static string) RLAPI const char *GetApplicationDirectory(void); // Get the directory if the running application (uses static string) RLAPI bool ChangeDirectory(const char *dir); // Change working directory, return true on success -RLAPI char **LoadDirectoryFiles(const char *dirPath, int *count); // Load filenames in a directory path -RLAPI void UnloadDirectoryFiles(void); // Clear directory files paths buffers +RLAPI char **LoadDirectoryFiles(const char *dirPath, int *count); // Load directory filepaths +RLAPI void UnloadDirectoryFiles(void); // Unload directory filepaths RLAPI bool IsFileDropped(void); // Check if a file has been dropped into window -RLAPI char **GetDroppedFiles(int *count); // Get dropped files names (memory must be freed) -RLAPI void ClearDroppedFiles(void); // Clear dropped files paths buffer (free memory) +RLAPI char **LoadDroppedFiles(int *count); // Load dropped filepaths +RLAPI void UnloadDroppedFiles(void); // Unload dropped filepaths RLAPI long GetFileModTime(const char *fileName); // Get file modification time (last write time) // Compression/Encoding functionality diff --git a/src/rcore.c b/src/rcore.c index b47bc388..ece26514 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -404,7 +404,7 @@ typedef struct CoreData { Point renderOffset; // Offset from render area (must be divided by 2) Matrix screenScale; // Matrix to scale screen (framebuffer rendering) - char **dropFilesPath; // Store dropped files paths as strings + char **dropFilepaths; // Store dropped files paths as strings int dropFileCount; // Count dropped files strings } Window; @@ -3109,7 +3109,7 @@ const char *GetApplicationDirectory(void) return appDir; } -// Get filenames in a directory path +// Load directory filepaths // NOTE: Files count is returned by parameters pointer char **LoadDirectoryFiles(const char *dirPath, int *fileCount) { @@ -3144,7 +3144,7 @@ char **LoadDirectoryFiles(const char *dirPath, int *fileCount) return dirFilesPath; } -// Clear directory files paths buffers +// Unload directory filepaths void UnloadDirectoryFiles(void) { if (dirFileCount > 0) @@ -3174,21 +3174,21 @@ bool IsFileDropped(void) else return false; } -// Get dropped files names -char **GetDroppedFiles(int *count) +// Load dropped filepaths +char **LoadDroppedFiles(int *count) { *count = CORE.Window.dropFileCount; - return CORE.Window.dropFilesPath; + return CORE.Window.dropFilepaths; } -// Clear dropped files paths buffer -void ClearDroppedFiles(void) +// Unload dropped filepaths +void UnloadDroppedFiles(void) { if (CORE.Window.dropFileCount > 0) { - for (int i = 0; i < CORE.Window.dropFileCount; i++) RL_FREE(CORE.Window.dropFilesPath[i]); + for (int i = 0; i < CORE.Window.dropFileCount; i++) RL_FREE(CORE.Window.dropFilepaths[i]); - RL_FREE(CORE.Window.dropFilesPath); + RL_FREE(CORE.Window.dropFilepaths); CORE.Window.dropFileCount = 0; } @@ -5419,14 +5419,14 @@ static void CursorEnterCallback(GLFWwindow *window, int enter) // Everytime new files are dropped, old ones are discarded static void WindowDropCallback(GLFWwindow *window, int count, const char **paths) { - ClearDroppedFiles(); + UnloadDroppedFiles(); - CORE.Window.dropFilesPath = (char **)RL_MALLOC(count*sizeof(char *)); + CORE.Window.dropFilepaths = (char **)RL_MALLOC(count*sizeof(char *)); for (int i = 0; i < count; i++) { - CORE.Window.dropFilesPath[i] = (char *)RL_MALLOC(MAX_FILEPATH_LENGTH*sizeof(char)); - strcpy(CORE.Window.dropFilesPath[i], paths[i]); + CORE.Window.dropFilepaths[i] = (char *)RL_MALLOC(MAX_FILEPATH_LENGTH*sizeof(char)); + strcpy(CORE.Window.dropFilepaths[i], paths[i]); } CORE.Window.dropFileCount = count;