Add SDL_PushEvent() to one of the hooked SDL functions.

This is needed by Dfterm3 plugin.
develop
Mikko Juola 2013-08-17 05:53:20 +03:00
parent 18a91ef221
commit 506a60709e
1 changed files with 9 additions and 0 deletions

@ -393,6 +393,8 @@ SDL_GetKeyState
Uint8 * SDLCALL SDL_GetKeyState(int *numkeys); Uint8 * SDLCALL SDL_GetKeyState(int *numkeys);
SDL_PollEvent SDL_PollEvent
int SDLCALL SDL_PollEvent(SDL_Event *event); int SDLCALL SDL_PollEvent(SDL_Event *event);
SDL_PushEvent
int SDLCALL SDL_PushEvent(SDL_Event *event);
*/ */
static int (*_SDL_EnableKeyRepeat)(int delay, int interval) = 0; static int (*_SDL_EnableKeyRepeat)(int delay, int interval) = 0;
@ -437,6 +439,12 @@ DFhackCExport int SDL_PollEvent(SDL::Event* event)
return orig_return; return orig_return;
} }
static int (*_SDL_PushEvent)(SDL::Event* event) = 0;
DFhackCExport int SDL_PushEvent(SDL::Event* event)
{
return _SDL_PushEvent(event);
}
/***** error handling /***** error handling
SDL_GetError SDL_GetError
char * SDLCALL SDL_GetError(void); char * SDLCALL SDL_GetError(void);
@ -762,6 +770,7 @@ bool FirstCall()
_SDL_LockSurface = (int (*)(void*))GetProcAddress(realSDLlib,"SDL_LockSurface"); _SDL_LockSurface = (int (*)(void*))GetProcAddress(realSDLlib,"SDL_LockSurface");
_SDL_MapRGB = (uint32_t (*)(void*, uint8_t, uint8_t, uint8_t))GetProcAddress(realSDLlib,"SDL_MapRGB"); _SDL_MapRGB = (uint32_t (*)(void*, uint8_t, uint8_t, uint8_t))GetProcAddress(realSDLlib,"SDL_MapRGB");
_SDL_PollEvent = (int (*)(SDL::Event*))GetProcAddress(realSDLlib,"SDL_PollEvent"); _SDL_PollEvent = (int (*)(SDL::Event*))GetProcAddress(realSDLlib,"SDL_PollEvent");
_SDL_PushEvent = (int (*)(SDL::Event*))GetProcAddress(realSDLlib,"SDL_PushEvent");
_SDL_Quit = (void (*)())GetProcAddress(realSDLlib,"SDL_Quit"); _SDL_Quit = (void (*)())GetProcAddress(realSDLlib,"SDL_Quit");
_SDL_RWFromFile = (void*(*)(const char*, const char*))GetProcAddress(realSDLlib,"SDL_RWFromFile"); _SDL_RWFromFile = (void*(*)(const char*, const char*))GetProcAddress(realSDLlib,"SDL_RWFromFile");
_SDL_RemoveTimer = (bool (*)(void*))GetProcAddress(realSDLlib,"SDL_RemoveTimer"); _SDL_RemoveTimer = (bool (*)(void*))GetProcAddress(realSDLlib,"SDL_RemoveTimer");