Those clouds look flat for me. If you are not trying to create volumetric clouds, you should not use the noise to create vertices with it, but instead try to write the noise to a texture and replace the 2 million faces with just a simple one. Moving and changing is then a lot easier without a noticable fps-drop.
Why do you have a list of pointers to cells anyway, why not just a list of cells?
Read the OP. That was the origional problem. I needed to modify the elements of the list and run functions on them. If I used pointers then I'd just get a COPY of the object, and the modifications would not stick.
Why are you using free? You must 'delete' what you 'new'. As this is clearly C++ code, you should not be using malloc or free.
Crashes the program. I try "delete &old;" after the erase and it doesn't work. I've tried a few other things as well.
Why do you have a void pointer? Those are very very seldom useful in C++. Call delete through a pointer to the right type, or base class type.
Doesn't seem to make a difference.
Those are the obvious problems to fix first.
Can't really fix problems concerning how "common" or "correct" something is if the program doesn't even stay open. At least with the things I was doing it was working, it just had a huge memory leak.
I switched my code to use a regular list, and it's working alright. But I guess I have a slightly different problem now: memory leaks. I kinda figured when elements were removed from the list they weren't freed from memory, so I tried something like this:
I guess how this works depends on the actual class, so I'll post what I'm using right now:
void doFunction(int a,int b,int c,int d,int e);
bool addCell(int newx,int newy,int newr,int newg,int newb);
This seems to cut down on the memory leaks, however I get a strage problem that the number of elements in the list is drastically differnet from the lists size, once the programs been running for a bit and many elements have been removed:
int cellCount = 0;
for( auto it = lifeforms.begin(); it!=lifeforms.end(); ++it )
int difference = ((signed int)lifeforms.size())-cellCount;
Difference fluctuates rapidly, itll be in the thousands one frame and then tens the next.
I'll change to a regular list if it's a problem. But will that cause a noticable drop in preformance? (note that I have thousands of objects in a list each having their functions run and values modifyed and accessed per frame)