Smoother freelook in Software

Mhm hmm...
This commit is contained in:
Jaime Ita Passos 2021-03-30 22:52:50 -03:00
parent df9b5c4312
commit 7e6bc97240
1 changed files with 8 additions and 9 deletions

View File

@ -1089,8 +1089,6 @@ subsector_t *R_PointInSubsectorOrNull(fixed_t x, fixed_t y)
// 18/08/18: (No it's actually 16*viewheight, thanks Jimita for finding this out) // 18/08/18: (No it's actually 16*viewheight, thanks Jimita for finding this out)
static void R_SetupFreelook(player_t *player, boolean skybox) static void R_SetupFreelook(player_t *player, boolean skybox)
{ {
INT32 dy = 0;
#ifndef HWRENDER #ifndef HWRENDER
(void)player; (void)player;
(void)skybox; (void)skybox;
@ -1109,14 +1107,15 @@ static void R_SetupFreelook(player_t *player, boolean skybox)
G_SoftwareClipAimingPitch((INT32 *)&aimingangle); G_SoftwareClipAimingPitch((INT32 *)&aimingangle);
} }
if (rendermode == render_soft) centeryfrac = (viewheight/2)<<FRACBITS;
{
dy = (AIMINGTODY(aimingangle)>>FRACBITS) * viewwidth/BASEVIDWIDTH;
yslope = &yslopetab[viewheight*8 - (viewheight/2 + dy)];
}
centery = (viewheight/2) + dy; if (rendermode == render_soft)
centeryfrac = centery<<FRACBITS; centeryfrac += FixedMul(AIMINGTODY(aimingangle), FixedDiv(viewwidth<<FRACBITS, BASEVIDWIDTH<<FRACBITS));
centery = FixedInt(FixedRound(centeryfrac));
if (rendermode == render_soft)
yslope = &yslopetab[viewheight*8 - centery];
} }
void R_SetupFrame(player_t *player) void R_SetupFrame(player_t *player)