Fix devel plugins linking in linux

develop
Pauli 2018-06-30 21:12:29 +03:00
parent 1a4440859c
commit 0727403ac1
3 changed files with 10 additions and 1 deletions

@ -35,6 +35,7 @@ distribution.
#include "DataDefs.h" #include "DataDefs.h"
#include "df/graphic.h" #include "df/graphic.h"
#include "df/viewscreen.h" #include "df/viewscreen.h"
#include "df/zoom_commands.h"
#include "modules/GuiHooks.h" #include "modules/GuiHooks.h"
@ -182,6 +183,9 @@ namespace DFHack
return rect2d(df::coord2d(0,0), getWindowSize()-df::coord2d(1,1)); return rect2d(df::coord2d(0,0), getWindowSize()-df::coord2d(1,1));
} }
/// Wrapper to call enabler->zoom_display from plugins
DFHACK_EXPORT void zoom(df::zoom_commands cmd);
/// Returns the state of [GRAPHICS:YES/NO] /// Returns the state of [GRAPHICS:YES/NO]
DFHACK_EXPORT bool inGraphicsMode(); DFHACK_EXPORT bool inGraphicsMode();

@ -90,6 +90,10 @@ df::coord2d Screen::getWindowSize()
return df::coord2d(gps->dimx, gps->dimy); return df::coord2d(gps->dimx, gps->dimy);
} }
void Screen::zoom(df::zoom_commands cmd) {
enabler->zoom_display(cmd);
}
bool Screen::inGraphicsMode() bool Screen::inGraphicsMode()
{ {
return init && init->display.flag.is_set(init_display_flags::USE_GRAPHICS); return init && init->display.flag.is_set(init_display_flags::USE_GRAPHICS);

@ -7,6 +7,7 @@
#include <map> #include <map>
#include <vector> #include <vector>
#include "modules/Gui.h" #include "modules/Gui.h"
#include "modules/Screen.h"
#include "modules/World.h" #include "modules/World.h"
#include "df/enabler.h" #include "df/enabler.h"
@ -52,7 +53,7 @@ command_result df_zoom (color_ostream &out, std::vector <std::string> & paramete
return CR_FAILURE; return CR_FAILURE;
} }
df::zoom_commands cmd = zcmap[parameters[0]]; df::zoom_commands cmd = zcmap[parameters[0]];
enabler->zoom_display(cmd); Screen::zoom(cmd);
if (cmd == df::zoom_commands::zoom_fullscreen) if (cmd == df::zoom_commands::zoom_fullscreen)
enabler->fullscreen = !enabler->fullscreen; enabler->fullscreen = !enabler->fullscreen;
return CR_OK; return CR_OK;