ya2 · news · projects · code · about

fixes for building
[pmachines.git] / pmachines / app.py
index 0b0234c59b46c73d76cfe070ea0373b3ed9b48b6..153ba718fc2cba436f7bbf09219f6cec6fe5f49d 100755 (executable)
@@ -8,6 +8,7 @@ from sys import platform, argv, exit
 from logging import info, debug
 from os.path import exists
 from os import makedirs
+from multiprocessing import cpu_count
 from panda3d.core import Filename, load_prc_file_data, AntialiasAttrib, \
     Texture, WindowProperties, LVector2i, TextNode
 from panda3d.bullet import BulletWorld, BulletDebugNode
@@ -304,5 +305,6 @@ class PmachinesApp:
             self.__fps_lst.pop(0)
         self.__fps_lst += [globalClock.average_frame_rate]
         if len(self.__fps_lst) == 4:
-            assert(any(fps > 55 for fps in self.__fps_lst))
+            fps_threshold = 55 if cpu_count() >= 4 else 25
+            assert(any(fps > fps_threshold for fps in self.__fps_lst), 'low fps %s' % self.__fps_lst)
         return task.again