make in_queue int tptre
This commit is contained in:
@@ -244,11 +244,11 @@ end
|
||||
function Simulation.queuegate(sim, gate)
|
||||
sim.gatequeue[sim.num_gatequeue+1] = gate
|
||||
sim.num_gatequeue = sim.num_gatequeue + 1
|
||||
gate.in_queue = 1
|
||||
gate.in_queue[0] = 1
|
||||
end
|
||||
|
||||
function Simulation.queuegate_safe(sim, gate)
|
||||
if gate.in_queue==0 then
|
||||
if gate.in_queue[0]==0 then
|
||||
Simulation.queuegate(sim, gate)
|
||||
end
|
||||
end
|
||||
@@ -277,29 +277,29 @@ end
|
||||
function Simulation.queuegroup(sim, group)
|
||||
sim.groupqueue[sim.num_groupqueue+1] = group
|
||||
sim.num_groupqueue = sim.num_groupqueue + 1
|
||||
group.in_queue = 1
|
||||
group.in_queue[0] = 1
|
||||
end
|
||||
|
||||
function Simulation.queuegroup_safe(sim, group)
|
||||
if group.in_queue==0 then
|
||||
if group.in_queue[0]==0 then
|
||||
Simulation.queuegroup(sim, group)
|
||||
end
|
||||
end
|
||||
|
||||
function Simulation.dequeuegroup(sim, group)
|
||||
if group.in_queue~=0 then
|
||||
if group.in_queue[0]~=0 then
|
||||
array_remove(sim.groupqueue, group, true)
|
||||
sim.num_groupqueue = sim.num_groupqueue - 1
|
||||
group.in_queue = 0
|
||||
group.in_queue[0] = 0
|
||||
end
|
||||
sim.groupfxqueue[group] = nil
|
||||
end
|
||||
|
||||
function Simulation.dequeuegate(sim, gate)
|
||||
if gate.in_queue~=0 then
|
||||
if gate.in_queue[0]~=0 then
|
||||
array_remove(sim.gatequeue, gate, true)
|
||||
sim.num_gatequeue = sim.num_gatequeue - 1
|
||||
gate.in_queue = 0
|
||||
gate.in_queue[0] = 0
|
||||
end
|
||||
if sim.inputqueue~=nil then sim.inputqueue[gate] = nil end
|
||||
if sim.initqueue ~=nil then sim.initqueue [gate] = nil end
|
||||
@@ -322,7 +322,7 @@ function Simulation.ticklogic(sim)
|
||||
for i = 1, sim.num_groupqueue do
|
||||
local group = sim.groupqueue[i]
|
||||
Group.update(group)
|
||||
group.in_queue = 0
|
||||
group.in_queue[0] = 0
|
||||
sim.groupqueue[i] = nil
|
||||
end
|
||||
--sim.groupqueue = {}
|
||||
@@ -330,7 +330,7 @@ function Simulation.ticklogic(sim)
|
||||
|
||||
if sim.tickqueue[sim.current_tick] ~= nil then
|
||||
for i, gate in pairs(sim.tickqueue[sim.current_tick]) do
|
||||
if gate.in_queue==0 then
|
||||
if gate.in_queue[0]==0 then
|
||||
Simulation.queuegate(sim, gate)
|
||||
end
|
||||
end
|
||||
@@ -340,7 +340,7 @@ function Simulation.ticklogic(sim)
|
||||
for i = 1, sim.num_gatequeue do
|
||||
local gate = sim.gatequeue[i]
|
||||
gate.logic(gate)
|
||||
gate.in_queue = 0
|
||||
gate.in_queue[0] = 0
|
||||
sim.gatequeue[i] = nil
|
||||
end
|
||||
--sim.gatequeue = {}
|
||||
|
||||
Reference in New Issue
Block a user