trying to get coverage analysis to reasonable time
This commit is contained in:
@@ -194,11 +194,29 @@ function profile.draw()
|
||||
love.graphics.print("Press - to remove 10 animated elements", 10, love.graphics.getHeight() - 45)
|
||||
end
|
||||
|
||||
function profile.keypressed(key)
|
||||
function profile.keypressed(key, profiler)
|
||||
if key == "=" or key == "+" then
|
||||
-- Create snapshot before changing animation count
|
||||
if profiler then
|
||||
local label = string.format("%d animations", profile.animationCount)
|
||||
profiler:createSnapshot(label, {
|
||||
animationCount = profile.animationCount,
|
||||
activeAnimations = #profile.animations
|
||||
})
|
||||
end
|
||||
|
||||
profile.animationCount = math.min(profile.maxAnimations, profile.animationCount + 10)
|
||||
profile.buildLayout()
|
||||
elseif key == "-" or key == "_" then
|
||||
-- Create snapshot before changing animation count
|
||||
if profiler then
|
||||
local label = string.format("%d animations", profile.animationCount)
|
||||
profiler:createSnapshot(label, {
|
||||
animationCount = profile.animationCount,
|
||||
activeAnimations = #profile.animations
|
||||
})
|
||||
end
|
||||
|
||||
profile.animationCount = math.max(profile.minAnimations, profile.animationCount - 10)
|
||||
profile.buildLayout()
|
||||
end
|
||||
|
||||
@@ -127,11 +127,29 @@ function profile.draw()
|
||||
love.graphics.print("Press - to remove 50 elements", 10, love.graphics.getHeight() - 45)
|
||||
end
|
||||
|
||||
function profile.keypressed(key)
|
||||
function profile.keypressed(key, profiler)
|
||||
if key == "=" or key == "+" then
|
||||
-- Create snapshot before changing element count
|
||||
if profiler then
|
||||
local label = string.format("%d elements", profile.elementCount)
|
||||
profiler:createSnapshot(label, {
|
||||
elementCount = profile.elementCount,
|
||||
nestingDepth = profile.nestingDepth
|
||||
})
|
||||
end
|
||||
|
||||
profile.elementCount = math.min(profile.maxElements, profile.elementCount + 50)
|
||||
profile.buildLayout()
|
||||
elseif key == "-" or key == "_" then
|
||||
-- Create snapshot before changing element count
|
||||
if profiler then
|
||||
local label = string.format("%d elements", profile.elementCount)
|
||||
profiler:createSnapshot(label, {
|
||||
elementCount = profile.elementCount,
|
||||
nestingDepth = profile.nestingDepth
|
||||
})
|
||||
end
|
||||
|
||||
profile.elementCount = math.max(10, profile.elementCount - 50)
|
||||
profile.buildLayout()
|
||||
end
|
||||
|
||||
@@ -152,11 +152,41 @@ function profile.draw()
|
||||
love.graphics.print("Press R/T/L to toggle features", 10, love.graphics.getHeight() - 50)
|
||||
end
|
||||
|
||||
function profile.keypressed(key)
|
||||
function profile.keypressed(key, profiler)
|
||||
if key == "=" or key == "+" then
|
||||
-- Create snapshot before changing element count
|
||||
if profiler then
|
||||
local label = string.format("%d elements (R:%s T:%s L:%s)",
|
||||
profile.elementCount,
|
||||
profile.showRounded and "on" or "off",
|
||||
profile.showText and "on" or "off",
|
||||
profile.showLayering and "on" or "off")
|
||||
profiler:createSnapshot(label, {
|
||||
elementCount = profile.elementCount,
|
||||
showRounded = profile.showRounded,
|
||||
showText = profile.showText,
|
||||
showLayering = profile.showLayering
|
||||
})
|
||||
end
|
||||
|
||||
profile.elementCount = math.min(profile.maxElements, profile.elementCount + 50)
|
||||
profile.buildLayout()
|
||||
elseif key == "-" or key == "_" then
|
||||
-- Create snapshot before changing element count
|
||||
if profiler then
|
||||
local label = string.format("%d elements (R:%s T:%s L:%s)",
|
||||
profile.elementCount,
|
||||
profile.showRounded and "on" or "off",
|
||||
profile.showText and "on" or "off",
|
||||
profile.showLayering and "on" or "off")
|
||||
profiler:createSnapshot(label, {
|
||||
elementCount = profile.elementCount,
|
||||
showRounded = profile.showRounded,
|
||||
showText = profile.showText,
|
||||
showLayering = profile.showLayering
|
||||
})
|
||||
end
|
||||
|
||||
profile.elementCount = math.max(profile.minElements, profile.elementCount - 50)
|
||||
profile.buildLayout()
|
||||
elseif key == "r" then
|
||||
|
||||
Reference in New Issue
Block a user