Skip to content
Snippets Groups Projects

WIP: Implement musicdef structs and music pre-loading

Open mazmazz requested to merge public-musicplus-musicdef into next

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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Author Owner

    Goals:

    Structure

    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) and S_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
  • mazmazz changed the description

    changed the description

  • mazmazz added 2 commits

    added 2 commits

    • a758b2b8 - API changes to separate music stream loading from the currently playing music
    • d8708e51 - Initial support for preloaded music

    Compare with previous version

  • mazmazz added 1 commit

    added 1 commit

    • fafc53c7 - Added preload/purge logic for music

    Compare with previous version

  • mazmazz added 1 commit

    added 1 commit

    • a34cedb5 - Level music preload adjustments

    Compare with previous version

  • mazmazz added 2 commits

    added 2 commits

    • 5e6f37f8 - cv_preloadmusic toggle
    • 8dfadd5c - DBG_AUDIO message fix (pointer casting)

    Compare with previous version

  • mazmazz added 1 commit

    added 1 commit

    • a63189b0 - DBG_AUDIO message fix (pointer casting)

    Compare with previous version

Please register or sign in to reply
Loading