[FIX] lockSurfaces

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[FIX] lockSurfaces

Bert Freudenberg-3
There is a wrong condition in an almost never-taken branch of  
BitBltSimulation>>lockSurfaces (when src=dst):

                 isWarping ifFalse:[
                     "When warping we always need the entire surface  
for the source"
                     sourceBits _ self cCode:'fn(sourceHandle,  
&sourcePitch, 0,0, sourceWidth, sourceHeight)'.
                 ] ifTrue:[
                     "Otherwise use overlapping area"
                     l _ sx min: dx. r _ (sx max: dx) + bbW.
                     t _ sy min: dy. b _ (sy max: sy) + bbH.
                     sourceBits _ self cCode:'fn(sourceHandle,  
&sourcePitch, l, t, r-l, b-t)'.
                 ].

As the comments indicate, the condition is reversed. Please include  
attached fix in VMMaker.

- Bert -




bltBltLockFix-bf.1.cs.gz (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [FIX] lockSurfaces

Andreas.Raab
Yup. Small but important fix - if this ever hits you you're dead in the
water. Thanks for finding it!

Cheers,
   - Andreas

Bert Freudenberg wrote:

> There is a wrong condition in an almost never-taken branch of
> BitBltSimulation>>lockSurfaces (when src=dst):
>
>                 isWarping ifFalse:[
>                     "When warping we always need the entire surface for
> the source"
>                     sourceBits _ self cCode:'fn(sourceHandle,
> &sourcePitch, 0,0, sourceWidth, sourceHeight)'.
>                 ] ifTrue:[
>                     "Otherwise use overlapping area"
>                     l _ sx min: dx. r _ (sx max: dx) + bbW.
>                     t _ sy min: dy. b _ (sy max: sy) + bbH.
>                     sourceBits _ self cCode:'fn(sourceHandle,
> &sourcePitch, l, t, r-l, b-t)'.
>                 ].
>
> As the comments indicate, the condition is reversed. Please include
> attached fix in VMMaker.
>
> - Bert -
>
>