From 50cc0ee15d2db46ee12460ece957b33bb0a10b7f Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Mon, 2 Feb 2015 09:58:30 +0100 Subject: currently, no separate startup banner for the demo version :( --- src/hexen/h2_main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/hexen/h2_main.c') diff --git a/src/hexen/h2_main.c b/src/hexen/h2_main.c index 23131e9b..185a6d70 100644 --- a/src/hexen/h2_main.c +++ b/src/hexen/h2_main.c @@ -335,6 +335,16 @@ void D_DoomMain(void) HandleArgs(); + // The 4 Level Demo Version prints a four-lined banner here + // (and indeed waits for a keypress): + /* +Hexen: Beyond Heretic + +4 Level Demo Version +Press any key to continue. + */ + // However, we currently only detect if we are running the 4 Level Demo Version + // at all much later in P_Init(). I_PrintStartupBanner("Hexen"); ST_Message("MN_Init: Init menu system.\n"); -- cgit v1.2.3 From 006e890f57abda5615a76ae5525a4614425b3227 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Fri, 13 Feb 2015 11:26:56 +0100 Subject: Identify the "shareware" version early on. Following the concept of Chocolate Doom, D_IdentifyVersion and D_SetGameDescription are introduced and called right after loading the IWAD. The first one checks for the characteristics of the "shareware" IWAD and sets gamemode accordingly, whereas the latter sets the gamedescription string according to gamemode. This string is then used in I_PrintStartupBanner() and I_SetWindowTitle(). So, the "shareware" version identifies itself properly now. I consider support for the 4 Level Hexen Demo pretty complete by now. --- src/hexen/h2_main.c | 56 +++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 44 insertions(+), 12 deletions(-) (limited to 'src/hexen/h2_main.c') diff --git a/src/hexen/h2_main.c b/src/hexen/h2_main.c index 185a6d70..62cd3d38 100644 --- a/src/hexen/h2_main.c +++ b/src/hexen/h2_main.c @@ -93,6 +93,7 @@ extern boolean askforquit; // PUBLIC DATA DEFINITIONS ------------------------------------------------- GameMode_t gamemode; +char *gamedescription; char *iwadfile; static char demolumpname[9]; // Demo lump to start playing. boolean nomonsters; // checkparm of -nomonsters @@ -252,6 +253,45 @@ static void D_AddFile(char *filename) W_AddFile(filename); } +// Find out what version of Hexen is playing. + +void D_IdentifyVersion(void) +{ + // The Hexen Shareware, ne 4 Level Demo Version, is missing the SKY1 lump + // and uses the SKY2 lump instead. Let's use this fact and the missing + // levels from MAP05 onward to identify it and set gamemode accordingly. + + if (W_CheckNumForName("SKY1") == -1 && + W_CheckNumForName("MAP05") == -1 ) + { + gamemode = shareware; + } +} + +// Set the gamedescription string. + +void D_SetGameDescription(void) +{ +/* + NB: The 4 Level Demo Version actually prints a four-lined banner + (and indeed waits for a keypress): + + Hexen: Beyond Heretic + + 4 Level Demo Version + Press any key to continue. +*/ + + if (gamemode == shareware) + { + gamedescription = "Hexen: 4 Level Demo Version"; + } + else + { + gamedescription = "Hexen"; + } +} + //========================================================================== // // H2_Main @@ -331,21 +371,13 @@ void D_DoomMain(void) D_AddFile(iwadfile); W_CheckCorrectIWAD(hexen); + D_IdentifyVersion(); + D_SetGameDescription(); AdjustForMacIWAD(); HandleArgs(); - // The 4 Level Demo Version prints a four-lined banner here - // (and indeed waits for a keypress): - /* -Hexen: Beyond Heretic - -4 Level Demo Version -Press any key to continue. - */ - // However, we currently only detect if we are running the 4 Level Demo Version - // at all much later in P_Init(). - I_PrintStartupBanner("Hexen"); + I_PrintStartupBanner(gamedescription); ST_Message("MN_Init: Init menu system.\n"); MN_Init(); @@ -673,7 +705,7 @@ void H2_GameLoop(void) M_snprintf(filename, sizeof(filename), "debug%i.txt", consoleplayer); debugfile = fopen(filename, "w"); } - I_SetWindowTitle("Hexen"); + I_SetWindowTitle(gamedescription); I_GraphicsCheckCommandLine(); I_SetGrabMouseCallback(D_GrabMouseCallback); I_InitGraphics(); -- cgit v1.2.3 From a64ebd8e36b6cd13f18163d0a3365f4e80d90805 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Mon, 30 Mar 2015 16:34:12 +0200 Subject: Turn maxplayers into a global variable ... and decrease its value from MAXPLAYERS (i.e. 8) to 4 if (gamemode == shareware). It seems that it was hard-coded to this value until some time between the releases of the Demo and the Full version. Arrays are still declared with their full width of 8, though, they are just not iterated over the whole range anymore. This fixes playback of the IWAD demos. --- src/hexen/h2_main.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/hexen/h2_main.c') diff --git a/src/hexen/h2_main.c b/src/hexen/h2_main.c index c907d29c..7084ceec 100644 --- a/src/hexen/h2_main.c +++ b/src/hexen/h2_main.c @@ -113,6 +113,7 @@ boolean autostart; boolean advancedemo; FILE *debugfile; int UpdateState; +int maxplayers = MAXPLAYERS; // PRIVATE DATA DEFINITIONS ------------------------------------------------ @@ -266,6 +267,7 @@ void D_IdentifyVersion(void) W_CheckNumForName("MAP05") == -1 ) { gamemode = shareware; + maxplayers = 4; } } -- cgit v1.2.3