added glow map support to animations

This commit is contained in:
Tim Anema 2014-12-05 15:01:15 -05:00
parent 2282d9ea33
commit 9911d02fd4

View File

@ -534,22 +534,20 @@ function body:drawGlow()
love.graphics.rectangle("fill", self.x, self.y, self.width, self.height) love.graphics.rectangle("fill", self.x, self.y, self.width, self.height)
elseif self.type == "polygon" then elseif self.type == "polygon" then
love.graphics.polygon("fill", unpack(self.data)) 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 if self.glowStrength > 0.0 and self.glow then
love.graphics.setShader(self.glowShader) love.graphics.setShader(self.glowShader)
self.glowShader:send("glowImage", self.glow) self.glowShader:send("glowImage", self.glow)
self.glowShader:send("glowTime", love.timer.getTime() * 0.5) self.glowShader:send("glowTime", love.timer.getTime() * 0.5)
love.graphics.setColor(255, 255, 255) love.graphics.setColor(255, 255, 255)
else else
love.graphics.setShader()
love.graphics.setColor(0, 0, 0) love.graphics.setColor(0, 0, 0)
end end
love.graphics.draw(self.img, self.x - self.ix, self.y - self.iy) if self.type == "animation" then
elseif self.type == "animation" then self.animation:draw(self.img, self.x - self.ix, self.y - self.iy)
if self.glow then else
print('glowmaps not yet supported for animations') love.graphics.draw(self.img, self.x - self.ix, self.y - self.iy)
end end
self.animation:draw(self.img, self.x - self.ix, self.y - self.iy)
end end
love.graphics.setShader() love.graphics.setShader()