SHADER模块整理,初始化代码移至main

This commit is contained in:
MrZ626
2020-11-16 09:21:22 +08:00
parent ba486b5de7
commit f1f2eb583f
19 changed files with 55 additions and 59 deletions

View File

@@ -113,7 +113,6 @@ PLAYERS={alive={}}--Players data
CURMODE=nil--Current mode object
RANKS={sprint_10=0}
--Load modules
require("Zframework")
@@ -192,6 +191,17 @@ VOC.set{
"welcome_voc",
}
--Load shader files from SOURCE ONLY
SHADER={}
for _,v in next,love.filesystem.getDirectoryItems("parts/shaders")do
if love.filesystem.getRealDirectory("parts/shaders/"..v)~=SAVEDIR then
local name=v:sub(1,-6)
SHADER[name]=love.graphics.newShader("parts/shaders/"..name..".glsl")
else
LOG.print("Dangerous file : %SAVE%/parts/shaders/"..v)
end
end
--Load background files from SOURCE ONLY
for _,v in next,love.filesystem.getDirectoryItems("parts/backgrounds")do
if love.filesystem.getRealDirectory("parts/backgrounds/"..v)~=SAVEDIR then