Commit graph

57 commits

Author SHA1 Message Date
toaster
0da140e37f Safety cap on M_GetFollowerState 2025-08-22 12:48:44 +01:00
toaster
2f6d7230f0 Dumb post alert: Ease off the horn
If we're bringing the spice we have to bring the whole pepper
2025-08-17 13:06:02 +01:00
toaster
9bd213ac78 Bugfixing for interactions between Profile charsel and Challenge Board
- Editing the current profile for a player will update their Driver so map command and Challenge Driver have proper comparison available
- Re-order M_CharacterSelectInit so driver/follower info is available/valid when M_SetupProfileGridPos is called
2025-08-15 20:10:03 +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
NepDisk
a67bdb2ad0 Make i and j UINT16 to account for the fact MAXFOLLOWERS is 1024 2024-11-20 00:42:01 +00:00
Sal
653766010d FRIENDCODE (aka, Teamplay) 2024-09-17 01:41:26 +00:00
AJ Martinez
ce1c5d03d3 Safety check t. nosegoblins 2024-05-04 04:23:26 -07:00
AJ Martinez
6ee0e40c1a Play character sounds + follower horns on charsel 2024-05-04 00:45:27 -07:00
toaster
224deed01d More copyright updates
- TehRealSalt and Lat` are currently preoccupied, so handle their credits
- Correct some accidential copypastes of existing boilerplate into new files
- Add a handful more of mine
- Consistency for Kaito Sinclaire's online handle
2024-04-02 22:14:49 +01:00
toaster
7f0df71558 R_SkinAvailableEX
- 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
2024-03-05 13:21:38 -08:00
James R
5e37aa12a5 Replace memcpy to gamecontrol with G_ApplyControlScheme 2024-02-24 21:29:18 -08:00
toaster
67b2f5e7de Call M_AnimateFollower in one place, instead of duplicating between general and specific func.
Should be resilient against additional setup steps added later!
2023-12-29 10:08:06 +00:00
toaster
15ef649e11 M_GetMenuCategoryFromFollower
Unified conversion for follower reference to menu category (as opposed to internal category).
Fixes Jartha's flicky bug.
2023-12-29 10:07:13 +00:00
James R
67aa3bb6e3 Menus/Character Select: animate follower when READY 2023-12-29 09:40:35 +00:00
James R
8b65779a4e Menus/Character Select: show character/follower behind ALL GOOD/CHANGE options
- Drawn at 50% transparency
2023-12-29 09:40:34 +00:00
James R
30e94d81fe Menus/Character Select: interpolate Profile selection 2023-12-29 09:40:34 +00:00
toaster
a07aeef049 play-char-select.c: Reduce copypasted hell
Instead of manually handling every single transition, only simple transitions are unique.
Helper functions are used for the complicated transitions - Color selection if there's more than 1 colour, Follower selection if you have any followers unlocked, and the choice of Alts versus Character when going back.
Fixes a whole class of issues where, for example, you'd skip over setting your skincolor if you went through the Alts submenu, but not if there's only one character on that statblock.
2023-12-26 23:00:09 +00:00
toaster
bfa52b695e Character select: Fix mismatch between ground truth and unlock-dependent followercategory
Resolves Fyrus' follower select bug
2023-12-26 22:13:05 +00:00
toaster
85d8cfdf85 menu_t: Add bgroutine
All backgrounds are now handled by a seperate routine.
This will allow more fine handling without a ton of special cases everywhere.
Creates an absolutely nasty diff because all menu_t have been updated in one blast 🥹
For the things that DO need to draw outside of GS_MENU (M_DrawOptionsCogs, the Wrongwarp), the behaviourflag MBF_DRAWBGWHILEPLAYING has also been added.
2023-12-04 20:10:03 +00:00
toaster
792fcf2ad8 Profile edit character select: Get transition to work 2023-12-04 13:44:15 +00:00
toaster
0e9997f2cd Character Select: If your profile's color/followercolor have not been unlocked, correct the visible colour to Default when selecting your Profile, instead of on Level start 2023-09-20 00:25:29 +01: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
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
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
a016a54e52 Rework how GP Backups are accessed
- Now actually from the relevant GP difficulty's Cupgrid, instead of the top-level Play choice
    - Permits a much cleaner M_StartCup, combining two of the previously four copypasted, slightly modified level startup regions (which could be further combined for sanity's sake, but would take a LITTLE more work right now than I have in me)
- Shows a funny exclamation mark from Sonic Rush on the relevant cup on the grid
- Selected by default when loading the menu, if appropriate
2023-06-25 23:44:39 +01:00
toaster
87c26f0fe9 Skip Bonus Rounds when loading up Live Event Backups
Prevents the exploit Tape discussed from being used for Battle.
Also attempts to recover to Podium if relevant.
2023-06-25 23:44:39 +01:00
toaster
3e6a5fda21 Change the rules of when GP Backup occours/is deleted
- Re-saved every time you lose a life, to prevent scumming
- Force-deletion of your backup has changed
    - Don't when saying NO to the GP Backup load prompt
    - Don't when returning to titlescreen under non-DEVELOP
    - DO when starting a new Grand Prix session of any cup
2023-06-25 23:44:38 +01:00
toaster
45bff5f0d8 Further polish
- Set a restoreMenu for M_GPBackup
- Improved newlines on associated message
2023-06-25 23:44:38 +01:00
toaster
281002f2ee Improve wording for A/B options for GP Backup prompt 2023-06-25 23:44:38 +01:00
toaster
2eef39e079 Fix valid followerskin range on GP Backup load 2023-06-25 23:44:38 +01:00
toaster
12ff436877 Make a first-class feature instead of a passworded secret
- Now called "Grand Prix Backup"
- Filename is now `gpringsav.bkp`
- Since available in standard contexts, do a little extra guarding against unsporting behaviour:
    - In non-DEVELOP builds, delete Grand Prix Backup when returning to the titlescreen/menus.
- "undo your extra work and make it more generic" - Tyron
2023-06-25 23:44:37 +01:00
toaster
e372d348cd Live Event Backup
Associated menu stuff is rough and unpolished, but it's 1am for the author of this commit.
- Activated for this session by either of the following Passwords.
    - `savetheframes`
    - `savetheanimals`
    - The idea is that if Ring Racers were ever ran at a GDQ, runners would swear their alliegance to a particular Metroid routing at the startup stage, because I think it's funny and cute.
- A live event backup is created/overwritten on non-cheated grandprix level change.
- It's wiped on reaching the podium.
- When hitting PLAY on the main menu, if a live event backup exists, make a Menu Message.
    - If you hit A, turn live event backups on for this session, and load the backup.
    - If you hit B/X, delete the backup and proceed to character select.
        - Done this way to avoid cheating a different character to the end of GP.
- Unlike the (maybe a little over-)engineering of ringdata.dat, liveringbak.bkp is streamlined as all hells and has very little recovery for differing file lists.
2023-06-25 23:44:37 +01:00
toaster
533433d41f play-char-select.c: We haven't had problems with devices for a while, so #define away all the device handling messages to reduce the spurious console noise. 2023-06-06 16:48:18 +01:00
toaster
2aa36b5d32 M_CharacterSelectInit: Fix a heaping of bugs
- Fix a softlock caused by commit 8d9b42e4 (!!)
- If your profile's skin was locked, fix a softlock where control was never restored
- If your profile's skin didn't exist, fix an invalid skin id set
- Just straight up flatten out the nested complexity of this function
2023-06-06 16:47:59 +01:00
toaster
8d9b42e49b Skin name search-assistive hashing
More opportunities for early rejection in table-wide searches, in anticipation of future work.
- Many circumstances independently implemented string name comparisons. Most of these have been converted to use R_SkinAvailable, with one exception.
    - M_CharacterSelectInit already needs to iterate over the characters, so produce the skin hash independently.
2023-05-30 12:21:40 +01:00
toaster
d86743f0ba Profile selection music
- `_OCEAN` on first launch without profile set, to avoid skipping between three different tracks in quick succession
- 'FILE' if you create a new profile on first launch OR if you go into Options->Profiles
2023-05-19 23:10:13 +01:00
toaster
317c30f7c1 Profiles: Fix deficiencies with pre-existing color handling that was exacerbated by this branch
- Do not turn SKINCOLOR_NONE into prefcolor automatically anymore (removed PR_GetProfileColor)
- M_DrawProfileCard:
    - Handle SKINCOLOR_NONE into prefcolor directly
    - Profile Card should not turn NONE-green if skin uses different startcolor for remap
    - Do not attempt to draw Follower if simply not selected for this profile
2023-04-25 14:19:53 +01:00
toaster
b30352022b M_HandleCharRotate: If the listLen is 1, there's only one valid colour - pick that!
Also uses the same technology to skip over setting followers if there are no followers unlocked.
2023-04-25 14:19:52 +01:00
toaster
6626b27a7a M_HandleFollowerRotate: Actually insert Follower-specific Match and Opposite into color wheel 2023-04-25 14:19:52 +01:00
Sally Coolatta
c486ec19af SECRET_COLOR 2023-04-25 14:19:52 +01:00
toaster
42cc95f6ed menubehaviourflags_t / (menu_t).behaviourflags
- MBF_UD_LR_FLIPPED
    - Genericisation of the control flip for PAUSE_PlaybackMenuDef
- MBF_SOUNDLESS
    - Do not create sound for default menu actions
2023-03-25 22:39:07 +00:00
toaster
2e1efaff0c Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into conditions-cascading
# Conflicts:
#	src/k_battle.c
#	src/k_hud_track.cpp
#	src/k_kart.c
#	src/p_inter.c
2023-03-14 21:59:19 +00:00
Eidolon
f952be1e2c Only allow P1 to be assigned KBM 2023-03-08 18:39:51 -06:00
Eidolon
7ed5e7a7a5 Change gamepad LED colors on playercolor change 2023-03-07 00:07:47 -06:00
Eidolon
86a9579e16 Handle gamepads from interface dynamically
Fixes numerous issues with hotswapping, gamepad assignment, and menu
responsiveness.
2023-03-07 00:07:47 -06:00
toaster
6d43d8ef09 Add SECRET_ONLINE.
- Online menu is inaccessible until unlocked.
- Unlike most unlocks, the fact that it's not enabled is very clearly signposted.
    - This is because the previous entry in the series barely had any offline content at all, so the fact you'll have to work for it will catch a lot of people by surprise.
    - Has a message that straight up tells you you need experience in Grand Prix mode.
- Has no affect in TESTERS builds, for which this is the only method of play available.
2023-02-27 17:01:15 +00:00
toaster
26ceb13672 Character Select: Press R (drift) to toggle an "extra info" mode
- Hides "A PLAYER/A $profilename" text
- Shows extra info relevant text
    - Early stages: "[EXTRAINFOMODE]"
    - Grid select: Speed and weight
    - Clone select/READY!!: Character name
    - Color: Color name
    - Follower category: Category name
    - Follower: Follower name
    - Follower color: Follower color name
- The hidden setup_page toggle feature now only uses L button
2023-02-26 23:28:00 +00:00