From 691f09159b1757eefb51059b12daae7d5e079246 Mon Sep 17 00:00:00 2001 From: zilmar Date: Mon, 18 Jan 2016 22:32:50 +1100 Subject: [PATCH] [Project64] remove Speed limiter code from non windows --- .../Project64-core/N64System/SpeedLimiterClass.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Source/Project64-core/N64System/SpeedLimiterClass.cpp b/Source/Project64-core/N64System/SpeedLimiterClass.cpp index d44d66578..f090d53cb 100644 --- a/Source/Project64-core/N64System/SpeedLimiterClass.cpp +++ b/Source/Project64-core/N64System/SpeedLimiterClass.cpp @@ -11,10 +11,11 @@ #include "stdafx.h" #include "SpeedLimiterClass.h" #include +#ifdef _WIN32 #include #include - #pragma comment(lib, "winmm.lib") +#endif CSpeedLimiter::CSpeedLimiter() { @@ -24,19 +25,23 @@ CSpeedLimiter::CSpeedLimiter() m_BaseSpeed = 60; m_Ratio = 1000.0F / (float)m_Speed; +#ifdef _WIN32 TIMECAPS Caps; timeGetDevCaps(&Caps, sizeof(Caps)); if (timeBeginPeriod(Caps.wPeriodMin) == TIMERR_NOCANDO) { g_Notify->DisplayError("Error during timer begin"); } +#endif } CSpeedLimiter::~CSpeedLimiter() { +#ifdef _WIN32 TIMECAPS Caps; timeGetDevCaps(&Caps, sizeof(Caps)); timeEndPeriod(Caps.wPeriodMin); +#endif } void CSpeedLimiter::SetHertz(uint32_t Hertz) @@ -50,11 +55,14 @@ void CSpeedLimiter::FixSpeedRatio() { m_Ratio = 1000.0f / static_cast(m_Speed); m_Frames = 0; +#ifdef _WIN32 m_LastTime = timeGetTime(); +#endif } bool CSpeedLimiter::Timer_Process(uint32_t * FrameRate) { +#ifdef _WIN32 m_Frames += 1; uint32_t CurrentTime = timeGetTime(); @@ -85,6 +93,9 @@ bool CSpeedLimiter::Timer_Process(uint32_t * FrameRate) { return false; } +#else + return false; +#endif } void CSpeedLimiter::IncreaseSpeed()