Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0727403

Browse files
committed
Fix devel plugins linking in linux
1 parent 1a44408 commit 0727403

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

library/include/modules/Screen.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ distribution.
3535
#include "DataDefs.h"
3636
#include "df/graphic.h"
3737
#include "df/viewscreen.h"
38+
#include "df/zoom_commands.h"
3839

3940
#include "modules/GuiHooks.h"
4041

@@ -182,6 +183,9 @@ namespace DFHack
182183
return rect2d(df::coord2d(0,0), getWindowSize()-df::coord2d(1,1));
183184
}
184185

186+
/// Wrapper to call enabler->zoom_display from plugins
187+
DFHACK_EXPORT void zoom(df::zoom_commands cmd);
188+
185189
/// Returns the state of [GRAPHICS:YES/NO]
186190
DFHACK_EXPORT bool inGraphicsMode();
187191

library/modules/Screen.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ df::coord2d Screen::getWindowSize()
9090
return df::coord2d(gps->dimx, gps->dimy);
9191
}
9292

93+
void Screen::zoom(df::zoom_commands cmd) {
94+
enabler->zoom_display(cmd);
95+
}
96+
9397
bool Screen::inGraphicsMode()
9498
{
9599
return init && init->display.flag.is_set(init_display_flags::USE_GRAPHICS);

plugins/devel/zoom.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <map>
88
#include <vector>
99
#include "modules/Gui.h"
10+
#include "modules/Screen.h"
1011
#include "modules/World.h"
1112
#include "df/enabler.h"
1213

@@ -52,7 +53,7 @@ command_result df_zoom (color_ostream &out, std::vector <std::string> & paramete
5253
return CR_FAILURE;
5354
}
5455
df::zoom_commands cmd = zcmap[parameters[0]];
55-
enabler->zoom_display(cmd);
56+
Screen::zoom(cmd);
5657
if (cmd == df::zoom_commands::zoom_fullscreen)
5758
enabler->fullscreen = !enabler->fullscreen;
5859
return CR_OK;

0 commit comments

Comments
 (0)