几个音频模块和skin模块load附加必须先init的条件

This commit is contained in:
MrZ626
2021-07-18 23:33:45 +08:00
parent 06d34d8c55
commit 498a0ef7e8
6 changed files with 10 additions and 1 deletions

View File

@@ -2,6 +2,8 @@ local BGM={
default=false,
getList=function()error("Can't getList before initialized!")end,
getCount=function()return 0 end,
loadOne=function()error("Cannot load before init!")end,
loadAll=function()error("Cannot load before init!")end,
play=NULL,
freshVolume=NULL,
stop=NULL,

View File

@@ -1,5 +1,7 @@
local IMG={
getCount=function()return 0 end,
loadOne=function()error("Cannot load before init!")end,
loadAll=function()error("Cannot load before init!")end,
}
function IMG.init(list)
IMG.init=nil

View File

@@ -1,5 +1,7 @@
local SFX={
getCount=function()return 0 end,
loadOne=function()error("Cannot load before init!")end,
loadAll=function()error("Cannot load before init!")end,
fieldPlay=NULL,
play=NULL,
fplay=NULL,

View File

@@ -3,7 +3,6 @@ local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth
local gc_draw,gc_line=gc.draw,gc.line
local gc_rectangle,gc_circle=gc.rectangle,gc.circle
local sin,cos=math.sin,math.cos
local max,min=math.max,math.min
local rnd=math.random
local ins,rem=table.insert,table.remove

View File

@@ -1,6 +1,8 @@
local VOC={
getCount=function()return 0 end,
getQueueCount=function()return 0 end,
loadOne=function()error("Cannot load before init!")end,
loadAll=function()error("Cannot load before init!")end,
getFreeChannel=NULL,
play=NULL,
update=NULL,