Page 2 of 2
Re: Synced --> UnSynced Mess... help plz
Posted: 18 Feb 2010, 08:58
by Argh
What the hell's a deep copy, and how do I do it?
I'm doing:
local particleCopy
particleCopy = particleList
...before I bind the first FBO and begin iterating within it's function.
Do I need to do a full iteration, i.e.:
Code: Select all
for i = 1,#particleList,1 do
particleCopy[i] = particleList[i]???
end
Re: Synced --> UnSynced Mess... help plz
Posted: 18 Feb 2010, 09:10
by Argh
So I wrote this:
Code: Select all
local particleCopy = {}
for i = 1,#particleList,1 do
particleCopy[i] = particleList[i]
for j,k in ipairs (particleList[i]) do
particleCopy[i][j] = k
end
end
Deep copy, right?
Well, it still failed. WTF!!! WHY IS MY DATA GETTING WRITTEN TO WHILE THE DRAWGENESIS FUNCTION HASN'T RETURNED YET....
Re: Synced --> UnSynced Mess... help plz
Posted: 18 Feb 2010, 09:43
by aegis
that's not a very deep copy.
Re: Synced --> UnSynced Mess... help plz
Posted: 18 Feb 2010, 09:47
by Argh
I FIXED IT.
You guys are never going to believe this.
Moving the entire particle-update function to DrawWorld() fixed it. Completely. Even after I moved the iteration functions back inside the FBOs. I'll leave it to somebody to figure out why; I've been fighting with this for two days, and it was the last remaining problem with P.O.P.S. + a working texture atlas.
OK, now to get back to doing something useful...