mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'sal-cam-sandboxing' into 'master'
Camera last minute adjustments Closes #1034 See merge request KartKrew/Kart!2161
This commit is contained in:
commit
59974ebce2
8 changed files with 55 additions and 10 deletions
|
|
@ -310,6 +310,7 @@ typedef enum
|
||||||
khud_boostcam, // Camera push forward on boost
|
khud_boostcam, // Camera push forward on boost
|
||||||
khud_destboostcam, // Ditto
|
khud_destboostcam, // Ditto
|
||||||
khud_timeovercam, // Camera timer for leaving behind or not
|
khud_timeovercam, // Camera timer for leaving behind or not
|
||||||
|
khud_aircam, // Camera follows vertically better in the air
|
||||||
|
|
||||||
// Sounds
|
// Sounds
|
||||||
khud_enginesnd, // Engine sound offset this player is using.
|
khud_enginesnd, // Engine sound offset this player is using.
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,7 @@ static void K_SpawnHitLagEFX(mobj_t *victim, mobj_t *inflictor, mobj_t *source,
|
||||||
I_Assert(P_MobjWasRemoved(victim) == false);
|
I_Assert(P_MobjWasRemoved(victim) == false);
|
||||||
|
|
||||||
K_PlayHitLagSFX(victim, tics);
|
K_PlayHitLagSFX(victim, tics);
|
||||||
P_StartQuakeFromMobj(tics, tics * 2 * mapobjectscale, 512 * mapobjectscale, victim);
|
P_StartQuakeFromMobj(tics, tics * 2 * mapobjectscale, 1536 * mapobjectscale, victim);
|
||||||
|
|
||||||
if (P_MobjWasRemoved(inflictor) == false)
|
if (P_MobjWasRemoved(inflictor) == false)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
33
src/k_kart.c
33
src/k_kart.c
|
|
@ -4689,7 +4689,7 @@ static void K_HandleTumbleBounce(player_t *player)
|
||||||
}
|
}
|
||||||
|
|
||||||
player->markedfordeath = false;
|
player->markedfordeath = false;
|
||||||
P_StartQuakeFromMobj(5, 32 * player->mo->scale, 512 * player->mo->scale, player->mo);
|
P_StartQuakeFromMobj(5, 64 * player->mo->scale, 4096 * player->mo->scale, player->mo);
|
||||||
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_INSTAKILL);
|
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_INSTAKILL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -5002,7 +5002,7 @@ void K_MineFlashScreen(mobj_t *source)
|
||||||
}
|
}
|
||||||
|
|
||||||
S_StartSound(source, sfx_s3k4e);
|
S_StartSound(source, sfx_s3k4e);
|
||||||
P_StartQuakeFromMobj(12, 55 * source->scale, MINEQUAKEDIST * source->scale, source);
|
P_StartQuakeFromMobj(18, 55 * source->scale, MINEQUAKEDIST * source->scale, source);
|
||||||
|
|
||||||
// check for potential display players near the source so we can have a sick flashpal.
|
// check for potential display players near the source so we can have a sick flashpal.
|
||||||
for (pnum = 0; pnum < MAXPLAYERS; pnum++)
|
for (pnum = 0; pnum < MAXPLAYERS; pnum++)
|
||||||
|
|
@ -8589,6 +8589,35 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
||||||
//CONS_Printf("cam: %d, dest: %d\n", player->karthud[khud_boostcam], player->karthud[khud_destboostcam]);
|
//CONS_Printf("cam: %d, dest: %d\n", player->karthud[khud_boostcam], player->karthud[khud_destboostcam]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (onground)
|
||||||
|
{
|
||||||
|
if (player->karthud[khud_aircam] > 0)
|
||||||
|
{
|
||||||
|
player->karthud[khud_aircam] -= FRACUNIT / 5;
|
||||||
|
|
||||||
|
if (player->karthud[khud_aircam] < 0)
|
||||||
|
{
|
||||||
|
player->karthud[khud_aircam] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//CONS_Printf("cam: %f\n", FixedToFloat(player->karthud[khud_aircam]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (player->karthud[khud_aircam] < FRACUNIT)
|
||||||
|
{
|
||||||
|
player->karthud[khud_aircam] += FRACUNIT / TICRATE;
|
||||||
|
|
||||||
|
if (player->karthud[khud_aircam] > FRACUNIT)
|
||||||
|
{
|
||||||
|
player->karthud[khud_aircam] = FRACUNIT;
|
||||||
|
}
|
||||||
|
|
||||||
|
//CONS_Printf("cam: %f\n", FixedToFloat(player->karthud[khud_aircam]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Make ABSOLUTELY SURE that your flashing tics don't get set WHILE you're still in hit animations.
|
// Make ABSOLUTELY SURE that your flashing tics don't get set WHILE you're still in hit animations.
|
||||||
if (player->spinouttimer != 0)
|
if (player->spinouttimer != 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -79,8 +79,7 @@ void Obj_EggBallThink(mobj_t *mo)
|
||||||
|
|
||||||
S_StartSound(mo, sfx_s3k59);
|
S_StartSound(mo, sfx_s3k59);
|
||||||
|
|
||||||
P_StartQuakeFromMobj(FRACUNIT*20, 6, 512 * mapobjectscale, mo);
|
P_StartQuakeFromMobj(10, 15 * mo->scale, 512 * mo->scale, mo);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -953,7 +953,7 @@ boolean Obj_SpecialUFODamage(mobj_t *ufo, mobj_t *inflictor, mobj_t *source, UIN
|
||||||
S_StopSound(ufo);
|
S_StopSound(ufo);
|
||||||
S_StartSound(ufo, sfx_gbrk);
|
S_StartSound(ufo, sfx_gbrk);
|
||||||
S_StartSound(ufo, sfx_clawk2);
|
S_StartSound(ufo, sfx_clawk2);
|
||||||
P_StartQuake(20, 64 * ufo->scale, 0, NULL);
|
P_StartQuake(30, 96 * ufo->scale, 0, NULL);
|
||||||
|
|
||||||
ufo_speed(ufo) += addSpeed; // Even more speed!
|
ufo_speed(ufo) += addSpeed; // Even more speed!
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -3299,7 +3299,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
player->markedfordeath = true;
|
player->markedfordeath = true;
|
||||||
damagetype = DMG_TUMBLE;
|
damagetype = DMG_TUMBLE;
|
||||||
type = DMG_TUMBLE;
|
type = DMG_TUMBLE;
|
||||||
P_StartQuakeFromMobj(5, 32 * player->mo->scale, 512 * player->mo->scale, player->mo);
|
P_StartQuakeFromMobj(5, 44 * player->mo->scale, 2560 * player->mo->scale, player->mo);
|
||||||
//P_KillPlayer(player, inflictor, source, damagetype);
|
//P_KillPlayer(player, inflictor, source, damagetype);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
10
src/p_spec.c
10
src/p_spec.c
|
|
@ -9498,7 +9498,7 @@ void P_StartQuakeFromMobj(tic_t time, fixed_t intensity, fixed_t radius, mobj_t
|
||||||
|
|
||||||
void P_DoQuakeOffset(UINT8 view, mappoint_t *viewPos, mappoint_t *offset)
|
void P_DoQuakeOffset(UINT8 view, mappoint_t *viewPos, mappoint_t *offset)
|
||||||
{
|
{
|
||||||
player_t *viewer = &players[ displayplayers[view] ];
|
const player_t *viewer = &players[ displayplayers[view] ];
|
||||||
quake_t *quake = NULL;
|
quake_t *quake = NULL;
|
||||||
fixed_t ir = 0;
|
fixed_t ir = 0;
|
||||||
fixed_t addZ = 0;
|
fixed_t addZ = 0;
|
||||||
|
|
@ -9530,7 +9530,6 @@ void P_DoQuakeOffset(UINT8 view, mappoint_t *viewPos, mappoint_t *offset)
|
||||||
viewPos->z - quake->epicenter->z
|
viewPos->z - quake->epicenter->z
|
||||||
) - distBuffer;
|
) - distBuffer;
|
||||||
|
|
||||||
|
|
||||||
fixed_t distEase = FixedDiv(max(epidist, 0), quake->radius);
|
fixed_t distEase = FixedDiv(max(epidist, 0), quake->radius);
|
||||||
distEase = min(distEase, FRACUNIT);
|
distEase = min(distEase, FRACUNIT);
|
||||||
ir = Easing_InCubic(distEase, ir, 0);
|
ir = Easing_InCubic(distEase, ir, 0);
|
||||||
|
|
@ -9560,6 +9559,13 @@ void P_DoQuakeOffset(UINT8 view, mappoint_t *viewPos, mappoint_t *offset)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const fixed_t maxShake = FixedMul(cv_cam_height[view].value, mapobjectscale) * 3 / 4;
|
||||||
|
if (addZ > maxShake)
|
||||||
|
{
|
||||||
|
// Cap screen shake between reasonable values
|
||||||
|
addZ = maxShake;
|
||||||
|
}
|
||||||
|
|
||||||
// Reverse every tic.
|
// Reverse every tic.
|
||||||
if ((leveltime + view) & 1)
|
if ((leveltime + view) & 1)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
12
src/p_user.c
12
src/p_user.c
|
|
@ -70,6 +70,7 @@
|
||||||
#include "k_endcam.h"
|
#include "k_endcam.h"
|
||||||
#include "k_credits.h"
|
#include "k_credits.h"
|
||||||
#include "k_hud.h" // K_AddMessage
|
#include "k_hud.h" // K_AddMessage
|
||||||
|
#include "m_easing.h"
|
||||||
|
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
#include "hardware/hw_light.h"
|
#include "hardware/hw_light.h"
|
||||||
|
|
@ -3461,6 +3462,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
if (mo->standingslope)
|
if (mo->standingslope)
|
||||||
{
|
{
|
||||||
pitch = (angle_t)FixedMul(P_ReturnThrustX(mo, thiscam->angle - mo->standingslope->xydirection, FRACUNIT), (fixed_t)mo->standingslope->zangle);
|
pitch = (angle_t)FixedMul(P_ReturnThrustX(mo, thiscam->angle - mo->standingslope->xydirection, FRACUNIT), (fixed_t)mo->standingslope->zangle);
|
||||||
|
|
||||||
if (mo->eflags & MFE_VERTICALFLIP)
|
if (mo->eflags & MFE_VERTICALFLIP)
|
||||||
{
|
{
|
||||||
if (pitch >= ANGLE_180)
|
if (pitch >= ANGLE_180)
|
||||||
|
|
@ -3472,6 +3474,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
pitch = 0;
|
pitch = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pitch = thiscam->pitch + (angle_t)FixedMul(pitch - thiscam->pitch, camspeed/4);
|
pitch = thiscam->pitch + (angle_t)FixedMul(pitch - thiscam->pitch, camspeed/4);
|
||||||
|
|
||||||
if (rendermode == render_opengl && !cv_glshearing.value)
|
if (rendermode == render_opengl && !cv_glshearing.value)
|
||||||
|
|
@ -3562,7 +3565,14 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
{
|
{
|
||||||
thiscam->momx = x - thiscam->x;
|
thiscam->momx = x - thiscam->x;
|
||||||
thiscam->momy = y - thiscam->y;
|
thiscam->momy = y - thiscam->y;
|
||||||
thiscam->momz = FixedMul(z - thiscam->z, camspeed*3/5);
|
|
||||||
|
fixed_t z_speed = Easing_Linear(
|
||||||
|
player->karthud[khud_aircam],
|
||||||
|
camspeed * 3 / 5,
|
||||||
|
camspeed
|
||||||
|
);
|
||||||
|
|
||||||
|
thiscam->momz = FixedMul(z - thiscam->z, z_speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
thiscam->pan = pan;
|
thiscam->pan = pan;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue