mirror of https://github.com/AxioDL/metaforce.git
Implement CTimeProvider
This commit is contained in:
parent
8ffa2d2b15
commit
7dedea85ff
|
@ -0,0 +1,32 @@
|
|||
#include "CTimeProvider.hpp"
|
||||
#if 0
|
||||
#include "CGraphics.hpp"
|
||||
#endif
|
||||
|
||||
namespace Retro
|
||||
{
|
||||
CTimeProvider* g_TimeProvider = nullptr;
|
||||
CTimeProvider::CTimeProvider(const float& time)
|
||||
: x0_currentTime(time)
|
||||
{
|
||||
x8_lastProvider = g_TimeProvider;
|
||||
|
||||
if (x8_lastProvider != nullptr)
|
||||
x8_lastProvider->x4_first = false;
|
||||
|
||||
#if 0
|
||||
CGraphics::SetExternalTimeProvider(this);
|
||||
#endif
|
||||
}
|
||||
|
||||
CTimeProvider::~CTimeProvider()
|
||||
{
|
||||
g_TimeProvider = x8_lastProvider;
|
||||
if (g_TimeProvider)
|
||||
g_TimeProvider->x4_first = true;
|
||||
#if 0
|
||||
CGraphics::SetExternalTimeProvider(g_TimeProvider);
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef __RETRO__CTIMEPROVIDER_HPP__
|
||||
#define __RETRO__CTIMEPROVIDER_HPP__
|
||||
namespace Retro
|
||||
{
|
||||
class CTimeProvider;
|
||||
extern CTimeProvider* g_TimeProvider;
|
||||
class CTimeProvider
|
||||
{
|
||||
public:
|
||||
const float& x0_currentTime; // in seconds
|
||||
bool x4_first = true;
|
||||
CTimeProvider* x8_lastProvider = nullptr;
|
||||
|
||||
CTimeProvider(const float& time);
|
||||
~CTimeProvider();
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue