You are browsing as a guest. Sign up (or log in) to start making projects!

2h 57m 57s logged

audio cleanup and persistent sounds

mostly audio , also got around to cleaning up the audio engine, added persistent sounds across scene changes, and fixed some ui stuff.

changes

audio

  • the old AudioEngine had raw ma_sound*s and a whole separate map just to keep decoders and their buffers alive. cleanup was duplicated everywhere, so i moved it all into SoundInstance with RAII. sound, decoder and VFS bytes all get cleaned up together now
  • music and sfx use the same type, stored as unique_ptr. StopMusicUnlocked went from a bunch of manual cleanup to basically m_CurrentMusic.reset()
  • PlaySound2D takes an optional persist flag. scene changes now stop normal audio, while persistent sounds keep playing until they finish
  • before this, audio just kept playing across scene switches whether you wanted it to or not. that’s fixed now w. the persistent flag

scripting and packaging

  • added IsEditor() so scripts can tell if they’re running in the editor or editor play mode (im using this for debugging stuff in the demo im working on :P )
  • PlaySound2D in ObSL accepts the new persist argument !!!
  • bumped the ObSL submodule, ( which needed a fix in the script asset analyzer )
  • packaged scripts now initialize with the correct path for imports. this was hardcoded to assets/scripts before, which doesn’t work in packaged builds

editor

  • the Project Browser has an Audio section now for .mp3 and .wav files
  • generalized the file-listing helper to accept multiple extensions, which the Scripts section uses too
  • swapped the UI Hierarchy and Registry tab order. tiny change but it’s the order i actually use…

ui

  • fixed button hit-testing for nested UI elements. Update() wasn’t accounting for the position accumulated through the element hierarchy, even though Draw() already was

the demo…

ive been working on a new demo project, most of my time has been spent just messing around in that (and is how i’ve been discovering these issues)


audio is in a much better place now… and the demo is looking pretty good….

0
35

Comments 0

No comments yet. Be the first!