فهرست منبع

Added a fix for fixed timestep on Windows

Ivan Safrin 11 سال پیش
والد
کامیت
1983a51de4
1فایلهای تغییر یافته به همراه7 افزوده شده و 2 حذف شده
  1. 7 2
      Core/Contents/Source/PolyCore.cpp

+ 7 - 2
Core/Contents/Source/PolyCore.cpp

@@ -227,8 +227,13 @@ namespace Polycode {
 		      
 		if(elapsed > 1000)
 			elapsed = 1000;
-		
-        timeLeftOver = fixedElapsed;
+
+		if(fixedElapsed > 0) {
+            timeLeftOver = fixedElapsed;
+        } else {
+            timeLeftOver = 0;
+        }
+        
         fixedElapsed = (((Number)elapsed)/1000.0f) + timeLeftOver;
         
         if(fixedElapsed > maxFixedElapsed) {