From 7a4de087f98b0f7d24254d00cf1d1a241bad3d4e Mon Sep 17 00:00:00 2001
From: pk-2000 <63214388+pk-2000@users.noreply.github.com>
Date: Fri, 3 Sep 2021 16:36:38 +0300
Subject: [PATCH] Enable cursor support

Enables the ability to use the cursor/mouse scripts.
e.g. Shaz's Super Simple Mouse System
https://forums.rpgmakerweb.com/index.php?threads/amaranths-super-simple-mouse-system-for-ace.17829/
works without relying in it's Win32API settings/Declarations
---
 src/eventthread.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/eventthread.cpp b/src/eventthread.cpp
index 699d7e8..b87f43a 100644
--- a/src/eventthread.cpp
+++ b/src/eventthread.cpp
@@ -105,6 +105,8 @@ EventThread::EventThread()
       showCursor(false)
 {}
 
+SDL_DisplayMode dm = {0};
+
 void EventThread::process(RGSSThreadData &rtData)
 {
 	SDL_Event event;
@@ -119,6 +121,8 @@ void EventThread::process(RGSSThreadData &rtData)
 #endif
 
 	fullscreen = rtData.config.fullscreen;
+	showCursor = rtData.config.showCursor;
+	SDL_GetDesktopDisplayMode(0, &dm);
 	int toggleFSMod = rtData.config.anyAltToggleFS ? KMOD_ALT : KMOD_LALT;
 
 	fps.lastFrame = SDL_GetPerformanceCounter();
@@ -540,6 +544,7 @@ void EventThread::resetInputStates()
 
 void EventThread::setFullscreen(SDL_Window *win, bool mode)
 {
+	SDL_GetDesktopDisplayMode(0, &dm);
 	SDL_SetWindowFullscreen
 	        (win, mode ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0);
 	fullscreen = mode;