mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-01-19 16:11:23 +00:00
Don't let DEarthquake depend on r_viewpoint.
The ticFrac value should be passed as a parameter, especially since this gets called from code that sets up r_viewpoint.
This commit is contained in:
parent
01bda6348e
commit
d73d89762d
3 changed files with 10 additions and 10 deletions
|
@ -177,9 +177,9 @@ void DEarthquake::Tick ()
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
double DEarthquake::GetModWave(double waveMultiplier) const
|
double DEarthquake::GetModWave(double ticFrac, double waveMultiplier) const
|
||||||
{
|
{
|
||||||
double time = m_Countdown - r_viewpoint.TicFrac;
|
double time = m_Countdown - ticFrac;
|
||||||
return g_sin(waveMultiplier * time * (M_PI * 2 / TICRATE));
|
return g_sin(waveMultiplier * time * (M_PI * 2 / TICRATE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,7 +292,7 @@ double DEarthquake::GetFalloff(double dist) const
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
int DEarthquake::StaticGetQuakeIntensities(AActor *victim, FQuakeJiggers &jiggers)
|
int DEarthquake::StaticGetQuakeIntensities(double ticFrac, AActor *victim, FQuakeJiggers &jiggers)
|
||||||
{
|
{
|
||||||
if (victim->player != NULL && (victim->player->cheats & CF_NOCLIP))
|
if (victim->player != NULL && (victim->player->cheats & CF_NOCLIP))
|
||||||
{
|
{
|
||||||
|
@ -339,12 +339,12 @@ int DEarthquake::StaticGetQuakeIntensities(AActor *victim, FQuakeJiggers &jigger
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
jiggers.RollWave = r * quake->GetModWave(quake->m_RollWave) * falloff * strength;
|
jiggers.RollWave = r * quake->GetModWave(ticFrac, quake->m_RollWave) * falloff * strength;
|
||||||
|
|
||||||
|
|
||||||
intensity.X *= quake->GetModWave(quake->m_WaveSpeed.X);
|
intensity.X *= quake->GetModWave(ticFrac, quake->m_WaveSpeed.X);
|
||||||
intensity.Y *= quake->GetModWave(quake->m_WaveSpeed.Y);
|
intensity.Y *= quake->GetModWave(ticFrac, quake->m_WaveSpeed.Y);
|
||||||
intensity.Z *= quake->GetModWave(quake->m_WaveSpeed.Z);
|
intensity.Z *= quake->GetModWave(ticFrac, quake->m_WaveSpeed.Z);
|
||||||
intensity *= strength * falloff;
|
intensity *= strength * falloff;
|
||||||
|
|
||||||
// [RH] This only gives effect to the last sine quake. I would
|
// [RH] This only gives effect to the last sine quake. I would
|
||||||
|
|
|
@ -145,10 +145,10 @@ public:
|
||||||
double m_RollIntensity, m_RollWave;
|
double m_RollIntensity, m_RollWave;
|
||||||
|
|
||||||
double GetModIntensity(double intensity, bool fake = false) const;
|
double GetModIntensity(double intensity, bool fake = false) const;
|
||||||
double GetModWave(double waveMultiplier) const;
|
double GetModWave(double ticFrac, double waveMultiplier) const;
|
||||||
double GetFalloff(double dist) const;
|
double GetFalloff(double dist) const;
|
||||||
|
|
||||||
static int StaticGetQuakeIntensities(AActor *viewer, FQuakeJiggers &jiggers);
|
static int StaticGetQuakeIntensities(double ticFrac, AActor *viewer, FQuakeJiggers &jiggers);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DEarthquake ();
|
DEarthquake ();
|
||||||
|
|
|
@ -872,7 +872,7 @@ void R_SetupFrame (FRenderViewpoint &viewpoint, FViewWindow &viewwindow, AActor
|
||||||
FQuakeJiggers jiggers;
|
FQuakeJiggers jiggers;
|
||||||
|
|
||||||
memset(&jiggers, 0, sizeof(jiggers));
|
memset(&jiggers, 0, sizeof(jiggers));
|
||||||
if (DEarthquake::StaticGetQuakeIntensities(viewpoint.camera, jiggers) > 0)
|
if (DEarthquake::StaticGetQuakeIntensities(viewpoint.TicFrac, viewpoint.camera, jiggers) > 0)
|
||||||
{
|
{
|
||||||
double quakefactor = r_quakeintensity;
|
double quakefactor = r_quakeintensity;
|
||||||
DAngle an;
|
DAngle an;
|
||||||
|
|
Loading…
Reference in a new issue