Map name on pause menu and intermission; current song credit on pause menu; server name in medium font
Closes#769 and #402
See merge request KartKrew/Kart!1892
- cursongcredit behaves the same as before
- Always compose song credit string
- g_realsongcredit always stores the song credit for the
current music, even if no song credit is displayed on
the HUD
- Some maps may contain very large or very many (animated)
textures
- Texture sets are not typically shared between maps, so
each texture allocation may go unused for a long time
after the map ends
- Keeping these PU_STATIC leads to significant memory
usage over the program duration
- 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.