Probably application bug: it called DIB_DirectDrawSurface_Blt with .bottom > 36000, seems like DirectDraw sanitized the values.
Well, I would prefer the fix to be different... For example, it seems to be valid to have negative top values as long as 'bottom - top' is valid (as it seems that DDraw will clip the blit for you).
Problem is that if negative top is valid, then bottom being bigger than dwHeight should be valid too. And your patch will thus prevent this case to work.
I guess you are right.
Did you try to simply return an error message (instead of doing the assert) to see if you see any graphical glitches ?
Yes, it did give glitches. After clipping it gave sane picture. But I dont have any idea how the picture looks on Windows, I dont have Windows.
Some values from log:
fixme:ddraw:DIB_DirectDrawSurface_Blt ddesc.dwHeight=480 xdst.top=382 xdst.bottom=36242 fixme:ddraw:DIB_DirectDrawSurface_Blt sdesc.dwHeight=480 xsrc.top=381 xsrc.bottom=36242 fixme:ddraw:DIB_DirectDrawSurface_Blt ddesc.dwHeight=480 xdst.top=381 xdst.bottom=36242 fixme:ddraw:DIB_DirectDrawSurface_Blt sdesc.dwHeight=480 xsrc.top=382 xsrc.bottom=36242
Anyway, I am installing Mingw + the DirectX SDKs to do some test apps on a Win2K laptop. I will try this case to see if I manage to see what real Windows does.
Cool. I looked into DDraw docs in web, but there was no descripton for special cases. I tried to fantasize but it got too crazy for me...
I guess you are right.
In fact, no, I am wrong... I just tested on my box, and it seems that DirectX actually checks the rectangles and refuses the Blt (at least on mine it returns error code '150' => DDERR_INVALIDRECT).
If anyone has a real Windows box, could you please test this proggie :
http://www.bbrox.org/test_dx2.exe
To quit, just press the mouse button. It may crash a little bit (though I wonder why as it's my first Windows program :-) ).
Please go near the border with the mouse and tell me (privately) if 1) the application stops and if yes, the error code 2) if it does not stop, what happens (is the 'sprite' clipped, does it disappear, ...) ?
Thanks.
fixme:ddraw:DIB_DirectDrawSurface_Blt ddesc.dwHeight=480 xdst.top=382 xdst.bottom=36242
Hmmmm, this is REALLY strange... Where does this happen ? My last Grim Fandango testings did not show any of these errors.
Lionel
On Tue, Nov 12, 2002 at 12:38:30AM +0100, Lionel Ulmer wrote:
I guess you are right.
In fact, no, I am wrong... I just tested on my box, and it seems that DirectX actually checks the rectangles and refuses the Blt (at least on mine it returns error code '150' => DDERR_INVALIDRECT).
Now I found this:
http://msdn.microsoft.com/archive/en-us/ddraw7/directdraw7/ddover_7ctz.asp
I read from there that source rect must be inside src. Destination _may_ be outside, only if something called 'clipper' is attached to dst.
If anyone has a real Windows box, could you please test this proggie :
http://www.bbrox.org/test_dx2.exe
To quit, just press the mouse button. It may crash a little bit (though I wonder why as it's my first Windows program :-) ).
Hehe.
Please go near the border with the mouse and tell me (privately) if
- the application stops and if yes, the error code
- if it does not stop, what happens (is the 'sprite' clipped, does it disappear, ...) ?
Thanks.
fixme:ddraw:DIB_DirectDrawSurface_Blt ddesc.dwHeight=480 xdst.top=382 xdst.bottom=36242
Hmmmm, this is REALLY strange... Where does this happen ? My last Grim Fandango testings did not show any of these errors.
Well, on my Grim Fandango testings it started when Calavera tried to walk to Big Boss cabinet (after talking Celso) - so near the end.
As it was near the scene-change I could not observe the graphic glitches. But when running around greenhouse it gave a lot of those errors. When wine was simply emitting errors then Calavera shadow was badly drawn.
Btw, there is some patch for Grim and my game was unpatched. Maybe it was "supposed" to fail on windows too? Then instead of clipping it, wine should return error? Anyway using assert there is overreacting...
Now I found this:
http://msdn.microsoft.com/archive/en-us/ddraw7/directdraw7/ddover_7ctz.asp
I read from there that source rect must be inside src. Destination _may_ be outside, only if something called 'clipper' is attached to dst.
OK, so according to my testings plus your MSDN findings, I attached a patch that should match 'feature to feature' what the real DirectX does... It certainly won't help you with your Grim problem though (BTW I tested it with an application that set a clipper and it still works fine).
Well, on my Grim Fandango testings it started when Calavera tried to walk to Big Boss cabinet (after talking Celso) - so near the end.
Do you have a save game for that so that I try it on my version of Grim (I may even test it on my Windows box :-) ).
Lionel
On Tue, Nov 12, 2002 at 10:36:38AM +0100, Lionel Ulmer wrote:
Now I found this:
http://msdn.microsoft.com/archive/en-us/ddraw7/directdraw7/ddover_7ctz.asp
I read from there that source rect must be inside src. Destination _may_ be outside, only if something called 'clipper' is attached to dst.
OK, so according to my testings plus your MSDN findings, I attached a patch that should match 'feature to feature' what the real DirectX does... It certainly won't help you with your Grim problem though (BTW I tested it with an application that set a clipper and it still works fine).
At least it wont crash.
Well, on my Grim Fandango testings it started when Calavera tried to walk to Big Boss cabinet (after talking Celso) - so near the end.
Do you have a save game for that so that I try it on my version of Grim (I may even test it on my Windows box :-) ).
Nope. Sorry. Deleted all.
OTOH maybe I should to test your patch this weekend...