[Bug 18916] Thief 2 crashes when bringing up in-game menu

wine-bugs at winehq.org wine-bugs at winehq.org
Tue Jun 16 05:30:22 CDT 2009


http://bugs.winehq.org/show_bug.cgi?id=18916





--- Comment #11 from Michael Abbott <michael at araneidae.co.uk>  2009-06-16 05:30:21 ---
(In reply to comment #10)
> I think http://www.winehq.org/pipermail/wine-patches/2009-June/074312.html
> should fix this.

I'm a bit troubled by this computation:

    WORD d15 = source[x] & 0xfffe;
    DWORD d24 = d15 * 0x100 + (d15 * 0xff80 + 0x3fff80) / 0x7fff00;

If I multiply the arithmetic out as if this was floating point, this comes to

   d24 = 256.0078 * d15 + 0.5

Don't get it.  You're not relying on d15*0xff80 overflowing and doing something
evil ... are you?  Certainly if the top bit of d15 is set then this overflows
as an unsigned value ... and then the division, in this inner loop, is not
going to speed things up.

Why not just

    DWORD d24 = (source[x] & 0xfffe) << 8;

?  What is the conversion rule that's really being applied here?

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list