Am Sonntag, 2. September 2007 14:16 schrieb David Hedberg:
(Resending mail after subscribing to list)
Hi,
This patch fixes a problem visible in Delta Force Land Warrior and Delta Force Task Force Dagger, where extra_surfaces would sometimes get a value of -1 and later cause a "near infinite" loop in CreateAdditionalSurfaces.
I think you should test that in the desc2.dwFlags & DDSD_MIPMAPCOUNT case above, where currently the "Mipmap count is given, nothing to do" comment is. It would be good if you extended the test case in dlls/ddraw/tests/dsurface.c to test the case where the mipmapcount flag is set, but the mipmap count is 0. It could either create a one-level surface (like your patch currently does), or ignore the mipmapcount flag, and create mipmaps until either width and height are 0.
Hi again,
I played around a bit with a simple test case, and it seems that my first attempt at a patch was faulty. From what I can see and what the test case says, windows does not allow the creation of these surfaces at all. I've remade the patch to mimic the behaviour of windows, and also added a test case. Even with this, delta force still seems to work fine.
Does this look ok?
David
On 9/2/07, Stefan Dösinger stefandoesinger@gmx.at wrote:
Am Sonntag, 2. September 2007 14:16 schrieb David Hedberg:
(Resending mail after subscribing to list)
Hi,
This patch fixes a problem visible in Delta Force Land Warrior and Delta Force Task Force Dagger, where extra_surfaces would sometimes get a value of -1 and later cause a "near infinite" loop in CreateAdditionalSurfaces.
I think you should test that in the desc2.dwFlags & DDSD_MIPMAPCOUNT case above, where currently the "Mipmap count is given, nothing to do" comment is. It would be good if you extended the test case in dlls/ddraw/tests/dsurface.c to test the case where the mipmapcount flag is set, but the mipmap count is 0. It could either create a one-level surface (like your patch currently does), or ignore the mipmapcount flag, and create mipmaps until either width and height are 0.
Am Sonntag, 2. September 2007 19:22 schrieb David Hedberg:
Hi again,
I played around a bit with a simple test case, and it seems that my first attempt at a patch was faulty. From what I can see and what the test case says, windows does not allow the creation of these surfaces at all. I've remade the patch to mimic the behaviour of windows, and also added a test case. Even with this, delta force still seems to work fine.
Does this look ok?
Yes, looks great, but you can send test and fix in one patch since both are small.