From 8e1c53b1e7a583202fe3c5e19af20096949e28f8 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Thu, 10 Dec 2020 13:18:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E5=AA=92=E4=BD=93=E5=BA=93=E5=86=8D?= =?UTF-8?q?=E5=AE=8C=E5=96=84=EF=BC=8C=E6=9C=AA=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E6=97=B6=E8=B0=83=E7=94=A8=E4=B8=8D=E4=BC=9A=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/bgm.lua | 5 +++++ Zframework/image.lua | 6 ++++-- Zframework/init.lua | 2 +- Zframework/sfx.lua | 8 +++++++- Zframework/voice.lua | 14 ++++++++++---- 5 files changed, 27 insertions(+), 8 deletions(-) diff --git a/Zframework/bgm.lua b/Zframework/bgm.lua index f69a3f04..d73316ff 100644 --- a/Zframework/bgm.lua +++ b/Zframework/bgm.lua @@ -1,4 +1,9 @@ local BGM={ + getList={}, + getCount=function()return 0 end, + play=NULL, + freshVolume=NULL, + stop=NULL, --nowPlay=[str:playing ID] --playing=[src:playing SRC] } diff --git a/Zframework/image.lua b/Zframework/image.lua index 38100668..2ff300c9 100644 --- a/Zframework/image.lua +++ b/Zframework/image.lua @@ -8,11 +8,13 @@ function IMG.init(list) end function IMG.getCount()return count end - IMG.loadOne=coroutine.wrap(function() + IMG.loadOne=coroutine.wrap(function(skip) IMG.loadAll=nil for k,v in next,list do IMG[k]=love.graphics.newImage("media/image/"..v) - coroutine.yield() + if not skip and i~=count then + coroutine.yield() + end end IMG.loadOne=nil end) diff --git a/Zframework/init.lua b/Zframework/init.lua index a77c7ca7..a885d16d 100644 --- a/Zframework/init.lua +++ b/Zframework/init.lua @@ -531,7 +531,7 @@ function love.run() gc.print("Memory:"..gcinfo(),SCR.safeX+5,_-40) gc.print("Lines:"..FREEROW.getCount(),SCR.safeX+5,_-60) gc.print("Cursor:"..int(mx+.5).." "..int(my+.5),SCR.safeX+5,_-80) - gc.print("Voices:"..VOC.getCount(),SCR.safeX+5,_-100) + gc.print("Voices:"..VOC.getQueueCount(),SCR.safeX+5,_-100) gc.print("Tasks:"..TASK.getCount(),SCR.safeX+5,_-120) ins(frameTimeList,1,dt)rem(frameTimeList,126) gc.setColor(1,1,1,.3) diff --git a/Zframework/sfx.lua b/Zframework/sfx.lua index 8030d560..1b9327ec 100644 --- a/Zframework/sfx.lua +++ b/Zframework/sfx.lua @@ -1,4 +1,10 @@ -local SFX={} +local SFX={ + getCount=function()return 0 end, + fieldPlay=NULL, + play=NULL, + fplay=NULL, + reset=NULL, +} function SFX.init(list) SFX.init=nil local rem=table.remove diff --git a/Zframework/voice.lua b/Zframework/voice.lua index a3832144..718649be 100644 --- a/Zframework/voice.lua +++ b/Zframework/voice.lua @@ -1,4 +1,10 @@ -local VOC={} +local VOC={ + getCount=function()return 0 end, + getQueueCount=NULL, + getFreeChannel=NULL, + play=NULL, + update=NULL, +} function VOC.init(list) VOC.init=nil @@ -52,6 +58,9 @@ function VOC.init(list) end VOC.loadOne=nil + function VOC.getQueueCount() + return #voiceQueue + end function VOC.getFreeChannel() local l=#voiceQueue for i=1,l do @@ -60,9 +69,6 @@ function VOC.init(list) voiceQueue[l+1]={s=0} return l+1 end - function VOC.getCount() - return #voiceQueue - end function VOC.play(s,chn) if SETTING.voc>0 then