ref: 939bb4cf3e586643919d606620bf298f2351d735
parent: 79ce35e89a61ad093d1f352a01c11c3307a8a1b1
author: Simon Howard <[email protected]>
date: Tue Oct 24 15:23:16 EDT 2006
Detect failures to initialise textscreen library and bomb out with an error mess age. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 727
--- a/setup/mainmenu.c
+++ b/setup/mainmenu.c
@@ -145,7 +145,12 @@
static void RunGUI(void)
{
- TXT_Init();
+ if (!TXT_Init())
+ {
+ fprintf(stderr, "Failed to initialise GUI\n");
+ exit(-1);
+ }
+
TXT_SetDesktopTitle(PACKAGE_NAME " Setup ver " PACKAGE_VERSION);
MainMenu();
--- a/src/net_gui.c
+++ b/src/net_gui.c
@@ -223,7 +223,12 @@
void NET_WaitForStart(void)
{
- TXT_Init();
+ if (!TXT_Init())
+ {
+ fprintf(stderr, "Failed to initialise GUI\n");
+ exit(-1);
+ }
+
I_SetWindowCaption();
I_SetWindowIcon();
--- a/textscreen/examples/calculator.c
+++ b/textscreen/examples/calculator.c
@@ -144,7 +144,12 @@
int main(int argc, char *argv[])
{
- TXT_Init();
+ if (!TXT_Init())
+ {
+ fprintf(stderr, "Failed to initialise GUI\n");
+ exit(-1);
+ }
+
TXT_SetDesktopTitle("Calculator demo");
BuildGUI();
--- a/textscreen/examples/guitest.c
+++ b/textscreen/examples/guitest.c
@@ -159,7 +159,11 @@
int main(int argc, char *argv[])
{
- TXT_Init();
+ if (!TXT_Init())
+ {
+ fprintf(stderr, "Failed to initialise GUI\n");
+ exit(-1);
+ }
TXT_SetDesktopTitle("Not Chocolate Doom Setup");