Does that do the right thing? I don't think that iterates over any surfaces it previously didn't. I'd expect an `attachment = attachment->next_attached` somewhere in there.
I think it does iterates over more surfaces with this change, in particular, more than one flippable surface.
Multiple backbuffers and mip levels form a chain through complex_array[0] (with other complex array elements used by head cube texture surface only). Without the change only the first after head was restored.
You're right, of course. The `complex_array[]` construction isn't entirely intuitive; wouldn't be the first time it trips me up. :-\
The surfaces attached explicitly by the app go to next_attached.
My test adds todo_wine which is removed with the change. I also added a test with attached Z buffer which suggests we should not iterate over next_attached, at least not in a generic case.
Slightly odd, but well, ddraw.