fix shearing offset with flipcam in K_GetScreenCoords

This commit is contained in:
Alug committed 2024-03-01 01:04:44 +01:00
1 parent 29ffb4200e
commit 3e94cd7c1e
1 file changed
+17
+17
View File
@@ -8973,6 +8973,8 @@ static void K_GetScreenCoords(vector2_t *vec, player_t *player, camera_t *came,
#endif
// thanks fickle
offset = FixedDiv(offset, fovratio);
if (srcflip)
offset = -offset; // flipcam
y = y + offset;
}
@@ -8980,6 +8982,21 @@ static void K_GetScreenCoords(vector2_t *vec, player_t *player, camera_t *came,
x = FixedMul(FINETANGENT(((x+ANGLE_90)>>ANGLETOFINESHIFT) & 4095), fov);
x = x + xres;
// adjust coords for splitscreen
if (splitscreen == 1){ // 2P
y = y>>1;
if (splitindex)
y = y + yres;
}
if (splitscreen >= 2) { // 3P or 4P
x = x>>1;
y = y>>1;
if (splitindex & 1)
x = x + xres;
if (splitindex >= 2)
y = y + yres;
}
vec->y = y;
vec->x = x;
}