Fix texture coordinate calculation in surface_blt_to_drawable

Roderick Colenbrander thunderbird2k at gmx.net
Mon Jan 14 11:23:27 CST 2008


I just wanted to confirm that this patch is correct. Stefan and I talked about it and it should be right. Before the surface rewrite there were two codepaths like this and one of them used integers and the other texture one used floats. During the rewrite they were merged and the combined one used integers. That's what caused the regression. The use of floats makes much more sense.

Roderick


> This fixes a bug with the use of opengl to render direct draw in older
> graphic cards.
> 
> The problem is in dlls/wined3d/surface.c in surface_blt_to_drawable.
> 
> 3547          coords[0].x = rect.left   / This->pow2Width;
> 
> 3550          coords[1].x = rect.left   / This->pow2Width;
> 
> 3553          coords[2].x = rect.right  / This->pow2Width;
> 
> 3556          coords[3].x = rect.right  / This->pow2Width;
> 
> 3559          coords[0].y = rect.top    / This->pow2Height;
> 3560          coords[1].y = rect.bottom / This->pow2Height;
> 3561          coords[2].y = rect.bottom / This->pow2Height;
> 3562          coords[3].y = rect.top    / This->pow2Height;
> 
> 
> All calculation are done with integers so when rect.right < pow2Wdith and
> rect.bottom < pow2Height
> all texture coordinates are set to 0 thus only the upper left pixel of the
> image is displayed
> scaled up to cover the entire window.

-- 
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail



More information about the wine-devel mailing list