This avoids an issue where the skins array takes up a fixed, but large
amount of memory at runtime. On x86_64 linux, that array is roughly 80
megabytes in memory, most of which is unused when the game is unmodded.
Instead, we treat `skins` as a dynamically resizing array, and it is an
array-of-pointers into separate allocated `skin_t`.
This is based on Lactozilla's skin limit MR for SRB2, but I've rewritten
it because RR has diverged quite a bit.
This was verified to check every access of `skins` by using clangd's
find-all-references function. However, I have only tested plain skins,
not Lua addons, so that could afford some extra checking.
- Built off g_fast_forward to utilise a lot of existing structure
- Only does steps of 5 seconds and therefore isn't precise, but that's better than having to rewatch/fastforward through the entire thing
- No single frame step back or general in-motion rewind preview, but that was all overkill
- Demos/Ghosts that end before ticking once are now correctly ignored. (ResolvesKartKrew/RingRacers#168)
- There was code for discovering it on read! It was just placed slightly too early, probably due to the conversion for netreplays! I'm very mad!
- As a preventative measure, demos *recorded* before ticking will simply not save in the first place.
- This was also a frustratingly easy fix for the amount of headache it's caused us.
- Reduced the amount of copypasted boilerplate by simplifying the places where DEMOMARKER can be written (and therefore read).
- Previously, like half the write functions tried to guess their own output size and potentially end the demo at any point.
- At best, this will grant us a few tics of reprireve for large netgames and MAYBE a handful of seconds for time attack, The Mode In Which The Aim Is To Go Fast.
- Instead, double the size of the deadspace buffer extension and just check to see if we've crossed into that territory.
This should substantially reduce the number of malloc/free calls made to
create and destroy mobjs, especially during level load and net
save/load.
memory_resource standard header is not available on the OSX deployment
target we are using, so I had to write my own fixed size pool allocator.
- SPB: The standard set-up has ATTACKING_TIME in addition to ATTACKING_SPB, so the _TIME check first prevented it from ever being ticked
- SPB: Check for encoremode instead of ATTACKING_SPB, to cover Versus SPB as well
- All Attacking modes: Check for != ATTACKING_NONE just in case we add other potential modeattacking configurations later
- If you called R_ResetViewInterpolation once but G_Ticker
got called more than once, then the effect of
R_ResetViewInterpolation would be cancelled
- This should be a comprehensive solution to the titlemap
camera bug
- Multiple tests:
- -skipintro
- -warp, then exit to title
- map command, then exit to title
- Wait for attract demo, then skip and exit to title
- If tally is skipped, the replay will be cut short
- Just stop reading the demo if this happened after the
tally started
- It's okay to let the level continue without any input
because the player already finished (we know the result)
- Spins and zooms around a center point
- Freezes the level while spinning
- Pans over to follow and object after spinning ends
- Timing and speed completely customizable
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.