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:
@@ -18,7 +18,7 @@
|
||||
#include <LyShine/Bus/UiTransform2dBus.h>
|
||||
#include <LyShine/Bus/UiTransformBus.h>
|
||||
|
||||
#include <ITimer.h>
|
||||
#include <AzCore/Time/ITime.h>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//! UiScrollerNotificationBus Behavior context handler class
|
||||
@@ -436,7 +436,8 @@ bool UiScrollBarComponent::HandlePressed(AZ::Vector2 point, bool& shouldStayActi
|
||||
else
|
||||
{
|
||||
// Move handle
|
||||
m_lastMoveTime = gEnv->pTimer->GetCurrTime(ITimer::ETIMER_UI);
|
||||
const AZ::TimeMs realTimeMs = AZ::GetRealElapsedTimeMs();
|
||||
m_lastMoveTime = AZ::TimeMsToSeconds(realTimeMs);
|
||||
m_moveDelayTime = 0.45f;
|
||||
|
||||
MoveHandle(pointLoc);
|
||||
@@ -617,7 +618,8 @@ void UiScrollBarComponent::InputPositionUpdate(AZ::Vector2 point)
|
||||
LocRelativeToHandle pointLoc = GetLocationRelativeToHandle(point);
|
||||
if (pointLoc != LocRelativeToHandle::OnHandle)
|
||||
{
|
||||
const float currentTime = gEnv->pTimer->GetCurrTime(ITimer::ETIMER_UI);
|
||||
const AZ::TimeMs realTimeMs = AZ::GetRealElapsedTimeMs();
|
||||
const float currentTime = AZ::TimeMsToSeconds(realTimeMs);
|
||||
if (currentTime - m_lastMoveTime > m_moveDelayTime)
|
||||
{
|
||||
m_lastMoveTime = currentTime;
|
||||
|
||||
Reference in New Issue
Block a user