Previously sounds with an origin would always start at max volume. This is
because the distance calculation adjusts the volume, and that volume needs to
be updated every tic as distance changes. Storing the original volume works.
(cherry picked from commit 22177753d2f00d58d19d930f51dcd086097dfd0d)
Worked out some edge cases that had resulted in tracks restarting in the same format when they shouldn't - or tracks not switching to the other format when they should.
Removed stray }
Adds musicpref to console and sound options menu, which allows users to select whether to prioritize MIDI or Digital music.
Functions GameMIDIMusic_OnChange and GameDigiMusic_OnChange updated to not assume digital music priority, and to have more consistent behavior between the two.
Positive side effect of using P_RestoreMusic in these functions means that powerup music (speed shoes, invincibility) will restore in the correct position when reenabling the original MusicType they loaded in with.
(oddly enough, this actually revealed some secret file dependencies previously included via r_things.h! I also needed to include d_player.h in r_skins.h itself it seems)
The extra argument is the music name, as passed into
P_PlayJingleMusic(player, musname), to run the hook for, optional.
Arguments are (player, musname) - the latter to allow global hooks
that still differentiate between different tracks.
https://cdn.discordapp.com/attachments/405336003239477249/641295998395613224/srb20042.gif
* Port MUSICDEFs from Kart.
* Safe to modify without modifying game, so we can put it in music.dta eventually.
* "Title", "AltTitle", "Authors" fields are self-evident.
* "Soundtestpage" and "Soundtestcond" are used to determine which sound test unlockable can play them (set with Unlockable's variable, just like Level Select).
* "Stoppingtime" and "BPM" both accept floats, and are used for presentation stuff on the sound test.
* Ironically, we don't share a single field name with them. Such is the case of differing foci, though, and I expect they'll change their implementation to match (since this is necessary for a sound test).
* Change how S_AddSoundFx works to avoid iterating through all of them, and to allow cv_soundtest to only scroll through defined slots (instead of the infinite wall of thok sounds when scrolling to the left).
* Change V_DrawFixedPatch to allow scaling on two seperate axes.
* Now called "V_DrawStretchyFixedPatch".
* "V_DrawFixedPatch" is a macro to V_DrawStretchyFixedPatch now (same scale on both axes).
* Available to Lua under v.drawStretched!
* Even works in GL!
* Bugfix: Add SR_PLAYER to SOC's menutypes_list.
Stay tuned for the merge request, where I put the onus on the Music Team to finish this off...