bug-gnubg
[Top][All Lists]
Advanced

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

[Bug-gnubg] Redesign of 2D board dice


From: Øystein Johansen
Subject: [Bug-gnubg] Redesign of 2D board dice
Date: Thu, 01 Jan 2004 23:30:31 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I've redesigned the dice if the 2d board, and I'm attaching the code
here. I still have a problem using this code in the html generation of
images. Can you please help me?

- -Øystein

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE/9J+H6kDTFPhwyqYRApHRAJ40MetcTNh2iHYs6Q0hvdoH5/zDJwCdHWvP
o4u8UMNbuRQFts1P9FNVw/8=
=aCxu
-----END PGP SIGNATURE-----
Index: render.c
===================================================================
RCS file: /cvsroot/gnubg/gnubg/render.c,v
retrieving revision 1.27
diff -r1.27 render.c
2122a2123
> #define circ(x,y) ssqrt( (x*x) + (y*y) )
2158,2159c2159
<                   if( fabs( x ) < 6.0 / 7.0 &&
<                       fabs( y ) < 6.0 / 7.0 ) {
---
>                   if( circ( x,y ) < 1.0  ) {
2170c2170
<                       if( fabs( x ) < 6.0 / 7.0 ) {
---
>                       if( fabs( x ) < 0  ) {
2175c2175
<                       } else if( fabs( y ) < 6.0 / 7.0 ) {
---
>                       } else if( fabs( y ) < 0 ) {
2182,2187c2182,2185
<                           x_norm = 7.0 * x + ( x > 0.0 ? -6.0 : 6.0 );
<                           y_norm = -7.0 * y - ( y > 0.0 ? -6.0 : 6.0 );
<                           if( ( z_norm = 1 - x_norm * x_norm -
<                                 y_norm * y_norm ) < 0.0 )
<                               goto missed;
<                           z_norm = sqrt( z_norm );
---
>                           x_norm = 0.707 * x; // - ( x > 0.0 ? 1.0 : 1.0); 
>                           y_norm = -0.707 * y; // - ( y > 0.0 ? 1.0 : 1.0 );
>                           z_norm = 1 - x_norm * x_norm - y_norm * y_norm; 
>                           z_norm = ssqrt( z_norm );
2729c2727
<                                     ( anDicePosition[ i ][ 0 ] + 1 + 2 * ix )
---
>                                     ( anDicePosition[ i ][ 0 ] + 1.5 + 1.5 * 
> ix )
2731c2729
<                                     ( anDicePosition[ i ][ 1 ] + 1 + 2 * iy )
---
>                                     ( anDicePosition[ i ][ 1 ] + 1.5 + 1.5 * 
> iy )
Index: gtkboard.c
===================================================================
RCS file: /cvsroot/gnubg/gnubg/gtkboard.c,v
retrieving revision 1.157
diff -r1.157 gtkboard.c
3395,3398c3395,3397
<               gdk_draw_rgb_image( pd, gc, x + s + 2 * s * ix,
<                                   y + s + 2 * s * iy, s, s,
<                                   GDK_RGB_DITHER_MAX,
<                                   achPip[ fColour ], s * 3 );
---
>               gdk_draw_rgb_image (pd, gc,  s * 1.5 + x + 1.5 * s * ix,
>                           s * 1.5 + y + 1.5 * s * iy, s, s,
>                           GDK_RGB_DITHER_MAX, achPip[fColour], s * 3);

reply via email to

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