Commit graph

505 commits

Author SHA1 Message Date
Oni
7bb49a9f67 Merge branch 'always-musicdef-author' into 'master'
Always show author on song credit (resolves #1332)

Closes #1332

See merge request KartKrew/Kart!2333
2024-05-02 02:45:10 +00:00
toaster
641e397625 Always show author on song credit, even if it's wider than we'd like
Credit is more important than aesthetic
2024-05-01 14:50:05 +01:00
Eidolon
f9d70530ed Add snd_mixingbuffersize cvar
Allows the user to configure the mixing buffer size to reduce
latency at the cost of higher CPU usage, or vice versa.

This also raises the default buffer size from 1024 to 2048, to
address some underrun problems people have with the current buffer
size.
2024-04-30 23:31:24 -05:00
Eidolon
6a9fd1bf5f Add 'contentidunsafe' property to MUSICDEF
This allows marking music in MUSICDEF as unsafe for Content ID and
other similar content surveillance mechanisms.
2024-04-30 17:44:35 -05: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
75b4bdd4ea Catch all other instances of sounds which might have played where R_CanShowSkinInDemo is false
- Tally
- Generic S_StartSound call (where sfx_id is in skinsound region)
2024-03-27 04:01:58 +00:00
James R
a4f2712d8a WIP - credits audio/wipe fixes, document this later 2024-03-23 16:21:03 -07:00
toaster
6e46f97847 As promised, Encore (alt)music
- `EncoreMusic` on mapheader
    - Supports up to 3 alt musics, as with every other type
- Do not vape/nightcoreify if provided
- To avoid complicating the Alt Music logic too much, uses "side B" of the same Prison Egg CD
    - That is to say, if there are 2 encore tracks and 3 normal tracks, the second Encore track will only play if you've gotten the CD associated with the second normal track

I haven't actually tested it *with* any Encore music, but I've triplechecked literally everywhere to make sure it didn't break standard play
2024-03-10 21:18:15 +00:00
toaster
57d5e54983 Stereo Mode: Fix multi-Track musicdefs not having their first part loop under non-Seq conditions
Had to introduce a hacky Music_SetFadeOut func, but I didn't want to rework this section of code/menu too heavily for how little time we have left
2024-03-10 21:18:14 +00:00
toaster
f3af88200f S_PopulateSoundTestSequence: Show Tutorial maps before Cups
Previously after Cups, as part of Lost & Found tracks
2024-03-10 21:17:20 +00:00
Sally Coolatta
9b93f56111 Add pre-Podium intermission music 2024-03-10 14:08:59 -04:00
Eidolon
6dc6bb63a7 Play TIMENT for mode attack intermission 2024-02-21 19:13:14 -06: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
d7e0a4d01a Add S_LoadSongCredit/S_UnloadSongCredit, refactor cursongcredit
- cursongcredit behaves the same as before
- Always compose song credit string
- g_realsongcredit always stores the song credit for the
  current music, even if no song credit is displayed on
  the HUD
2024-02-09 18:13:35 -08:00
AJ Martinez
4efaed3690 Fix sound falloff calculation overflow 2024-02-06 06:02:17 -07:00
Sal
3958c15dfe New Credits 2024-01-28 23:31:30 +00:00
James R
f12d4c275e music, sounds: toggle based on cvar's actual value 2024-01-12 17:32:25 -08:00
Eidolon
448b54c41c Make master volume an independent gain control
Master volume should control after-mixing gain; the idea is the mixed
output of sfx and music's amplitude should never exceed
`cv_mastervolume`. Setting each submixer's gain independently will
still allow the master mixer to exceed that preferred volume, which was
the main issue with the SDL_Mixer backend. So, instead we use a separate
gain control that is applied after everything is mixed.
2024-01-12 19:06:19 -06:00
James R
09fd14df98 musicvolume, soundvolume: do not unmute during config loading
- The order that cvars appear in the config is messy, so
  music appears before musicvolume
- When musicvolume is changed, music is forced to On,
  which would ignore the config value
2024-01-11 13:53:52 -08:00
Oni
df5c866573 Merge branch 'map-access-flingerdinger' into 'master'
Stronger Course progression restriction

Closes #832, #859, and #839

See merge request KartKrew/Kart!1795
2024-01-09 08:11:12 +00:00
toaster
83366b6507 More universal Course restriction based on progression
All courses are restricted in Match Race/Time Attack/Online if not visited in GP UNLESS:
- It is the first Race Course of a Cup
- Course has "NoVisitNeeded = True`
    - The Controls Tutorial and Test Run are the only two stages that will need this

The above replaces:
- A lot of restricted courses having to be marked with `FinishNeeded = True`
    - Hidden Palace
    - Sealed Stars 1-14
        - Once Special Mode is unlocked, it will now be possible to practice Sealed Stars before rematching them in GP
- Almost all Tutorial-specific behaviour, since it was heinously hacky

HOWEVER, `FinishNeeded = True` was left in specifically for future releases, and I reserve the right to use it on Adventure Example again before launch.
2024-01-07 13:57:05 +00:00
James R
b7c9c92749 Music_Seek: argument in milliseconds instead of tics 2024-01-05 15:56:23 -08:00
James R
076cea7047 Stereo Mode: stop Stereo after unlooped, unsequenced track ends 2023-12-29 07:30:54 -08:00
James R
95f4768e46 Stereo Mode: fix unsequenced track fading at the end
- Starts both stereo and stereo_fade in tandem
- Suspends the tune which is not to be heard
- Swaps suspension when toggling SEQ
- Special handling so fade-out can not be interrupted by
  switching off SEQ
2023-12-29 04:54:55 -08:00
James R
64aaf02b8a soundtest: refactor to track tune with integer instead of string 2023-12-29 04:30:54 -08:00
James R
a2abbdefde Master volume: alter both music/sound volume without changing balance 2023-12-23 13:38:15 -08:00
James R
79012d00e8 Sound options: merge playmusicifunfocused/playsoundifunfocused into one cvar 2023-12-23 13:17:04 -08:00
James R
0c251ee643 Sound options: add master volume slider
- Updates music and sound volumes simultaneously
- Changing music/sound volumes separately sets master
  volume to highest of the two
- Visually distinct slider
2023-12-23 13:17:04 -08:00
James R
375d87255e Re-enable music/sounds when volume cvars are changed 2023-12-23 13:17:04 -08:00
James R
2d450b05f8 TuneManager: clear current song if music is disabled, so music can resume later 2023-12-23 13:17:03 -08:00
SteelT
36f6c89ce1 Remove code that is behind SURROUND define 2023-12-19 13:36:49 -05:00
James R
d97fece311 S_ShowMusicCredit: use at most 3/4 screen width 2023-12-04 20:40:18 -08:00
James R
e1f2ed11c7 S_ShowMusicCredit: subtract indentation amount from available screen space 2023-12-03 17:06:01 -08:00
James R
764a692a5e P_IsLocalPlayer, P_IsMachineLocalPlayer, P_IsDisplayPlayer: let player pointer be const 2023-11-25 04:51:13 -08:00
James R
063d7946a3 mobj.hpp: add srb2::Mobj class, abstraction around mobj_t
API is still a work in progress and is not yet
comprehensive.
2023-11-22 19:04:30 -08:00
James R
61cad641bb Invincible player punts hazardous/solid things, unless MF_ELEMENTAL
If player is in one of these states:

- Invincibility
- Grow (K_IsBigger)
- Flame Shield dash
- Over 200% speed

And the other object:

- Does not have MF_DONTPUNT

Then, touching a solid object:

- Punts the object, unless the object has MF_ELEMENTAL
- Fizzles the object, if the object has MF_ELEMENTAL

Or, when an object damages the player:

- That object is punted, unless it has MF_ELEMENTAL
- The object fizzles, if it has MF_ELEMENTAL

Punting means:

- A copy of the object is made
- Both the player and copy receive 5 tics of hitlag
- The copy is thrust away from the player at a minimum of
  60 FU, or 2x either the player's or object's momentum,
  whichever is ultimately greater
- The copy despawns after 2 seconds
- The copy flickers constantly, while thrust away

Fizzling means:

- The object disappears completely
- A puff of smoke is spawned in place of the object
- No hitlag is applied to the player

Both punting and fizzling:

- Hide the original object (intangible and invisible)
- The original object reppears after 30 seconds
- For 2 seconds before reappearing, the object flickers
  back in, but is still intangible
2023-11-13 22:18:35 -08:00
AJ Martinez
e3fe3ed54a Handle sound falloff for exiting player sounds 2023-11-10 17:08:39 -07:00
AJ Martinez
ff131335d4 Don't force player sounds to full volume when exiting 2023-11-10 16:47:52 -07:00
toaster
acad8754c8 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into break-through-them-all 2023-10-17 23:32:08 +01:00
toaster
52706b4f6f S_SoundTestDefLocked: Actually restrict tracks that should be restricted
- POSITION!! music and the standard course track is always visible.
- Alt Music is hidden behind the relevant SECRET_ALTMUSIC.
- Associated music requires you to beat the level to listen.
2023-10-09 12:20:00 +01: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
toaster
55bdd60519 Merge branch 'radio-shuffle' into 'master'
Stereo Mode: Add "Shf" (Shuffle) option

See merge request KartKrew/Kart!1517
2023-09-26 22:07:59 +00:00
toaster
36f8a64d65 Stereo Mode: Add "shf" (Shuffle) option
This basically came to me in a dream, who am I to look the horse in its mouth

- Press to start a shuffled sequence, losing your current position in the autosequence.
    - Press again to disable, but keep your current track.
- Adjust horizontal offset of Stereo buttons slightly.
- More judiciously comment Sound Test functionality, to assist future maintainers.
2023-09-24 10:46:32 +01:00
James R.
acbe0b270c s_sound.c: consolidate music volume related functions, always use cvars internally 2023-09-22 02:00:50 -07:00
James R.
472f7d060c Kill HW3SOUND related code (in files that are actually used) 2023-09-22 02:00:42 -07: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
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
f4ca6001d8 s_sound: remove unused OpenMPT stuff 2023-08-24 04:56:02 -07:00
James R
c5e341769b Remove unused cvars
- growmusicfade
- invincmusicfade
- music_resync_powerups_only
- music_resync_threshold
- renderstats (wasn't even registered in the console!)
- resetspecialmusic
- resume
- samplerate
- stretch
- tailspickup
2023-08-24 04:52:41 -07:00
James R
dbca307ad4 Fix sound handling in demo freecam
- Object sounds are audible from the location of the
  camera
- Certain HUD sounds should no longer be audible
  - For instance, lap complete sfx
2023-08-19 05:01:40 -07:00