Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix automap marks dissapering near left side of the screen #1127

Merged
merged 4 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/doom/am_map.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//

Check notice on line 1 in src/doom/am_map.c

View workflow job for this annotation

GitHub Actions / cpp-linter (clang)

Run clang-format on src/doom/am_map.c

File src/doom/am_map.c does not conform to Custom style guidelines. (lines 857, 858, 2073, 2075, 2077)
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
Expand Down Expand Up @@ -854,7 +854,8 @@
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);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! I never realized this was wrong, because honestly, how often do you play with flipped levels? 😁

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly? Pretty rarely and only in vanilla IWADs. But I still remember very well first time effect - dizziness and disorientation. Literally almost hit my face on the corner of the wall while trying to walk out from my room after one hour of playing. That's was quite something!

But it was 2017 I think. Far later, in the end of 2019 in pre- New Year celebration at day job, I have tried expensive VR helmet with some kind of zombie shooter game. While playing everything was okay. But about 10 minutes after, different feeling comes: like I was lost between two realities. It's hard to describe, but something like: eyes are seeing one, traditional scene and surroundings, while brain still thinks that I'm "somewhere else" and do not accepts current reality. But no dizziness and disorientation, just heavily annoying "desync" which was standing for a few hours.

Fortunately, my wife was near by, and walking to home was much easier than it could be. Well, she wasn't wife back then, it was happened just a 6 months later. 🙂

m_paninc2.y = FTOM(ev->data3*(mouseSensitivity_x2+5)/(160 >> crispy->hires));
rc = true;
}
Expand Down Expand Up @@ -2051,6 +2052,7 @@
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 @@
{
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
Loading