From a4707e1bf853117cd8d7d9f5634deff08cb97428 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 8 Oct 2005 19:33:48 +0000 Subject: Allow dehacked patches to override the name of the game via the startup banner. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 170 --- src/d_main.c | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 87 insertions(+), 11 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index b4aa2343..69fd75d5 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// $Id: d_main.c 168 2005-10-08 18:23:18Z fraggle $ +// $Id: d_main.c 170 2005-10-08 19:33:48Z fraggle $ // // Copyright(C) 1993-1996 Id Software, Inc. // Copyright(C) 2005 Simon Howard @@ -22,6 +22,10 @@ // 02111-1307, USA. // // $Log$ +// Revision 1.20 2005/10/08 19:33:48 fraggle +// Allow dehacked patches to override the name of the game via the +// startup banner. +// // Revision 1.19 2005/10/08 18:23:18 fraggle // WAD merging code // @@ -99,7 +103,7 @@ //----------------------------------------------------------------------------- -static const char rcsid[] = "$Id: d_main.c 168 2005-10-08 18:23:18Z fraggle $"; +static const char rcsid[] = "$Id: d_main.c 170 2005-10-08 19:33:48Z fraggle $"; #define BGCOLOR 7 #define FGCOLOR 8 @@ -756,6 +760,76 @@ static void FindIWAD (void) } } +// Strings for dehacked replacements of the startup banner + +static char *banners[] = +{ + // doom1.wad + " " + "DOOM Shareware Startup v%i.%i" + " ", + // doom.wad + " " + "DOOM Registered Startup v%i.%i" + " ", + // doom.wad (Ultimate DOOM) + " " + "The Ultimate DOOM Startup v%i.%i" + " ", + // doom2.wad + " " + "DOOM 2: Hell on Earth v%i.%i" + " ", + // tnt.wad + " " + "DOOM 2: TNT - Evilution v%i.%i" + " ", + // plutonia.wad + " " + "DOOM 2: Plutonia Experiment v%i.%i" + " ", +}; + +// +// Get game name: if the startup banner has been replaced, use that. +// Otherwise, use the name given +// + +static char *GetGameName(char *gamename) +{ + int i; + char *deh_sub; + + for (i=0; i 0) { - gamedescription = "DOOM Registered"; + gamedescription = GetGameName("DOOM Registered"); gamemode = registered; } else { - gamedescription = "DOOM Shareware"; + gamedescription = GetGameName("DOOM Shareware"); gamemode = shareware; } } @@ -825,11 +899,11 @@ static void IdentifyVersion(void) gamemode = commercial; if (gamemission == doom2) - gamedescription = "DOOM 2: Hell on Earth"; + gamedescription = GetGameName("DOOM 2: Hell on Earth"); else if (gamemission == pack_plut) - gamedescription = "DOOM 2: Plutonia Experiment"; + gamedescription = GetGameName("DOOM 2: Plutonia Experiment"); else if (gamemission == pack_tnt) - gamedescription = "DOOM 2: TNT - Evilution"; + gamedescription = GetGameName("DOOM 2: TNT - Evilution"); else gamedescription = "DOOM 2: ?????????????"; } @@ -913,8 +987,9 @@ void FindResponseFile (void) void PrintBanner(char *msg) { int i; + int spaces = 35 - (strlen(msg) / 2); - for (i=0; i<35-(strlen(msg) / 2); ++i) + for (i=0; i