优化几个unpack调用
This commit is contained in:
@@ -137,7 +137,8 @@ function SCN.swapTo(tar,style)--Parallel scene swapping, cannot back
|
|||||||
SCN.swapping=true
|
SCN.swapping=true
|
||||||
local S=SCN.stat
|
local S=SCN.stat
|
||||||
S.tar,S.style=tar,style
|
S.tar,S.style=tar,style
|
||||||
S.time,S.mid,S.draw=unpack(swap[style])
|
local s=swap[style]
|
||||||
|
S.time,S.mid,S.draw=s[1],s[2],s[3]
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
LOG.print("No Scene: "..tar,"warn")
|
LOG.print("No Scene: "..tar,"warn")
|
||||||
|
|||||||
@@ -141,7 +141,8 @@ end
|
|||||||
function button:draw()
|
function button:draw()
|
||||||
local x,y,w,h=self.x,self.y,self.w,self.h
|
local x,y,w,h=self.x,self.y,self.w,self.h
|
||||||
local ATV=self.ATV
|
local ATV=self.ATV
|
||||||
local r,g,b=unpack(self.color)
|
local c=self.color
|
||||||
|
local r,g,b=c[1],c[2],c[3]
|
||||||
gc.setColor(.2+r*.8,.2+g*.8,.2+b*.8,.7)
|
gc.setColor(.2+r*.8,.2+g*.8,.2+b*.8,.7)
|
||||||
gc.rectangle("fill",x-ATV,y-ATV,w+2*ATV,h+2*ATV)
|
gc.rectangle("fill",x-ATV,y-ATV,w+2*ATV,h+2*ATV)
|
||||||
if ATV>0 then
|
if ATV>0 then
|
||||||
@@ -233,7 +234,8 @@ end
|
|||||||
function key:draw()
|
function key:draw()
|
||||||
local x,y,w,h=self.x,self.y,self.w,self.h
|
local x,y,w,h=self.x,self.y,self.w,self.h
|
||||||
local ATV=self.ATV
|
local ATV=self.ATV
|
||||||
local r,g,b=unpack(self.color)
|
local c=self.color
|
||||||
|
local r,g,b=c[1],c[2],c[3]
|
||||||
|
|
||||||
gc.setColor(1,1,1,ATV*.125)
|
gc.setColor(1,1,1,ATV*.125)
|
||||||
gc.rectangle("fill",x,y,w,h)
|
gc.rectangle("fill",x,y,w,h)
|
||||||
|
|||||||
@@ -106,8 +106,8 @@ function Player:createBeam(R,send,color)
|
|||||||
else x2,y2=R.x+308*R.size,R.y+450*R.size
|
else x2,y2=R.x+308*R.size,R.y+450*R.size
|
||||||
end
|
end
|
||||||
|
|
||||||
local r,g,b=unpack(minoColor[color])
|
local c=minoColor[color]
|
||||||
r,g,b=r*2,g*2,b*2
|
local r,g,b=c[1]*2,c[2]*2,c[3]*2
|
||||||
|
|
||||||
local a=GAME.modeEnv.royaleMode and not(self.type=="human"or R.type=="human")and .2 or 1
|
local a=GAME.modeEnv.royaleMode and not(self.type=="human"or R.type=="human")and .2 or 1
|
||||||
SYSFX.newAttack(1-SETTING.atkFX*.1,x1,y1,x2,y2,int(send^.7*(4+SETTING.atkFX)),r,g,b,a*(SETTING.atkFX+2)*.0626)
|
SYSFX.newAttack(1-SETTING.atkFX*.1,x1,y1,x2,y2,int(send^.7*(4+SETTING.atkFX)),r,g,b,a*(SETTING.atkFX+2)*.0626)
|
||||||
|
|||||||
@@ -76,7 +76,8 @@ local function merge()
|
|||||||
local connected={{cy,cx}}
|
local connected={{cy,cx}}
|
||||||
local count=1
|
local count=1
|
||||||
repeat
|
repeat
|
||||||
local y,x=unpack(rem(connected))
|
local c=rem(connected)
|
||||||
|
local y,x=c[1],c[2]
|
||||||
if board[y][x]~=0 then
|
if board[y][x]~=0 then
|
||||||
board[y][x]=0
|
board[y][x]=0
|
||||||
SYSFX.newShade(2,320+x*128-128,40+y*128-128,128,128)
|
SYSFX.newShade(2,320+x*128-128,40+y*128-128,128,128)
|
||||||
|
|||||||
Reference in New Issue
Block a user