2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-05-13 19:51:22 +00:00
metaforce/Runtime/CTimeProvider.cpp
Lioncash deff9d054b CTimeProvider: Move global instance to cpp file
This isn't used anywhere externally, so we can keep it hidden in the cpp
file.
2020-04-26 03:05:57 -04:00

27 lines
678 B
C++

#include "Runtime/CTimeProvider.hpp"
#include "Runtime/Graphics/CGraphics.hpp"
namespace urde {
static CTimeProvider* s_currentTimeProvider = nullptr;
CTimeProvider::CTimeProvider(const float& time) : x0_currentTime(time), x8_lastProvider(s_currentTimeProvider) {
if (x8_lastProvider != nullptr) {
x8_lastProvider->x4_first = false;
}
s_currentTimeProvider = this;
CGraphics::SetExternalTimeProvider(this);
}
CTimeProvider::~CTimeProvider() {
s_currentTimeProvider = x8_lastProvider;
if (s_currentTimeProvider != nullptr) {
s_currentTimeProvider->x4_first = true;
}
CGraphics::SetExternalTimeProvider(s_currentTimeProvider);
}
} // namespace urde