Commit graph

483 commits

Author SHA1 Message Date
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
James R
d3577c02b9 Port tunes command to new music system
The tunes command basically operates the Stereo now, with
the distinction that the song loops forever.

tunes -none will stop music indefinitely. Only the Stereo
can override it.

tunes -default restores level music to the correct time.
2023-08-06 17:31:45 -07:00
James R
feada89364 Port Sound Test (Stereo) code to new music system
Much of struct soundtest was removed, since the music
system handles its functionality now.
2023-08-06 17:31:45 -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
James R
646701c55c Remove Lua Music API
In preparation for replacing music handling entirely.
Eventually, we can make a new Lua API.
2023-08-05 16:26:53 -07:00
AJ Martinez
5a703240bd Slow down level music in Encore - "vape mode" 2023-08-01 19:04:30 -07:00
toaster
2dbb11af89 Use S_AttemptToRestoreMusic to handle music after server connection
Resolves #473
2023-07-22 19:24:25 +01: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
toaster
d9589edbb8 S_ShowMusicCredit: If the track has no title, clear existing music credit. 2023-06-13 22:15:33 +01:00
toaster
d9fd0eda2e Fix lack of NULL setting for the last musicdef in the list's sequence.next 2023-06-13 20:37:31 +01:00
toaster
ff089afad1 S_StopSoundByID: Permit NULL origin to be stopped manually 2023-06-09 18:36:48 +01:00
toaster
ce6737aa67 S_SoundTestPlay: Set MINIMUM looping of ~4 seconds, for the sake the extremely short votepick song. 2023-06-03 15:41:52 +01:00
toaster
1d619d10f2 Add Podium level to Stereo Mode
- LF2_HIDEINMENU is considered equivalent to LF2_FINISHNEEDED for:
    - S_SoundTestDefLocked
        - So you don't see podium stuff without having beaten a GP
    - MV_FINISHNEEDED
        - So the status is saved to gamedata and persists between launches if custom
- G_UpdateVisited is now called in K_FinishCeremony, so level is marked as beaten
2023-06-03 14:24:46 +01:00
toaster
4c34d04f8a recorddata_t handling adjustments
Preperatory work for the next feature on my agenda.
- No longer independently allocated.
    - This was a byproduct of the previous NUMMAPS-based implementation. It's just cleaner to have it live directly on the mapheader_t, no caveats about it.
- Now contains mapvisited bitflag array.
    - Now all to-gamedata properties on a mapheader's struct are grouped together.
        - I was of two minds about it, but decided that this would have cleaner guarantees for compartmentalisation, saving, and loading.
        - They can still be wiped independently (G_ClearRecords for time/lap and M_ClearSecrets for mapvisited).
2023-05-30 12:21:39 +01:00
toaster
6935bf4754 S_AttemptToRestoreMusic: Handle both GS_INTERMISSION and musiccountdown (via FALLTHRU) 2023-05-02 18:16:26 +01:00
toaster
a31d83cd6b Resolve #510 by not stopping attempted playback/sequence when song duration is 0 2023-04-08 12:39:02 +01:00
toaster
d432cf3837 musicdef important parameter: Guarantee match by touppering the character 2023-04-08 12:32:47 +01:00
toaster
dc8a97475f musicdef_t: Add an important parameter
If set to true/yes/1, add at the head of the sequence in S_PopulateSoundTestSequence.
Otherwise, append to the tail.
2023-04-08 12:32:47 +01:00
toaster
5dd4e36b72 S_StopMusicCredit: Make killing a music credit a request, not a guarantee
Fixes some menu events causing Stereo-caused music credits to disappear
2023-04-08 12:32:47 +01:00
toaster
2e687b4033 Sound credits no longer go off the screen
Uses V_ThinStringWidth to check whether it'd exceed BASEVIDWIDTH.
Does not apply to the main song title - if that exceeds the width of the screen, just visibly fail.
2023-04-08 12:32:46 +01:00
toaster
37c1a40da6 S_SoundTestPlay: Improvements
- Tidy conditionals
    - Fixes dosequencefadeout potentially not being set for this particular track.
- Only functionally loop the song if the duration before looping is less than 3 minutes.
    - Ensures particularly long songs that already do minor variations of the same loop don't overstay their welcome.
2023-04-08 12:32:46 +01:00
toaster
1bdbfdf22b S_TickSoundTest: Clean up significantly.
- Introduce comments to make flow understandable.
- Abstract the number of seconds in the fade out (previously handled across multiple places) into SOUNDTEST_FADEOUTSECONDS.
- Make all next/conclude song cases for autosequence and non-looping track handled in one place.
    - Fixes the case where a non-looping track could stop the Sound Test even in autosequence mode.
2023-04-08 12:32:46 +01:00