[WINED3D] Lights: Maintain doubly linked list
Ivan Gyurdiev
ivg2 at cornell.edu
Sun May 14 04:10:33 CDT 2006
Ivan Gyurdiev wrote:
> I didn't run into any specific problems, but noticed this while
> investigating another issue. The stateblock contains a doubly-linked
> list of lights. The backward link isn't maintained properly in
> recording mode in SetLight and SetLightEnable. Nothing good can come
> out of that - fix it so it doesn't cause any issues in the future.
Well... it looks as if the prev link isn't actually used in recording
mode...
I think this is caused by a larger design issue - using the same data
structures to store state (in device->stateBlock), and to record state
changes (device->updateStateBlock). I don't know the code well enough
yet, but that seems like a rather confusing design to me. In one case a
doubly-linked list seems to be used, and in the other it's re-used as a
singly linked list for a rather different purpose. In one case you have
flags like "changed", "enableChanged", and in the other they don't seem
to be used at all, since you're interested in state, not in the state delta.
You could argue that the double link should be maintained in either case
for consistency.
Merge at your discretion, I have no strong opinion - still learning how
this part of the code works.
More information about the wine-patches
mailing list