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
|
||||
|
||||
#include <ruby.h>
|
||||
#include <SDL.h>
|
||||
#if defined(__WIN32__) && defined(USE_ESSENTIALS_FIXES)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include "sharedstate.h"
|
||||
#endif
|
||||
|
||||
|
@ -18,6 +20,9 @@ typedef void* (__stdcall *MINIFFI_FUNC)(...);
|
|||
typedef void* (__cdecl *MINIFFI_FUNC)(...);
|
||||
#endif
|
||||
|
||||
// MiniFFI class, also named Win32API on Windows
|
||||
// Uses LoadLibrary/GetProcAddress on Windows, dlopen/dlsym everywhere else
|
||||
|
||||
static VALUE
|
||||
MiniFFI_alloc(VALUE self)
|
||||
{
|
||||
|
@ -191,6 +196,11 @@ MiniFFI_call(int argc, VALUE *argv, VALUE self)
|
|||
// do not work with MKXP will be intercepted here so that the code
|
||||
// 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,
|
||||
// and GetForegroundWindow are used for determining whether to
|
||||
// handle input and for positioning
|
||||
|
@ -219,6 +229,8 @@ MiniFFI_call(int argc, VALUE *argv, VALUE self)
|
|||
}
|
||||
|
||||
// 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")
|
||||
{
|
||||
|
@ -250,6 +262,10 @@ MiniFFI_call(int argc, VALUE *argv, VALUE self)
|
|||
SDL_SetWindowPosition(shState->sdlWindow(),params[2],params[3]);
|
||||
return true;
|
||||
}
|
||||
else if_func_is("RegisterHotKey") // Don't disable SDL's fullscreen,
|
||||
{ // it works fine
|
||||
ret = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = (unsigned long)ApiFunction(param);
|
||||
|
|
Loading…
Add table
Reference in a new issue