mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Fixes (by The_Bob):
- Fixed never ending interrupt bug (cats/bugs got interrupt when out of breath) - Added condition to interrupt code for minimal breath left to get interrupts - Tweaked timer control code git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8401 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -289,12 +289,12 @@ UINT32 GetNextCounterDoneTime(void)
|
||||
gliTimestampDiff = gliPerfCountNext.QuadPart - gliPerfCount.QuadPart;
|
||||
gliWaitTime = (gliTimestampDiff * FREQUENCY_CONST) / gliPerfFreq.QuadPart;
|
||||
|
||||
// if the wait time is too long/short, re-evaluate the timer and try waiting 125ms
|
||||
if (gliWaitTime > 15 * FREQUENCY_CONST) {
|
||||
// if the wait time is too long, or the "missed" step gets too long, re-evaluate the timer and try waiting 125ms
|
||||
if (gliWaitTime > 15000 || gliWaitTime < -15000) {
|
||||
gliWaitTime = 125; // in mili-seconds
|
||||
|
||||
QueryPerformanceFrequency(&gliPerfFreq);
|
||||
gliPerfCountNext.QuadPart = gliPerfCount.QuadPart + ((125 * gliPerfFreq.QuadPart) / 1000000);
|
||||
gliPerfCountNext.QuadPart = gliPerfCount.QuadPart + ((125 * gliPerfFreq.QuadPart) / FREQUENCY_CONST);
|
||||
}
|
||||
|
||||
return (UINT32)((gliWaitTime > 0) ? gliWaitTime : 0);
|
||||
|
||||
Reference in New Issue
Block a user