2p splitscreen camera height fix

When 2p splitscreen is active, only use 75% of map-specific camera heights.
This commit is contained in:
eebrozgi 2025-06-12 02:19:16 +03:00
parent dce6a92ef3
commit 9db2da65a6
2 changed files with 18 additions and 2 deletions

View file

@ -9650,9 +9650,16 @@ void P_DoQuakeOffset(UINT8 view, mappoint_t *viewPos, mappoint_t *offset)
fixed_t maxShake = FixedMul(cv_cam_height[view].value, mapobjectscale) * 3 / 4;
// Map-specific camera height
if (mapheaderinfo[gamemap-1]->cameraHeight >= 0)
{
maxShake = FixedMul(mapheaderinfo[gamemap-1]->cameraHeight, mapobjectscale) * 3 / 4;
if (r_splitscreen != 1)
maxShake = FixedMul(mapheaderinfo[gamemap-1]->cameraHeight, mapobjectscale) * 3 / 4;
// For 2p SPLITSCREEN SPECIFICALLY:
// The view is pretty narrow, so move it back 1/4th of the way towards default camera height.
else
maxShake = FixedMul((mapheaderinfo[gamemap-1]->cameraHeight*3 + cv_cam_height[view].value)/4, mapobjectscale) * 3 / 4;
}
if (battle)

View file

@ -3376,9 +3376,18 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
camdist = FixedMul(cv_cam_dist[num].value, cameraScale);
camheight = FixedMul(cv_cam_height[num].value, cameraScale);
// Map-specific camera height
if (mapheaderinfo[gamemap-1]->cameraHeight >= 0)
{
camheight = FixedMul(mapheaderinfo[gamemap-1]->cameraHeight, cameraScale);
if (r_splitscreen != 1)
camheight = FixedMul(mapheaderinfo[gamemap-1]->cameraHeight, cameraScale);
// For 2p SPLITSCREEN SPECIFICALLY:
// The view is pretty narrow, so move it back 1/4th of the way towards default camera height.
else {
// CONS_Printf( "Camera values: %f / %f / %f \n", FixedToFloat(mapheaderinfo[gamemap-1]->cameraHeight), FixedToFloat(cv_cam_height[num].value), FixedToFloat(cameraScale) );
camheight = FixedMul((mapheaderinfo[gamemap-1]->cameraHeight*3 + cv_cam_height[num].value)/4, cameraScale);
}
}
if (loop_in < loop->zoom_in_speed)