adjust to new variable names

develop
Myk Taylor 2022-12-21 14:07:36 -08:00
parent 839e927f9b
commit 93c875fb56
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
2 changed files with 5 additions and 18 deletions

@ -2150,7 +2150,7 @@ bool Gui::setDesignationCoords (const int32_t x, const int32_t y, const int32_t
df::coord Gui::getMousePos()
{
df::coord pos;
if (gps && gps->mouse_x_pixel > -1) {
if (gps && gps->precise_mouse_x > -1) {
pos = getViewportPos();
/* TODO: understand how this changes for v50
pos.x += gps->mouse_x_pixel / tile_width;

@ -87,7 +87,7 @@ df::coord2d Screen::getMousePos()
{
if (!gps)
return df::coord2d(-1, -1);
return df::coord2d(gps->mouse_x_tile, gps->mouse_y_tile);
return df::coord2d(gps->mouse_x, gps->mouse_y);
}
// returns the screen pixel coordinates
@ -95,7 +95,7 @@ df::coord2d Screen::getMousePixels()
{
if (!gps)
return df::coord2d(-1, -1);
return df::coord2d(gps->mouse_x_pixel, gps->mouse_y_pixel);
return df::coord2d(gps->precise_mouse_x, gps->precise_mouse_y);
}
df::coord2d Screen::getWindowSize()
@ -114,21 +114,6 @@ bool Screen::inGraphicsMode()
return init && init->display.flag.is_set(init_display_flags::USE_GRAPHICS);
}
static int32_t flood_clear(int32_t target, size_t index, size_t max_idx) {
if (index >= max_idx || !gps->screen1_offset_tile[index]
|| gps->screen1_offset_tile[index] != target)
return 0;
gps->screen1_offset_tile[index] = 0;
gps->screen1_offset_x[index] = 0;
gps->screen1_offset_y[index] = 0;
int32_t cleared = 1;
cleared += flood_clear(target, index - 1, max_idx);
cleared += flood_clear(target, index + 1, max_idx);
cleared += flood_clear(target, index - gps->dimy, max_idx);
cleared += flood_clear(target, index + gps->dimy, max_idx);
return cleared;
}
static bool doSetTile_default(const Pen &pen, int x, int y, bool map)
{
auto dim = Screen::getWindowSize();
@ -136,6 +121,7 @@ static bool doSetTile_default(const Pen &pen, int x, int y, bool map)
return false;
// TODO: understand how this changes for v50
/*
size_t index = ((x * gps->dimy) + y);
if (!map) {
// don't let DF overlay interface elements draw over us
@ -160,6 +146,7 @@ static bool doSetTile_default(const Pen &pen, int x, int y, bool map)
argb[4] = bg[0];
argb[5] = bg[1];
argb[6] = bg[2];
*/
/* old code
// auto screen = gps->screen + index*4;
// screen[0] = uint8_t(pen.ch);