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/p_switch.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/hexen/p_switch.c') 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); } -- cgit v1.2.3 From 19659f3eab0614465577ac71731b4bdce67ce30c Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Mon, 23 Mar 2015 12:12:08 +0100 Subject: maintain an explicit switch list for the demo version instead of interating through the list for the full version and letting missing texture lumps slip through. --- src/hexen/p_switch.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'src/hexen/p_switch.c') diff --git a/src/hexen/p_switch.c b/src/hexen/p_switch.c index 92bd0be4..a90269a7 100644 --- a/src/hexen/p_switch.c +++ b/src/hexen/p_switch.c @@ -25,7 +25,14 @@ // CHANGE THE TEXTURE OF A WALL SWITCH TO ITS OPPOSITE // //================================================================== -switchlist_t alphSwitchList[] = { +switchlist_t alphSwitchListDemo[] = { + {"SW_1_UP", "SW_1_DN", SFX_SWITCH1}, + {"SW_2_UP", "SW_2_DN", SFX_SWITCH1}, + {"SW52_OFF", "SW52_ON", SFX_SWITCH2}, + {"\0", "\0", 0} +}; + +switchlist_t alphSwitchListFull[] = { {"SW_1_UP", "SW_1_DN", SFX_SWITCH1}, {"SW_2_UP", "SW_2_DN", SFX_SWITCH1}, {"VALVE1", "VALVE2", SFX_VALVE_TURN}, @@ -39,6 +46,8 @@ switchlist_t alphSwitchList[] = { {"\0", "\0", 0} }; +switchlist_t *alphSwitchList = NULL; + int switchlist[MAXSWITCHES * 2]; int numswitches; button_t buttonlist[MAXBUTTONS]; @@ -58,6 +67,18 @@ void P_InitSwitchList(void) int i; int index; + if (!alphSwitchList) + { + if (gamemode == shareware) + { + alphSwitchList = alphSwitchListDemo; + } + else + { + alphSwitchList = alphSwitchListFull; + } + } + for (index = 0, i = 0; i < MAXSWITCHES; i++) { if (!alphSwitchList[i].soundID) @@ -66,13 +87,6 @@ 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); } -- cgit v1.2.3