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.
Notable deletions:
- Metal Sonic Race
- Includes all the specialised recording/playback apparatus which made g_demo.c harder to read
- A bunch of hyperspecialised code inside several A_ actions
- EXCEPTION: intentfully left in the spriteless SMK stuff for Sal's add-on down the line.
- Always force a page seperation between the last core files cup and the first modded cup
- Lost and Found sits exactly between them
- If any cup on the last page of basegame is unlocked, place LnF on the last core page
- Else, LnF is the first "cup" on the first Modded page
- It's done this way so no Core material is spoiled if you haven't unlocked it yet. We want people to believe RR contains only 7 cups unless they go above and beyond
Also address Volt's bug report: Prevent the first page of cups from being overridden if everything is locked
- Go to a MainCfg-specified map on its guessed gametype
- `TutorialChallengeMap = RR_ZonedCity`
- Some unique settings
- K_CanChangeRules() == false
- If GTR_CIRCUIT, make it Hard Speed
- If GTR_BUMPERS, die in one hit
- If GTR_BOTS, make them all difficulty 13 of the default bot skin
- No Medals or Spray Cans during the Tutorial Challenge
- Complete the stage in 1st place or don't bother at all
- Has the "Give up" menu option available, but no "Try Again"
- Condition for successfully completing the Tutorial Skip
- `Condition1 = TutorialSkip`
Related bugfixes:
- Correctly wipe skipstats when returning to the Title/menus
- Typing of `ultimatemode` (hey this isn't accessible by anything right now I wonder)
- Add lua_profile cheat: calculate average time spent in
hooks over a period
- Show hook times in a sorted table, along with lump name,
script line number and hook type
- Show cumulative time spent in game logic hooks and
percentage of overhead to game logic
Fixes several things to do with the boss healthbar.
- Makes its randomised jitter work with interp/pause
- Constantly calling the external PRNG tanks performance, at least on Windows, so this solves that too
Done as a special non-netsynced random class so the author of this commit wouldn't have to create a third suite of duplicated Random functions.
Skip up to 3 frames of rendering if the time between tics
exceeds TICRATE. If rendering is a significant source of
that slowdown, skipping some frames can speed up the game
loop and improve input responsiveness.