summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--setup/display.c14
-rw-r--r--setup/mainmenu.c25
3 files changed, 24 insertions, 17 deletions
diff --git a/NEWS b/NEWS
index 0dbdb06f..d8221ead 100644
--- a/NEWS
+++ b/NEWS
@@ -91,6 +91,8 @@
they are on the in-game "new game" menu (thanks AlexXav).
* There is no longer a limit on the lengths of filenames provided
to the -record command line parameter (thanks AlexXav).
+ * Window title is not lost in setup tool when changing video
+ driver (thanks AlexXav).
libtextscreen:
* The font used for the textscreen library can be forced by
diff --git a/setup/display.c b/setup/display.c
index 42a1dced..ca22824c 100644
--- a/setup/display.c
+++ b/setup/display.c
@@ -29,6 +29,8 @@
#include "display.h"
+extern void RestartTextscreen(void);
+
typedef struct
{
char *description;
@@ -520,18 +522,6 @@ static char *win32_video_drivers[] =
"Windows GDI",
};
-// Restart the textscreen library. Used when the video_driver variable
-// is changed.
-
-static void RestartTextscreen(void)
-{
- TXT_Shutdown();
-
- SetDisplayDriver();
-
- TXT_Init();
-}
-
static void SetWin32VideoDriver(void)
{
if (!strcmp(video_driver, "windib"))
diff --git a/setup/mainmenu.c b/setup/mainmenu.c
index ae8ab9b0..a3dfafed 100644
--- a/setup/mainmenu.c
+++ b/setup/mainmenu.c
@@ -256,11 +256,9 @@ static void SetIcon(void)
free(mask);
}
-//
-// Initialize and run the textscreen GUI.
-//
+// Initialize the textscreen library.
-static void RunGUI(void)
+static void InitTextscreen(void)
{
SetDisplayDriver();
@@ -272,7 +270,24 @@ static void RunGUI(void)
TXT_SetDesktopTitle(PACKAGE_NAME " Setup ver " PACKAGE_VERSION);
SetIcon();
-
+}
+
+// Restart the textscreen library. Used when the video_driver variable
+// is changed.
+
+void RestartTextscreen(void)
+{
+ TXT_Shutdown();
+ InitTextscreen();
+}
+
+//
+// Initialize and run the textscreen GUI.
+//
+
+static void RunGUI(void)
+{
+ InitTextscreen();
MainMenu();
TXT_GUIMainLoop();