2012-12-19 09:30:18 +00:00
|
|
|
/****************************************************************************
|
|
|
|
* *
|
|
|
|
* Project 64 - A Nintendo 64 emulator. *
|
|
|
|
* http://www.pj64-emu.com/ *
|
|
|
|
* Copyright (C) 2012 Project64. All rights reserved. *
|
|
|
|
* *
|
|
|
|
* License: *
|
|
|
|
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
|
|
|
|
* *
|
|
|
|
****************************************************************************/
|
|
|
|
#pragma once
|
|
|
|
|
2012-12-31 12:46:03 +00:00
|
|
|
class CSpeedLimitor :
|
|
|
|
private CGameSettings
|
|
|
|
{
|
2008-09-18 03:15:49 +00:00
|
|
|
public:
|
2015-04-28 22:19:02 +00:00
|
|
|
CSpeedLimitor();
|
|
|
|
~CSpeedLimitor();
|
2012-12-31 12:46:03 +00:00
|
|
|
|
2015-04-28 22:19:02 +00:00
|
|
|
void SetHertz(const DWORD Hertz);
|
|
|
|
bool Timer_Process(DWORD* const FrameRate);
|
|
|
|
void IncreaseSpeed();
|
|
|
|
void DecreaseSpeed();
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2012-12-31 12:46:03 +00:00
|
|
|
private:
|
2015-04-28 22:19:02 +00:00
|
|
|
CSpeedLimitor(const CSpeedLimitor&); // Disable copy constructor
|
|
|
|
CSpeedLimitor& operator=(const CSpeedLimitor&); // Disable assignment
|
2012-12-31 12:46:03 +00:00
|
|
|
|
2015-04-28 22:19:02 +00:00
|
|
|
void FixSpeedRatio();
|
2012-12-31 12:46:03 +00:00
|
|
|
|
2015-04-28 22:19:02 +00:00
|
|
|
DWORD m_Speed, m_BaseSpeed, m_Frames, m_LastTime;
|
|
|
|
double m_Ratio;
|
2008-09-18 03:15:49 +00:00
|
|
|
};
|