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

Conversation

JNechaevsky
Copy link
Collaborator

Fixes this case in widescreen mode:

crispy-doom.2023-12-17.17-49-01-406.mp4

Hovewer! There is a small problem with Doom, caused by flipscreenwidth. This is won't happent if just CXMTOF(pt.x) will be used. Note how 1 is blinking and appearing when it shouldn't. It was happening even before my fix.

crispy-doom.2023-12-17.18-45-56-925.mp4

Not sure how to fix this blinking, no ideas yet... 🤔

Copy link
Owner

@fabiangreffrath fabiangreffrath left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@JNechaevsky
Copy link
Collaborator Author

Allow me please to break head more on flipscreenwidth issue, I don't want to leave this blinking. Marks itself are pretty useful when playing less familiar levels, for cases like "leave mega armor for next level, but mark it to don't loose it".

@JNechaevsky
Copy link
Collaborator Author

Hm, this seems to be working fine and fixing marks blinking in both normal and -fliplevels modes:

 void AM_drawMarks(void)
 {
-    int i, fx, fy, w, h;
+    int i, fx, fx_flip, fy, w, h;
     mpoint_t pt;
 
     for (i=0;i<AM_NUMMARKPOINTS;i++)
@@ -2068,10 +2068,11 @@
 	    {
 		AM_rotatePoint(&pt);
 	    }
-	    fx = (flipscreenwidth[CXMTOF(pt.x)] >> crispy->hires) - 1;
+	    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 - WIDESCREENDELTA, fy, marknums[i]);
+		V_DrawPatch(fx_flip - WIDESCREENDELTA, fy, marknums[i]);
 	}
     }

I.e., we are drawing mark patch with taking to account possible flipped screen width, but keeping it in strictly original/positive screen bounds (damn, language barriers!).

But I wonder if it could be simplified, such "doubling" doesn't looks nice. Simple fx_flip = (flipscreenwidth[fx]); doesn't work.

@JNechaevsky
Copy link
Collaborator Author

I think it's all done now. To summarize, this PR making two things:

  • Fixes possible mark dissapearing and blinking in both normal and flipped levels mode.
  • Fixes "mirrored" map panning by mouse movement left-right in flipped levels mode.

Still don't like that fx_flip doubler, but I don't see any ways to simplify it. @fabiangreffrath, your turn please, when you'll have a minute.

@JNechaevsky JNechaevsky marked this pull request as ready for review December 20, 2023 17:38
@@ -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);
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. 🙂

Copy link
Owner

@fabiangreffrath fabiangreffrath left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

@JNechaevsky JNechaevsky merged commit ef9cd31 into master Dec 21, 2023
6 checks passed
@JNechaevsky JNechaevsky deleted the am_marks branch December 21, 2023 08:36
JNechaevsky added a commit to JNechaevsky/international-doom that referenced this pull request Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants