CLOSES #1367, CLOSES #1585, CLOSES #1611, CLOSES #1612, CLOSES #1636, CLOSES #1638, CLOSES #1641

This commit is contained in:
bryanthaboi
2026-08-21 07:14:24 -04:00
parent c11c762f15
commit 8c0d0ace4d
15 changed files with 174 additions and 52 deletions
+8
View File
@@ -154,8 +154,14 @@ local function newSfxSource(data, key, def, pitch, tempo, plain)
return newFileSource(def)
end
local function deviceSuspended()
local ChipAudio = package.loaded["src.core.ChipAudio"]
return ChipAudio ~= nil and ChipAudio.isSuspended()
end
local function playPath(data, key, def, pitch, tempo, plain)
if not love.audio or not def then return nil end
if deviceSuspended() then return nil end
local src = cache[key]
if src == false then return nil end -- known bad, already logged
if not src then
@@ -602,6 +608,7 @@ end
-- cache carries no clips (Red/Blue) or headless.
function Sound.playPikaCry(data, n)
if not love.audio then return nil end
if deviceSuspended() then return nil end
local count = data.audio and data.audio.pikaCries
if not count then return nil end
n = math.max(1, math.min(count, n or 1))
@@ -633,6 +640,7 @@ end
-- like the original's PlayCry -> WaitForSoundToFinish can poll it
function Sound.playCry(data, species, pikaClip)
if not love.audio then return nil end
if deviceSuspended() then return nil end
-- Yellow voices every Pikachu cry with the PCM clips (the chip cry is
-- never used for the species there). Which clip is a property of the
-- call site in the original -- every caller of PlayPikachuSoundClip sets