Skip to content
Snippets Groups Projects
Commit 6489f397 authored by dg's avatar dg
Browse files

make sure particles has coords

git-svn-id: http://svn.net-core.org/repos/t-engine4@2090 51575b47-30f0-44d4-a5cc-537603b46e54
parent ae208dc0
No related branches found
No related tags found
No related merge requests found
...@@ -957,12 +957,12 @@ function _M:displayParticles(nb_keyframes) ...@@ -957,12 +957,12 @@ function _M:displayParticles(nb_keyframes)
local del = {} local del = {}
local e = next(self.particles) local e = next(self.particles)
while e do while e do
if nb_keyframes == 0 then if nb_keyframes == 0 and e.x and e.y then
-- Just display it, not updating, no emiting -- Just display it, not updating, no emiting
if e.x + e.radius >= self.mx and e.x - e.radius < self.mx + self.viewport.mwidth and e.y + e.radius >= self.my and e.y - e.radius < self.my + self.viewport.mheight then if e.x + e.radius >= self.mx and e.x - e.radius < self.mx + self.viewport.mwidth and e.y + e.radius >= self.my and e.y - e.radius < self.my + self.viewport.mheight then
alive = e.ps:toScreen(self.display_x + (e.x - self.mx + 0.5) * self.tile_w * self.zoom, self.display_y + (e.y - self.my + 0.5) * self.tile_h * self.zoom, self.seens(e.x, e.y), e.zoom * self.zoom) alive = e.ps:toScreen(self.display_x + (e.x - self.mx + 0.5) * self.tile_w * self.zoom, self.display_y + (e.y - self.my + 0.5) * self.tile_h * self.zoom, self.seens(e.x, e.y), e.zoom * self.zoom)
end end
else elseif e.x and e.y then
-- Update more, if needed -- Update more, if needed
for i = 1, nb_keyframes do for i = 1, nb_keyframes do
local alive = not e.update(e) local alive = not e.update(e)
...@@ -979,6 +979,9 @@ function _M:displayParticles(nb_keyframes) ...@@ -979,6 +979,9 @@ function _M:displayParticles(nb_keyframes)
e.dead = true e.dead = true
end end
end end
else
del[#del+1] = e
e.dead = true
end end
e = next(self.particles, e) e = next(self.particles, e)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment