mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-08 03:28:03 +03:00
Minor formatting
This commit is contained in:
parent
0bc1d1f004
commit
e902c0e94e
4 changed files with 41 additions and 26 deletions
|
@ -495,7 +495,7 @@ void LaraControl(ItemInfo* item, CollisionInfo* coll)
|
|||
player.Context.WaterSurfaceDist = -water.HeightFromWater;
|
||||
|
||||
if (player.Context.Vehicle == NO_ITEM)
|
||||
WadeSplash(item, water.WaterHeight, water.WaterDepth);
|
||||
SpawnPlayerSplash(*item, water.WaterHeight, water.WaterDepth);
|
||||
|
||||
bool isWaterOnHeadspace = false;
|
||||
|
||||
|
@ -558,7 +558,7 @@ void LaraControl(ItemInfo* item, CollisionInfo* coll)
|
|||
{
|
||||
player.Control.WaterStatus = WaterStatus::Wade;
|
||||
|
||||
// Make splash ONLY within this particular threshold before swim depth while airborne (WadeSplash() above interferes otherwise).
|
||||
// Make splash ONLY within this particular threshold before swim depth while airborne (SpawnPlayerSplash() above interferes otherwise).
|
||||
if (water.WaterDepth > (SWIM_WATER_DEPTH - CLICK(1)) &&
|
||||
item->Animation.IsAirborne && !water.IsSwamp)
|
||||
{
|
||||
|
|
|
@ -1236,43 +1236,58 @@ void TriggerDynamicLight(int x, int y, int z, short falloff, byte r, byte g, byt
|
|||
g_Renderer.AddDynamicLight(x, y, z, falloff, r, g, b);
|
||||
}
|
||||
|
||||
void WadeSplash(ItemInfo* item, int wh, int wd)
|
||||
// TODO: Better implementation.
|
||||
void SpawnPlayerSplash(const ItemInfo& item, int waterHeight, int waterDepth)
|
||||
{
|
||||
auto probe1 = GetCollision(item);
|
||||
auto probe2 = GetCollision(probe1.Block, item->Pose.Position.x, probe1.Position.Ceiling, item->Pose.Position.z);
|
||||
// Get point collision.
|
||||
auto pointColl0 = GetCollision(item);
|
||||
auto pointColl1 = GetCollision(pointColl0.Block, item.Pose.Position.x, pointColl0.Position.Ceiling, item.Pose.Position.z);
|
||||
|
||||
if (!TestEnvironment(ENV_FLAG_WATER, probe1.RoomNumber) ||
|
||||
TestEnvironment(ENV_FLAG_WATER, probe1.RoomNumber) == TestEnvironment(ENV_FLAG_WATER, probe2.RoomNumber))
|
||||
if (!TestEnvironment(ENV_FLAG_WATER, pointColl0.RoomNumber) ||
|
||||
TestEnvironment(ENV_FLAG_WATER, pointColl0.RoomNumber) == TestEnvironment(ENV_FLAG_WATER, pointColl1.RoomNumber))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& bounds = GetBestFrame(item).BoundingBox;
|
||||
if (item.Pose.Position.y + bounds.Y1 > waterHeight)
|
||||
return;
|
||||
|
||||
const auto& bounds = GetBestFrame(*item).BoundingBox;
|
||||
if (item->Pose.Position.y + bounds.Y1 > wh)
|
||||
if (item.Pose.Position.y + bounds.Y2 < waterHeight)
|
||||
return;
|
||||
|
||||
if (item->Pose.Position.y + bounds.Y2 < wh)
|
||||
return;
|
||||
|
||||
if (item->Animation.Velocity.y <= 0.0f || wd >= 474 || SplashCount != 0)
|
||||
if (item.Animation.Velocity.y <= 0.0f || waterDepth >= 474 || SplashCount != 0)
|
||||
{
|
||||
if (!(Wibble & 0xF))
|
||||
{
|
||||
if (!(GetRandomControl() & 0xF) || item->Animation.ActiveState != LS_IDLE)
|
||||
if (!(GetRandomControl() & 0xF) || item.Animation.ActiveState != LS_IDLE)
|
||||
{
|
||||
if (item->Animation.ActiveState != LS_IDLE)
|
||||
SpawnRipple(Vector3(item->Pose.Position.x, wh - 1, item->Pose.Position.z), item->RoomNumber, 112 + (GetRandomControl() & 15), (int)RippleFlags::SlowFade | (int)RippleFlags::LowOpacity);
|
||||
if (item.Animation.ActiveState != LS_IDLE)
|
||||
{
|
||||
SpawnRipple(
|
||||
Vector3(item.Pose.Position.x, waterHeight - 1, item.Pose.Position.z),
|
||||
item.RoomNumber, 112 + (GetRandomControl() & 15),
|
||||
(int)RippleFlags::SlowFade | (int)RippleFlags::LowOpacity);
|
||||
}
|
||||
else
|
||||
SpawnRipple(Vector3(item->Pose.Position.x, wh - 1, item->Pose.Position.z), item->RoomNumber, 112 + (GetRandomControl() & 15), (int)RippleFlags::LowOpacity);
|
||||
{
|
||||
SpawnRipple(
|
||||
Vector3(item.Pose.Position.x, waterHeight - 1, item.Pose.Position.z),
|
||||
item.RoomNumber, 112 + (GetRandomControl() & 15),
|
||||
(int)RippleFlags::LowOpacity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SplashSetup.y = wh - 1;
|
||||
SplashSetup.x = item->Pose.Position.x;
|
||||
SplashSetup.z = item->Pose.Position.z;
|
||||
SplashSetup.x = item.Pose.Position.x;
|
||||
SplashSetup.y = waterHeight - 1;
|
||||
SplashSetup.z = item.Pose.Position.z;
|
||||
SplashSetup.innerRadius = 16;
|
||||
SplashSetup.splashPower = item->Animation.Velocity.z;
|
||||
SetupSplash(&SplashSetup, probe1.RoomNumber);
|
||||
SplashSetup.splashPower = item.Animation.Velocity.z;
|
||||
|
||||
SetupSplash(&SplashSetup, pointColl0.RoomNumber);
|
||||
SplashCount = 16;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -273,7 +273,7 @@ void TriggerFlashSmoke(int x, int y, int z, short roomNumber);
|
|||
void TriggerMetalSparks(int x, int y, int z, int xv, int yv, int zv, const Vector3& color, int additional);
|
||||
void SpawnCorpseEffect(const Vector3& pos);
|
||||
void TriggerAttackFlame(const Vector3i& pos, const Vector3& color, int scale);
|
||||
void WadeSplash(ItemInfo* item, int wh, int wd);
|
||||
void SpawnPlayerSplash(const ItemInfo& item, int waterHeight, int waterDepth);
|
||||
void Splash(ItemInfo* item);
|
||||
void TriggerRocketFire(int x, int y, int z);
|
||||
void TriggerExplosionBubbles(int x, int y, int z, short roomNumber);
|
||||
|
|
|
@ -631,11 +631,11 @@ void StopSoundTracks(bool excludeAmbience)
|
|||
{
|
||||
for (int i = 0; i < (int)SoundTrackType::Count; i++)
|
||||
{
|
||||
auto mode = (SoundTrackType)i;
|
||||
if (excludeAmbience && mode == SoundTrackType::BGM)
|
||||
auto type = (SoundTrackType)i;
|
||||
if (excludeAmbience && type == SoundTrackType::BGM)
|
||||
continue;
|
||||
|
||||
StopSoundTrack((SoundTrackType)i, SOUND_XFADETIME_ONESHOT);
|
||||
StopSoundTrack(type, SOUND_XFADETIME_ONESHOT);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue