shithub: choc

Download patch

ref: a9fd2c72eb93708461c42dc623e5273c4895717a
parent: 9c9e1bac25a53ba9486a74300c669492f9641d76
author: Simon Howard <[email protected]>
date: Wed Aug 31 17:50:57 EDT 2005

Nicer banner showing the game type (once we know). Remove dead code.
Find the config file properly.

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

--- a/src/d_main.c
+++ b/src/d_main.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: d_main.c 61 2005-08-31 21:35:42Z fraggle $
+// $Id: d_main.c 62 2005-08-31 21:50:57Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,10 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.10  2005/08/31 21:50:57  fraggle
+// Nicer banner showing the game type (once we know).  Remove dead code.
+// Find the config file properly.
+//
 // Revision 1.9  2005/08/31 21:35:42  fraggle
 // Display the game name in the title bar.  Move game start code to later
 // in initialisation because of the IWAD detection changes.
@@ -64,7 +68,7 @@
 //-----------------------------------------------------------------------------
 
 
-static const char rcsid[] = "$Id: d_main.c 61 2005-08-31 21:35:42Z fraggle $";
+static const char rcsid[] = "$Id: d_main.c 62 2005-08-31 21:50:57Z fraggle $";
 
 #define	BGCOLOR		7
 #define	FGCOLOR		8
@@ -792,8 +796,6 @@
         else
             gamedescription = "DOOM 2: ?????????????";
     }
-
-    printf("%s\n", gamedescription);
 }
 
 //
@@ -871,17 +873,34 @@
 
 // Startup banner
 
-void PrintBanner(void)
+void PrintBanner(char *msg)
 {
     int i;
 
-    for (i=0; i<39-(strlen(PACKAGE_STRING) / 2); ++i)
+    for (i=0; i<35-(strlen(msg) / 2); ++i)
         putchar(' ');
 
-    puts(PACKAGE_STRING);
+    puts(msg);
 }
 
+// Set the default location for the configuration file
 
+void SetBaseDefault(void)
+{
+    char *homedir;
+
+    homedir = getenv("HOME");
+
+    if (homedir != NULL)
+    {
+        sprintf(basedefault, "%s/.doomrc", homedir);
+    }
+    else
+    {
+        strcpy(basedefault, "default.cfg");
+    }
+}
+
 //
 // D_DoomMain
 //
@@ -906,69 +925,14 @@
     else if (M_CheckParm ("-deathmatch"))
 	deathmatch = 1;
 
-    // print banner
+    // set the location for default.cfg
 
-    PrintBanner();
+    SetBaseDefault();
 
-#if 0
-    switch ( gamemode )
-    {
-      case retail:
-	sprintf (title,
-		 "                         "
-		 "The Ultimate DOOM Startup v%i.%i"
-		 "                           ",
-		 DOOM_VERSION/100,DOOM_VERSION%100);
-	break;
-      case shareware:
-	sprintf (title,
-		 "                            "
-		 "DOOM Shareware Startup v%i.%i"
-		 "                           ",
-		 DOOM_VERSION/100,DOOM_VERSION%100);
-	break;
-      case registered:
-	sprintf (title,
-		 "                            "
-		 "DOOM Registered Startup v%i.%i"
-		 "                           ",
-		 DOOM_VERSION/100,DOOM_VERSION%100);
-	break;
-      case commercial:
-	sprintf (title,
-		 "                         "
-		 "DOOM 2: Hell on Earth v%i.%i"
-		 "                           ",
-		 DOOM_VERSION/100,DOOM_VERSION%100);
-	break;
-/*FIXME
-       case pack_plut:
-	sprintf (title,
-		 "                   "
-		 "DOOM 2: Plutonia Experiment v%i.%i"
-		 "                           ",
-		 DOOM_VERSION/100,DOOM_VERSION%100);
-	break;
-      case pack_tnt:
-	sprintf (title,
-		 "                     "
-		 "DOOM 2: TNT - Evilution v%i.%i"
-		 "                           ",
-		 DOOM_VERSION/100,DOOM_VERSION%100);
-	break;
-*/
-      default:
-	sprintf (title,
-		 "                     "
-		 "Public DOOM - v%i.%i"
-		 "                           ",
-		 DOOM_VERSION/100,DOOM_VERSION%100);
-	break;
-    }
-    printf ("%s\n",title);
-#endif
-    
+    // print banner
 
+    PrintBanner(PACKAGE_STRING);
+
     if (devparm)
 	printf(D_DEVSTR);
     
@@ -1148,6 +1112,11 @@
 	}
 	autostart = true;
     }
+
+    printf ("===========================================================================\n");
+
+    PrintBanner(gamedescription);
+
     
     printf (
 	    "===========================================================================\n"