2012-12-19 09:30:18 +00:00
|
|
|
/****************************************************************************
|
|
|
|
* *
|
2015-11-10 05:21:49 +00:00
|
|
|
* Project64 - A Nintendo 64 emulator. *
|
2012-12-19 09:30:18 +00:00
|
|
|
* 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
|
|
|
|
|
2015-12-04 06:49:31 +00:00
|
|
|
#include "../Settings/GameSettings.h"
|
2015-11-12 11:00:47 +00:00
|
|
|
|
2015-12-14 22:09:12 +00:00
|
|
|
class CSpeedLimiter :
|
2015-11-08 18:53:05 +00:00
|
|
|
private CGameSettings
|
|
|
|
{
|
2008-09-18 03:15:49 +00:00
|
|
|
public:
|
2015-12-14 22:09:12 +00:00
|
|
|
CSpeedLimiter();
|
|
|
|
~CSpeedLimiter();
|
2012-12-31 12:46:03 +00:00
|
|
|
|
2015-11-08 18:53:05 +00:00
|
|
|
void SetHertz(const uint32_t Hertz);
|
|
|
|
bool Timer_Process(uint32_t* const FrameRate);
|
|
|
|
void IncreaseSpeed();
|
|
|
|
void DecreaseSpeed();
|
2008-09-18 03:15:49 +00:00
|
|
|
|
2012-12-31 12:46:03 +00:00
|
|
|
private:
|
2015-12-14 22:09:12 +00:00
|
|
|
CSpeedLimiter(const CSpeedLimiter&); // Disable copy constructor
|
|
|
|
CSpeedLimiter& operator=(const CSpeedLimiter&); // Disable assignment
|
2012-12-31 12:46:03 +00:00
|
|
|
|
2015-11-08 18:53:05 +00:00
|
|
|
void FixSpeedRatio();
|
2012-12-31 12:46:03 +00:00
|
|
|
|
2015-11-08 18:53:05 +00:00
|
|
|
uint32_t m_Speed, m_BaseSpeed, m_Frames, m_LastTime;
|
|
|
|
double m_Ratio;
|
2008-09-18 03:15:49 +00:00
|
|
|
};
|