2019-12-22 20:04:07 +00:00
|
|
|
#include "Runtime/CTimeProvider.hpp"
|
|
|
|
|
|
|
|
#include "Runtime/Graphics/CGraphics.hpp"
|
2015-10-27 20:04:02 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace urde {
|
2016-02-07 16:15:43 +00:00
|
|
|
CTimeProvider* CTimeProvider::g_currentTimeProvider = nullptr;
|
2018-12-08 05:30:43 +00:00
|
|
|
CTimeProvider::CTimeProvider(const float& time) : x0_currentTime(time), x8_lastProvider(g_currentTimeProvider) {
|
|
|
|
if (x8_lastProvider != nullptr)
|
|
|
|
x8_lastProvider->x4_first = false;
|
2015-10-27 20:04:02 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
g_currentTimeProvider = this;
|
2016-02-18 16:14:57 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
CGraphics::SetExternalTimeProvider(this);
|
2015-10-27 20:04:02 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
CTimeProvider::~CTimeProvider() {
|
|
|
|
g_currentTimeProvider = x8_lastProvider;
|
|
|
|
if (g_currentTimeProvider)
|
|
|
|
g_currentTimeProvider->x4_first = true;
|
|
|
|
CGraphics::SetExternalTimeProvider(g_currentTimeProvider);
|
2015-10-27 20:04:02 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace urde
|