mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-28 15:57:59 +03:00
Fixed weather particles performance
This commit is contained in:
parent
43c8f8658b
commit
222e67e493
3 changed files with 11 additions and 6 deletions
|
@ -7,7 +7,9 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
|
|||
|
||||
### Bug fixes
|
||||
|
||||
* Fixed bad engine performance around multiple stacked bridges.
|
||||
* Fixed engine performance around multiple stacked bridges.
|
||||
* Fixed engine performance if weather effects are active.
|
||||
* Fixed snow particles not always melting on the ground.
|
||||
* Fixed enemy pickups dropping on death sectors.
|
||||
|
||||
### Features/Amendments
|
||||
|
|
|
@ -36,6 +36,7 @@ namespace TEN::Collision::Point
|
|||
public:
|
||||
// Constructors
|
||||
|
||||
PointCollisionData() = default;
|
||||
PointCollisionData(const Vector3i& pos, int roomNumber);
|
||||
|
||||
// Getters
|
||||
|
|
|
@ -361,8 +361,9 @@ namespace TEN::Effects::Environment
|
|||
if (part.Type == WeatherType::None)
|
||||
continue;
|
||||
|
||||
auto pointColl = GetPointCollision(part.Position, part.RoomNumber);
|
||||
PointCollisionData pointColl;
|
||||
bool collisionCalculated = false;
|
||||
bool landed = false;
|
||||
|
||||
if (part.CollisionCheckDelay <= 0)
|
||||
{
|
||||
|
@ -393,9 +394,8 @@ namespace TEN::Effects::Environment
|
|||
|
||||
if (pointColl.GetRoomNumber() == part.RoomNumber)
|
||||
{
|
||||
// Not landed on door, so out of room bounds - delete.
|
||||
part.Enabled = false;
|
||||
continue;
|
||||
// Not landed on door, so out of room bounds - land.
|
||||
landed = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -409,7 +409,7 @@ namespace TEN::Effects::Environment
|
|||
// If particle is inside water or swamp, count it as "inSubstance".
|
||||
// If particle got below floor or above ceiling, count it as "landed".
|
||||
bool inSubstance = g_Level.Rooms[pointColl.GetRoomNumber()].flags & (ENV_FLAG_WATER | ENV_FLAG_SWAMP);
|
||||
bool landed = (pointColl.GetFloorHeight() <= part.Position.y) || (pointColl.GetCeilingHeight() >= part.Position.y);
|
||||
landed = landed || (pointColl.GetFloorHeight() <= part.Position.y) || (pointColl.GetCeilingHeight() >= part.Position.y);
|
||||
|
||||
if (inSubstance || landed)
|
||||
{
|
||||
|
@ -427,6 +427,8 @@ namespace TEN::Effects::Environment
|
|||
part.Enabled = false;
|
||||
AddWaterSparks(prevPos.x, prevPos.y, prevPos.z, 6);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue