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
AudioEnginehad rawma_sound*s and a whole separate map just to keep decoders and their buffers alive. cleanup was duplicated everywhere, so i moved it all intoSoundInstancewith RAII. sound, decoder and VFS bytes all get cleaned up together now - music and sfx use the same type, stored as
unique_ptr.StopMusicUnlockedwent from a bunch of manual cleanup to basicallym_CurrentMusic.reset() -
PlaySound2Dtakes an optionalpersistflag. 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 ) -
PlaySound2Din 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/scriptsbefore, which doesn’t work in packaged builds
editor
- the Project Browser has an Audio section now for
.mp3and.wavfiles - 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 thoughDraw()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….
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.