bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnubg] wrong dice colours in html export and below board in GUI


From: Jon Kinsey
Subject: Re: [Bug-gnubg] wrong dice colours in html export and below board in GUI
Date: Fri, 28 Nov 2003 09:55:01 +0000

At 14:52 23/11/2003, Martin Janke wrote:
Hi,

the colour of the dice in the html export images doesn't seem to be
correct. E.g. the yellow dice of the "dailygammon" board layout are
purple, the blue dice are grey.

I think I found the bug, here's the change if anyone is familiar with the code perhaps they could double check my fix.

htmlimages.c
       int dice_x = 3 * s * ( BEAROFF_WIDTH +
                              3 * POINT_WIDTH +
                              ( 6 * POINT_WIDTH + BAR_WIDTH ) * i )
-        - 3 * ss * DIE_WIDTH / 2;
+        - DIE_WIDTH / 2 *  3 * ss;

-      int dice_y = ( BOARD_HEIGHT / 2 * s - DIE_HEIGHT / 2 * ss ) * nStride;
+      int dice_y = ( s * BOARD_HEIGHT / 2 - ss * DIE_HEIGHT / 2 ) * nStride;

        AlphaBlend( auchBoard +
                    dice_x - 3 * ss * DIE_WIDTH +
                    dice_y,
        ...

Looks like the / and * were a bit mixed up causing occasional int rounding errors - when the pointer is one out the reds change to greens etc.

Jon





reply via email to

[Prev in Thread] Current Thread [Next in Thread]