Fixes two bugs:
- Attract mode carrying over to gameplay if an attract
demo is allowed to finish without interrupting it
- Credits ending after the first replay ends
- Most R_SkinAvailable calls should be returning index into demo.skinlist (same numerical value as when demo was recorded), for demo sync
- A handful of general things permit exception for this
- Expose `replaynumskins` (calculated as `(demo.playback ? demo.numskins : numskins)`) to Lua
- There's *always* more that can be done for this, but this is the minimum spec that can at least be somewhat stable
- All inputs create input events that get stored in a very
small buffer
- Normally, the game listens for some inputs and then
immediately processes them and updates the button state
in-game
- However, during wipes the processing step would not
happen and it would just let the events pile up
- Because the buffer is small though, it would quickly
fill up and lose some events
- This would lead to button states getting stuck on some
controllers if you released a button during a wipe
- If you spun an analog stick around, this would cause
it to happen more frequently, because there is a new
event for every slight change of an analog stick's
position
Holey textures (textures with transparent pixels) cannot
be used on upper/lower textures or on 1-sided linedefs. If
the game tries to render this, the texture name will
appear on the HUD if devmode render is turned on.
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.