Skip to content

Commit

Permalink
Fix flip_levels in three-screen mode, and more
Browse files Browse the repository at this point in the history
Also expanded explanation of the fix in the previous commit.
  • Loading branch information
MrAlaux committed Jan 5, 2025
1 parent 12e0890 commit 8e338fa
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

- Broken movement in systems assuming `char`s to be unsigned
- `comp_lsamnesia` inversely affecting collision with entities (i.e. lost souls would remember their target)
- Weapon sprites being raised/lowered excessively when using switch interruption with certain bobbing styles
- Weapon sprites being raised/lowered excessively when using switch interruption
with certain bobbing styles and/or reduced weapon bobbing amplitude
- _Flip Levels_ setting not working for side screens in three-screen mode
- Message grouping only checking as many characters as the last message had,
causing incorrect grouping (e.g. new message "TEST" being grouped with last message "TES")
4 changes: 4 additions & 0 deletions src/r_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1280,6 +1280,10 @@ void R_SetupFrame (player_t *player)

// [Nugget] /===============================================================

// Flip levels
if (viewangleoffset && STRICTMODE(flip_levels))
{ viewangle += ANG180; }

// Alt. intermission background --------------------------------------------

if (WI_UsingAltInterpic() && gamestate == GS_INTERMISSION)
Expand Down
34 changes: 17 additions & 17 deletions src/r_things.c
Original file line number Diff line number Diff line change
Expand Up @@ -1024,23 +1024,6 @@ void R_DrawPlayerSprites(void)
mfloorclip = screenheightarray;
mceilingclip = negonearray;

// [Nugget] Flip levels
if (STRICTMODE(flip_levels))
{
for (int y = 0; y < viewheight; y++)
{
for (int x = 0; x < viewwidth/2; x++)
{
pixel_t *left = &I_VideoBuffer[(viewwindowy + y) * video.pitch + viewwindowx + x],
*right = left + viewwidth - 1 - x*2,
temp = *left;

*left = *right;
*right = temp;
}
}
}

// display crosshair
if (hud_crosshair_on) // [Nugget] Use crosshair toggle
HU_DrawCrosshair();
Expand Down Expand Up @@ -1373,6 +1356,23 @@ void R_DrawMasked(void)
if (ds->maskedtexturecol)
R_RenderMaskedSegRange(ds, ds->x1, ds->x2);

// [Nugget] Flip levels
if (STRICTMODE(flip_levels))
{
for (int y = 0; y < viewheight; y++)
{
for (int x = 0; x < viewwidth/2; x++)
{
pixel_t *left = &I_VideoBuffer[(viewwindowy + y) * video.pitch + viewwindowx + x],
*right = left + viewwidth - 1 - x*2,
temp = *left;

*left = *right;
*right = temp;
}
}
}

// draw the psprites on top of everything
// but does not draw on side views
if (!viewangleoffset)
Expand Down

0 comments on commit 8e338fa

Please sign in to comment.