On Sun, 6 Jul 2008, James Cameron wrote: > Mmm, nice. Be able to test for regressions in display performance. > Thanks. > > In changes just pushed ... > > Add experimental support for tactical halos, which are arcs of > circles drawn near the edge of tactical, to express distance and > bearing to off-screen objects such as ships. > > - not drawn in red alert, > - drawn every ten updates, so lag reality, > - dark green for our planets, > - light green for our team players, > - red for non-team (enemy) players, > - thicker for players with kills. > > On Sun, Jul 06, 2008 at 12:09:09AM +1000, Stephen Thorne wrote: > > I have a problem on AMD64 figuring out the file descriptor of the X > > server. The current logic does some incredibly magical things using > > ctypes to dig into the X server to figure out which fd to attach > > to. > > I think it is digging into the X library, actually, not the server. > > The mysterious code came from the One Laptop Per Child project, where > AMD64 was not a consideration. > > Pygame rests on top of SDL, and SDL rests on top of Xlib. Xlib > manages the UNIX socket or TCP socket connection to the X server. > > Here is a guess as to what it does. I think it is looking into the > _XDisplay struct as defined by Xlib.h, which contains two pointers > then an int fd. > > typedef struct _XDisplay > { > XExtData *ext_data; /* hook for extension to hang data */ > struct _XPrivate *private1; > int fd; /* Network socket. */ > ... } > > Therefore on AMD64 that last "n+8" should be "n+16" since the two > members of the struct immediately before the fd are pointers. FWIW you can tell ctypes about structures and so it should then work out the sizes itself (say specify the pointers as void *) ie http://www.python.org/doc/current/lib/ctypes-structures-unions.html > Many people have asked pygame to expose their X socket file > descriptor, and that they haven't suggests it might be an SDL > limitation. Pesky abstractions ;) -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: This is a digitally signed message part. Url : http://mailman.us.netrek.org/pipermail/netrek-dev/attachments/20080706/5b29384a/attachment.pgp