If non-NULL, filesearch will begin in that subfolder of the desired searchpath, but can go back up to the root of the search later if not found in that location.
Primarily a small optimisation for checking the addons folder first
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.
- ResolvesKartKrew/RingRacers#281 under standard operation
- Add `-immediate` parameter for previous, `wait`-ignoring behaviour
- Used by configfile, EXECCFG
Uninhibited voices/horns (see the "meme" setting in v1).
Removes the SECRET_MEMETAUNTS unlock, which didn't fit the general level of cohesion main game content should have.
- No need to call CV_RegisterVar
- Cvar definitions live in only one file, easier to locate
- Organized into sections -- netvars, cheats, etc.
- Use builder pattern to initialize cvars
- Still need to extern if you want to read the cvar value
System for netsyncing unlocks, inspired by but with nowhere near as many moving parts as (STJr/SRB2!1756).
* `gamedata->unlocked[MAXUNLOCKABLES]` is duplicated to `netUnlocked[MAXUNLOCKABLES]` (or all `true` in `dedicated`
* New `local` boolean for M_SecretUnlocked
* Removed last vestiges of SRB2 special stage token code because it occupied the spot in the netsave we wanted to use.
* Correct typing of multiple `m_cond` functions that returned `boolean` constants as `UINT8`s.
Mammoth commit, sorry. I only realised halfway through writing it that SECRET_SKIN was only partially merged.
Ports from 2.2:
- Merge SECRET_SKIN (STJr/SRB2!1474)
- Default skin is now handled by checking all skins for unlock status, and I_Erroring if none are available
- Don't show skin names on game startup, to keep our secrets hidden
- Unlockables now have string variables zallocated.
- For skin names rather than numbers.
- Correctly clean up memory when freeing unlockables and emblems.
Bespoke code:
- For temporary testing. `unlocks.pk3`
- Using this for rapid testing gameboot SOC instead of patch.pk3 because of the intent to turn that into scripts.pk3
- Don't not save gamedata in DEVELOP builds, even if you've used cheats!
- `player->availabilities` is now an array of UINT8
- (MAXSKINS + 7)/8 entries, or 32 bytes.
- Included with XD_ADDPLAYER instead of XD_NAMEANDCOLOR.
- Simplifies a lot of logic with respect to demos, skin changes mid-game, etc.
- Seriously, there's a lot of random places in the code that just iterate over MAXSPLITSCREENPLAYERS and g_localplayers to update availabilities in real time in a way that's not particularly netsafe...
- Lines up with the plan for handling unlocks when returning to menus.
- Was included with XD_ADDBOT, but that actually overruns the netxcmd buffer at first mapload with 7 bots. We might need to consider expanding the size of the netxcmd buffer...
- In demos, can be interpreted as both relative to the original replay and the current skin list depending on boolean context provided to R_SkinUsable.
- Used for SF_IRONMAN (and will crash if all other skins are inaccessible).
- Grand Prix bot randomisation uses the host's unlocks.
- Don't show locked characters on the fancy new character select.
- DXD_JOINDATA for demos
- Replaces the dual-purpose behaviour of DXD_PLAYSTATE
- Contains availabilities
- Handles bot material in a different way
- Forceskin restrictions
- Won't run in demos, because it's assumed recorded DXD_SKIN will handle all the conversions the original match had
- Won't run if K_CanChangeRules says no
- Correctly set `mapvisited` on level visit, even in [fake gasp] MULTIPLAYER/NETGAMES!! 🥹
- Added updating unlockables and extra emblems on `mapvisited` update.
- Currently fails to produce the cecho, but that'll be stripped out entirely in a future commit so I'm not bothered.