Friday, April 22, 2005

corrected ring deletion: cascade delete

In previous versions, deleting a ring also deleted all subsequent rings in the list. This was only perceptible when the erroneously deleted rings happened to be visible. This situation occurs in certain demo patches which use a large star factor.

demo patches affected:

drastic change:
cross Y totally different; occasional nice moire but mostly too cluttered
lotus light Y rings persist too long and spoil the drama
mercedes Y rings persist too long and spoil the drama

slight change:
pinwheel fab color Y "tunnel" state clears differently, but it's fine
pinwheel Y occasional very slight difference at edges
shimmer Y occasional slight difference at edges
tentacles Y slight difference: occasional stray threads hang around

no change:
good2 N no difference
kaleid N no difference
real pinwheel N no difference

"all at once" cascade:
m_Ring.RemoveAt(CurPos);
while (NextPos != NULL) { // delete remaining rings
CurPos = NextPos;
m_Ring.GetNext(NextPos);
m_Ring.RemoveAt(CurPos);
}

gradual cascade, similar to original behavior, but smoother:
POSITION DelPos = NULL
// main loop
m_Ring.RemoveAt(CurPos);
DelPos = NextPos; // start cascade delete
// end of main loop
if (DelPos != NULL) {
RING& rp = m_Ring.GetNext(DelPos);
rp.Steps = 1e9; // mark ring for deletion
}

No comments: