summaryrefslogtreecommitdiff
path: root/textscreen
diff options
context:
space:
mode:
authorSimon Howard2006-08-31 18:11:47 +0000
committerSimon Howard2006-08-31 18:11:47 +0000
commitfe1a0afdd7acec6705ccf0ada6b51eae9aae2870 (patch)
tree7410c783e22758de6b74fd4874467bf29e7f9ec5 /textscreen
parent5e303c43dab6c433bc3b59dd34d4672317c5f4e1 (diff)
downloadchocolate-doom-fe1a0afdd7acec6705ccf0ada6b51eae9aae2870.tar.gz
chocolate-doom-fe1a0afdd7acec6705ccf0ada6b51eae9aae2870.tar.bz2
chocolate-doom-fe1a0afdd7acec6705ccf0ada6b51eae9aae2870.zip
Exit the main loop automatically after all windows are closed
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 577
Diffstat (limited to 'textscreen')
-rw-r--r--textscreen/txt_desktop.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/textscreen/txt_desktop.c b/textscreen/txt_desktop.c
index e9673434..803fa4fc 100644
--- a/textscreen/txt_desktop.c
+++ b/textscreen/txt_desktop.c
@@ -147,15 +147,6 @@ void TXT_DispatchEvents(void)
TXT_WindowKeyPress(all_windows[num_windows - 1], c);
}
- else
- {
- // No windows
-
- if (c == KEY_ESCAPE)
- {
- TXT_ExitMainLoop();
- }
- }
}
}
@@ -171,7 +162,16 @@ void TXT_GUIMainLoop(void)
while (main_loop_running)
{
TXT_DispatchEvents();
+
+ // After the last window is closed, exit the loop
+
+ if (num_windows <= 0)
+ {
+ TXT_ExitMainLoop();
+ }
+
TXT_DrawDesktop();
+ TXT_Sleep(0);
}
}