File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ int main(void) {
61
61
renderer.WaitIdle (t);
62
62
}
63
63
64
- if (scene.IsRunning ()) scene.Stop ();
64
+ if (scene.IsRunning () or scene. IsPaused () ) scene.Stop ();
65
65
66
66
app->Stop (scene);
67
67
delete app;
Original file line number Diff line number Diff line change @@ -35,17 +35,16 @@ namespace volt::renderer {
35
35
void EditorLayer::drawControls (runtime::Scene &s) noexcept {
36
36
if (ImGui::Begin (" Controls" , nullptr , ImGuiWindowFlags_NoTitleBar)) {
37
37
if (s.IsRunning ()) {
38
- if (ImGui::Button (" Pause" )) {
39
- s.Pause ();
40
- }
38
+ if (ImGui::Button (" Pause" )) s.Pause ();
41
39
ImGui::SameLine ();
42
- if (ImGui::Button (" Stop" )) {
43
- s.Stop ();
44
- }
40
+ if (ImGui::Button (" Stop" )) s.Stop ();
45
41
}
46
- else if (ImGui::Button (" Play" )) {
47
- s.Play ();
42
+ else if (s.IsPaused ()) {
43
+ if (ImGui::Button (" Play" )) s.Play ();
44
+ ImGui::SameLine ();
45
+ if (ImGui::Button (" Stop" )) s.Stop ();
48
46
}
47
+ else if (ImGui::Button (" Play" )) s.Play ();
49
48
}
50
49
ImGui::End ();
51
50
}
Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ namespace volt::runtime {
60
60
std::optional<Entity> FindEntityByID (core::SnowflakeID::value_type id);
61
61
std::optional<Entity> FindEntityByName (const std::string &name);
62
62
inline bool IsRunning (void ) const noexcept { return m_running; }
63
+ inline bool IsPaused (void ) const noexcept { return m_paused; }
63
64
void Play (void ) noexcept ;
64
65
void Pause (void ) noexcept ;
65
66
void Stop (void ) noexcept ;
You can’t perform that action at this time.
0 commit comments