mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-07 11:58:13 +00:00
Tweak WindowDropCallback()
#2943
This commit is contained in:
@@ -5598,6 +5598,8 @@ static void CursorEnterCallback(GLFWwindow *window, int enter)
|
|||||||
// GLFW3 Window Drop Callback, runs when drop files into window
|
// GLFW3 Window Drop Callback, runs when drop files into window
|
||||||
static void WindowDropCallback(GLFWwindow *window, int count, const char **paths)
|
static void WindowDropCallback(GLFWwindow *window, int count, const char **paths)
|
||||||
{
|
{
|
||||||
|
if (count > 0)
|
||||||
|
{
|
||||||
// In case previous dropped filepaths have not been freed, we free them
|
// In case previous dropped filepaths have not been freed, we free them
|
||||||
if (CORE.Window.dropFileCount > 0)
|
if (CORE.Window.dropFileCount > 0)
|
||||||
{
|
{
|
||||||
@@ -5618,6 +5620,7 @@ static void WindowDropCallback(GLFWwindow *window, int count, const char **paths
|
|||||||
CORE.Window.dropFilepaths[i] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char));
|
CORE.Window.dropFilepaths[i] = (char *)RL_CALLOC(MAX_FILEPATH_LENGTH, sizeof(char));
|
||||||
strcpy(CORE.Window.dropFilepaths[i], paths[i]);
|
strcpy(CORE.Window.dropFilepaths[i], paths[i]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user