introduce the MBF_STRICT macro

This is enabled with the WOOF_STRICT compile time option.

It is used to enable original MBF code paths that are demo
incompatible to PrBoom+ complevel 11.
This commit is contained in:
Fabian Greffrath 2021-03-12 10:11:44 +01:00
parent 92318ee3cd
commit 377a60079c
6 changed files with 24 additions and 11 deletions

View File

@ -39,6 +39,7 @@ set(PROJECT_VERSION_RC "${PROJECT_VERSION_MAJOR},${PROJECT_VERSION_MINOR},${PROJ
# Toggle-able defines added at compile-time.
option("${PROJECT_NAME}_INSTRUMENTED" "Enable memory allocation statistics" OFF)
option("${PROJECT_NAME}_RANGECHECK" "Enable bounds-checking of performance-sensitive functions" ON)
option("${PROJECT_NAME}_STRICT" "Prefer original MBF code paths over demo compatiblity with PrBoom+" OFF)
# Compiler environment requirements.
check_library_exists(m pow "" m_FOUND)

View File

@ -129,6 +129,9 @@ endif()
if("${${PROJECT_NAME}_RANGECHECK}")
target_compile_definitions(woof PRIVATE RANGECHECK)
endif()
if("${${PROJECT_NAME}_STRICT}")
target_compile_definitions(woof PRIVATE MBF_STRICT)
endif()
# Assemble library files.
set(WOOF_DLLS "")

View File

@ -1497,12 +1497,12 @@ void D_DoomMain(void)
mobjinfo[MT_SKULL].deathstate = S_BSKUL_DIE1;
mobjinfo[MT_SKULL].damage = 1;
}
#ifdef MBF_STRICT
// This code causes MT_SCEPTRE and MT_BIBLE to not spawn on the map,
// which causes desync in Eviternity.wad demos.
#if 0
else
mobjinfo[MT_SCEPTRE].doomednum = mobjinfo[MT_BIBLE].doomednum = -1;
#endif
#endif
// jff 1/24/98 set both working and command line value of play parms
nomonsters = clnomonsters = M_CheckParm ("-nomonsters");

View File

@ -337,7 +337,6 @@ static boolean P_Move(mobj_t *actor, boolean dropoff) // killough 9/12/98
tryy = actor->y + (deltay = speed * yspeed[actor->movedir]);
// killough 12/98: rearrange, fix potential for stickiness on ice
// Removed parts incompatible with PrBoom+ complevel 11
if (friction <= ORIG_FRICTION)
try_ok = P_TryMove(actor, tryx, tryy, dropoff);
@ -345,7 +344,8 @@ static boolean P_Move(mobj_t *actor, boolean dropoff) // killough 9/12/98
{
fixed_t x = actor->x;
fixed_t y = actor->y;
#if 0
#ifdef MBF_STRICT
// Removed parts incompatible with PrBoom+ complevel 11
fixed_t floorz = actor->floorz;
fixed_t ceilingz = actor->ceilingz;
fixed_t dropoffz = actor->dropoffz;
@ -358,12 +358,12 @@ static boolean P_Move(mobj_t *actor, boolean dropoff) // killough 9/12/98
if (try_ok)
{
#if 0
#ifdef MBF_STRICT
P_UnsetThingPosition(actor);
#endif
actor->x = x;
actor->y = y;
#if 0
#ifdef MBF_STRICT
actor->floorz = floorz;
actor->ceilingz = ceilingz;
actor->dropoffz = dropoffz;

View File

@ -1046,10 +1046,11 @@ boolean P_LoadBlockMap (int lump)
if (M_CheckParm("-blockmap") || (count = W_LumpLength(lump)/2) >= 0x10000 || count < 4) // [FG] always rebuild too short blockmaps
{
if (demo_version >= 200 && demo_version < 203)
P_CreateBlockMapBoom();
else
#ifdef MBF_STRICT
P_CreateBlockMap();
#else
P_CreateBlockMapBoom();
#endif
}
else
{

View File

@ -495,7 +495,11 @@ fixed_t P_FindShortestTextureAround(int secnum)
{
const sector_t *sec = &sectors[secnum];
int i, minsize = D_MAXINT;
int mintex = (demo_version < 203) ? 1 : 0; //jff 8/14/98 texture 0 is a placeholder
#ifdef MBF_STRICT
static const int mintex = 0;
#else
static const int mintex = 1; //jff 8/14/98 texture 0 is a placeholder
#endif
if (!comp[comp_model])
minsize = 32000<<FRACBITS; //jff 3/13/98 prevent overflow in height calcs
@ -532,7 +536,11 @@ fixed_t P_FindShortestUpperAround(int secnum)
{
const sector_t *sec = &sectors[secnum];
int i, minsize = D_MAXINT;
int mintex = (demo_version < 203) ? 1 : 0; //jff 8/14/98 texture 0 is a placeholder
#ifdef MBF_STRICT
static const int mintex = 0;
#else
static const int mintex = 1; //jff 8/14/98 texture 0 is a placeholder
#endif
if (!comp[comp_model])
minsize = 32000<<FRACBITS; //jff 3/13/98 prevent overflow