背景系统微调,初始强制加载none背景

This commit is contained in:
MrZ626
2020-11-12 00:47:12 +08:00
parent 18b7448da8
commit 55414b061c
3 changed files with 11 additions and 12 deletions

View File

@@ -1,10 +1,16 @@
local BGlist={} local BGlist={
none={
draw=function()
love.graphics.clear(.15,.15,.15)
end
}
}
local BG={ local BG={
cur="", cur="none",
init=nil, init=nil,
resize=nil, resize=nil,
update=NULL, update=NULL,
draw=NULL, draw=BGlist.none.draw,
event=nil, event=nil,
discard=NULL, discard=NULL,
} }
@@ -17,8 +23,8 @@ function BG.send(...)
BG.event(...) BG.event(...)
end end
end end
function BG.set(background,force) function BG.set(background)
if background==BG.cur or not(SETTING.bg or force)then return end if background==BG.cur or not SETTING.bg then return end
BG.discard() BG.discard()
background=BGlist[background] background=BGlist[background]
if not background then if not background then

View File

@@ -477,7 +477,6 @@ function love.run()
else else
SCN.init("load") SCN.init("load")
end end
BG.set("none",true)
return function() return function()
local _ local _

View File

@@ -1,6 +0,0 @@
local gc=love.graphics
local back={}
function back.draw()
gc.clear(.15,.15,.15)
end
return back