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()
95
95
m_edgeActivatedHatValues.clear ();
96
96
97
97
m_running = false ;
98
+ m_frameActivity = false ;
98
99
99
100
m_unsupportedBlocks.clear ();
100
101
}
@@ -421,6 +422,7 @@ void Engine::stop()
421
422
m_running = false ;
422
423
}
423
424
425
+ m_frameActivity = false ;
424
426
deleteClones ();
425
427
stopSounds ();
426
428
m_stopped ();
@@ -578,6 +580,9 @@ void Engine::step()
578
580
}
579
581
}
580
582
583
+ // Check running threads (must be done here)
584
+ m_frameActivity = !m_threads.empty ();
585
+
581
586
m_redrawRequested = false ;
582
587
583
588
// Step threads
@@ -737,7 +742,7 @@ void Engine::eventLoop(bool untilProjectStops)
737
742
738
743
bool Engine::isRunning () const
739
744
{
740
- return m_running;
745
+ return m_running || m_frameActivity ;
741
746
}
742
747
743
748
double Engine::fps () const
Original file line number Diff line number Diff line change @@ -277,6 +277,7 @@ class Engine : public IEngine
277
277
bool m_spriteFencingEnabled = true ;
278
278
279
279
bool m_running = false ;
280
+ bool m_frameActivity = false ;
280
281
bool m_redrawRequested = false ;
281
282
sigslot::signal<> m_aboutToRedraw;
282
283
sigslot::signal<VirtualMachine *> m_threadAboutToStop;
Original file line number Diff line number Diff line change @@ -2018,6 +2018,8 @@ TEST(EngineTest, StopAllBypass)
2018
2018
ASSERT_VAR (stage, " j" );
2019
2019
ASSERT_EQ (GET_VAR (stage, " j" )->value ().toInt (), 5 );
2020
2020
2021
+ ASSERT_TRUE (engine->isRunning ());
2022
+ engine->step ();
2021
2023
ASSERT_FALSE (engine->isRunning ());
2022
2024
}
2023
2025
You can’t perform that action at this time.
0 commit comments