Skip to content

Commit

Permalink
更新加载的fmod bank文件名
Browse files Browse the repository at this point in the history
  • Loading branch information
MrZ626 committed Apr 21, 2024
1 parent 1bc3cb3 commit d8aa4aa
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -219,23 +219,28 @@ function FMODLoadFunc() -- Will be called again when applying advanced options
if not FMOD.loadBank(love.filesystem.getSaveDirectory().."/soundbank/Master.strings.bank") then
MSG.new('warn',"Strings bank file load failed")
end
if not FMOD.loadBank(love.filesystem.getSaveDirectory().."/soundbank/Master.bank") then
MSG.new('warn',"Master bank file load failed")
end
FMOD.registerMusic((function()
if not love.filesystem.getInfo("soundbank/Master.bank") then
MSG.new('warn',"Music bank not found")
return {}
end
local bankMusic=FMOD.loadBank(love.filesystem.getSaveDirectory().."/soundbank/Master.bank")
if not bankMusic then
MSG.new('warn',"Music bank file load failed")
return {}
end
local L={}
for _,bankName in next,{"Music_Beepbox","Music_FL","Music_Community","Music_Extra"} do
local bankMusic=FMOD.loadBank(love.filesystem.getSaveDirectory().."/soundbank/"..bankName..".bank")
if not bankMusic then
MSG.new('warn',"bank "..bankName.." load failed")
else
local l,c=bankMusic:getEventList(bankMusic:getEventCount())
for i=1,c do
local path=l[i-1]:getPath()
if path then
local name=path:match("/([^/]+)$"):lower()
L[name]=path
end
end
end
end
return L
Expand Down Expand Up @@ -275,7 +280,7 @@ SFX[('play')]=function(name,vol,pos,tune)
tune=tune,
})
end
DEBUG.checkLoadTime("Load Zenitha resources and things relevant to Fmod")
DEBUG.checkLoadTime("Config Zenitha and Fmod")
--------------------------------------------------------------
-- Load saving data
TABLE.coverR(FILE.load('conf/settings','-json -canskip') or {},SETTINGS)
Expand Down

0 comments on commit d8aa4aa

Please sign in to comment.