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
|
ProfOn = true
|
||||||
drawRect = true
|
drawRect = true
|
||||||
local Prof = Profiler:new()
|
local Prof = Profiler:new()
|
||||||
function iterateSmall()
|
function iterateSmall()
|
||||||
for i=1,1000 do
|
for i=1,1000 do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function iterateLarge()
|
function iterateLarge()
|
||||||
for i=1,100000 do
|
for i=1,100000 do
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function drawRectangles()
|
function drawRectangles()
|
||||||
for i=1,100 do
|
for i=1,100 do
|
||||||
love.graphics.setColor(255,0,0)
|
love.graphics.setColor(255,0,0)
|
||||||
love.graphics.rectangle("line",i,i,i,i)
|
love.graphics.rectangle("line",i,i,i,i)
|
||||||
love.graphics.setColor(255,255,255)
|
love.graphics.setColor(255,255,255)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function love.load()
|
function love.load()
|
||||||
end
|
end
|
||||||
function love.draw()
|
function love.draw()
|
||||||
if drawRect then
|
if drawRect then
|
||||||
drawRectangles()
|
drawRectangles()
|
||||||
Prof:detach()
|
Prof:detach()
|
||||||
end
|
end
|
||||||
if ProfOn then
|
if ProfOn then
|
||||||
Prof:draw({50})
|
Prof:draw({50})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function love.update(dt)
|
function love.update(dt)
|
||||||
Prof:attach()
|
Prof:attach()
|
||||||
iterateSmall()
|
iterateSmall()
|
||||||
iterateLarge()
|
iterateLarge()
|
||||||
if drawRect then
|
if drawRect then
|
||||||
Prof:detach(true)
|
Prof:detach(true)
|
||||||
else
|
else
|
||||||
Prof:detach()
|
Prof:detach()
|
||||||
end
|
end
|
||||||
local data = Prof:unpack()
|
local data = Prof:unpack()
|
||||||
end
|
end
|
||||||
function love.keypressed(key)
|
function love.keypressed(key)
|
||||||
if key == "esc" then
|
if key == "esc" then
|
||||||
ProfOn = not ProfOn
|
ProfOn = not ProfOn
|
||||||
elseif key == ";" then
|
elseif key == ";" then
|
||||||
drawRect = not drawRect
|
drawRect = not drawRect
|
||||||
end
|
end
|
||||||
Prof:keypressed(key)
|
Prof:keypressed(key)
|
||||||
end
|
end
|
||||||
function love.mousepressed(...)
|
function love.mousepressed(...)
|
||||||
Prof:mousepressed(...)
|
Prof:mousepressed(...)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user