- This code uploads encoremap to the GPU as a texture.
- It assumes encoremap is 256 * 32 bytes, but in reality
encoremap is only 256 bytes.
- The textures go completely unused, so I simply
commented out the code altogether.
How lightlists work:
- Each FOF casts a shadow beneath it.
- Draw the column above each FOF with colormap set from
the previous FOF.
- Then set colormap from the current FOF, so the next FOF
is bathed in the current FOF's shadow.
What broke:
- Colormap was not set when drawing the column above the
first FOF.
This commit:
- Before iterating lightlists, set colormap to base sector
lighting.
- De-duplicate some code by using lambdas.
- Column would be zero length if there are no visible
pixels in it.
- Trying to draw such a column results in a negative
heightmask in R_DrawColumnTemplate and a probable read
out of bounds.
- Holey textures are ones where the column height may not
match the texture height.
- R_DrawColumn cannot cope with this directly and it may
lead to a read out bounds.
- Transparency would not render for true wall textures
anyway since these are not masked midtextures, so just
don't render the texture in this case.
- In R_DrawColumnTemplate, texheight is used to switch
between a non-PO2 rasterizer and a more efficient PO2
rasterizer.
- There is bounds checking on the non-PO2 version (in the
form of sourcelength) but not on the PO2 version.
- texheight was set to the sprite patch height, which may
be taller than the column (sourcelength), leading to a
read out of bounds.
I was running into a memcpy of overlapping memory regions
in R_RenderMaskedSegRange.
- This is because of the reallocation of lightlists, which
uses Z_Frame_Alloc.
- The memory pool that Z_Frame_Alloc draws from is cleared
each frame.
- g_dc was not cleared though, so when the lightlists were
reallocated, it'd try to copy from invalidated pointers.
- Access to invalid pointers within the memory pool does
not cause a segfault directly (because the memory pool
is allocated once). However, a memcpy involving such an
invalid pointer leads to overlap, which may cause memory
corruption.
- Remove V_HUDTRANS (Tally makes it fully transparent)
- Embed button codes instead of drawing them separately (fixes minor alignment issues)
- Fade in over 1 second (visual flair)
Before
- Each time / once only activates when the mobj's sector
changes
- The activation may depend on the mobj touching the floor
- If the mobj is in the air when the sector changes, the
action will never be activated
After
- Each time / once actions that require floor touching
also activate every time the mobj lands on the ground
from the air (regardless of whether the sector changed)
- This lets party changes take effect during
GS_INTERMISSION or GS_VOTING
- displayplayers must always be updated, in order for
splitscreen viewports to appear when the level starts
- Only G_FixCamera is not called, because it may rely on
player_t.mo and I'm scared of that
Use G_PartySize/G_LocalSplitscreenPartySize instead of
r_splitscreen/splitscreen. This should be less
error-prone in case r_splitscreen fails to be updated
somehow.