ref: 77f49e5ea5aae45fe904306a9364018c0fc23b71
parent: 6d773dce144d7037ae207d16ef98dab794b5cf3c
author: James Canete <[email protected]>
date: Thu Oct 17 12:14:40 EDT 2019
Requested changes. https://github.com/chocolate-doom/chocolate-doom/pull/1205
--- a/src/d_mode.h
+++ b/src/d_mode.h
@@ -56,8 +56,7 @@
typedef enum
{
- exe_doom_1_1, // Doom 1.0/1.1: shareware and registered
- exe_doom_1_2, // Doom 1.2: "
+ exe_doom_1_2, // Doom 1.2: shareware and registered
exe_doom_1_666, // Doom 1.666: for shareware, registered and commercial
exe_doom_1_7, // Doom 1.7/1.7a: "
exe_doom_1_8, // Doom 1.8: "
--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@ -959,7 +959,6 @@
const char *cmdline;
GameVersion_t version;
} gameversions[] = {
- {"Doom 1.0/1.1", "1.1", exe_doom_1_1},
{"Doom 1.2", "1.2", exe_doom_1_2},
{"Doom 1.666", "1.666", exe_doom_1_666},
{"Doom 1.7/1.7a", "1.7", exe_doom_1_7},
@@ -988,9 +987,9 @@
// @arg <version>
// @category compat
//
- // Emulate a specific version of Doom. Valid values are "1.1", "1.2",
- // "1.666", "1.7", "1.8", "1.9", "ultimate", "final", "final2", "hacx"
- // and "chex".
+ // Emulate a specific version of Doom. Valid values are "1.2",
+ // "1.666", "1.7", "1.8", "1.9", "ultimate", "final", "final2",
+ // "hacx" and "chex".
//
p = M_CheckParmWithArgs("-gameversion", 1);
@@ -1082,12 +1081,6 @@
}
}
}
-
- // detect v1.0/v1.1 from missing D_INTROA
- if (gameversion == exe_doom_1_2 && W_CheckNumForName("D_INTROA") < 0)
- {
- gameversion = exe_doom_1_1;
- }
}
else if (gamemode == retail)
{
@@ -1103,6 +1096,12 @@
gameversion = exe_final;
}
+ }
+
+ // Deathmatch 2.0 did not exist until Doom v1.4
+ if (gameversion <= exe_doom_1_2 && deathmatch == 2)
+ {
+ deathmatch = 1;
}
// The original exe does not support retail - 4th episode not supported
--- a/src/doom/g_game.c
+++ b/src/doom/g_game.c
@@ -2052,10 +2052,6 @@
{
switch (gameversion)
{
- case exe_doom_1_1:
- return 101;
- case exe_doom_1_2:
- return 102;
case exe_doom_1_666:
return 106;
case exe_doom_1_7:
@@ -2174,6 +2170,7 @@
skill_t skill;
int i, lumpnum, episode, map;
int demoversion;
+ boolean olddemo = false;
lumpnum = W_GetNumForName(defdemoname);
gameaction = ga_nothing;
@@ -2184,9 +2181,7 @@
if (demoversion >= 0 && demoversion <= 4)
{
- if (gameversion <= exe_doom_1_2)
- demoversion = G_VanillaVersionCode();
-
+ olddemo = true;
demo_p--;
}
@@ -2199,7 +2194,8 @@
{
longtics = true;
}
- else if (demoversion != G_VanillaVersionCode())
+ else if (demoversion != G_VanillaVersionCode() &&
+ !(gameversion <= exe_doom_1_2 && olddemo))
{
const char *message = "Demo is from a different game version!\n"
"(read %i, should be %i)\n"
@@ -2217,7 +2213,7 @@
skill = *demo_p++;
episode = *demo_p++;
map = *demo_p++;
- if (demoversion > 102)
+ if (!olddemo)
{
deathmatch = *demo_p++;
respawnparm = *demo_p++;
--- a/src/doom/hu_stuff.c
+++ b/src/doom/hu_stuff.c
@@ -522,7 +522,7 @@
message_counter = HU_MSGTIMEOUT;
if ( gamemode == commercial )
S_StartSound(0, sfx_radio);
- else
+ else if (gameversion > exe_doom_1_2)
S_StartSound(0, sfx_tink);
}
HUlib_resetIText(&w_inputbuffer[i]);
--- a/src/doom/p_inter.c
+++ b/src/doom/p_inter.c
@@ -397,7 +397,8 @@
player->health = deh_max_soulsphere;
player->mo->health = player->health;
player->message = DEH_String(GOTSUPER);
- sound = sfx_getpow;
+ if (gameversion > exe_doom_1_2)
+ sound = sfx_getpow;
break;
case SPR_MEGA:
@@ -409,7 +410,8 @@
// affects the MegaArmor.
P_GiveArmor (player, 2);
player->message = DEH_String(GOTMSPHERE);
- sound = sfx_getpow;
+ if (gameversion > exe_doom_1_2)
+ sound = sfx_getpow;
break;
// cards
@@ -485,7 +487,8 @@
if (!P_GivePower (player, pw_invulnerability))
return;
player->message = DEH_String(GOTINVUL);
- sound = sfx_getpow;
+ if (gameversion > exe_doom_1_2)
+ sound = sfx_getpow;
break;
case SPR_PSTR:
@@ -494,7 +497,8 @@
player->message = DEH_String(GOTBERSERK);
if (player->readyweapon != wp_fist)
player->pendingweapon = wp_fist;
- sound = sfx_getpow;
+ if (gameversion > exe_doom_1_2)
+ sound = sfx_getpow;
break;
case SPR_PINS:
@@ -501,7 +505,8 @@
if (!P_GivePower (player, pw_invisibility))
return;
player->message = DEH_String(GOTINVIS);
- sound = sfx_getpow;
+ if (gameversion > exe_doom_1_2)
+ sound = sfx_getpow;
break;
case SPR_SUIT:
@@ -508,7 +513,8 @@
if (!P_GivePower (player, pw_ironfeet))
return;
player->message = DEH_String(GOTSUIT);
- sound = sfx_getpow;
+ if (gameversion > exe_doom_1_2)
+ sound = sfx_getpow;
break;
case SPR_PMAP:
@@ -515,7 +521,8 @@
if (!P_GivePower (player, pw_allmap))
return;
player->message = DEH_String(GOTMAP);
- sound = sfx_getpow;
+ if (gameversion > exe_doom_1_2)
+ sound = sfx_getpow;
break;
case SPR_PVIS:
@@ -522,7 +529,8 @@
if (!P_GivePower (player, pw_infrared))
return;
player->message = DEH_String(GOTVISOR);
- sound = sfx_getpow;
+ if (gameversion > exe_doom_1_2)
+ sound = sfx_getpow;
break;
// ammo
--- a/src/doom/p_sight.c
+++ b/src/doom/p_sight.c
@@ -16,7 +16,6 @@
// LineOfSight/Visibility checks, uses REJECT Lookup Table.
//
-#include <stdlib.h> // abs()
#include "doomdef.h"
#include "doomstat.h"
@@ -45,37 +44,37 @@
// taken from prboom-plus/src/p_sight.c:69-102
boolean PTR_SightTraverse(intercept_t *in)
{
- line_t *li;
- fixed_t slope;
+ line_t *li;
+ fixed_t slope;
- li = in->d.line;
+ li = in->d.line;
- //
- // crosses a two sided line
- //
- P_LineOpening(li);
+ //
+ // crosses a two sided line
+ //
+ P_LineOpening(li);
- if (openbottom >= opentop) // quick test for totally closed doors
- return false; // stop
+ if (openbottom >= opentop) // quick test for totally closed doors
+ return false; // stop
- if (li->frontsector->floorheight != li->backsector->floorheight)
- {
- slope = FixedDiv(openbottom - sightzstart , in->frac);
- if (slope > bottomslope)
- bottomslope = slope;
- }
+ if (li->frontsector->floorheight != li->backsector->floorheight)
+ {
+ slope = FixedDiv(openbottom - sightzstart, in->frac);
+ if (slope > bottomslope)
+ bottomslope = slope;
+ }
- if (li->frontsector->ceilingheight != li->backsector->ceilingheight)
- {
- slope = FixedDiv(opentop - sightzstart, in->frac);
- if (slope < topslope)
- topslope = slope;
- }
+ if (li->frontsector->ceilingheight != li->backsector->ceilingheight)
+ {
+ slope = FixedDiv(opentop - sightzstart, in->frac);
+ if (slope < topslope)
+ topslope = slope;
+ }
- if (topslope <= bottomslope)
- return false; // stop
+ if (topslope <= bottomslope)
+ return false; // stop
- return true; // keep going
+ return true; // keep going
}
--- a/src/doom/p_spec.c
+++ b/src/doom/p_spec.c
@@ -531,7 +531,6 @@
case MT_HEADSHOT:
case MT_BRUISERSHOT:
return;
- break;
default: break;
}
--- a/src/doom/s_sound.c
+++ b/src/doom/s_sound.c
@@ -445,40 +445,6 @@
I_Error("Bad sfx #: %d", sfx_id);
}
- // substitute missing sounds in Doom 1.2
- if (gameversion <= exe_doom_1_2)
- {
- switch(sfx_id)
- {
- case sfx_bdcls:
- sfx_id = sfx_dorcls;
- break;
-
- case sfx_bdopn:
- sfx_id = sfx_doropn;
- break;
-
- case sfx_getpow:
- sfx_id = sfx_itemup;
- break;
-
- case sfx_itmbk:
- sfx_id = sfx_stnmov;
- break;
-
- case sfx_pdiehi:
- sfx_id = sfx_pldeth;
- break;
-
- case sfx_tink:
- sfx_id = sfx_swtchx;
- break;
-
- default:
- break;
- }
- }
-
sfx = &S_sfx[sfx_id];
// Initialize sound parameters
@@ -696,7 +662,7 @@
if (musicnum == mus_intro && (snd_musicdevice == SNDDEVICE_ADLIB
|| snd_musicdevice == SNDDEVICE_SB)
- && gameversion >= exe_doom_1_2)
+ && W_CheckNumForName("D_INTROA") >= 0)
{
musicnum = mus_introa;
}
--- a/src/doom/st_lib.c
+++ b/src/doom/st_lib.c
@@ -50,7 +50,7 @@
void STlib_init(void)
{
- if (W_CheckNumForName(DEH_String("STTMINUS")) > 0)
+ if (W_CheckNumForName(DEH_String("STTMINUS")) >= 0)
sttminus = (patch_t *) W_CacheLumpName(DEH_String("STTMINUS"), PU_STATIC);
else
sttminus = NULL;
--- a/src/doom/st_stuff.c
+++ b/src/doom/st_stuff.c
@@ -1149,7 +1149,7 @@
callback(namebuf, &faceback);
// status bar background bits
- if (gameversion >= exe_doom_1_2)
+ if (W_CheckNumForName("STBAR") >= 0)
{
callback(DEH_String("STBAR"), &sbar);
sbarr = NULL;