From 2ef21fc3e2b9105ac6c956db648c747b2f742f49 Mon Sep 17 00:00:00 2001 From: Flavio Calva Date: Mon, 18 Jul 2022 18:55:15 +0100 Subject: [PATCH] assert fps --- pmachines/app.py | 10 ++++++++++ prj.org | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pmachines/app.py b/pmachines/app.py index bbb82c7..a5f964d 100755 --- a/pmachines/app.py +++ b/pmachines/app.py @@ -101,6 +101,8 @@ class PmachinesApp: self._fsm.demand('Menu') if args.functional_test or args.functional_ref: FunctionalTest(args.functional_ref, self._pos_mgr) + self.__fps_lst = [] + taskMgr.do_method_later(1.0, self.__assert_fps, 'assert_fps') def on_menu_enter(self): self._menu_bg = Background() @@ -280,3 +282,11 @@ class PmachinesApp: def _on_aspect_ratio_changed(self): if self._fsm.state == 'Scene': self._scene.on_aspect_ratio_changed() + + def __assert_fps(self, task): + if len(self.__fps_lst) > 3: + 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)) + return task.again diff --git a/prj.org b/prj.org index 2a3089b..85082cd 100644 --- a/prj.org +++ b/prj.org @@ -3,9 +3,7 @@ #+CATEGORY: pmachines #+TAGS: bug(b) calendar(c) waiting(w) -* READY drag and drop positions in the scene files as empty nodes -* READY functional tests for performance (frame rate) -* READY functional tests for "cleaning" i.e. at the end of the states verify: +* CODE functional tests for "cleaning" i.e. at the end of the states verify: - [ ] active threads - [ ] active tasks - [ ] current nodepaths (render3d) @@ -13,6 +11,7 @@ - [ ] current nodepaths (render3d) - [ ] current accepting events - [ ] current buffers +* READY drag and drop positions in the scene files as empty nodes * READY refactoring (recurring task) * BACKLOG intro animation (from target item to start position) * BACKLOG buttons of the scenes enabled sequentially @@ -21,6 +20,7 @@ - [ ] put an "update" if id is saved and versions are different * BACKLOG actions: rewind, prev, next * BACKLOG teeter-tooter with constraints (real teeter tooter), magnet, road cone, bucket +* BACKLOG (when python 3.11) use toml in place of ini * BACKLOG (when panda3d provides it) android build (test with the emulator of android studio) * BACKLOG (when itch.io's client waiting works with wine) functional tests for windows-itch.io * calendar :calendar: -- 2.30.2