Removal and Replacement of the CryTimer (gEnv->pTimer) (#5409)

Replaced and removed the CryTimer (gEnv->pTimer). The new TimeSystem is a merger of the current time functionality found in the engine.

* Rename TimeSystemComponent.h/.cpp to TimeSystem.h/.cpp
* Adding New TimeSystem
* remove old timer cvars
* small improvements to the time system.
 - updated parts to use the time conversion functions.
 - in AdvanceTickDeltaTimes applying t_simulationTickScale is now uses doubles instead of floats.
* Replace gEnv->pTimer / ITimer usages with TimeSystem
* Updating usages of AZ::TimeMs{ 0 } and AZ::TimeUs{ 0 } to AZ::Time::ZeroTimeMs and AZ::Time::ZeroTimeUs
* red code the CryTimer
* using TimeUs instead of TimeMs is some cases + updating usages of old cvars to new

Signed-off-by: amzn-sean <75276488+amzn-sean@users.noreply.github.com>
This commit is contained in:
amzn-sean
2021-11-15 12:11:58 +00:00
committed by GitHub
parent 0ada8b335b
commit 38a03817bb
142 changed files with 1215 additions and 2090 deletions
@@ -54,10 +54,10 @@ namespace Multiplayer
m_maxPayloadSize = connection.GetConnectionMtu() - UdpPacketHeaderSerializeSize - ReplicationManagerPacketOverhead;
// Schedule ClearRemovedReplicators()
m_clearRemovedReplicators.Enqueue(AZ::TimeMs{ 0 }, true);
m_clearRemovedReplicators.Enqueue(AZ::Time::ZeroTimeMs, true);
// Start window update events
m_updateWindow.Enqueue(AZ::TimeMs{ 0 }, true);
m_updateWindow.Enqueue(AZ::Time::ZeroTimeMs, true);
INetworkEntityManager* networkEntityManager = GetNetworkEntityManager();
if (networkEntityManager != nullptr)
@@ -97,7 +97,7 @@ namespace Multiplayer
notReadyEntities.push_back(entityId);
}
}
if (m_entityActivationTimeSliceMs > AZ::TimeMs{ 0 } && AZ::GetElapsedTimeMs() > endTimeMs)
if (m_entityActivationTimeSliceMs > AZ::Time::ZeroTimeMs && AZ::GetElapsedTimeMs() > endTimeMs)
{
// If we go over our timeslice, break out the loop
break;
@@ -344,7 +344,7 @@ namespace Multiplayer
void EntityReplicator::SetPendingRemoval(AZ::TimeMs pendingRemovalTimeMs)
{
AZ_Assert(m_propertyPublisher, "Only valid if we are publishing updates");
if (pendingRemovalTimeMs > AZ::TimeMs{ 0 })
if (pendingRemovalTimeMs > AZ::Time::ZeroTimeMs)
{
if (!IsPendingRemoval())
{
@@ -26,7 +26,7 @@ namespace Multiplayer
bool PropertySubscriber::IsDeleting() const
{
return m_markForRemovalTimeMs > AZ::TimeMs{ 0 };
return m_markForRemovalTimeMs > AZ::Time::ZeroTimeMs;
}
bool PropertySubscriber::IsDeleted() const
@@ -40,6 +40,6 @@ namespace Multiplayer
// The last packet to have been received about this entity
AzNetworking::PacketId m_lastReceivedPacketId = AzNetworking::InvalidPacketId;
AZ::TimeMs m_markForRemovalTimeMs = AZ::TimeMs{ 0 };
AZ::TimeMs m_markForRemovalTimeMs = AZ::Time::ZeroTimeMs;
};
}