Merge branch 'splitscreen-camera-height' into 'master'

2-player splitscreen flat map camera height fix

Closes #1567

See merge request kart-krew-dev/ring-racers-internal!2630
This commit is contained in:
SteelT 2025-06-15 21:08:16 -04:00
commit a96fe4e2d0
2 changed files with 18 additions and 2 deletions

View file

@ -9657,9 +9657,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)