WIP: Implement musicdef structs and music pre-loading
Use the musicdef
code to keep a global list of music information AND memory-loaded music. (Thanks Sal for the original code!)
Edited by mazmazz
Merge request reports
Activity
Filter activity
Goals:
Structure
-
Port
musicdef
code from Kart -- https://git.magicalgirl.moe/KartKrew/Kart-Public/merge_requests/23 -
Grab jingle list from
musicplus-jingle
-
Add in-memory music data to
musicdef
Paradigm
-
Change sound interface paradigm to load and unload music separately from playback
- ShutdownSound: Unload all music streams in the musicdef chain?
- LoadSong: On subsequent calls to LoadSong if the musicdef already has music loaded, check if we need to reload. Store a checksum of the previous lump?
-
Expose
S_PreloadMusic(name, longevity)
andS_UnloadMusic()
method to Lua.-
longevity
means keep permanently loaded, or unload upon map change, etc. - Support "preload music" consvar by keeping a list of the requested names and their longevities. Refer to that list whenever the consvar changes.
-
-
Add "preload music" consvar and menu toggle, default on.
- Off means don't load any music into memory other than the current song.
- Add change handler: disable means unload all other songs. Enable means load the jingles and map names (see below)
Application
- Jingles are always loaded into memory
- On each map load, search for the level header's music names, as well as music names for the Change Music linedef. Preload those songs.
- When music lumps are replaced, check for current preloads. Reload the music that was replaced.
Edited by mazmazz-
Port
added 2 commits
Please register or sign in to reply