Skip to content

Commit 048b657

Browse files
committed
fixing whitespace
1 parent 3548c44 commit 048b657

File tree

8 files changed

+113
-113
lines changed

8 files changed

+113
-113
lines changed

lua/entities/gmod_wire_fpga/cl_init.lua

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ function ENT:GetWorldTipBodySize()
2525
local w,h = surface.GetTextSize(str)
2626
w_total = math.max(w_total, w)
2727
h_total = h_total + h + 10
28-
28+
2929
local str = string.format("peak cpu time: %ius", timebenchPeak * 1000000)
3030
local w,h = surface.GetTextSize(str)
3131
w_total = math.max(w_total, w)
3232
h_total = h_total + h + 10
33-
33+
3434
return w_total, h_total
3535
end
3636

@@ -149,21 +149,21 @@ function ENT:DrawInsideView()
149149
local scale = math.min(scaleX, scaleY)
150150

151151
local nodeSize = FPGANodeSize/self.ViewData.Scale * scale
152-
152+
153153
--to make sure we don't draw outside the edges
154154
render.SetScissorRect(
155-
FPGAInsideViewPosition[1] + ScrW()/2 + 1,
156-
FPGAInsideViewPosition[3] + ScrH()/2 + 1,
157-
FPGAInsideViewPosition[2] + ScrW()/2 - 1,
158-
FPGAInsideViewPosition[4] + ScrH()/2 - 1,
155+
FPGAInsideViewPosition[1] + ScrW()/2 + 1,
156+
FPGAInsideViewPosition[3] + ScrH()/2 + 1,
157+
FPGAInsideViewPosition[2] + ScrW()/2 - 1,
158+
FPGAInsideViewPosition[4] + ScrH()/2 - 1,
159159
true
160160
)
161161

162162
--edges
163163
for _, edge in pairs(self.ViewData.Edges) do
164164
surface.SetDrawColor(FPGATypeColor[edge.type])
165165
surface.DrawLine(
166-
centerX + edge.from.x * scale, centerY + edge.from.y * scale,
166+
centerX + edge.from.x * scale, centerY + edge.from.y * scale,
167167
centerX + edge.to.x * scale, centerY + edge.to.y * scale
168168
)
169169
end
@@ -230,7 +230,7 @@ function ENT:ConstructInsideView(viewData)
230230
size = node.s
231231
})
232232
end
233-
233+
234234
self.ViewData.Labels = {}
235235
if viewData.Labels then
236236
for _, label in pairs(viewData.Labels) do
@@ -268,7 +268,7 @@ net.Receive("wire_fpga_view_data", function (len)
268268

269269
local ok, data = pcall(util.Decompress, data)
270270
if not ok then return end
271-
271+
272272
ok, data = pcall(WireLib.von.deserialize, data)
273273
if ok then
274274
ent:ConstructInsideView(data)

lua/entities/gmod_wire_fpga/init.lua

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ DEFINE_BASECLASS("base_wire_entity")
66

77
--HELPERS
88
local function getGate(node)
9-
if node.type == "wire" then
9+
if node.type == "wire" then
1010
return GateActions[node.gate]
1111
elseif node.type == "fpga" then
1212
return FPGAGateActions[node.gate]
@@ -110,7 +110,7 @@ function ENT:Initialize()
110110
self:PhysicsInit(SOLID_VPHYSICS)
111111
self:SetMoveType(MOVETYPE_VPHYSICS)
112112
self:SetSolid(SOLID_VPHYSICS)
113-
113+
114114
self.Debug = false
115115

116116
self.time = 0
@@ -135,7 +135,7 @@ function ENT:Initialize()
135135

136136
self.Inputs = WireLib.CreateInputs(self, {})
137137
self.Outputs = WireLib.CreateOutputs(self, {})
138-
138+
139139
self.Gates = {}
140140
self.LastGateValues = {}
141141

@@ -165,7 +165,7 @@ function ENT:BuildDupeInfo()
165165
end
166166

167167
function ENT:Setup(data)
168-
if data then
168+
if data then
169169
-- entity was duplicated
170170
self:Upload(data)
171171
end
@@ -225,14 +225,14 @@ function ENT:SynthesizeViewData(data)
225225
if not data.Nodes then return end
226226

227227
local viewData = {}
228-
228+
229229
viewData.Nodes = {}
230230
viewData.Labels = {}
231231
viewData.Edges = {}
232232
for nodeId, node in pairs(data.Nodes) do
233233
local gate = getGate(node)
234234

235-
if not gate then
235+
if not gate then
236236
--special case, label
237237
if node.type == "editor" and node.visual == "label" then
238238
table.insert(viewData.Labels, {
@@ -331,7 +331,7 @@ function ENT:ValidateData(data)
331331
end
332332

333333
--type check
334-
if getInputType(inGate, inputNum) != getOutputType(outGate, outputNum) then
334+
if getInputType(inGate, inputNum) != getOutputType(outGate, outputNum) then
335335
return "type mismatch between input and output " .. inGate.name .. " ["..getInputType(inGate, inputNum).."]" .. " and " .. outGate.name .. " ["..getOutputType(outGate, outputNum).."]"
336336
end
337337
end
@@ -518,7 +518,7 @@ function ENT:Upload(data)
518518

519519
self.Uploaded = true
520520

521-
self:Reset()
521+
self:Reset()
522522
end
523523

524524

@@ -609,9 +609,9 @@ function ENT:Think()
609609
BaseClass.Think(self)
610610

611611
if not self.Uploaded then return end
612-
if self.CompilationError or self.ExecutionError then
612+
if self.CompilationError or self.ExecutionError then
613613
self:UpdateOverlay(false)
614-
return
614+
return
615615
end
616616
self:NextThink(CurTime())
617617

@@ -621,7 +621,7 @@ function ENT:Think()
621621
--Time benchmarking
622622
self.timebench = self.timebench * 0.98 + (self.time) * 0.02
623623
self.time = 0
624-
624+
625625
--Limiting
626626
if self.timebench > fpga_quota_avg then
627627
self:ThrowExecutionError("exceeded cpu time limit", "cpu time limit exceeded")
@@ -661,7 +661,7 @@ function ENT:Think()
661661
table.insert(nodesToRun, nodeId)
662662
end
663663
self.QueuedNodes = {}
664-
664+
665665
if #nodesToRun > 0 then self:RunProtected(nodesToRun) end
666666

667667
self:UpdateOverlay(false)
@@ -733,7 +733,7 @@ function ENT:Run(changedNodes)
733733
end
734734
for nodeId, active in pairs(activeNodes) do
735735
local gate = getGate(self.Nodes[nodeId])
736-
if active and gate.neverActive then
736+
if active and gate.neverActive then
737737
activeNodes[nodeId] = false
738738
end
739739
if gate.alwaysActive then
@@ -763,7 +763,7 @@ function ENT:Run(changedNodes)
763763
--nodesInQueue = {0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0}
764764
--nodesVisited = {}
765765

766-
if self.Debug then
766+
if self.Debug then
767767
for nodeId, node in pairs(self.Nodes) do
768768
print(nodeId .. table.ToString(node, "", false))
769769
end
@@ -783,7 +783,7 @@ function ENT:Run(changedNodes)
783783
self:ThrowExecutionError("stuck in loop for too long", "stuck in loop")
784784
return
785785
end
786-
if self.Debug then
786+
if self.Debug then
787787
print()
788788
print(table.ToString(nodeQueue, "nodeQueue", false))
789789
print(table.ToString(nodesInQueue, "nodesInQueue", false))
@@ -882,7 +882,7 @@ function ENT:Run(changedNodes)
882882
gate.postCycle(self.Gates[nodeId])
883883
local value = self:CalculateNode(node, nodeId, gate)
884884
self:Propagate(node, value)
885-
end
885+
end
886886

887887
--keep track of time spent this tick
888888
self.LastExecution = bench

lua/entities/gmod_wire_fpga/shared.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ if SERVER then
119119
if not IsValid(ply) then continue end --don't know why this happens, but it does
120120

121121
if not ply:KeyDown(IN_USE) then continue end
122-
122+
123123
local ent = ply:GetEyeTrace().Entity
124-
124+
125125
if IsValid(ent) and ent:GetClass() == "gmod_wire_fpga" and ent:AllowsInsideView() and ent:GetViewData() then
126126
if not FPGAPlayerHasHash[ply] then FPGAPlayerHasHash[ply] = {} end
127127

0 commit comments

Comments
 (0)