ref: 013dc015d160e5090579f75f4b8a9b3d5acb7b52
parent: c33d1935292af81142783137e09dec828df298bc
author: Simon Howard <[email protected]>
date: Fri Sep 26 22:15:33 EDT 2008
Split out startup banner code into common code; display copyright notice in Heretic. Subversion-branch: /branches/raven-branch Subversion-revision: 1295
--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@ -602,19 +602,7 @@
return handle != NULL;
}
-// Startup banner
-void PrintBanner(char *msg)
-{
- int i;
- int spaces = 35 - (strlen(msg) / 2);
-
- for (i=0; i<spaces; ++i)
- putchar(' ');
-
- puts(msg);
-}
-
// Copyright message banners
// Some dehacked mods replace these. These are only displayed if they are
// replaced by dehacked.
@@ -850,7 +838,7 @@
// print banner
- PrintBanner(PACKAGE_STRING);
+ I_PrintBanner(PACKAGE_STRING);
printf (DEH_String("Z_Init: Init zone memory allocation daemon. \n"));
Z_Init ();
@@ -1457,27 +1445,13 @@
if (W_CheckNumForName("SS_START") >= 0
|| W_CheckNumForName("FF_END") >= 0)
{
- printf ("===========================================================================\n");
+ I_PrintDivider();
printf(" WARNING: The loaded WAD file contains modified sprites or\n"
" floor textures. You may want to use the '-merge' command\n"
" line option instead of '-file'.\n");
}
-
- printf ("===========================================================================\n");
- PrintBanner(gamedescription);
-
-
- printf (
- "===========================================================================\n"
- " " PACKAGE_NAME " is free software, covered by the GNU General Public\n"
- " License. There is NO warranty; not even for MERCHANTABILITY or FITNESS\n"
- " FOR A PARTICULAR PURPOSE. You are welcome to change and distribute\n"
- " copies under certain conditions. See the source for more information.\n"
-
- "===========================================================================\n"
- );
-
+ I_PrintStartupBanner(gamedescription);
PrintDehackedBanners();
printf (DEH_String("M_Init: Init miscellaneous info.\n"));
--- a/src/heretic/d_main.c
+++ b/src/heretic/d_main.c
@@ -797,6 +797,8 @@
FILE *fp;
boolean devMap;
+ I_PrintBanner(PACKAGE_STRING);
+
I_AtExit(D_Endoom, false);
M_FindResponseFile();
@@ -948,6 +950,8 @@
gamemode = registered;
gamedescription = "Heretic (registered)";
}
+
+ I_PrintStartupBanner(gamedescription);
#ifdef __WATCOMC__
I_StartupKeyboard();
--- a/src/i_system.c
+++ b/src/i_system.c
@@ -38,6 +38,8 @@
#include <unistd.h>
#endif
+#include "config.h"
+
#include "deh_str.h"
#include "doomtype.h"
#include "m_argv.h"
@@ -119,6 +121,44 @@
return zonemem;
}
+void I_PrintBanner(char *msg)
+{
+ int i;
+ int spaces = 35 - (strlen(msg) / 2);
+
+ for (i=0; i<spaces; ++i)
+ putchar(' ');
+
+ puts(msg);
+}
+
+void I_PrintDivider(void)
+{
+ int i;
+
+ for (i=0; i<75; ++i)
+ {
+ putchar('=');
+ }
+
+ putchar('\n');
+}
+
+void I_PrintStartupBanner(char *gamedescription)
+{
+ I_PrintDivider();
+ I_PrintBanner(gamedescription);
+ I_PrintDivider();
+
+ printf(
+ " " PACKAGE_NAME " is free software, covered by the GNU General Public\n"
+ " License. There is NO warranty; not even for MERCHANTABILITY or FITNESS\n"
+ " FOR A PARTICULAR PURPOSE. You are welcome to change and distribute\n"
+ " copies under certain conditions. See the source for more information.\n");
+
+ I_PrintDivider();
+}
+
//
// I_ConsoleStdout
//
@@ -215,7 +255,6 @@
//
// I_Error
//
-extern boolean demorecording;
static boolean already_quitting = false;
@@ -256,17 +295,6 @@
entry = entry->next;
}
- /*
- if (demorecording)
- {
- G_CheckDemoStatus();
- }
-
- D_QuitNetGame ();
- I_ShutdownGraphics();
- S_Shutdown();
- */
-
#ifdef _WIN32
// On Windows, pop up a dialog box with the error message.
{
--- a/src/i_system.h
+++ b/src/i_system.h
@@ -85,5 +85,17 @@
void I_Endoom(byte *data);
+// Print startup banner copyright message.
+
+void I_PrintStartupBanner(char *gamedescription);
+
+// Print a centered text banner displaying the given string.
+
+void I_PrintBanner(char *text);
+
+// Print a dividing line for startup banners.
+
+void I_PrintDivider(void);
+
#endif