Merge pull request #56 from Indev450/sdldraganddrop

Addfile per drag and drop
This commit was merged in pull request #56.
This commit is contained in:
indev authored and GitHub committed 2023-09-08 11:51:31 +03:00
commit 3ff865b1b6
1 file changed
+7
+7
View File
@@ -59,6 +59,7 @@
#endif
#include "../doomstat.h"
#include "../p_setup.h"
#include "../i_system.h"
#include "../v_video.h"
#include "../m_argv.h"
@@ -969,6 +970,7 @@ static void Impl_HandleControllerButtonEvent(SDL_ControllerButtonEvent evt, Uint
void I_GetEvent(void)
{
SDL_Event evt;
char* dropped_filedir;
// We only want the first motion event,
// otherwise we'll end up catching the warp back to center.
//int mouseMotionOnce = 0;
@@ -1293,6 +1295,11 @@ void I_GetEvent(void)
if (currentMenu == &OP_JoystickSetDef)
M_SetupJoystickMenu(0);
break;
case SDL_DROPFILE:
dropped_filedir = evt.drop.file;
P_AddWadFile(dropped_filedir);
SDL_free(dropped_filedir); // Free dropped_filedir memory
break;
case SDL_QUIT:
I_Quit();
M_QuitResponse('y');