Commit graph

260 commits

Author SHA1 Message Date
toaster
48261ae4b5 filesearch: Add "Priority folder" string parameter
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
2025-08-25 20:14:37 +01:00
Eidolon
892a6b8620 Merge public master 2025-08-12 16:49:14 -05:00
Eidolon
255570cfca Dynamically allocate skins
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.
2025-08-12 15:33:00 -05:00
Eidolon
cb7f437e60 Merge public master 2025-02-13 15:48:11 -06:00
Eidolon
a4d304a1f5 Update copyright years to 2025 2025-02-13 15:32:26 -06:00
Eidolon
1a8467fdaf Merge public master 2025-02-12 19:02:38 -06:00
Antonio Martinez
cad7273ff4 Controller type refactor 2024-09-27 03:28:40 -07:00
Antonio Martinez
80912b173c Descriptiveinput in profiles, various 6bt. modes 2024-09-27 03:28:40 -07:00
toaster
3ca282c3b4 COM_Exec_f: By default, insert into command buffer
- Resolves KartKrew/RingRacers#281 under standard operation
- Add `-immediate` parameter for previous, `wait`-ignoring behaviour
    - Used by configfile, EXECCFG
2024-09-15 18:19:36 +01:00
AJ Martinez
d32ba6cf64 Vicious difficulty 2024-05-05 13:57:18 -07:00
AJ Martinez
1a8b4dc78f Retheme difficulty modes 2024-05-05 20:56:40 +01:00
Sally Coolatta
d2b73b7096 #if out more execversion code
It's not relevant to a first release at all.
2024-04-05 11:48:18 -04:00
toaster
dea698a276 Tasteless Taunts
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.
2024-04-02 23:26:57 +01:00
toaster
7f6de407f1 Copyright update: Add Kart Krew (2024) in general for high-traffic inherited sourcefiles 2024-04-02 17:42:38 +01:00
toaster
93de95d8f8 Add a little more info to Host menu (text only)
So you have a representative idea of what each submenu contains
2024-03-29 22:04:16 +00:00
James R
a9e181cde5 Prevent CV_NOSHOWHELP cvars from being accessed or modified through the console at all 2024-03-01 07:34:20 -08:00
James R
ed832c5486 Rename Easy, Normal, Hard to Gear 1, 2, 3 in non-GP contexts 2024-02-27 06:18:36 -08:00
James R
4ee00d4333 Pass const pointer to all netxcmd handlers
Ensure buffer data is read-only and not modified by
handler
2024-02-11 05:42:07 -08:00
James R
30e8d1663d Register a bunch of commands with COM_AddDebugCommand, so they show up on the cheats menu
- angle
- archivetest
- assert
- bind
- causecfail
- clearscores
- countmobjs
- crash
- debugrender_highlight
- devmode
- displayplayer
- downloads
- eval
- gametype
- give
- god
- goto
- gravflip
- grayscale
- help
- hurtme
- isgamemodified
- listmapthings
- listwad
- memdump
- memfree
- minigen
- musicdef
- noclip
- numthinkers
- objectplace
- ping
- playsound
- randommap
- resetcamera
- respawnat
- restartaudio
- rteleport
- savecheckpoint
- scale
- setrings
- setscore
- setspheres
- showmap
- showscores
- showtime
- skynum
- teleport
- togglemodified
- tunes
- version
- view
- weather
2023-09-01 22:13:17 +01:00
James R
9dc277bc3d command.h: define xcommand_t, add COM_AddDebugCommand
This will become useful soon...
2023-09-01 22:13:17 +01:00
James R
e3da061192 cecho command: don't add trailing space
Fixes centering for cechos of only punctuation.
2023-08-27 15:11:14 -07:00
James R
ae2fdcbd12 cecho command: use titlecard font 2023-08-26 21:39:18 +01:00
James R
64a112e358 Pause menu: add cheats menu
Automatically populated with every cheat cvar.
2023-08-25 17:35:29 -07:00
James R
6c0b042eed Refactor cvar definitions completely, move everything to cvars.cpp
- 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
2023-08-25 17:22:40 -07:00
James R
ccd1450b73 Add 'reset' command to reset a cvar to its default value 2023-08-11 13:10:27 -07:00
James R
7c3d3282f0 Merge branch 'console_sanity' into 'master'
Console Sanity

Closes #517

See merge request KartKrew/Kart!1344
2023-07-19 22:17:10 +00:00
SteelT
05b130b422 Add CV_TrueFalse as possible value types for console variables
This also adds support for using true/false as value aliases for On/Off, Yes/No or 1/0

# Conflicts:
#	src/command.c
2023-07-18 20:39:08 +01:00
toaster
a07a9e2191 Don't use skincolor unlocks in situations where gamedata is inappropriate
- Recieving a different client's XD_NAMEANDCOLOR
- Loading profiles on game boot
2023-07-18 10:50:25 +01:00
toaster
1ec5b74892 Implement SECRET_MEMETAUNTS
Permits "Meme" player taunt voice and "Meme" follower horn options
2023-06-28 19:31:40 +01:00
toaster
5036719280 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into seeecret-colors
# Conflicts:
#	src/k_menudraw.c
2023-06-26 23:25:47 +01:00
toaster
fde06aace2 CV_SetValueMaybeStealth: Correctly null terminate tmpskin for forcecharacter 2023-05-30 12:21:40 +01:00
toaster
0964ba5c7b COM_Help_f: Adjust Color_cons_t (and catch Followercolor_cons_t) per review 2023-04-25 14:19:53 +01:00
Sally Coolatta
c486ec19af SECRET_COLOR 2023-04-25 14:19:52 +01:00
toaster
5296ab1397 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into conditions-cascading 2023-03-04 20:09:48 +00:00
James R
a2493bb9db Purge control characters from COM_Args 2023-03-02 22:56:09 -08:00
toaster
102ada37ca Unlock system: Imprement SECRET_MASTERMODE
- Locks Master difficulty in GP difficulty select.
- Remove SECRET_LEGACYBOXRUMMAGE at the same time, because that plan is long dead.
2023-02-27 13:39:47 +00:00
toaster
5a97dab6d4 Merge branch 'minor-cherrypicks-270123' into 'master'
Minor cherrypicks 270123

Closes STJr/SRB2#900

See merge request KartKrew/Kart!905
2023-02-06 22:19:32 +00:00
toaster
05301d0825 Repair demos that finish without crashing inexplicably returning to titlescreen after their completion
It's because of cv_cheats' default value in DEVELOP builds...
2023-01-28 23:18:50 +00:00
SteelT
236394f639 Fix "unknown command" not being printed on dedicated 2023-01-27 23:35:02 +00:00
toaster
e7c79ab461 M_CheckNetUnlockByID
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.
2022-12-09 17:26:52 +00:00
toaster
b074d6cbdd Fix the actual problem with saving in DEVELOP: cv_cheats didn't have CV_NOINIT
Also fixes a likely waiting-in-the-wings crash for the next time we make a non-DEVELOP build.
2022-11-28 19:21:02 +00:00
toaster
6d0637d39d Unlockable skins (in a way friendly to #define MAXSKINS 255)
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.
2022-11-27 22:53:29 +00:00
James R
a6e87ae82c Let toggle command multiple choice mode work on cvars lacking PossibleValue array 2022-11-03 05:46:22 -07:00
Sally Coolatta
80d9637dda devmode cheat online 2022-09-29 12:19:45 -04:00
James R
57a3c4109c Reset player cheat effects when disabling cheats cvar 2022-09-29 05:54:58 -07:00
James R
6426358377 Let some cheat commands work online
noclip
god
scale
gravflip
hurtme
2022-09-29 05:54:57 -07:00
James R
0444e70413 Rearrange player cheat flags
PC_GODMODE -> PF_GODMODE
PC_NOCLIP -> MF_NOCLIP
2022-09-29 02:23:07 -07:00
Sally Coolatta
b7bfa5a5c7 Don't try cheater warning if NULL netvar 2022-09-27 16:16:04 -04:00
Sally Coolatta
d61c9aefe1 Use cvar->string instead of svalue for the check 2022-09-27 15:57:31 -04:00
Sally Coolatta
e2b2b7785c Cheater warning 2022-09-27 15:22:59 -04:00