From: <go...@us...> - 2009-10-20 01:01:41
|
Revision: 2976 http://desmume.svn.sourceforge.net/desmume/?rev=2976&view=rev Author: gocha Date: 2009-10-20 01:01:34 +0000 (Tue, 20 Oct 2009) Log Message: ----------- Fix timeBeginPeriod-timeEndPeriod nesting Modified Paths: -------------- trunk/desmume/src/windows/main.cpp Modified: trunk/desmume/src/windows/main.cpp =================================================================== --- trunk/desmume/src/windows/main.cpp 2009-10-19 04:39:19 UTC (rev 2975) +++ trunk/desmume/src/windows/main.cpp 2009-10-20 01:01:34 UTC (rev 2976) @@ -1802,6 +1802,7 @@ return buf; } +DWORD wmTimerRes; int _main() { InitDecoder(); @@ -2108,19 +2109,6 @@ MainWindow->checkMenu(frameskiprate + IDC_FRAMESKIP0, true); } - DWORD wmTimerRes; - TIMECAPS tc; - if (timeGetDevCaps(&tc, sizeof(TIMECAPS))== TIMERR_NOERROR) - { - wmTimerRes = std::min(std::max(tc.wPeriodMin, (UINT)1), tc.wPeriodMax); - timeBeginPeriod (wmTimerRes); - } - else - { - wmTimerRes = 5; - timeBeginPeriod (wmTimerRes); - } - if (KeyInDelayMSec == 0) { DWORD dwKeyboardDelay; SystemParametersInfo(SPI_GETKEYBOARDDELAY, 0, &dwKeyboardDelay, 0); @@ -2285,13 +2273,26 @@ int nFunsterStil) { - timeBeginPeriod(1); + TIMECAPS tc; + if (timeGetDevCaps(&tc, sizeof(TIMECAPS))== TIMERR_NOERROR) + { + wmTimerRes = std::min(std::max(tc.wPeriodMin, (UINT)1), tc.wPeriodMax); + timeBeginPeriod (wmTimerRes); + } + else + { + wmTimerRes = 5; + timeBeginPeriod (wmTimerRes); + } + g_thread_init (NULL); hAppInst=hThisInstance; OpenConsole(); // Init debug console int ret = _main(); + timeEndPeriod (wmTimerRes); + CloseConsole(); return ret; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |