[AD] bug in win/wddbmp.c

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Hi, i think i found a small bug in win/wddbmp.c. At least, by applying
the attached patch, my program works and else it doesn't.

If what i changed was a bug, it was a double-bug - that's why i'm not
completely sure it was wrong. The first problem was inside the callback
function, where backbuffersurf and tripbuffersurf were assigned the same
value if both were NULL.
The second problem was due to a note i found in the DX7 docs for the
EnumAttachedSurfaces function:
"This method enumerates only those surfaces that are directly attached
to this surface. For example, in a flipping chain of three or more
surfaces, only one surface is enumerated because each surface is
attached only to the next surface in the flipping chain. In such a
configuration, you can call EnumAttachedSurfaces on each successive
surface to walk the entire flipping chain."
So i changed the call according to this.

I don't know much about DX, so i have no idea why tripbuffersurfing is
needed, or if it is a good idea to use its memory for video_bitmaps.
There are some checks with ReusedScreen, so first i thought this would
take care of it - but my test program works with my patch and doesn't
without. The problem was, my 3rd video bitmap for storing often used
sprites used the same video mem as the 2nd page for page flipping. Maybe
someone who knows more about DX can clarify this.

note: it's the first time i used diff, so i hope i did it right

Elias Pschernig

Attachment: wddbmp.diff
Description: Binary data



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/