mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-04-04 17:02:24 +00:00
Interesting consideration: flat angle wasn't used to determine seperate visplanes. This is obviously incorrect behaviour. Enabling this restriction makes flat alignment on slopes ALMOST work identically to normal, but not quite.
Also, made the fudge a const, since it may as well be one.
This commit is contained in:
parent
d62a628346
commit
b924a7d902
1 changed files with 3 additions and 4 deletions
|
@ -486,6 +486,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
|||
&& !pfloor && !check->ffloor
|
||||
&& check->viewx == viewx && check->viewy == viewy && check->viewz == viewz
|
||||
&& check->viewangle == viewangle
|
||||
&& check->plangle == plangle
|
||||
#ifdef ESLOPE
|
||||
&& check->slope == slope
|
||||
#endif
|
||||
|
@ -954,10 +955,11 @@ void R_DrawSinglePlane(visplane_t *pl)
|
|||
floatv3_t p, m, n;
|
||||
float ang;
|
||||
float vx, vy, vz;
|
||||
float fudge;
|
||||
// compiler complains when P_GetZAt is used in FLOAT_TO_FIXED directly
|
||||
// use this as a temp var to store P_GetZAt's return value each time
|
||||
fixed_t temp;
|
||||
// Okay, look, don't ask me why this works, but without this setup there's a disgusting-looking misalignment with the textures. -Red
|
||||
const float fudge = ((1<<nflatshiftup)+1.0f)/(1<<nflatshiftup);
|
||||
|
||||
xoffs &= ((1 << (32-nflatshiftup))-1);
|
||||
yoffs &= ((1 << (32-nflatshiftup))-1);
|
||||
|
@ -965,9 +967,6 @@ void R_DrawSinglePlane(visplane_t *pl)
|
|||
xoffs -= (pl->slope->o.x + (1 << (31-nflatshiftup))) & ~((1 << (32-nflatshiftup))-1);
|
||||
yoffs += (pl->slope->o.y + (1 << (31-nflatshiftup))) & ~((1 << (32-nflatshiftup))-1);
|
||||
|
||||
// Okay, look, don't ask me why this works, but without this setup there's a disgusting-looking misalignment with the textures. -Red
|
||||
fudge = ((1<<nflatshiftup)+1.0f)/(1<<nflatshiftup);
|
||||
|
||||
xoffs = (fixed_t)(xoffs*fudge);
|
||||
yoffs = (fixed_t)(yoffs/fudge);
|
||||
|
||||
|
|
Loading…
Reference in a new issue