Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force GPU to always render if on hud #22

Merged
merged 2 commits into from
Nov 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lua/entities/gmod_wire_gpu/cl_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

-- Fetch all monitors
local count = um:ReadShort()
for i=1,count do

Check warning on line 35 in lua/entities/gmod_wire_gpu/cl_init.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator
Monitors[gpuIdx][i] = um:ReadLong()
end

Expand Down Expand Up @@ -101,7 +101,7 @@

-- Draw outlines in chip mode
local tempDrawOutline = self.DrawEntityOutline
self.DrawEntityOutline = function(self) if self.ChipType ~= 0 then tempDrawOutline(self) end end

Check warning on line 104 in lua/entities/gmod_wire_gpu/cl_init.lua

View workflow job for this annotation

GitHub Actions / lint

"Shadowing"

Variable 'self' shadows existing binding, defined at line 67, column 10
end

-- Assert that sprite buffer exists and is available for any operations on it
Expand Down Expand Up @@ -133,8 +133,8 @@
self.VM.Memory[65527] = math.Clamp(self.VM.Memory[65527],1,1200000)

-- Calculate timing
Cycles = math.max(1,math.floor(self.VM.Memory[65527]*self.DeltaTime*0.5))

Check warning on line 136 in lua/entities/gmod_wire_gpu/cl_init.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator

Check warning on line 136 in lua/entities/gmod_wire_gpu/cl_init.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator
self.VM.TimerDT = self.DeltaTime/Cycles

Check warning on line 137 in lua/entities/gmod_wire_gpu/cl_init.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator
self.VM.TIMER = self.CurrentTime
self.VM.ASYNC = 1
else
Expand Down Expand Up @@ -194,7 +194,7 @@
if self.VM.VertexMode == 0 then self.VM.RenderEnable = 0 end
else
-- Remember screen RT if this is the first switch
local noRT = true

Check warning on line 197 in lua/entities/gmod_wire_gpu/cl_init.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: noRT
if not self.ScreenRTSet then
self.ScreenRT = render.GetRenderTarget()
self.ScreenRTWidth = ScrW()
Expand Down Expand Up @@ -287,11 +287,11 @@
local ply = LocalPlayer()
local trace = ply:GetEyeTraceNoCursor()
if (trace.Entity and trace.Entity:IsValid() and trace.Entity == self) then
local dist = trace.Normal:Dot(trace.HitNormal)*trace.Fraction*(-16384)

Check warning on line 290 in lua/entities/gmod_wire_gpu/cl_init.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace after ')'

Check warning on line 290 in lua/entities/gmod_wire_gpu/cl_init.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator
dist = math.max(dist, trace.Fraction*16384-self:BoundingRadius())

Check warning on line 291 in lua/entities/gmod_wire_gpu/cl_init.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator

if (dist < 256) then
local pos = WorldToLocal( trace.HitPos, Angle(), pos, ang )

Check warning on line 294 in lua/entities/gmod_wire_gpu/cl_init.lua

View workflow job for this annotation

GitHub Actions / lint

"Shadowing"

Variable 'pos' shadows existing binding, defined at line 285, column 25
local x = 0.5+pos.x/(monitor.RS*(1024/monitor.RatioX))
local y = 0.5-pos.y/(monitor.RS*1024)

Expand Down Expand Up @@ -440,6 +440,7 @@
local screenWidth = ScrW()
local screenHeight = ScrH()

videoGPU:Draw()
videoGPU:RenderVertex(screenWidth,screenHeight)
end
end
Expand Down
Loading