diff --git a/README.md b/README.md index 9fa0ea1..57616c7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ :todoing --make sure all draw calls check if the object is within range -add body animations -optimize shadow body calculations and drawing methods diff --git a/lib/init.lua b/lib/init.lua index 6cb34de..9b0785a 100644 --- a/lib/init.lua +++ b/lib/init.lua @@ -182,7 +182,9 @@ function light_world:drawRefraction(l,t,w,h,s) self.refractionMap:clear() util.drawto(self.refractionMap, l, t, s, function() for i = 1, #self.body do - self.body[i]:drawRefraction() + if self.body[i]:isInRange(l,t,w,h,s) then + self.body[i]:drawRefraction() + end end end)