整理代码,增加一些注释
This commit is contained in:
@@ -379,11 +379,10 @@ function update.remote_alive(P,dt)
|
|||||||
frmStep<480 and rnd(2,3) or
|
frmStep<480 and rnd(2,3) or
|
||||||
3
|
3
|
||||||
repeat
|
repeat
|
||||||
local pos=P.streamProgress
|
local eventTime=P.stream[P.streamProgress]
|
||||||
local eventTime=P.stream[pos]
|
if eventTime then--Normal state, event forward
|
||||||
if eventTime then
|
if P.stat.frame==eventTime then--Event time, execute action, read next so don't update immediately
|
||||||
if P.stat.frame==eventTime then
|
local event=P.stream[P.streamProgress+1]
|
||||||
local event=P.stream[pos+1]
|
|
||||||
if event==0 then--Just wait
|
if event==0 then--Just wait
|
||||||
elseif event<=32 then--Press key
|
elseif event<=32 then--Press key
|
||||||
P:pressKey(event)
|
P:pressKey(event)
|
||||||
@@ -419,13 +418,13 @@ function update.remote_alive(P,dt)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
P.streamProgress=pos+2
|
P.streamProgress=P.streamProgress+2
|
||||||
else
|
else--No event now, run one frame
|
||||||
update.alive(P,dt)
|
update.alive(P,dt)
|
||||||
frmStep=frmStep-1
|
frmStep=frmStep-1
|
||||||
end
|
end
|
||||||
else
|
else--Pause state, no actions, quit loop
|
||||||
frmStep=frmStep-1
|
break
|
||||||
end
|
end
|
||||||
until frmStep<=0
|
until frmStep<=0
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user