Skip to content

Commit

Permalink
Fix possible autmap marks dissapering/blinking on wide screen mode (#…
Browse files Browse the repository at this point in the history
…1127)

* Fix of possible automap marks disappearing and blinking

* Fix mouse panning for flipped levels
  • Loading branch information
JNechaevsky authored Dec 21, 2023
1 parent 66497c4 commit ef9cd31
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions src/doom/am_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,8 @@ AM_Responder
if (!followplayer && (ev->data2 || ev->data3))
{
// [crispy] mouse sensitivity for strafe
m_paninc2.x = FTOM(ev->data2*(mouseSensitivity_x2+5)/(160 >> crispy->hires));
const int flip_x = (ev->data2*(mouseSensitivity_x2+5)/(160 >> crispy->hires));
m_paninc2.x = crispy->fliplevels ? -FTOM(flip_x) : FTOM(flip_x);
m_paninc2.y = FTOM(ev->data3*(mouseSensitivity_x2+5)/(160 >> crispy->hires));
rc = true;
}
Expand Down Expand Up @@ -2051,6 +2052,7 @@ AM_drawThings
void AM_drawMarks(void)
{
int i, fx, fy, w, h;
int fx_flip; // [crispy] support for marks drawing in flipped levels

Check warning on line 2055 in src/doom/am_map.c

View workflow job for this annotation

GitHub Actions / cpp-linter (clang)

src/doom/am_map.c:2055:9 [cppcoreguidelines-init-variables]

variable 'fx_flip' is not initialized
mpoint_t pt;

for (i=0;i<AM_NUMMARKPOINTS;i++)
Expand All @@ -2068,10 +2070,11 @@ void AM_drawMarks(void)
{
AM_rotatePoint(&pt);
}
fx = (flipscreenwidth[CXMTOF(pt.x)] >> crispy->hires) - 1 - WIDESCREENDELTA;
fx = (CXMTOF(pt.x) >> crispy->hires) - 1;
fy = (CYMTOF(pt.y) >> crispy->hires) - 2;
fx_flip = (flipscreenwidth[CXMTOF(pt.x)] >> crispy->hires) - 1;
if (fx >= f_x && fx <= (f_w >> crispy->hires) - w && fy >= f_y && fy <= (f_h >> crispy->hires) - h)
V_DrawPatch(fx, fy, marknums[i]);
V_DrawPatch(fx_flip - WIDESCREENDELTA, fy, marknums[i]);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/strife/am_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -1835,13 +1835,13 @@ void AM_drawMarks(void)
{
AM_rotatePoint(&pt);
}
fx = (CXMTOF(pt.x) >> crispy->hires) - 3 - WIDESCREENDELTA;
fx = (CXMTOF(pt.x) >> crispy->hires) - 3;
fy = (CYMTOF(pt.y) >> crispy->hires) - 3;
if (fx >= f_x && fx <= (f_w >> crispy->hires) - w && fy >= f_y && fy <= (f_h >> crispy->hires) - h)
{
// villsa [STRIFE]
if(i >= mapmarknum)
V_DrawPatch(fx, fy, marknums[i]);
V_DrawPatch(fx - WIDESCREENDELTA, fy, marknums[i]);
}
}
}
Expand Down

0 comments on commit ef9cd31

Please sign in to comment.