s/CSpeedLimitor/CSpeedLimiter
This commit is contained in:
parent
b50163938e
commit
df83c3c440
|
@ -147,7 +147,7 @@ private:
|
||||||
CProfiling m_CPU_Usage; //used to track the cpu usage
|
CProfiling m_CPU_Usage; //used to track the cpu usage
|
||||||
CRecompiler * m_Recomp;
|
CRecompiler * m_Recomp;
|
||||||
CAudio m_Audio;
|
CAudio m_Audio;
|
||||||
CSpeedLimitor m_Limitor;
|
CSpeedLimiter m_Limitor;
|
||||||
bool m_InReset;
|
bool m_InReset;
|
||||||
int32_t m_NextTimer;
|
int32_t m_NextTimer;
|
||||||
CSystemTimer m_SystemTimer;
|
CSystemTimer m_SystemTimer;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
#pragma comment(lib, "winmm.lib")
|
#pragma comment(lib, "winmm.lib")
|
||||||
|
|
||||||
CSpeedLimitor::CSpeedLimitor()
|
CSpeedLimiter::CSpeedLimiter()
|
||||||
{
|
{
|
||||||
m_Frames = 0;
|
m_Frames = 0;
|
||||||
m_LastTime = 0;
|
m_LastTime = 0;
|
||||||
|
@ -32,28 +32,28 @@ CSpeedLimitor::CSpeedLimitor()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CSpeedLimitor::~CSpeedLimitor()
|
CSpeedLimiter::~CSpeedLimiter()
|
||||||
{
|
{
|
||||||
TIMECAPS Caps;
|
TIMECAPS Caps;
|
||||||
timeGetDevCaps(&Caps, sizeof(Caps));
|
timeGetDevCaps(&Caps, sizeof(Caps));
|
||||||
timeEndPeriod(Caps.wPeriodMin);
|
timeEndPeriod(Caps.wPeriodMin);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSpeedLimitor::SetHertz(uint32_t Hertz)
|
void CSpeedLimiter::SetHertz(uint32_t Hertz)
|
||||||
{
|
{
|
||||||
m_Speed = Hertz;
|
m_Speed = Hertz;
|
||||||
m_BaseSpeed = Hertz;
|
m_BaseSpeed = Hertz;
|
||||||
FixSpeedRatio();
|
FixSpeedRatio();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSpeedLimitor::FixSpeedRatio()
|
void CSpeedLimiter::FixSpeedRatio()
|
||||||
{
|
{
|
||||||
m_Ratio = 1000.0f / static_cast<double>(m_Speed);
|
m_Ratio = 1000.0f / static_cast<double>(m_Speed);
|
||||||
m_Frames = 0;
|
m_Frames = 0;
|
||||||
m_LastTime = timeGetTime();
|
m_LastTime = timeGetTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CSpeedLimitor::Timer_Process(uint32_t * FrameRate)
|
bool CSpeedLimiter::Timer_Process(uint32_t * FrameRate)
|
||||||
{
|
{
|
||||||
m_Frames += 1;
|
m_Frames += 1;
|
||||||
uint32_t CurrentTime = timeGetTime();
|
uint32_t CurrentTime = timeGetTime();
|
||||||
|
@ -87,7 +87,7 @@ bool CSpeedLimitor::Timer_Process(uint32_t * FrameRate)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSpeedLimitor::IncreaseSpeed()
|
void CSpeedLimiter::IncreaseSpeed()
|
||||||
{
|
{
|
||||||
if (m_Speed >= 60)
|
if (m_Speed >= 60)
|
||||||
{
|
{
|
||||||
|
@ -105,7 +105,7 @@ void CSpeedLimitor::IncreaseSpeed()
|
||||||
FixSpeedRatio();
|
FixSpeedRatio();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSpeedLimitor::DecreaseSpeed()
|
void CSpeedLimiter::DecreaseSpeed()
|
||||||
{
|
{
|
||||||
if (m_Speed > 60)
|
if (m_Speed > 60)
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,12 +12,12 @@
|
||||||
|
|
||||||
#include "../Settings/GameSettings.h"
|
#include "../Settings/GameSettings.h"
|
||||||
|
|
||||||
class CSpeedLimitor :
|
class CSpeedLimiter :
|
||||||
private CGameSettings
|
private CGameSettings
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CSpeedLimitor();
|
CSpeedLimiter();
|
||||||
~CSpeedLimitor();
|
~CSpeedLimiter();
|
||||||
|
|
||||||
void SetHertz(const uint32_t Hertz);
|
void SetHertz(const uint32_t Hertz);
|
||||||
bool Timer_Process(uint32_t* const FrameRate);
|
bool Timer_Process(uint32_t* const FrameRate);
|
||||||
|
@ -25,8 +25,8 @@ public:
|
||||||
void DecreaseSpeed();
|
void DecreaseSpeed();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CSpeedLimitor(const CSpeedLimitor&); // Disable copy constructor
|
CSpeedLimiter(const CSpeedLimiter&); // Disable copy constructor
|
||||||
CSpeedLimitor& operator=(const CSpeedLimitor&); // Disable assignment
|
CSpeedLimiter& operator=(const CSpeedLimiter&); // Disable assignment
|
||||||
|
|
||||||
void FixSpeedRatio();
|
void FixSpeedRatio();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue