File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ void Engine::clear()
9595 m_edgeActivatedHatValues.clear ();
9696
9797 m_running = false ;
98+ m_frameActivity = false ;
9899
99100 m_unsupportedBlocks.clear ();
100101}
@@ -421,6 +422,7 @@ void Engine::stop()
421422 m_running = false ;
422423 }
423424
425+ m_frameActivity = false ;
424426 deleteClones ();
425427 stopSounds ();
426428 m_stopped ();
@@ -578,6 +580,9 @@ void Engine::step()
578580 }
579581 }
580582
583+ // Check running threads (must be done here)
584+ m_frameActivity = !m_threads.empty ();
585+
581586 m_redrawRequested = false ;
582587
583588 // Step threads
@@ -737,7 +742,7 @@ void Engine::eventLoop(bool untilProjectStops)
737742
738743bool Engine::isRunning () const
739744{
740- return m_running;
745+ return m_running || m_frameActivity ;
741746}
742747
743748double Engine::fps () const
Original file line number Diff line number Diff line change @@ -277,6 +277,7 @@ class Engine : public IEngine
277277 bool m_spriteFencingEnabled = true ;
278278
279279 bool m_running = false ;
280+ bool m_frameActivity = false ;
280281 bool m_redrawRequested = false ;
281282 sigslot::signal<> m_aboutToRedraw;
282283 sigslot::signal<VirtualMachine *> m_threadAboutToStop;
Original file line number Diff line number Diff line change @@ -2018,6 +2018,8 @@ TEST(EngineTest, StopAllBypass)
20182018 ASSERT_VAR (stage, " j" );
20192019 ASSERT_EQ (GET_VAR (stage, " j" )->value ().toInt (), 5 );
20202020
2021+ ASSERT_TRUE (engine->isRunning ());
2022+ engine->step ();
20212023 ASSERT_FALSE (engine->isRunning ());
20222024}
20232025
You can’t perform that action at this time.
0 commit comments