Changed loggin to only log when enabled with logPrint function
This commit is contained in:
parent
75b7aad1e6
commit
89c12b4a0b
|
@ -87,3 +87,7 @@ function checkCPUTime(action, name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end]]
|
end]]
|
||||||
|
|
||||||
|
function logPrint(string)
|
||||||
|
if logging then print(string) end
|
||||||
|
end
|
||||||
|
|
|
@ -245,7 +245,7 @@ function GridDisplay()
|
||||||
end
|
end
|
||||||
|
|
||||||
function TileOptimizeObjects()
|
function TileOptimizeObjects()
|
||||||
print("new optimization")
|
logPrint("new optimization")
|
||||||
local unoptimized = 0
|
local unoptimized = 0
|
||||||
local isTileOptimized = {}
|
local isTileOptimized = {}
|
||||||
|
|
||||||
|
@ -280,7 +280,7 @@ function TileOptimizeObjects()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
print(n)
|
logPrint("Group size: "..n)
|
||||||
unoptimized = unoptimized + n
|
unoptimized = unoptimized + n
|
||||||
local base_x = tileProperties.scale * j * tileProperties.width + tileProperties.scale * (levelProperties.offset.x - tileProperties.height)
|
local base_x = tileProperties.scale * j * tileProperties.width + tileProperties.scale * (levelProperties.offset.x - tileProperties.height)
|
||||||
local base_y = tileProperties.scale * i * tileProperties.height + tileProperties.scale * (levelProperties.offset.y - tileProperties.height)
|
local base_y = tileProperties.scale * i * tileProperties.height + tileProperties.scale * (levelProperties.offset.y - tileProperties.height)
|
||||||
|
@ -297,7 +297,7 @@ function TileOptimizeObjects()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
print("collisions optimized from " .. unoptimized .. " to " .. #LoadedObjects.Collisions)
|
logPrint("collisions optimized from " .. unoptimized .. " to " .. #LoadedObjects.Collisions)
|
||||||
end
|
end
|
||||||
|
|
||||||
function TileCreateObjects()
|
function TileCreateObjects()
|
||||||
|
|
|
@ -59,7 +59,7 @@ function interfaceDialog:checkConfirm()
|
||||||
if love.mouse.isDown(1) then
|
if love.mouse.isDown(1) then
|
||||||
self.clicked = true
|
self.clicked = true
|
||||||
self.value = self.value + 1
|
self.value = self.value + 1
|
||||||
print(self.value.." of "..self.target_value)
|
logPrint(self.value.." of "..self.target_value)
|
||||||
self:updateContents()
|
self:updateContents()
|
||||||
end
|
end
|
||||||
elseif not love.mouse.isDown(1) then
|
elseif not love.mouse.isDown(1) then
|
||||||
|
|
4
main.lua
4
main.lua
|
@ -57,7 +57,7 @@ function love.load()
|
||||||
gravity = 0.2
|
gravity = 0.2
|
||||||
-- Debug and log stuff
|
-- Debug and log stuff
|
||||||
memoryUsage, dtcount = 0, 0
|
memoryUsage, dtcount = 0, 0
|
||||||
if logging then print("mothback: "..collectgarbage("count").." kB, Loading time: "..os.clock().." seconds") end
|
logPrint("mothback: "..collectgarbage("count").." kB, Loading time: "..os.clock().." seconds")
|
||||||
end
|
end
|
||||||
|
|
||||||
function love.update(dt)
|
function love.update(dt)
|
||||||
|
@ -81,7 +81,7 @@ function love.update(dt)
|
||||||
if debug or logging then
|
if debug or logging then
|
||||||
memoryUsage = math.floor(collectgarbage("count"))
|
memoryUsage = math.floor(collectgarbage("count"))
|
||||||
end
|
end
|
||||||
if logging then print("Second "..secs..": "..memoryUsage.." kB") end
|
logPrint("Second "..secs..": "..memoryUsage.." kB")
|
||||||
end
|
end
|
||||||
|
|
||||||
--keypressed
|
--keypressed
|
||||||
|
|
Loading…
Reference in New Issue