mirror of
https://github.com/TangentFoxy/Piefiller.git
synced 2024-11-19 17:14:23 +00:00
main.lua had stupid amounts of whitespace too
This commit is contained in:
parent
54b5dbd295
commit
0249a09bec
44
main.lua
44
main.lua
@ -1,53 +1,53 @@
|
||||
Profiler = require("piefiller")
|
||||
Profiler = require("piefiller")
|
||||
ProfOn = true
|
||||
drawRect = true
|
||||
drawRect = true
|
||||
local Prof = Profiler:new()
|
||||
function iterateSmall()
|
||||
for i=1,1000 do
|
||||
end
|
||||
for i=1,1000 do
|
||||
end
|
||||
end
|
||||
function iterateLarge()
|
||||
for i=1,100000 do
|
||||
|
||||
end
|
||||
for i=1,100000 do
|
||||
|
||||
end
|
||||
end
|
||||
function drawRectangles()
|
||||
for i=1,100 do
|
||||
for i=1,100 do
|
||||
love.graphics.setColor(255,0,0)
|
||||
love.graphics.rectangle("line",i,i,i,i)
|
||||
love.graphics.setColor(255,255,255)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
function love.load()
|
||||
end
|
||||
function love.draw()
|
||||
if drawRect then
|
||||
if drawRect then
|
||||
drawRectangles()
|
||||
Prof:detach()
|
||||
end
|
||||
if ProfOn then
|
||||
end
|
||||
if ProfOn then
|
||||
Prof:draw({50})
|
||||
end
|
||||
end
|
||||
end
|
||||
function love.update(dt)
|
||||
Prof:attach()
|
||||
iterateSmall()
|
||||
iterateLarge()
|
||||
if drawRect then
|
||||
if drawRect then
|
||||
Prof:detach(true)
|
||||
else
|
||||
else
|
||||
Prof:detach()
|
||||
end
|
||||
end
|
||||
local data = Prof:unpack()
|
||||
end
|
||||
function love.keypressed(key)
|
||||
if key == "esc" then
|
||||
if key == "esc" then
|
||||
ProfOn = not ProfOn
|
||||
elseif key == ";" then
|
||||
drawRect = not drawRect
|
||||
end
|
||||
elseif key == ";" then
|
||||
drawRect = not drawRect
|
||||
end
|
||||
Prof:keypressed(key)
|
||||
end
|
||||
function love.mousepressed(...)
|
||||
Prof:mousepressed(...)
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user