don't need this

develop
Vitaly Pronkin 2018-05-25 01:34:57 +12:00
parent 0217916568
commit a44f5b57cb
4 changed files with 2 additions and 22 deletions

@ -127,12 +127,6 @@ DFhackCExport int SDL_PushEvent(SDL::Event* event)
return _SDL_PushEvent(event);
}
static unsigned char* (*_SDL_GetKeyState)(int *numkeys) = 0;
DFhackCExport unsigned char* SDL_GetKeyState(int *numkeys)
{
return _SDL_GetKeyState(numkeys);
}
struct WINDOW;
DFhackCExport int DFH_wgetch(WINDOW *win)
{
@ -297,7 +291,6 @@ DFhackCExport int DFH_SDL_Init(uint32_t flags)
bind(SDL_Quit);
bind(SDL_PollEvent);
bind(SDL_PushEvent);
bind(SDL_GetKeyState);
bind(SDL_UpperBlit);
bind(SDL_CreateRGBSurface);

@ -58,7 +58,6 @@ DFhackCExport int SDL_NumJoysticks(void);
DFhackCExport void SDL_Quit(void);
DFhackCExport int SDL_PollEvent(SDL::Event* event);
DFhackCExport int SDL_PushEvent(SDL::Event* event);
DFhackCExport unsigned char* SDL_GetKeyState(int *numkeys);
DFhackCExport int SDL_Init(uint32_t flags);
DFhackCExport int wgetch(WINDOW * win);

@ -136,11 +136,7 @@ if (BUILD_SUPPORTED)
DFHACK_PLUGIN(manipulator manipulator.cpp)
DFHACK_PLUGIN(misery misery.cpp)
DFHACK_PLUGIN(mode mode.cpp)
IF(UNIX AND NOT APPLE)
DFHACK_PLUGIN(mousequery mousequery.cpp LINK_LIBRARIES SDL)
ELSE()
DFHACK_PLUGIN(mousequery mousequery.cpp)
ENDIF()
DFHACK_PLUGIN(mousequery mousequery.cpp)
DFHACK_PLUGIN(orders orders.cpp LINK_LIBRARIES jsoncpp)
DFHACK_PLUGIN(pathable pathable.cpp LINK_LIBRARIES lua)
DFHACK_PLUGIN(petcapRemover petcapRemover.cpp)

@ -21,10 +21,6 @@
#include "TileTypes.h"
#include "DataFuncs.h"
// For SDL_GetKeyState
#include "Hooks.h"
#include "SDL_keyboard.h"
DFHACK_PLUGIN("mousequery");
REQUIRE_GLOBAL(enabler);
REQUIRE_GLOBAL(gps);
@ -302,11 +298,7 @@ struct mousequery_hook : public df::viewscreen_dwarfmodest
bool handleLeft(df::coord &mpos, int32_t mx, int32_t my)
{
static unsigned char *keystate = 0;
if (!keystate)
keystate = SDL_GetKeyState(NULL);
if (!(keystate[SDL::Key::K_LSHIFT] || keystate[SDL::Key::K_RSHIFT]))
if (!(Core::getInstance().getModstate() & DFH_MOD_SHIFT))
mpos.z += Gui::getDepthAt(mx, my);
bool cursor_still_here = (last_clicked_x == mpos.x && last_clicked_y == mpos.y && last_clicked_z == mpos.z);