From 013dc015d160e5090579f75f4b8a9b3d5acb7b52 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 27 Sep 2008 02:15:33 +0000 Subject: Split out startup banner code into common code; display copyright notice in Heretic. Subversion-branch: /branches/raven-branch Subversion-revision: 1295 --- src/doom/d_main.c | 32 +++----------------------------- src/heretic/d_main.c | 4 ++++ src/i_system.c | 52 ++++++++++++++++++++++++++++++++++++++++------------ src/i_system.h | 12 ++++++++++++ 4 files changed, 59 insertions(+), 41 deletions(-) diff --git a/src/doom/d_main.c b/src/doom/d_main.c index 67d4489d..3bc5bfe7 100644 --- a/src/doom/d_main.c +++ b/src/doom/d_main.c @@ -602,18 +602,6 @@ static boolean D_AddFile(char *filename) return handle != NULL; } -// Startup banner - -void PrintBanner(char *msg) -{ - int i; - int spaces = 35 - (strlen(msg) / 2); - - for (i=0; i= 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")); diff --git a/src/heretic/d_main.c b/src/heretic/d_main.c index 3f96a867..8c7a14d0 100644 --- a/src/heretic/d_main.c +++ b/src/heretic/d_main.c @@ -797,6 +797,8 @@ void D_DoomMain(void) FILE *fp; boolean devMap; + I_PrintBanner(PACKAGE_STRING); + I_AtExit(D_Endoom, false); M_FindResponseFile(); @@ -949,6 +951,8 @@ void D_DoomMain(void) gamedescription = "Heretic (registered)"; } + I_PrintStartupBanner(gamedescription); + #ifdef __WATCOMC__ I_StartupKeyboard(); I_StartupJoystick(); diff --git a/src/i_system.c b/src/i_system.c index 034d831a..77c06436 100644 --- a/src/i_system.c +++ b/src/i_system.c @@ -38,6 +38,8 @@ #include #endif +#include "config.h" + #include "deh_str.h" #include "doomtype.h" #include "m_argv.h" @@ -119,6 +121,44 @@ byte *I_ZoneBase (int *size) return zonemem; } +void I_PrintBanner(char *msg) +{ + int i; + int spaces = 35 - (strlen(msg) / 2); + + for (i=0; inext; } - /* - if (demorecording) - { - G_CheckDemoStatus(); - } - - D_QuitNetGame (); - I_ShutdownGraphics(); - S_Shutdown(); - */ - #ifdef _WIN32 // On Windows, pop up a dialog box with the error message. { diff --git a/src/i_system.h b/src/i_system.h index 000c6025..2af3aa33 100644 --- a/src/i_system.h +++ b/src/i_system.h @@ -85,5 +85,17 @@ void I_BindVariables(void); 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 -- cgit v1.2.3