整理代码,大规模整理(展开)使用次数不多的局部变量名
框架跟进
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
local gc=love.graphics
|
||||
local function C(x,y)
|
||||
local canvas=gc.newCanvas(x,y)
|
||||
gc.setCanvas(canvas)
|
||||
local canvas=GC.newCanvas(x,y)
|
||||
GC.setCanvas(canvas)
|
||||
return canvas
|
||||
end
|
||||
|
||||
@@ -23,35 +22,35 @@ end
|
||||
function SKIN.getList()return skinList end
|
||||
|
||||
local skinMeta={__index=function(self,name)
|
||||
gc.push()
|
||||
gc.origin()
|
||||
gc.setDefaultFilter('nearest','nearest')
|
||||
GC.push()
|
||||
GC.origin()
|
||||
GC.setDefaultFilter('nearest','nearest')
|
||||
local I
|
||||
local N=Skins[name]
|
||||
if N and love.filesystem.getInfo(N)then
|
||||
I=gc.newImage(N)
|
||||
I=GC.newImage(N)
|
||||
else
|
||||
MES.new('warn',"[no skin] "..name)
|
||||
end
|
||||
|
||||
SKIN.lib[name],SKIN.libMini[name]={},{}
|
||||
gc.setColor(1,1,1)
|
||||
GC.setColor(1,1,1)
|
||||
for y=0,2 do
|
||||
for x=1,8 do
|
||||
SKIN.lib[name][8*y+x]=C(30,30)
|
||||
if I then
|
||||
gc.draw(I,30-30*x,-30*y)
|
||||
GC.draw(I,30-30*x,-30*y)
|
||||
end
|
||||
|
||||
SKIN.libMini[name][8*y+x]=C(6,6)
|
||||
if I then
|
||||
gc.draw(I,6-6*x,-6*y,nil,.2)
|
||||
GC.draw(I,6-6*x,-6*y,nil,.2)
|
||||
end
|
||||
end
|
||||
end
|
||||
gc.setDefaultFilter('linear','linear')
|
||||
gc.setCanvas()
|
||||
gc.pop()
|
||||
GC.setDefaultFilter('linear','linear')
|
||||
GC.setCanvas()
|
||||
GC.pop()
|
||||
return self[name]
|
||||
end}
|
||||
setmetatable(SKIN.lib,skinMeta)
|
||||
|
||||
Reference in New Issue
Block a user