From cde334985274c57a2a8b4b2dda9ca6662342c598 Mon Sep 17 00:00:00 2001 From: Tim Anema Date: Tue, 7 Oct 2014 09:49:56 -0400 Subject: [PATCH] fixed translation problem after postshader changes --- lib/light_world.lua | 4 ++-- lib/postshader.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/light_world.lua b/lib/light_world.lua index 57e088c..956fa7b 100644 --- a/lib/light_world.lua +++ b/lib/light_world.lua @@ -249,7 +249,7 @@ function light_world:draw(l,t,w,h,s) love.graphics.push() love.graphics.scale(1/s) - sl, st, sw, sh = (l*s), (t*s), (w*s), (h*s) + local sl, st, sw, sh = (l*s), (t*s), (w*s), (h*s) self.drawBackground( sl,st,sw,sh,s) self:drawShadow( sl,st,sw,sh,s) self.drawForground( sl,st,sw,sh,s) @@ -260,7 +260,7 @@ function light_world:draw(l,t,w,h,s) self:drawReflection( sl,st,sw,sh,s) love.graphics.pop() - self.post_shader:drawWith(self.render_buffer) + self.post_shader:drawWith(self.render_buffer, l, t) end -- draw shadow diff --git a/lib/postshader.lua b/lib/postshader.lua index d135962..0d28133 100644 --- a/lib/postshader.lua +++ b/lib/postshader.lua @@ -64,7 +64,7 @@ function post_shader:toggleEffect(shaderName, ...) end end -function post_shader:drawWith(canvas) +function post_shader:drawWith(canvas, l, t) for shader, args in pairs(self.effects) do if shader == "bloom" then self:drawBloom(canvas, args) @@ -88,7 +88,7 @@ function post_shader:drawWith(canvas) love.graphics.setCanvas() love.graphics.setShader() love.graphics.setColor(255, 255, 255) - love.graphics.draw(canvas) + love.graphics.draw(canvas, l or 0, t or 0) end function post_shader:drawBloom(canvas, args)