diff options
author | Fabian Greffrath | 2015-01-20 06:53:45 +0100 |
---|---|---|
committer | Fabian Greffrath | 2015-01-20 06:57:46 +0100 |
commit | ad816c1bc28ab81ddb892ff878f65969bddd9764 (patch) | |
tree | 98ecf42b00d079710172b95c4fb20d2a2e044784 | |
parent | 80bf45c902f78e3cd0212938ee176a3c6f436997 (diff) | |
download | chocolate-doom-ad816c1bc28ab81ddb892ff878f65969bddd9764.tar.gz chocolate-doom-ad816c1bc28ab81ddb892ff878f65969bddd9764.tar.bz2 chocolate-doom-ad816c1bc28ab81ddb892ff878f65969bddd9764.zip |
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
-rw-r--r-- | src/hexen/g_game.c | 6 | ||||
-rw-r--r-- | src/hexen/p_setup.c | 12 | ||||
-rw-r--r-- | src/hexen/p_switch.c | 7 | ||||
-rw-r--r-- | src/hexen/sb_bar.c | 5 |
4 files changed, 27 insertions, 3 deletions
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; diff --git a/src/hexen/p_setup.c b/src/hexen/p_setup.c index 1ff6cef5..db9af228 100644 --- a/src/hexen/p_setup.c +++ b/src/hexen/p_setup.c @@ -796,16 +796,26 @@ static void InitMapInfo(void) int mcmdValue; mapInfo_t *info; char songMulch[10]; + char *default_sky_name = DEFAULT_SKY_NAME; mapMax = 1; + // The Hexen Shareware, ne 4-level Demo, is missing the SKY1 lump + // and uses the SKY2 lump instead. Let's use this fact to identify + // it and set gamemode accordingly + if (W_CheckNumForName(default_sky_name) == -1) + { + default_sky_name = "SKY2"; + gamemode = shareware; + } + // Put defaults into MapInfo[0] info = MapInfo; info->cluster = 0; info->warpTrans = 0; info->nextMap = 1; // Always go to map 1 if not specified info->cdTrack = 1; - info->sky1Texture = R_TextureNumForName(DEFAULT_SKY_NAME); + info->sky1Texture = R_TextureNumForName(default_sky_name); info->sky2Texture = info->sky1Texture; info->sky1ScrollDelta = 0; info->sky2ScrollDelta = 0; diff --git a/src/hexen/p_switch.c b/src/hexen/p_switch.c index 9d86f92a..92bd0be4 100644 --- a/src/hexen/p_switch.c +++ b/src/hexen/p_switch.c @@ -66,6 +66,13 @@ void P_InitSwitchList(void) switchlist[index] = -1; break; } + + if (R_CheckTextureNumForName(alphSwitchList[i].name1) == -1 && + gamemode == shareware) + { + continue; + } + switchlist[index++] = R_TextureNumForName(alphSwitchList[i].name1); switchlist[index++] = R_TextureNumForName(alphSwitchList[i].name2); } diff --git a/src/hexen/sb_bar.c b/src/hexen/sb_bar.c index bcc5b675..e75edd25 100644 --- a/src/hexen/sb_bar.c +++ b/src/hexen/sb_bar.c @@ -314,6 +314,7 @@ void SB_Init(void) void SB_SetClassData(void) { int class; + int maxplayers = (gamemode == shareware) ? 4 : MAXPLAYERS; class = PlayerClass[consoleplayer]; // original player class (not pig) PatchWEAPONSLOT = W_CacheLumpNum(W_GetNumForName("wpslot0") @@ -330,12 +331,12 @@ void SB_SetClassData(void) if (!netgame) { // single player game uses red life gem (the second gem) PatchLIFEGEM = W_CacheLumpNum(W_GetNumForName("lifegem") - + MAXPLAYERS * class + 1, PU_STATIC); + + maxplayers * class + 1, PU_STATIC); } else { PatchLIFEGEM = W_CacheLumpNum(W_GetNumForName("lifegem") - + MAXPLAYERS * class + consoleplayer, + + maxplayers * class + consoleplayer, PU_STATIC); } SB_state = -1; |