Skip to content

Commit

Permalink
Updated: Micro optimization of TOOL:DrawUCS
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdvideo1234 committed Sep 29, 2017
1 parent 0de7c60 commit 15d00e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lua/autorun/gearassembly_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ local asmlib = gearasmlib

------ CONFIGURE ASMLIB ------
asmlib.InitBase("gear","assembly")
asmlib.SetOpVar("TOOL_VERSION","5.185")
asmlib.SetOpVar("TOOL_VERSION","5.186")
asmlib.SetIndexes("V",1,2,3)
asmlib.SetIndexes("A",1,2,3)
asmlib.SetIndexes("S",4,5,6,7)
Expand Down
6 changes: 4 additions & 2 deletions lua/weapons/gmod_tool/stools/gearassembly.lua
Original file line number Diff line number Diff line change
Expand Up @@ -658,10 +658,12 @@ end
function TOOL:DrawUCS(oScreen, vOrg, aOrg, nRad, sCol, bRgh)
local Op, UCS = vOrg:ToScreen(), 15
local Xs = (vOrg + UCS * aOrg:Forward()):ToScreen()
local Ys = (vOrg + UCS * aOrg:Right()):ToScreen()
local Zs = (vOrg + UCS * aOrg:Up()):ToScreen()
oScreen:DrawLine(Op,Xs,"r","SURF")
if(bRgh) then oScreen:DrawLine(Op,Ys,"g") end
if(bRgh) then -- Do not calculate the disabled Ys
local Ys = (vOrg + UCS * aOrg:Right()):ToScreen()
oScreen:DrawLine(Op,Ys,"g")
end
oScreen:DrawLine(Op,Zs,"b")
oScreen:DrawCircle(Op,nRad,sCol,"SURF")
return Op
Expand Down

0 comments on commit 15d00e0

Please sign in to comment.