Expand debug system pages and add noclip exploration

This commit is contained in:
UnixNight committed 2026-10-25 20:34:27 -04:00
1 parent b915a2c2e4
commit d7838980fd
20 files changed
+628 -47

No files matched your search

+9 -1
View File
@@ -11,6 +11,7 @@ public sealed class SdlAudio : IDisposable
private readonly bool loop;
private bool audioInitialized;
public bool Paused { get; private set; }
public bool Muted { get; private set; }
public int QueuedBytes
{
get
@@ -19,7 +20,7 @@ public sealed class SdlAudio : IDisposable
return bytes >= 0 ? bytes : throw new InvalidOperationException(Sdl.Error);
}
}
public SdlAudio(string path,bool loop=false,bool paused=false)
public SdlAudio(string path,bool loop=false,bool paused=false,bool muted=false)
{
this.loop=loop;
if(!Sdl.SDL_InitSubSystem(Sdl.InitAudio))throw new InvalidOperationException(Sdl.Error);
@@ -34,6 +35,7 @@ public sealed class SdlAudio : IDisposable
// SDL_OpenAudioDeviceStream starts paused. Keep it paused from its
// first sample when created while a debug menu has stopped playback.
Paused = true;
SetMuted(muted);
SetPaused(paused);
Console.WriteLine($"SDL3 WAV stream: {spec.Frequency} Hz, {spec.Channels} channel(s), {length} source bytes.");
}
@@ -47,6 +49,12 @@ public sealed class SdlAudio : IDisposable
if (!changed) throw new InvalidOperationException(Sdl.Error);
Paused = paused;
}
public void SetMuted(bool muted)
{
ObjectDisposedException.ThrowIf(stream == 0, this);
if (!Sdl.SDL_SetAudioStreamGain(stream, muted ? 0 : 1)) throw new InvalidOperationException(Sdl.Error);
Muted = muted;
}
private void Queue(){if(!Sdl.SDL_PutAudioStreamData(stream,data,length))throw new InvalidOperationException(Sdl.Error);}
public void Pump(){if(!Paused && loop && QueuedBytes<length)Queue();}
public void Dispose()