Commit graph

542 commits

Author SHA1 Message Date
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
a4d304a1f5 Update copyright years to 2025 2025-02-13 15:32:26 -06:00
Sally Coolatta
113146d208 Disallow palette flashes with reducevfx
Resolves #214
2024-08-09 22:46:40 -04:00
toaster
7390ee5442 G_SaveDemo: Resolve memory errors that could result in crashes
- Empty `demo.titlename` case
    - Don't try to save demo of name `.lmp`
    - Doesn't fall back to anything, because emptying out the name field can be reasonably treated as not wanting to save
- `demo.titlename` consists only of invalid characters
    - Don't try to save demo of name `-.lmp`
    - Falls back to the default demo title, because the user clearly wanted to save and just happened to provide invalid text
2024-05-01 19:54:09 +01:00
toaster
db73636f5e Fix attract title logo slidein (resolves #1273)
- V_SLIDEIN: For (G_IsTitleCardAvailable == false)/(versus at map start == true) contexts, use timeinmap instead of leveltime
- Don't reset timeinmap when reloading gamestate, so it's more functionally equivalent to lt_ticker
These two changes also fix the hypothetical issue of titlecard-less custom gametypes having weird HUD state on late netgame join.

Timeinmap is exclusively used for HUD, as is st_fadein. timeinmap also doesn't increment under g_fastforward, therefore the best candidate to tie together
2024-04-14 20:59:50 +01:00
James R
bb5297c780 Fix wrong button on Save Replay prompt
- Y -> X
2024-04-08 23:24:15 -07:00
toaster
7f6de407f1 Copyright update: Add Kart Krew (2024) in general for high-traffic inherited sourcefiles 2024-04-02 17:42:38 +01:00
AJ Martinez
070525f711 Always show delay (remove cv_showping) 2024-03-22 19:11:04 -07:00
James R
2cb62c8663 devmode replay: show demo format version 2024-03-19 01:12:59 -07:00
James R
2945f41f13 Don't let Tab key hide player name in Time Attack replays 2024-03-17 04:56:21 -07:00
James R
0e7b4c0987 HUD: 4P viewpoint text in bottom corners 2024-03-14 06:26:16 -07:00
James R
a7ca3c1768 HUD: switch viewpoint text to thin font if it becomes too wide
- 200 px limit in Race (GTR_CIRCUIT)
- 100 px limit in Battle (GTR_BUMPERS)
2024-03-14 06:23:27 -07:00
James R
fa64052cb3 HUD: fix spacing on some button prompts 2024-03-11 23:32:12 -07:00
Sally Coolatta
9b93f56111 Add pre-Podium intermission music 2024-03-10 14:08:59 -04:00
James R
2d39617014 HUD: redesign VIEWPOINT text
- 1P
  - "-Watching-" in thin font
  - Player name in free play font
- 2P
  - Player name in free play font, transparent
- 4P
  - Unchanged (player name in thin font, transparent)
2024-03-07 11:24:01 -08:00
James R
38e1ae1c53 Replays: let name be changed any time until the file is saved 2024-03-03 06:30:54 -08:00
James R
983fb4c53c Replays: merge HUD and intermission drawing functions for "Save replay" prompt 2024-03-03 06:30:54 -08:00
James R
8fa01ee558 Replays: use Virtual Keyboard for title entry
- This shortens the maximum title length from 64 to 31
  characters
2024-03-03 06:30:54 -08:00
James R
fb9f4a68b9 Server splash: display server name in medium font 2024-02-09 18:13:35 -08:00
James R
6e6b2b704a Fix "Save replay" text not appearing at end of map
- Remove V_HUDTRANS (Tally makes it fully transparent)
- Embed button codes instead of drawing them separately (fixes minor alignment issues)
- Fade in over 1 second (visual flair)
2024-02-02 05:16:07 -08:00
James R
a879975e83 devmode DEMO: replay buffer usage displayed in real-time on the HUD
- Buffer usage in megabytes, bytes and percentage
- Approximate usage per second
- Estimated time until buffer runs out and replay is stopped
2024-01-29 02:20:26 -08:00
Sal
3958c15dfe New Credits 2024-01-28 23:31:30 +00:00
toaster
b09a9b40c4 Account for Hidden Palace-like replacement levels in the round queue and ranking systems
- When a nextmapoverride is in play, do not insert the just-played map into the GP Rank
- Put all the behaviour that determines which Round icon to show in exactly one places

Also, fix a bug where it would show the skin realname for a spectating player's tally instead of the ROUND text.
2023-11-19 18:01:02 +00:00
toaster
a55803b690 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into other-progression 2023-11-18 18:00:05 +00:00
James R
7d7110ead7 Let devmode work in replays, let teleport commands work in replay freecam 2023-11-16 18:45:04 -08:00
toaster
f6214fd8e9 Tutorial dialogue: Synergy wth titlecard
- Draw in front of the titlecard
- Don't tick while levelloading and not leveltime, so prevent instantly appearing
2023-11-13 21:34:26 +00:00
toaster
e060e9dadc More consistent handling of special event round icons
- Gametypes have "GPpic" and "GPpicMini" parameters
- These are shown in contexts where a Round Number would be shown in GP, but an eventmode is under way.
- Instead of having different rules to show up on the pause menu, titlecard, and tally/intermission...
    - Pause Menu Roundqueue, Tally, and Intermission have all been aligned to the same rules.
    - As long as the titlecard is standard, it will show the GP Pic per those rules. (GTR_SPECIALSTART and GTR_BOSS still have their unique behaviour here)
2023-10-25 20:34:40 +01:00
toaster
b87f57440c Versus warning: Revert usage of V_REVERSESUBTRACT to V_SUBTRACT 2023-10-25 11:24:51 +01:00
toaster
5f10f4de0f Versus Mode intro: Two different warning patches scrolling opposite directions
Also repairs capitalisation on the opponent's subtitle, and moves everything down very slightly.
2023-10-24 23:10:17 +01:00
James R
ecc324e4d8 HUD: fix server splash alignment in non-green resolutions 2023-10-17 19:18:00 -07:00
James R
1f3a9a4758 Splitscreen Director HUD; replace freecam HUD 2023-10-09 18:53:55 -07:00
James R
fa89576f34 Move freecam state to camera_t, lets splitscreen players use freecam independently of each other 2023-10-08 14:26:21 -07:00
James R.
454850d349 ST_CalculateFadeIn: do not interpolate at very beginning or end of fade 2023-10-03 21:28:34 -07:00
James R.
7b3010c93d Fix many instances of splitscreen view number if there are duplicate displayplayers
- Avoid iterating displayplayers to find view number and
  prefer R_GetViewNumber.
- Iterate over all matching displayplayers if necessary,
  instead of stopping at the first match.
2023-10-03 21:28:33 -07:00
James R.
3cdfa86b11 Make timing of level fade-in consistent, relative to title card 2023-09-12 05:19:27 -07:00
Oni
9e283a4993 Merge branch 'swag-fade-returns' into 'master'
Move V_DrawCustomFadeScreen to D_Display

See merge request KartKrew/Kart!1480
2023-09-12 04:46:47 +00:00
James R.
afeba341c0 Remove translucenthud cvar, let V_HUDTRANS fade in like V_SLIDEIN
- V_HUDTRANS does not fade if combined with V_SLIDEIN
  (since sliding elements are not supposed to fade).
- If not V_SPLITSCREEN, uses most opaque fade value among
  splitscreen players (since Tally will fade back out for
  specific players).
2023-09-11 18:30:40 -07:00
James R.
653db93022 V_AdjustXYWithSnap: refactor V_SLIDEIN, separate timer calculation, fix interpolation
- Move timer calculation to ST_CalculateFadeIn, cache in
  st_fadein
- Fix interpolation by using rendertimefrac instead of
  renderdeltatics
2023-09-11 18:22:29 -07:00
toaster
bd5a34022f Move V-DrawCustomFadeScreen to D_Display
TODO: This is steenky.

Essentially immediately tint the geometry and players the latest possible place it is safe to do so, with the magic of the software-exclusive fade.
This would ideally be handled with a shader so that GL and any future hwr2-native renderer can get in on the action too.
2023-09-11 09:20:00 +01:00
James R
4f60d046ba V_DrawTitleCardString, V_TitleCardStringWidth: add 4P font support 2023-08-26 21:39:18 +01:00
VelocitOni
2eef398381 Merge branch 'master' into dialogue-2 2023-08-25 22:46:14 -04:00
toaster
92bd71496e VC review
- Continue showing up on main in-game pause menu
- Flip to top half of screen, to avoid conflict with Round Queue
- Show over most UI, including menu
2023-08-25 21:41:15 +01:00
Sally Coolatta
c2c46aca58 Add note about MOTDICON 2023-08-25 14:56:50 -04:00
Sally Coolatta
819ebc4c26 Highlight contact with shoutcolor 2023-08-25 14:51:21 -04:00
Sally Coolatta
019546e846 Add server join splash
Just wanted to give literally any possibility of seeing the server contact as a client
2023-08-25 14:42:01 -04:00
Sally Coolatta
16e6aa423e Dialogue 2 2023-08-24 17:28:53 -04:00
James R
5a40f554d4 ST_overlayDrawer: hide VIEWPOINT text when using demo freecam 2023-08-19 05:01:40 -07:00
James R
39f46a0f20 Replace music handling
(This commit does not compile. Sound test and tunes
command code needs to be ported after this.)

This is a big one. Here's the rundown:

The old music system was very direct, much of the time
just a proxy to the real sound API in i_sound.h.

You could change the music on command, but there wasn't
a consistent way to prevent some music from playing over
others. P_RestoreMusic is one example of needing to
address this problem. The jingles system was intended as
another solution. Furthermore, sound test (Stereo) has its
own needs.

I am removing all of that. Music handling in general is
now a very deliberate system, kind of similar to jingles.

In the new system, "tunes" are registered. The tune stores
info such as whether it should loop or fade out. Most of
the configuration is intended to be initialized only ONCE.
Tunes can be mapped to an actual music lump. They can be
remapped at any time too.

Tunes are also configured with a priority number. This
determines which tune is heard, if multiple are supposed
to be playing at a time. You can even tell a tune how long
it should play, so it's unnecessary to track this with
bespoke timers.
2023-08-06 17:31:45 -07:00
toaster
c5dc430b50 V_6WIDTHSPACE no longer a pitfall for using V_DrawThinString
The bunched text behaviour is now the primary mode of operation for TINY_FONT.
2023-07-12 09:00:29 +01:00
toaster
a536f884ce V_ALLOWLOWERCASE --> V_FORCEUPPERCASE
Content of commit was originally written by Sal, but as a monolithic commit. The author of this commit is chunking it up for easier review.

Simple inversion on the face of things, but with a long tail of consequences, including 19 changed files.

Forced uppercase has been applied in a handful of locations where it was aesthetically imperative. Most menus will follow in another commit, so that that may be reverted if we change the default menu font.
2023-07-12 09:00:29 +01:00