Skip to content

Instantly share code, notes, and snippets.

@godwhoa
Created June 2, 2016 09:32
Show Gist options
  • Save godwhoa/1173f5a374cf324ad1a7be408be4d0af to your computer and use it in GitHub Desktop.
Save godwhoa/1173f5a374cf324ad1a7be408be4d0af to your computer and use it in GitHub Desktop.
diff --git a/src/TileLayer.lua b/src/TileLayer.lua
index ecc40b2..f54836b 100644
--- a/src/TileLayer.lua
+++ b/src/TileLayer.lua
@@ -223,7 +223,7 @@ function TileLayer:draw(x,y)
local tile_iterator = self:_getTileIterator()
for _,batch in pairs(self._batches) do
- batch:bind()
+ batch:flush()
batch:clear()
end
@@ -239,7 +239,7 @@ function TileLayer:draw(x,y)
batch = love.graphics.newSpriteBatch(tile.tileset.image,size)
self._batches[tileset] = batch
- batch:bind()
+ batch:flush()
end
local x2,y2,dx,dy,angle,sx,sy,ox2,oy2 = self:_getDrawParameters(tx,ty,tile)
@@ -251,7 +251,7 @@ function TileLayer:draw(x,y)
end
for tileset,batch in pairs(self._batches) do
- if unbind then batch:unbind() end
+ if unbind then batch:flush() end
love.graphics.draw(batch, x,y, nil,nil,nil,
-self.ox-tileset.offsetX, -self.oy-tileset.offsetY)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment