Ignore RGSS Linker, fix(?) Essentials mouse

This commit is contained in:
Inori 2019-08-03 07:45:36 -04:00 committed by Inori
parent ef7ced8fed
commit 5e41f16851
2 changed files with 24 additions and 2 deletions

View file

@ -516,6 +516,19 @@ static void runRMXPScripts(BacktraceData &btData)
btData.scriptNames.insert(buf, scriptName);
int state;
#if defined(__WIN32__) && defined(USE_ESSENTIALS_FIXES)
// I can hack around RGSS Linker and have it work properly,
// but (A) working with essentials is already hacky enough
// and (B) we can simply just use F-MOD as MKXP's audio backend
// if we absolutely had to.
// GENERATE WIKI PAGES is just excluded because of a difference
// in ruby's regex code from 1.8.1 -> 1.8.7 that I haven't worked out yet
if (strcmp(scriptName, "RGSS Linker")
&& strcmp(scriptName, "F-mod main script")
&& strcmp(scriptName, "GENERATE WIKI PAGES"))
#endif
evalString(string, fname, &state);
if (state)
break;

View file

@ -223,17 +223,26 @@ MiniDL_call(int argc, VALUE *argv, VALUE self)
ret = 0;
}
// GetCursorPos is broken too, apparently
// Mouse support
else if_func_is("GetCursorPos")
{
int *output = (int*)params[0];
int x, y;
SDL_GetMouseState(&x, &y);
SDL_GetGlobalMouseState(&x, &y);
output[0] = x;
output[1] = y;
ret = true;
}
else if_func_is("ScreenToClient")
{
int *output = (int*)params[1];
int x, y;
SDL_GetMouseState(&x, &y);
output[0] = x;
output[1] = y;
ret = true;
}
else
{
ret = (unsigned long)ApiFunction(param);