Skip to content

Commit

Permalink
stop getting the quad so much
Browse files Browse the repository at this point in the history
bad for memory usage
  • Loading branch information
tesselode committed Mar 11, 2019
1 parent fbe3624 commit 65e24df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cartographer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ function Layer.tilelayer:_updateAnimatedTiles()
for tileset, spriteBatch in pairs(self._spriteBatches) do
for gid, animation in pairs(tileset._animations) do
if self._animatedTiles[tileset][gid] and animation.changed then
local q = tileset:_getQuad(gid)
for _, tile in pairs(self._animatedTiles[tileset][gid]) do
local q = tileset:_getQuad(gid)
spriteBatch:set(tile.sprite, q, tile.x, tile.y)
end
end
Expand Down
5 changes: 3 additions & 2 deletions main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ end

function love.draw()
testMap:draw()
love.graphics.print(love.timer.getFPS())
end
love.graphics.print('FPS: ' .. love.timer.getFPS())
love.graphics.print('Memory: ' .. math.floor(collectgarbage 'count') .. ' kb', 0, 16)
end

0 comments on commit 65e24df

Please sign in to comment.