P10.2: SFX bank over System Sound Services (sx / iOS)
Refactor GameAudio from the single clear cue into a full bank: load swap, match, combo1..combo5, win, lose once at startup, each into its own SystemSoundID via load_system_sound. Expose per-event play methods (play_swap/play_match/play_cascade/play_win/play_lose), each a single AudioServicesPlaySystemSound. play_cascade selects the ascending clip by clamping cascade depth through the pure, OS-agnostic cascade_cue_index (depth<=1 -> combo1, depth>=5 -> combo5) so P10.4 can snapshot it headlessly. Layer stays purely additive and inline-if-OS==.ios guarded; the clear trigger is migrated to sfx_cascade(mv.rounds.len) at its board_view call site, with sfx_swap/match/win/lose shims staged for P10.3 wiring. No framework added beyond the already-linked AudioToolbox/CoreFoundation (build.sx untouched).
This commit is contained in:
8
main.sx
8
main.sx
@@ -285,10 +285,10 @@ main :: () -> void {
|
||||
g_motion = xx context.allocator.alloc(size_of(GemMotion));
|
||||
g_motion.init();
|
||||
|
||||
// SFX (P8.1). Loads the one System Sound Services cue once; board_view
|
||||
// plays it when a swap clears a match. Purely additive — never touches
|
||||
// score/board/move state. On iOS the platform has already chdir'd to the
|
||||
// bundle, so the cue's relative path resolves. No-op off iOS.
|
||||
// SFX (P10.2). Loads the System Sound Services cue bank once; board_view
|
||||
// plays a cue per event. Purely additive — never touches score/board/move
|
||||
// state. On iOS the platform has already chdir'd to the bundle, so each
|
||||
// cue's relative path resolves. No-op off iOS.
|
||||
g_audio = xx context.allocator.alloc(size_of(GameAudio));
|
||||
memset(xx g_audio, 0, size_of(GameAudio));
|
||||
g_audio.init();
|
||||
|
||||
Reference in New Issue
Block a user