#46 Padding for short reject lumps


This patch re-enables PrBoom-Plus's padding of short
reject lumps for demo_compatibility mode, and also pads
other deficient reject lumps with zeroes[1]

It is changed somewhat from the previous version, which
was disabled due to its reliance on
W_CacheLumpNumPadded (which is not available when mmap
is being used for lumps) Instead, in the case of a
short reject, a new block is allocated, tagged as
PU_LEVEL so it is freed automatically at level exit,
the short reject lump is copied over, and padded.

I have put all the relevant code into a new function
P_LoadReject, into which RejectOverrunAddInt was
merged. This allows the removal of a couple of global
variables - I think Doom has enough of those pesky
things already :) P_GroupLines was modified slightly to
return a number that P_LoadReject needs to calculate
the correct bytes for padding in doom2.exe
compatibility mode.

[1] PrBoom 2.2.6 used to pad short reject lumps with
0xff. Neither value is "correct" from a demo
compatibility perspective - Boom, MBF etc. make no
attempt to pad short rejects, so any underflow is
implicitly padded by random data. Therefore I chose to
pad with zero, as it is more useful than padding with
ones - any wad is going to be more playable with a
zeroed reject that one that stops all the monsters
waking up! Furthermore an increasing number of wads are
being released with zero-length reject lumps, and both
ZDoom and Eternity treat this as an equivalent
zero-filled reject.


  • RjY

    RjY - 2006-10-04

    Pad short reject lumps

  • Florian Schulze

    Florian Schulze - 2006-10-07
    • assigned_to: nobody --> proff_fs
    • status: open --> closed-accepted

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks