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:
@@ -15,7 +15,7 @@ namespace UnitTest
|
||||
{
|
||||
AzNetworking::PacketId m_packetId = AzNetworking::InvalidPacketId;
|
||||
uint32_t m_id = 0;
|
||||
AZ::TimeMs m_timeMs = AZ::TimeMs{ 0 };
|
||||
AZ::TimeMs m_timeMs = AZ::Time::ZeroTimeMs;
|
||||
float m_blendFactor = 0.f;
|
||||
AZStd::vector<int> m_growVector, m_shrinkVector;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <AzNetworking/AutoGen/CorePackets.AutoPackets.h>
|
||||
#include <AzCore/Interface/Interface.h>
|
||||
#include <AzCore/Console/LoggerSystemComponent.h>
|
||||
#include <AzCore/Time/TimeSystemComponent.h>
|
||||
#include <AzCore/Time/TimeSystem.h>
|
||||
#include <AzCore/Name/NameDictionary.h>
|
||||
#include <AzCore/UnitTest/TestTypes.h>
|
||||
|
||||
@@ -102,24 +102,24 @@ namespace UnitTest
|
||||
SetupAllocator();
|
||||
AZ::NameDictionary::Create();
|
||||
|
||||
m_loggerComponent = new AZ::LoggerSystemComponent;
|
||||
m_timeComponent = new AZ::TimeSystemComponent;
|
||||
m_networkingSystemComponent = new AzNetworking::NetworkingSystemComponent;
|
||||
m_loggerComponent = AZStd::make_unique<AZ::LoggerSystemComponent>();
|
||||
m_timeSystem = AZStd::make_unique<AZ::TimeSystem>();
|
||||
m_networkingSystemComponent = AZStd::make_unique<AzNetworking::NetworkingSystemComponent>();
|
||||
}
|
||||
|
||||
void TearDown() override
|
||||
{
|
||||
delete m_networkingSystemComponent;
|
||||
delete m_timeComponent;
|
||||
delete m_loggerComponent;
|
||||
m_networkingSystemComponent.reset();
|
||||
m_timeSystem.reset();
|
||||
m_loggerComponent.reset();
|
||||
|
||||
AZ::NameDictionary::Destroy();
|
||||
TeardownAllocator();
|
||||
}
|
||||
|
||||
AZ::LoggerSystemComponent* m_loggerComponent;
|
||||
AZ::TimeSystemComponent* m_timeComponent;
|
||||
AzNetworking::NetworkingSystemComponent* m_networkingSystemComponent;
|
||||
AZStd::unique_ptr<AZ::LoggerSystemComponent> m_loggerComponent;
|
||||
AZStd::unique_ptr<AZ::TimeSystem> m_timeSystem;
|
||||
AZStd::unique_ptr<AzNetworking::NetworkingSystemComponent> m_networkingSystemComponent;
|
||||
};
|
||||
|
||||
#if AZ_TRAIT_DISABLE_FAILED_NETWORKING_TESTS
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <AzNetworking/AutoGen/CorePackets.AutoPackets.h>
|
||||
#include <AzCore/Interface/Interface.h>
|
||||
#include <AzCore/Console/LoggerSystemComponent.h>
|
||||
#include <AzCore/Time/TimeSystemComponent.h>
|
||||
#include <AzCore/Time/TimeSystem.h>
|
||||
#include <AzCore/Name/NameDictionary.h>
|
||||
#include <AzCore/UnitTest/TestTypes.h>
|
||||
|
||||
@@ -105,24 +105,24 @@ namespace UnitTest
|
||||
SetupAllocator();
|
||||
AZ::NameDictionary::Create();
|
||||
|
||||
m_loggerComponent = new AZ::LoggerSystemComponent;
|
||||
m_timeComponent = new AZ::TimeSystemComponent;
|
||||
m_networkingSystemComponent = new AzNetworking::NetworkingSystemComponent;
|
||||
m_loggerComponent = AZStd::make_unique<AZ::LoggerSystemComponent>();
|
||||
m_timeSystem = AZStd::make_unique<AZ::TimeSystem>();
|
||||
m_networkingSystemComponent = AZStd::make_unique<AzNetworking::NetworkingSystemComponent>();
|
||||
}
|
||||
|
||||
void TearDown() override
|
||||
{
|
||||
delete m_networkingSystemComponent;
|
||||
delete m_timeComponent;
|
||||
delete m_loggerComponent;
|
||||
m_networkingSystemComponent.reset();
|
||||
m_timeSystem.reset();
|
||||
m_loggerComponent.reset();
|
||||
|
||||
AZ::NameDictionary::Destroy();
|
||||
TeardownAllocator();
|
||||
}
|
||||
|
||||
AZ::LoggerSystemComponent* m_loggerComponent;
|
||||
AZ::TimeSystemComponent* m_timeComponent;
|
||||
AzNetworking::NetworkingSystemComponent* m_networkingSystemComponent;
|
||||
AZStd::unique_ptr<AZ::LoggerSystemComponent> m_loggerComponent;
|
||||
AZStd::unique_ptr<AZ::TimeSystem> m_timeSystem;
|
||||
AZStd::unique_ptr<AzNetworking::NetworkingSystemComponent> m_networkingSystemComponent;
|
||||
};
|
||||
|
||||
TEST_F(UdpTransportTests, PacketIdWrap)
|
||||
|
||||
Reference in New Issue
Block a user