more optimizations: move port states into gates, inline net queue checks
This commit is contained in:
@@ -81,9 +81,15 @@ function GateDefinition.constructgate(def, objref, position, rotation)
|
||||
pos[1] = -pos[2]
|
||||
pos[2] = x
|
||||
end
|
||||
|
||||
Gate.addport(gate, Port.new(type, dir, {position[1]+pos[1], position[2]+pos[2], position[3]+pos[3]}, portd.causeupdate, i))
|
||||
|
||||
local port = Port.new(type, dir, {position[1]+pos[1], position[2]+pos[2], position[3]+pos[3]}, portd.causeupdate, i, gate)
|
||||
|
||||
gate.ports[port.idx] = port
|
||||
--gate[port.idx*2] = nil
|
||||
--gate[port.idx*2+1] = 0
|
||||
gate.port_nets[port.idx] = nil
|
||||
gate.port_states[port.idx] = 0
|
||||
end
|
||||
|
||||
|
||||
return gate
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user