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:
@@ -19,6 +19,7 @@
|
||||
#include <AzCore/Component/TransformBus.h>
|
||||
#include <AzCore/Asset/AssetManager.h>
|
||||
#include <AzCore/Interface/Interface.h>
|
||||
#include <AzCore/Time/ITime.h>
|
||||
#include <AzCore/Utils/Utils.h>
|
||||
#include <MathConversion.h>
|
||||
|
||||
@@ -749,7 +750,9 @@ bool CCryEditDoc::OnOpenDocument(const QString& lpszPathName)
|
||||
|
||||
bool CCryEditDoc::BeforeOpenDocument(const QString& lpszPathName, TOpenDocContext& context)
|
||||
{
|
||||
CTimeValue loading_start_time = gEnv->pTimer->GetAsyncTime();
|
||||
const AZ::TimeMs timeMs = AZ::GetRealElapsedTimeMs();
|
||||
const double timeSec = AZ::TimeMsToSecondsDouble(timeMs);
|
||||
const CTimeValue loading_start_time(timeSec);
|
||||
|
||||
bool usePrefabSystemForLevels = false;
|
||||
AzFramework::ApplicationRequests::Bus::BroadcastResult(
|
||||
@@ -790,7 +793,7 @@ bool CCryEditDoc::BeforeOpenDocument(const QString& lpszPathName, TOpenDocContex
|
||||
|
||||
bool CCryEditDoc::DoOpenDocument(TOpenDocContext& context)
|
||||
{
|
||||
CTimeValue& loading_start_time = context.loading_start_time;
|
||||
const CTimeValue& loading_start_time = context.loading_start_time;
|
||||
|
||||
bool isPrefabEnabled = false;
|
||||
AzFramework::ApplicationRequests::Bus::BroadcastResult(isPrefabEnabled, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
|
||||
@@ -860,7 +863,9 @@ bool CCryEditDoc::DoOpenDocument(TOpenDocContext& context)
|
||||
|
||||
StartStreamingLoad();
|
||||
|
||||
CTimeValue loading_end_time = gEnv->pTimer->GetAsyncTime();
|
||||
const AZ::TimeMs timeMs = AZ::GetRealElapsedTimeMs();
|
||||
const double timeSec = AZ::TimeMsToSecondsDouble(timeMs);
|
||||
const CTimeValue loading_end_time(timeSec);
|
||||
|
||||
CLogFile::FormatLine("-----------------------------------------------------------");
|
||||
CLogFile::FormatLine("Successfully opened document %s", context.absoluteLevelPath.toUtf8().data());
|
||||
|
||||
Reference in New Issue
Block a user