Skip to content

Commit

Permalink
reduce the number of vertices in the debug graphs by 75%
Browse files Browse the repository at this point in the history
fps moment
  • Loading branch information
poco0317 committed Nov 19, 2020
1 parent 901cfd9 commit 9d5f336
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions Themes/Til Death/BGAnimations/_calcdisplay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1116,9 +1116,6 @@ o[#o + 1] = LoadFont("Common Normal") .. {
local dotWidth = 0
local function setOffsetVerts(vt, x, y, c)
vt[#vt + 1] = {{x - dotWidth, y + dotWidth, 0}, c}
vt[#vt + 1] = {{x + dotWidth, y + dotWidth, 0}, c}
vt[#vt + 1] = {{x + dotWidth, y - dotWidth, 0}, c}
vt[#vt + 1] = {{x - dotWidth, y - dotWidth, 0}, c}
end

local function topGraphLine(mod, colorToUse, hand)
Expand All @@ -1139,6 +1136,9 @@ local function topGraphLine(mod, colorToUse, hand)
y = y + plotHeight / 2
setOffsetVerts(verts, x, y, color("1,1,1"))
end
if #verts <= 1 then
verts = {}
end
self:SetVertices(verts)
self:SetDrawState {Mode = "DrawMode_LineStrip", First = 1, Num = #verts}
return
Expand All @@ -1154,6 +1154,9 @@ local function topGraphLine(mod, colorToUse, hand)
setOffsetVerts(verts, x, y, colorToUse)
end

if #verts <= 1 then
verts = {}
end
self:SetVertices(verts)
self:SetDrawState {Mode = "DrawMode_LineStrip", First = 1, Num = #verts}

Expand Down Expand Up @@ -1214,6 +1217,9 @@ local function topGraphLineJackStam(mod, colorToUse, hand)
setOffsetVerts(verts, x, y, colorToUse)
end

if #verts <= 1 then
verts = {}
end
self:SetVertices(verts)
self:SetDrawState {Mode = "DrawMode_LineStrip", First = 1, Num = #verts}
else
Expand Down Expand Up @@ -1260,6 +1266,9 @@ local function bottomGraphLineMSD(mod, colorToUse, hand)
setOffsetVerts(verts, x, y, colorToUse)
end

if #verts <= 1 then
verts = {}
end
self:SetVertices(verts)
self:SetDrawState {Mode = "DrawMode_LineStrip", First = 1, Num = #verts}
else
Expand Down Expand Up @@ -1309,6 +1318,9 @@ local function bottomGraphLineJack(colorToUse, hand)
setOffsetVerts(verts, x, y, colorToUse)
end

if #verts <= 1 then
verts = {}
end
self:SetVertices(verts)
self:SetDrawState {Mode = "DrawMode_LineStrip", First = 1, Num = #verts}
else
Expand Down Expand Up @@ -1353,6 +1365,9 @@ local function bottomGraphLineSSR(lineNum, colorToUse)
setOffsetVerts(verts, x, y, colorToUse)
end

if #verts <= 1 then
verts = {}
end
self:SetVertices(verts)
self:SetDrawState {Mode = "DrawMode_LineStrip", First = 1, Num = #verts}
else
Expand Down

0 comments on commit 9d5f336

Please sign in to comment.