From 9911d02fd433bce9f51a0834e310ef4a3f76c344 Mon Sep 17 00:00:00 2001 From: Tim Anema Date: Fri, 5 Dec 2014 15:01:15 -0500 Subject: [PATCH] added glow map support to animations --- lib/body.lua | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/body.lua b/lib/body.lua index d741c05..fb3f7ac 100644 --- a/lib/body.lua +++ b/lib/body.lua @@ -534,22 +534,20 @@ function body:drawGlow() love.graphics.rectangle("fill", self.x, self.y, self.width, self.height) elseif self.type == "polygon" then love.graphics.polygon("fill", unpack(self.data)) - elseif self.type == "image" and self.img then + elseif (self.type == "image" or self.type == "animation") and self.img then if self.glowStrength > 0.0 and self.glow then love.graphics.setShader(self.glowShader) self.glowShader:send("glowImage", self.glow) self.glowShader:send("glowTime", love.timer.getTime() * 0.5) love.graphics.setColor(255, 255, 255) else - love.graphics.setShader() love.graphics.setColor(0, 0, 0) end - love.graphics.draw(self.img, self.x - self.ix, self.y - self.iy) - elseif self.type == "animation" then - if self.glow then - print('glowmaps not yet supported for animations') + if self.type == "animation" then + self.animation:draw(self.img, self.x - self.ix, self.y - self.iy) + else + love.graphics.draw(self.img, self.x - self.ix, self.y - self.iy) end - self.animation:draw(self.img, self.x - self.ix, self.y - self.iy) end love.graphics.setShader()