Skip to content

Commit

Permalink
strife: Add flipped weapon sprites (#1108)
Browse files Browse the repository at this point in the history
  • Loading branch information
ceski-1 authored Nov 2, 2023
1 parent 89c4b8d commit 04850e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/strife/d_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1694,10 +1694,10 @@ void D_DoomMain (void)
// @category obscure
// @vanilla
//
// Flip player gun sprites (broken).
// Flip player gun sprites.
//

flipparm = M_CheckParm ("-flip");
flipparm = M_CheckParm("-flip") || M_CheckParm("-flipweapons"); // [crispy]

//!
// @category game
Expand Down
5 changes: 3 additions & 2 deletions src/strife/r_things.c
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,8 @@ void R_DrawPSprite (pspdef_t* psp, psprnum_t psprnum) // [crispy] read psprnum
// calculate edges of the shape
tx = psp->sx2-(ORIGWIDTH/2)*FRACUNIT;

tx -= spriteoffset[lump];
// [crispy] fix sprite offsets for mirrored sprites
tx -= flip ? 2 * tx - spriteoffset[lump] + spritewidth[lump] : spriteoffset[lump];
x1 = (centerxfrac + FixedMul (tx,pspritescale) ) >>FRACBITS;

// off the right side
Expand Down Expand Up @@ -874,7 +875,7 @@ void R_DrawPSprite (pspdef_t* psp, psprnum_t psprnum) // [crispy] read psprnum
}

// [crispy] free look
vis->texturemid += FixedMul(vis->xiscale, (centery - viewheight / 2) << FRACBITS);
vis->texturemid += FixedMul(pspriteiscale, (centery - viewheight / 2) << FRACBITS);

R_DrawVisSprite (vis, vis->x1, vis->x2);
}
Expand Down

0 comments on commit 04850e6

Please sign in to comment.