shithub: choc

Download patch

ref: 4fc7b22ad09759474706012251161caef3970420
parent: e63839de20c56649ce16adfe7e849735223ad130
author: Simon Howard <[email protected]>
date: Sat Jan 1 21:49:20 EST 2011

Restore window title when changing video driver in setup tool (thanks
AlexXav).

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 2233

--- 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
--- a/setup/display.c
+++ b/setup/display.c
@@ -29,6 +29,8 @@
 
 #include "display.h"
 
+extern void RestartTextscreen(void);
+
 typedef struct
 {
     char *description;
@@ -519,18 +521,6 @@
     "DirectX",
     "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)
 {
--- a/setup/mainmenu.c
+++ b/setup/mainmenu.c
@@ -256,11 +256,9 @@
     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 @@
 
     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();