if there are over 150 segments, don't show any of them because it will cause laaaaaaaaag

This commit is contained in:
AJ Kelly
2012-01-07 17:19:11 -06:00
parent c78efe387f
commit dcf0155fa3
@@ -1,3 +1,5 @@
local maxSegments = 150
local function CreateSegments(Player)
local t = Def.ActorFrame { };
local bars = Def.ActorFrame{ };
@@ -36,6 +38,12 @@ local function CreateSegments(Player)
local scrolls = timingData:GetScrolls();
local speeds = timingData:GetSpeeds();
-- we don't want too many segments to be shown.
local sumSegments = bpms + stops + delays + warps + fakes + scrolls + speeds
if sumSegments > maxSegments then
return Def.ActorFrame{}
end
local function CreateLine(beat, secs, firstShadow, firstDiffuse, secondShadow, firstEffect, secondEffect)
local beatTime = timingData:GetElapsedTimeFromBeat(beat);
if beatTime < 0 then beatTime = 0; end;