From ad816c1bc28ab81ddb892ff878f65969bddd9764 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Tue, 20 Jan 2015 06:53:45 +0100 Subject: First shot at support for the Hexen 4-level Demo With these changes it is possible to run the game using the HEXEN.WAD IWAD from the 4-level Demo and start a new game as one of the three player classes. Known missing bits: - The game does not yet identify itself as the demo version - The cheat codes are still unchanged - Bug compatibility, see e.g. http://dengine.net/dew/index.php?title=Libhexen --- src/hexen/g_game.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/hexen/g_game.c') diff --git a/src/hexen/g_game.c b/src/hexen/g_game.c index 6d10dcfd..4dcd3bd9 100644 --- a/src/hexen/g_game.c +++ b/src/hexen/g_game.c @@ -1467,6 +1467,12 @@ void G_SecretExitLevel (void) void G_Completed(int map, int position) { + if (gamemode == shareware && map > 4) + { + P_SetMessage(&players[consoleplayer], "access denied -- demo", true); + return; + } + gameaction = ga_completed; LeaveMap = map; LeavePosition = position; -- cgit v1.2.3 From bfd396ee4184265e11b27c9e87d45c28a713d90c Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Thu, 19 Feb 2015 18:35:40 +0100 Subject: Apparently, the Hexen font only has upper-case chcracters --- src/hexen/g_game.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/hexen/g_game.c') diff --git a/src/hexen/g_game.c b/src/hexen/g_game.c index 4df4cb86..d6a73678 100644 --- a/src/hexen/g_game.c +++ b/src/hexen/g_game.c @@ -1473,7 +1473,7 @@ void G_Completed(int map, int position) { if (gamemode == shareware && map > 4) { - P_SetMessage(&players[consoleplayer], "access denied -- demo", true); + P_SetMessage(&players[consoleplayer], "ACCESS DENIED -- DEMO", true); return; } -- cgit v1.2.3 From 350ac122030d198b187255b19b2519ef8267364a Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Mon, 23 Mar 2015 12:12:38 +0100 Subject: play sound when trying to enter a forbidden map in the demo version --- src/hexen/g_game.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/hexen/g_game.c') diff --git a/src/hexen/g_game.c b/src/hexen/g_game.c index d6a73678..04e0e5af 100644 --- a/src/hexen/g_game.c +++ b/src/hexen/g_game.c @@ -1474,6 +1474,7 @@ void G_Completed(int map, int position) if (gamemode == shareware && map > 4) { P_SetMessage(&players[consoleplayer], "ACCESS DENIED -- DEMO", true); + S_StartSound(NULL, SFX_CHAT); return; } -- 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/g_game.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/hexen/g_game.c') diff --git a/src/hexen/g_game.c b/src/hexen/g_game.c index 04e0e5af..e0a7afac 100644 --- a/src/hexen/g_game.c +++ b/src/hexen/g_game.c @@ -639,7 +639,7 @@ void G_DoLoadLevel(void) levelstarttic = gametic; // for time calculation gamestate = GS_LEVEL; - for (i = 0; i < MAXPLAYERS; i++) + for (i = 0; i < maxplayers; i++) { if (playeringame[i] && players[i].playerstate == PST_DEAD) players[i].playerstate = PST_REBORN; @@ -756,7 +756,7 @@ boolean G_Responder(event_t * ev) do { displayplayer++; - if (displayplayer == MAXPLAYERS) + if (displayplayer == maxplayers) { displayplayer = 0; } @@ -899,7 +899,7 @@ void G_Ticker(void) // // do player reborns if needed // - for (i = 0; i < MAXPLAYERS; i++) + for (i = 0; i < maxplayers; i++) if (playeringame[i] && players[i].playerstate == PST_REBORN) G_DoReborn(i); @@ -963,7 +963,7 @@ void G_Ticker(void) //buf = gametic%BACKUPTICS; buf = (gametic / ticdup) % BACKUPTICS; - for (i = 0; i < MAXPLAYERS; i++) + for (i = 0; i < maxplayers; i++) if (playeringame[i]) { cmd = &players[i].cmd; @@ -993,7 +993,7 @@ void G_Ticker(void) // // check for special buttons // - for (i = 0; i < MAXPLAYERS; i++) + for (i = 0; i < maxplayers; i++) if (playeringame[i]) { if (players[i].cmd.buttons & BT_SPECIAL) @@ -1335,7 +1335,7 @@ void G_DoReborn(int playernum) else { // Try to spawn at one of the other player start spots - for (i = 0; i < MAXPLAYERS; i++) + for (i = 0; i < maxplayers; i++) { if (G_CheckSpot(playernum, &playerstarts[RebornPosition][i])) { // Found an open start spot @@ -1492,7 +1492,7 @@ void G_DoCompleted(void) { return; } - for (i = 0; i < MAXPLAYERS; i++) + for (i = 0; i < maxplayers; i++) { if (playeringame[i]) { @@ -1519,7 +1519,7 @@ void G_DoCompleted(void) { return; } - for(i = 0; i < MAXPLAYERS; i++) + for(i = 0; i < maxplayers; i++) { if(playeringame[i]) { @@ -1732,7 +1732,7 @@ void G_InitNew(skill_t skill, int episode, int map) } M_ClearRandom(); // Force players to be initialized upon first level load - for (i = 0; i < MAXPLAYERS; i++) + for (i = 0; i < maxplayers; i++) { players[i].playerstate = PST_REBORN; players[i].worldTimer = 0; @@ -1755,7 +1755,7 @@ void G_InitNew(skill_t skill, int episode, int map) // Give one null ticcmd_t //gametic = 0; //maketic = 1; - //for (i=0 ; i