Skip to content

Commit a123452

Browse files
committed
use dims from DwarfmodeDims now that they're fixed
1 parent 11333e3 commit a123452

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

plugins/pathable.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#include "df/graphic_viewportst.h"
2-
1+
#include "modules/Gui.h"
32
#include "modules/Maps.h"
43
#include "modules/Screen.h"
54

@@ -34,10 +33,9 @@ static void paintScreen(df::coord target, bool skip_unrevealed = false) {
3433

3534
bool use_graphics = Screen::inGraphicsMode();
3635

37-
auto dimx = use_graphics ? gps->main_viewport->dim_x : gps->dimx;
38-
auto dimy = use_graphics ? gps->main_viewport->dim_y : gps->dimy;
39-
for (int y = 0; y < dimy; ++y) {
40-
for (int x = 0; x < dimx; ++x) {
36+
auto dims = Gui::getDwarfmodeViewDims().map();
37+
for (int y = dims.first.y; y <= dims.second.y; ++y) {
38+
for (int x = dims.first.x; x <= dims.second.x; ++x) {
4139
df::coord map_pos(*window_x + x, *window_y + y, *window_z);
4240

4341
if (!Maps::isValidTilePos(map_pos))

0 commit comments

Comments
 (0)