Merge branch 'freecamstuffs' into Saturn-Testing

This commit is contained in:
Alug committed 2025-01-20 19:34:02 +01:00
commit d7293ef41d
6 files changed
+28 -14

No files matched your search

+3
View File
@@ -380,6 +380,9 @@ unset_bit_array (bitarray_t * const array, const int value)
array[value >> 3] &= ~(1<<(value & 7));
}
#define intsign(n) \
((n) < 0 ? -1 : (n) > 0 ? 1 : 0)
typedef UINT64 precise_t;
#endif //__DOOMTYPE__
+2 -1
View File
@@ -966,6 +966,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
// dumbass thing so we can use a few buttons but dont accidentally drive away
if (player->spectator || freecam)
{
cmd->angleturn = (INT16)(lang >> 16);
G_BuildLocalTiccmd(cmd, ssplayer, freecam);
// let lua override everything
@@ -1032,7 +1033,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
side += ((axis * sidemove[0]) >> 10);
}
if (player->spectator || cv_mouseturn.value)
if (cv_mouseturn.value)
{
//THIS WORKS WTF????????
cmd->angleturn = (INT16)(cmd->angleturn - ((mousex*(encoremode ? -1 : 1)*8)));
+3
View File
@@ -95,6 +95,9 @@ typedef struct camera_s
// Freecam: aiming needs to be reset after switching from chasecam
boolean reset_aiming;
// Hold up/down to pan the camera vertically
SINT8 dpad_y_held;
// Things used by FS cameras.
fixed_t viewheight;
angle_t startangle;
+14 -1
View File
@@ -468,7 +468,20 @@ void P_RunChaseCameras(void)
for (i = 0; i <= splitscreen; i++)
{
if (camera[i].chase)
P_MoveChaseCamera(&players[displayplayers[i]], &camera[i], false);
{
player_t *p = &players[displayplayers[i]];
camera_t *cam = &camera[i];
if (p->mo && p->kartstuff[k_throwdir] != 0)
{
if (p->speed < 6 * p->mo->scale && abs(cam->dpad_y_held) < 2*TICRATE)
cam->dpad_y_held += intsign(p->kartstuff[k_throwdir]);
}
else
cam->dpad_y_held = 0;
P_MoveChaseCamera(p, cam, false);
}
}
}
+6 -8
View File
@@ -3168,10 +3168,6 @@ void P_ToggleDemoCamera(UINT8 viewnum)
}
static ticcmd_t cameracmd[MAXSPLITSCREENPLAYERS];
#define intsign(n) \
((n) < 0 ? -1 : (n) > 0 ? 1 : 0)
static ticcmd_t *P_CameraCmd(camera_t *cam, UINT8 num)
{
INT32 laim, forward, side, axis;
@@ -3235,7 +3231,7 @@ static ticcmd_t *P_CameraCmd(camera_t *cam, UINT8 num)
turnright = turnright || (axis > 0);
turnleft = turnleft || (axis < 0);
}
forward = 0;
forward = side = 0;
// let movement keys cancel each other out
if (turnright && !(turnleft))
@@ -3267,7 +3263,6 @@ static ticcmd_t *P_CameraCmd(camera_t *cam, UINT8 num)
straferight = straferight || (axis > 0);
strafeleft = strafeleft || (axis < 0);
}
side = 0;
// let strafe keys cancel each other out
if (straferight && !(strafeleft))
@@ -3494,8 +3489,6 @@ static void P_DemoCameraMovement(camera_t *cam, UINT8 num)
cam->subsector = R_PointInSubsector(cam->x, cam->y);
}
#undef intsign
void P_ResetCamera(player_t *player, camera_t *thiscam)
{
tic_t tries = 0;
@@ -3847,6 +3840,11 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
focusaiming = player->aiming;
}
if (abs(thiscam->dpad_y_held) >= 2*TICRATE)
{
focusaiming += ANGLE_45 * intsign(thiscam->dpad_y_held) * P_MobjFlip(mo);
}
if (P_CameraThinker(player, thiscam, resetcalled))
return true;
-4
View File
@@ -851,10 +851,6 @@ void R_ApplyViewMorph(void)
vid.width*vid.bpp, vid.height, vid.width*vid.bpp, vid.width);
}
static inline int intsign(int n) {
return n < 0 ? -1 : n > 0 ? 1 : 0;
}
angle_t R_ViewRollAngle(const player_t *player)
{
angle_t roll = 0;