Skip to content

Commit

Permalink
output: fix bad RHW value when calculatin room vertices
Browse files Browse the repository at this point in the history
Resolves #226.
  • Loading branch information
walkawayy committed Sep 10, 2024
1 parent fc79d77 commit c97dd00
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/game/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,17 +649,16 @@ const int16_t *__cdecl Output_CalcRoomVertices(
const double persp = g_FltPersp / zv;
const int32_t depth = zv_int >> W2V_SHIFT;
vbuf->zv += base_z;
vbuf->rhw = persp * g_FltRhwOPersp;

if (depth < FOG_END) {
if (depth > FOG_START) {
shade += depth - FOG_START;
}
vbuf->rhw = persp * g_FltRhwOPersp;
} else {
clip_flags = far_clip;
shade = 0x1FFF;
vbuf->zv = g_FltFarZ;
vbuf->rhw = 0.0; // *(int32_t*)0x00478054
vbuf->zv = zv + base_z;
}

double xs = xv * persp + g_FltWinCenterX;
Expand Down

0 comments on commit c97dd00

Please sign in to comment.