mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-09-10 12:02:53 +02:00
Don't let SpriteResizer disable native fullscreen
This commit is contained in:
parent
7717e47197
commit
9ac3dd969e
1 changed files with 17 additions and 1 deletions
|
@ -1,9 +1,11 @@
|
||||||
// Most of the MiniDL class was taken from Ruby 1.8's Win32API.c,
|
// Most of the MiniFFI class was taken from Ruby 1.8's Win32API.c,
|
||||||
// it's just as basic but should work fine for the moment
|
// it's just as basic but should work fine for the moment
|
||||||
|
|
||||||
#include <ruby.h>
|
#include <ruby.h>
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#if defined(__WIN32__) && defined(USE_ESSENTIALS_FIXES)
|
#if defined(__WIN32__) && defined(USE_ESSENTIALS_FIXES)
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#include <windows.h>
|
||||||
#include "sharedstate.h"
|
#include "sharedstate.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -18,6 +20,9 @@ typedef void* (__stdcall *MINIFFI_FUNC)(...);
|
||||||
typedef void* (__cdecl *MINIFFI_FUNC)(...);
|
typedef void* (__cdecl *MINIFFI_FUNC)(...);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// MiniFFI class, also named Win32API on Windows
|
||||||
|
// Uses LoadLibrary/GetProcAddress on Windows, dlopen/dlsym everywhere else
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
MiniFFI_alloc(VALUE self)
|
MiniFFI_alloc(VALUE self)
|
||||||
{
|
{
|
||||||
|
@ -190,6 +195,11 @@ MiniFFI_call(int argc, VALUE *argv, VALUE self)
|
||||||
// On Windows, if essentials fixes are enabled, function calls that
|
// On Windows, if essentials fixes are enabled, function calls that
|
||||||
// do not work with MKXP will be intercepted here so that the code
|
// do not work with MKXP will be intercepted here so that the code
|
||||||
// still has its desired effect
|
// still has its desired effect
|
||||||
|
|
||||||
|
// TODO: Move these to actual functions and just redirect the
|
||||||
|
// function pointers during the initialization stage
|
||||||
|
// so that we're not going through ugly if statements
|
||||||
|
// a million times a second in Essentials
|
||||||
|
|
||||||
// GetCurrentThreadId, GetWindowThreadProcessId, FindWindowEx,
|
// GetCurrentThreadId, GetWindowThreadProcessId, FindWindowEx,
|
||||||
// and GetForegroundWindow are used for determining whether to
|
// and GetForegroundWindow are used for determining whether to
|
||||||
|
@ -219,6 +229,8 @@ MiniFFI_call(int argc, VALUE *argv, VALUE self)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mouse support
|
// Mouse support
|
||||||
|
// FIXME: It worked before but I've broken it somehow,
|
||||||
|
// but on the plus side everything else works
|
||||||
|
|
||||||
else if_func_is("GetCursorPos")
|
else if_func_is("GetCursorPos")
|
||||||
{
|
{
|
||||||
|
@ -250,6 +262,10 @@ MiniFFI_call(int argc, VALUE *argv, VALUE self)
|
||||||
SDL_SetWindowPosition(shState->sdlWindow(),params[2],params[3]);
|
SDL_SetWindowPosition(shState->sdlWindow(),params[2],params[3]);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if_func_is("RegisterHotKey") // Don't disable SDL's fullscreen,
|
||||||
|
{ // it works fine
|
||||||
|
ret = 0;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ret = (unsigned long)ApiFunction(param);
|
ret = (unsigned long)ApiFunction(param);
|
||||||
|
|
Loading…
Add table
Reference in a new issue