CLIENT PATCHES ---------------------------------------------------------------------- From: hadley@cardinal.ics.uci.edu (Tedd Hadley) Newsgroups: alt.games.xtrek Subject: Re: boder color problems... Date: 3 Nov 91 05:14:19 GMT The following is kind of involved. If you're not a netrek X or C hack you might want to hit 'n' now. In <21238@chaph.usc.edu> wiegley@girtab.usc.edu (Jeffrey Wiegley) writes: >This is really pissing me off. I have the source from scam (which >personally is out of date and seems to have some bugs left why doesn't >somebody put up some up-to-date source code somewhere?) >Anyways my client is having border color problems. It does not change the >border color to reflect the condition (red/yellow/green) it says it changes >it and it calls W_ChangeBorder() but the border stays white. >I asked the people playing flubber but I guess NOBODY there reads their >message window. No wonder the Roms are getting their butt kicked. Maybe >you guys should start reading your windows and then you could get some team >effort going. >Please help me solve this stupid border problem. X11(r4,5) changed, essentially. Here's the official word from the Inter-Client Communications Conventions manual (ICCC): "Clients should be aware that their borders may not be visible. Window managers [twm,olwm,mwm] are free to use reparenting techniques to decorate client's top-level windows with borders containing titles, controls, and other details to maintain a consistent look-and-feel [...] Clients, therefore, should not depend on the top-level window's border being visible or use it to display any critical [condition RED, uh oh.] information" (brackets mine) You may have noticed that the old binaries did show border colors but that they had all kinds of other problems, i.e., you couldn't move/iconify them, no automatic keyboard focus, etc. This was because they set override-redirect on each window, effectively disabling the window manager for the application. (You can see how this worked by adding attrs.override_redirect = True; and CWOverrideRedirect to the call to XCreateWindow in W_MakeWindow in x11window.c) There is an easier solution: instead of changing the toplevel window's borders (which the wm ignores) change 1 or more internal windows' borders. (I believe the most recent binary does this). In death.c and redraw.c change occurences of W_ChangeBorder(baseWin, ..) to W_ChangeBorder(w, ..). This causes the bottom and right edges of the local display to reflect the alert status. (I experimented with warnw and mesg also but got some strange border patterns at the top of each window. Might be a server bug) (BTW, I also changed 'int oldalert = PFGREEN' to 'int oldalert = 0' in data.c to force it to fill the borders at the start) Other possibilities: change the color of your shield or player number (or both) to reflect alert status. (Wouldn't work on black & white, of course.) ++ Tedd Hadley (hadley@ics.uci.edu) ------------------------------ From: rjc@cstr.ed.ac.uk (Richard Caley) Newsgroups: alt.games.xtrek Subject: Making X11netrek a good X citizen Date: 20 Jan 92 02:49:59 GMT Just in case anyone is interested, the patch below to x11window.c in the client code makes x11netrek better behaved from an X point of view. This doesn't give you any kind of borg, it just makes things like message windows have reasonable names and flags them as belonging to the main nettrek window. The exact result of this will depend on the window manager, but it may remember to iconify the small windows when the main one is iconified and will probably not add decoration to them etc. Much better than setting override_redirect as suggested in the README. This patch also stops the icon window asking for input which in turn lets tvtwm (and possibly others) treat it like a normal icon. Patch follows sig. -- rjc@cstr.ed.ac.uk There is no such thing as a small change to a window manager... *** netrek/x11window.c Thu Nov 1 04:35:42 1990 --- ../netrek/x11window.c Tue Dec 17 13:18:18 1991 *************** *** 38,49 **** char *getdefault(); char *strdup(); static XClassHint class_hint = { "netrek", "Netrek", }; static XWMHints wm_hint = { ! InputHint, 1, }; static W_Event W_myevent; --- 38,58 ---- char *getdefault(); char *strdup(); + extern W_Window baseWin; + static XClassHint class_hint = { "netrek", "Netrek", }; static XWMHints wm_hint = { ! InputHint|StateHint, ! True, ! WithdrawnState, ! None, ! None, ! 0,0, ! None, ! None, }; static W_Event W_myevent; *************** *** 367,375 **** wparent=W_Void2Window(parent)->window; attrs.override_redirect=False; attrs.border_pixel=colortable[color].pixelValue; ! attrs.event_mask=KeyPressMask|ButtonPressMask|ExposureMask; attrs.background_pixel=colortable[W_Black].pixelValue; ! attrs.do_not_propagate_mask=KeyPressMask|ButtonPressMask|ExposureMask; newwin=newWindow( XCreateWindow(W_Display, wparent, x, y, width, height, border, CopyFromParent, InputOutput, CopyFromParent, --- 376,387 ---- wparent=W_Void2Window(parent)->window; attrs.override_redirect=False; attrs.border_pixel=colortable[color].pixelValue; ! if (strcmp(name,"netrek_icon")==0) /* hack, icon should not select for input */ ! attrs.event_mask=ExposureMask; ! else ! attrs.event_mask=KeyPressMask|ButtonPressMask|ExposureMask; attrs.background_pixel=colortable[W_Black].pixelValue; ! attrs.do_not_propagate_mask=KeyPressMask|ButtonPressMask|ExposureMask; newwin=newWindow( XCreateWindow(W_Display, wparent, x, y, width, height, border, CopyFromParent, InputOutput, CopyFromParent, *************** *** 376,383 **** --- 388,402 ---- CWBackPixel|CWEventMask|CWOverrideRedirect|CWBorderPixel, &attrs), WIN_GRAPH); + class_hint.res_name=name; XSetClassHint(W_Display, newwin->window, &class_hint); XSetWMHints(W_Display, newwin->window, &wm_hint); + XStoreName(W_Display, newwin->window, name); + if (wparent==W_Root && baseWin != NULL) + { + XSetTransientForHint(W_Display, newwin->window, + wparent=W_Void2Window(baseWin)->window); + } newwin->name=strdup(name); newwin->width=width; newwin->height=height; *************** *** 774,781 **** --- 793,807 ---- CWOverrideRedirect|CWBorderPixel, &attrs), WIN_TEXT); + class_hint.res_name=name; XSetClassHint(W_Display, newwin->window, &class_hint); XSetWMHints(W_Display, newwin->window, &wm_hint); + XStoreName(W_Display, newwin->window, name); + if (wparent==W_Root && baseWin != NULL) + { + XSetTransientForHint(W_Display, newwin->window, + wparent=W_Void2Window(baseWin)->window); + } newwin->name=strdup(name); newwin->width=width; newwin->height=height; *************** *** 859,866 **** --- 885,899 ---- CWOverrideRedirect|CWBorderPixel, &attrs), WIN_SCROLL); + class_hint.res_name=name; XSetClassHint(W_Display, newwin->window, &class_hint); XSetWMHints(W_Display, newwin->window, &wm_hint); + XStoreName(W_Display, newwin->window, name); + if (wparent==W_Root && baseWin != NULL) + { + XSetTransientForHint(W_Display, newwin->window, + wparent=W_Void2Window(baseWin)->window); + } newwin->name=strdup(name); newwin->data=NULL; newwin->width=width; *************** *** 980,987 **** --- 1013,1027 ---- CWOverrideRedirect|CWBorderPixel, &attrs), WIN_MENU); + class_hint.res_name=name; XSetClassHint(W_Display, newwin->window, &class_hint); XSetWMHints(W_Display, newwin->window, &wm_hint); + XStoreName(W_Display, newwin->window, name); + if (wparent==W_Root && baseWin != NULL) + { + XSetTransientForHint(W_Display, newwin->window, + wparent=W_Void2Window(baseWin)->window); + } newwin->name=strdup(name); items=(struct menuItem *) malloc(height*sizeof(struct menuItem)); for (i=0; ip_flags & PFTRACT || j->p_flags & PFPRESS) { double theta; unsigned char dir; int lx[2], ly[2]; tx = (players[j->p_tractor].p_x - me->p_x) / SCALE + WINSIDE / 2; ty = (players[j->p_tractor].p_y - me->p_y) / SCALE + WINSIDE / 2; if (tx == dx && ty == dy) continue; /* this had better be last in for(..) */ #define XPI 3.1415926 theta = atan2((double) (tx - dx), (double) (dy - ty)) + XPI / 2.0; dir = (unsigned char) (theta / XPI * 128.0); lx[0] = tx + (Cos[dir] * (shield_width/2)); ly[0] = ty + (Sin[dir] * (shield_width/2)); lx[1] = tx - (Cos[dir] * (shield_width/2)); ly[1] = ty - (Sin[dir] * (shield_width/2)); #undef XPI W_MakeLine(w, dx, dy, lx[0], ly[0], foreColor); W_MakeLine(w, dx, dy, lx[1], ly[1], foreColor); clearline[0][clearlcount] = dx; clearline[1][clearlcount] = dy; clearline[2][clearlcount] = lx[0]; clearline[3][clearlcount] = ly[0]; clearlcount++; clearline[0][clearlcount] = dx; clearline[1][clearlcount] = dy; clearline[2][clearlcount] = lx[1]; clearline[3][clearlcount] = ly[1]; clearlcount++; } } /* end of for each player loop */ I also increased the size of clearline[] to compensate. Basically, this draws a cone from the center of the person doing the tractoring to the shields of the person being tractored. The effect diminishes slightly if they don't have their shields up, since the beams just sorta end. Still, it looks decent. ------------------------------ From: jmt@voyage.cma.fr (Jean-Marc Tanzi) Newsgroups: alt.games.xtrek Subject: (more) visible tractor Date: 23 Jan 92 14:36:39 GMT I just made a cheap modification to my server, to have a better feedback on the tractor/pressor status. Now the form of the cursor reflects the status, with arrows pointing in or out. Patch below signature: a few lines in redraw.c, and two new bitmaps in oldbitmaps.h. BTW, some good work could really be done to clean up the transmission part of xtrek. I'm sure one could reduce netlag effect *and* cut down traffic by one-half. The big waste: each position is transmitted as a 32-bits integer pair, but it just codes a 0-500 range. We are using 64 bits instead of 18... Alas, I just can't find the time. *** /tmp/RCSAa10128 Thu Jan 23 15:17:40 1992 --- oldbitmaps.h Thu Jan 23 14:19:17 1992 *************** *** 486,519 **** static char eplasmatorp_bits[] = { 0x08, 0x2a, 0x1c, 0x7f, 0x1c, 0x2a, 0x08}; static char mtorp_bits[] = { 0x02, 0x07, 0x02}; static char mplasmatorp_bits[] = { 0x04, 0x0e, 0x1f, 0x0e, 0x04}; #define cross_width 16 #define cross_height 16 #define cross_x_hot 7 #define cross_y_hot 7 static char cross_bits[] = { ! 0x00, 0x00, 0xc0, 0x03, 0xa0, 0x05, 0x00, 0x00, 0x80, 0x01, 0x04, 0x20, ! 0x82, 0x41, 0x56, 0x6a, 0x56, 0x6a, 0x82, 0x41, 0x04, 0x20, 0x80, 0x01, ! 0x00, 0x00, 0xa0, 0x05, 0xc0, 0x03, 0x00, 0x00}; static char crossmask_bits[] = { 0xe0, 0x07, 0xf0, 0x0f, 0xf0, 0x0f, 0xf0, 0x0f, 0xce, 0x73, 0xcf, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xf3, 0xce, 0x73, 0xf0, 0x0f, 0xf0, 0x0f, 0xf0, 0x0f, 0xe0, 0x07}; #define indplanet_width 30 #define indplanet_height 30 static char indplanet_bits[] = { 0x00, 0xf8, 0x03, 0x00, 0x00, 0x07, 0x1c, 0x00, 0xc0, 0x00, 0x60, 0x00, 0x20, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x08, --- 486,538 ---- static char eplasmatorp_bits[] = { 0x08, 0x2a, 0x1c, 0x7f, 0x1c, 0x2a, 0x08}; static char mtorp_bits[] = { 0x02, 0x07, 0x02}; static char mplasmatorp_bits[] = { 0x04, 0x0e, 0x1f, 0x0e, 0x04}; + #define cross_width 16 #define cross_height 16 #define cross_x_hot 7 #define cross_y_hot 7 static char cross_bits[] = { ! 0x00, 0x00, 0xe0, 0x07, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x02, 0x40, ! 0x82, 0x41, 0x56, 0x6a, 0x56, 0x6a, 0x82, 0x41, 0x02, 0x40, 0x80, 0x01, ! 0x00, 0x00, 0x80, 0x01, 0xe0, 0x07, 0x00, 0x00}; + #define tractCross_width 16 + #define tractCross_height 16 + #define tractCross_x_hot 7 + #define tractCross_y_hot 7 + static char tractCross_bits[] = { + 0x20, 0x04, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01, 0x80, 0x01, 0x03, 0xc0, + 0x86, 0x61, 0x5e, 0x7a, 0x5e, 0x7a, 0x86, 0x61, 0x03, 0xc0, 0x80, 0x01, + 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0x20, 0x04}; + #define pressCross_width 16 + #define pressCross_height 16 + #define pressCross_x_hot 7 + #define pressCross_y_hot 7 + static char pressCross_bits[] = { + 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xa0, 0x05, 0x80, 0x01, 0x0c, 0x30, + 0x86, 0x61, 0x5f, 0xfa, 0x5f, 0xfa, 0x86, 0x61, 0x0c, 0x30, 0x80, 0x01, + 0xa0, 0x05, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01}; + static char crossmask_bits[] = { 0xe0, 0x07, 0xf0, 0x0f, 0xf0, 0x0f, 0xf0, 0x0f, 0xce, 0x73, 0xcf, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xf3, 0xce, 0x73, 0xf0, 0x0f, 0xf0, 0x0f, 0xf0, 0x0f, 0xe0, 0x07}; + #define indplanet_width 30 #define indplanet_height 30 static char indplanet_bits[] = { 0x00, 0xf8, 0x03, 0x00, 0x00, 0x07, 0x1c, 0x00, 0xc0, 0x00, 0x60, 0x00, 0x20, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x08, *** /tmp/RCSAa10133 Thu Jan 23 15:17:57 1992 --- redraw.c Thu Jan 23 14:35:09 1992 *************** *** 4,23 **** --- 4,24 ---- #include "copyright.h" #include #include #include #include "Wlib.h" #include "defs.h" #include "struct.h" #include "data.h" #include "packets.h" + #include "oldbitmaps.h" static int clearzone[4][(MAXTORP + 1) * MAXPLAYER + (MAXPLASMA + 1) * MAXPLAYER + MAXPLANETS]; static int clearcount; static int clearline[4][MAXPLAYER]; static int clearlcount; static int mclearzone[6][MAXPLAYER]; /* For map window */ static short nplayers; *************** *** 137,157 **** register struct torp *k; register struct planet *l; register struct phaser *php; register struct plasmatorp *pt; int dx, dy; int view; char idbuf[2]; W_Icon (*ship_bits)[VIEWS]; ! /* Kludge to try to fix missing ID chars on tactical (short range) display. */ idbuf[0] = '0'; idbuf[1] = '\0'; /* Draw Planets */ view = SCALE * WINSIDE / 2; for (i = 0, l = &planets[i]; i < MAXPLANETS; i++, l++) { dx = l->pl_x - me->p_x; dy = l->pl_y - me->p_y; if (dx > view || dx < -view || dy > view || dy < -view) continue; dx = dx / SCALE + WINSIDE / 2; --- 138,173 ---- register struct torp *k; register struct planet *l; register struct phaser *php; register struct plasmatorp *pt; int dx, dy; int view; char idbuf[2]; W_Icon (*ship_bits)[VIEWS]; ! /* JMT: Change cursor icon for tractor/pressor */ ! static unsigned int cursorState ; ! ! if ( cursorState != (me->p_flags & (PFPRESS | PFTRACT)) ) ! { ! if (me->p_flags & PFPRESS) ! W_DefineCursor(baseWin, 16, 16, pressCross_bits, crossmask_bits, 7, 7); ! else if (me->p_flags & PFTRACT) ! W_DefineCursor(baseWin, 16, 16, tractCross_bits, crossmask_bits, 7, 7); ! else ! W_DefineCursor(baseWin, 16, 16, cross_bits, crossmask_bits, 7, 7); ! ! cursorState = (me->p_flags & (PFPRESS | PFTRACT)) ; ! } ! ! /* Kludge to try to fix missing ID chars on tactical display. */ idbuf[0] = '0'; idbuf[1] = '\0'; /* Draw Planets */ view = SCALE * WINSIDE / 2; for (i = 0, l = &planets[i]; i < MAXPLANETS; i++, l++) { dx = l->pl_x - me->p_x; dy = l->pl_y - me->p_y; if (dx > view || dx < -view || dy > view || dy < -view) continue; dx = dx / SCALE + WINSIDE / 2; ------------------------------ From: rjc@cstr.ed.ac.uk (Richard Caley) Newsgroups: alt.games.xtrek Subject: More X11 Politeness for the client Date: 27 Feb 92 11:06:10 GMT The following patch to x11window.c makes x11netrek tell the window manager when the position of the main window has been specified in the .xtrekrc. This should make the window manager place the window as you have specified. It also fixes the size of the window -- there seems to be no point in letting the user change the size of the window and get lots of new blank space :-). [patch follows sig] -- rjc@cstr.ed.ac.uk _O_ |< *** x11window.c~ Sat Feb 22 05:47:52 1992 --- x11window.c Thu Feb 27 10:50:00 1992 *************** *** 55,60 **** --- 55,62 ---- None, }; + static XSizeHints wm_size_hint; + static W_Event W_myevent; static int W_isEvent=0; *************** *** 367,377 **** struct window *newwin; Window wparent; XSetWindowAttributes attrs; #ifdef DEBUG printf("New window...\n"); #endif ! checkGeometry(name, &x, &y, &width, &height); checkParent(name, &parent); wparent=W_Void2Window(parent)->window; attrs.override_redirect=False; --- 369,384 ---- struct window *newwin; Window wparent; XSetWindowAttributes attrs; + int gx, gy; #ifdef DEBUG printf("New window...\n"); #endif ! checkGeometry(name, &gx, &gy, &width, &height); ! if ( gx >= 0 ) ! x=gx; ! if ( gy >= 0 ) ! y=gy; checkParent(name, &parent); wparent=W_Void2Window(parent)->window; attrs.override_redirect=False; *************** *** 397,402 **** --- 404,417 ---- XSetTransientForHint(W_Display, newwin->window, wparent=W_Void2Window(baseWin)->window); } + wm_size_hint.min_width= + wm_size_hint.max_width= wm_size_hint.base_width= width; + wm_size_hint.min_height= + wm_size_hint.max_height= wm_size_hint.base_height= height; + wm_size_hint.flags= USSize|PMinSize|PMaxSize|PBaseSize; + if ( gx >= 0 || gy >= 0 ) + wm_size_hint.flags |= USPosition; + XSetWMNormalHints(W_Display, newwin->window, &wm_size_hint); newwin->name=strdup(name); newwin->width=width; newwin->height=height; *************** *** 773,783 **** struct window *newwin; Window wparent; XSetWindowAttributes attrs; ! #ifdef DEBUG printf("New window...\n"); #endif ! checkGeometry(name, &x, &y, &width, &height); checkParent(name, &parent); attrs.override_redirect=False; attrs.border_pixel=colortable[W_White].pixelValue; --- 788,803 ---- struct window *newwin; Window wparent; XSetWindowAttributes attrs; ! int gx, gy; ! #ifdef DEBUG printf("New window...\n"); #endif ! checkGeometry(name, &gx, &gy, &width, &height); ! if ( gx >= 0 ) ! x=gx; ! if ( gy >= 0 ) ! y=gy; checkParent(name, &parent); attrs.override_redirect=False; attrs.border_pixel=colortable[W_White].pixelValue; *************** *** 865,875 **** struct window *newwin; Window wparent; XSetWindowAttributes attrs; #ifdef DEBUG printf("New window...\n"); #endif ! checkGeometry(name, &x, &y, &width, &height); checkParent(name, &parent); wparent=W_Void2Window(parent)->window; attrs.override_redirect=False; --- 885,901 ---- struct window *newwin; Window wparent; XSetWindowAttributes attrs; + int gx, gy; #ifdef DEBUG printf("New window...\n"); #endif ! checkGeometry(name, &gx, &gy, &width, &height); ! if ( gx >= 0 ) ! x=gx; ! if ( gy >= 0 ) ! y=gy; ! checkParent(name, &parent); wparent=W_Void2Window(parent)->window; attrs.override_redirect=False; *************** *** 992,1002 **** Window wparent; int i; XSetWindowAttributes attrs; #ifdef DEBUG printf("New window...\n"); #endif ! checkGeometry(name, &x, &y, &width, &height); checkParent(name, &parent); wparent=W_Void2Window(parent)->window; attrs.override_redirect=False; --- 1018,1034 ---- Window wparent; int i; XSetWindowAttributes attrs; + int gx, gy; #ifdef DEBUG printf("New window...\n"); #endif ! checkGeometry(name, &gx, &gy, &width, &height); ! if ( gx >= 0 ) ! x=gx; ! if ( gy >= 0 ) ! y=gy; ! checkParent(name, &parent); wparent=W_Void2Window(parent)->window; attrs.override_redirect=False; *************** *** 1205,1210 **** --- 1237,1245 ---- char *adefault; char buf[100]; char *s; + + + *x = *y = -1; sprintf(buf, "%s.geometry", name); adefault=getdefault(buf); ------------------------------ Newsgroups: alt.games.xtrek,rec.games.netrek From: terence@bronco.ece.cmu.edu (Terence Chang) Subject: Re: Galaxy clients (was Re: CLASH OF THE TREK-TITANS '92) Date: Tue, 7 Apr 1992 05:31:10 GMT I haven't released any client sources, unless you snagged them indirectly off of AFS -- there is only a "bronco server". As far as I know there are pure vanilla scam clients which are recognizable by the following known bugs: - doesn't recognize color.red in .xtrekrc - doesn't recognize italicfont in .xtrekrc - changes external border color (not guaranteed to work under X11R4) - displays scout's max etmp as 120 instead of 100 - stats window bar graphs not cleared after a refit - doesn't get along with window managers at all - has a char *buf[80] that's really a char buf[80] From there you can fix the problems, and then after that it's hard to trace the geneaology -- adding galaxy class support, or adding a set of independent team bitmaps, or common info borg features, or UDP support :) can all be done indepedently in any order. Terence ------------------------------ From: jcollins@nunki.usc.edu (James Collins) Newsgroups: alt.games.xtrek Subject: Re: Changing colors in the client code. Date: 12 Mar 92 15:43:16 GMT larkins@python.cis.ohio-state.edu (darrell brian larkins) writes: |> I have compiled the client code under HP-UX 6.5 and am having trouble |> with the color. There is a bug in the KSU sources (I don't know if this is in the bronco sources too) that keeps it from reading in new colors from the .xtrekrc... Basically, what you have to do is go into x11window.c to the getColors routine, find where the strcpy(defaultstring... line is and change strcpy to sprintf. It should work then. James ------------------------------ Newsgroups: rec.games.netrek From: rjones@sulaco.NoSubdomain.NoDomain (Ray Jones - Perp) Subject: Re: Client Bug on 16 Color Display Date: Fri, 25 Sep 92 15:29:39 GMT siegl@risc.uni-linz.ac.at (Kurt Siegl) writes: >[Color Map problem] This happens on TrueColor Screens. Here is the GetColors function from x11window.c that seems to solve the problem. I encourage any client-builders out there to incorporate this or some change like it in their code. GetColors() { int i,j; XColor foo, garbage; int white, black; unsigned long pixel; unsigned long planes[3]; char defaultstring[100]; char *defaults; extern int forceMono; forceMono = booleanDefault("forcemono", forceMono); /* 11/14/91 TC */ if ((DisplayCells(W_Display, W_Screen) <= 2) || forceMono) { white=WhitePixel(W_Display, W_Screen); black=BlackPixel(W_Display, W_Screen); for (i=0; i jkuner@be.seas.upenn.edu (John A. E. Kuner) writes: >I've been noticing that recently, when I play netrek from an NCD terminal, >there seems to be a memory leak bug somewhere. First, I get a 'Low on Memory - >any attempt to open new windows will result in error' or something like that. [...] You need to be more specific about what the "latest client" is, unless there's a single source of clients that I'm missing. I think I can nail this one, but in the future please be specific about which client it is and where you got it from. There was a problem in the original Hadley client that caused this (I could go for an hour or so, but a guy downstairs with a color monitor would play for about 1.5 minutes before he got booted). Didn't have a problem on a color Solbourne though. Here's Tedd's fix; not sure if it applies to the newer clients. It worked for me. ----- I haven't had a problem either on my color sun. The X implementation must do a better job of sharing colors. But it is a memory leak alright, I forgot to call XFreeCursor. Here's a patch: *** input.c Sat Aug 15 13:19:36 1992 --- ../input.c Tue Aug 25 14:48:57 1992 *************** *** 654,660 **** struct obtype *gettarget(); #ifdef NOWARP ! message_off(); /* ATM */ #endif #ifdef SHORT_PACKETS --- 654,661 ---- struct obtype *gettarget(); #ifdef NOWARP ! if(messageon) ! message_off(); /* ATM */ #endif #ifdef SHORT_PACKETS *** x11window.c Sat Aug 15 13:19:42 1992 --- ../x11window.c Tue Aug 25 14:56:52 1992 *************** *** 7,13 **** #include #include #include ! #ifdef TSH #include #endif #include --- 7,13 ---- #include #include #include ! #ifdef TCURSORS #include #endif #include *************** *** 158,163 **** --- 158,166 ---- #ifdef SHORT_PACKETS int insensitive; #endif + #ifdef TCURSORS + Cursor cursor; + #endif }; struct stringList { *************** *** 1372,1377 **** --- 1375,1383 ---- #ifdef SHORT_PACKETS newwin->insensitive = 0; #endif + #ifdef TCURSORS + newwin->cursor = NULL; + #endif return(newwin); } *************** *** 1750,1758 **** --- 1756,1768 ---- XQueryColor(W_Display, W_Colormap, &f); XQueryColor(W_Display, W_Colormap, &b); + if(win->cursor) + XFreeCursor(W_Display, win->cursor); + new = XCreateFontCursor(W_Display, XC_tcross); XRecolorCursor(W_Display, new, &f, &b); XDefineCursor(W_Display, win->window, new); + win->cursor = new; } void W_DefineTrekCursor(window) *************** *** 1769,1777 **** --- 1779,1791 ---- XQueryColor(W_Display, W_Colormap, &f); XQueryColor(W_Display, W_Colormap, &b); + if(win->cursor) + XFreeCursor(W_Display, win->cursor); + new = XCreateFontCursor(W_Display, XC_trek); XRecolorCursor(W_Display, new, &f, &b); XDefineCursor(W_Display, win->window, new); + win->cursor = new; } void W_DefineWarningCursor(window) *************** *** 1788,1796 **** --- 1802,1815 ---- XQueryColor(W_Display, W_Colormap, &f); XQueryColor(W_Display, W_Colormap, &b); + if(win->cursor) + XFreeCursor(W_Display, win->cursor); + new = XCreateFontCursor(W_Display, XC_pirate); XRecolorCursor(W_Display, new, &f, &b); XDefineCursor(W_Display, win->window, new); + + win->cursor = new; } void W_DefineArrowCursor(window) *************** *** 1807,1815 **** --- 1826,1839 ---- XQueryColor(W_Display, W_Colormap, &f); XQueryColor(W_Display, W_Colormap, &b); + if(win->cursor) + XFreeCursor(W_Display, win->cursor); + new = XCreateFontCursor(W_Display, XC_left_ptr); XRecolorCursor(W_Display, new, &f, &b); XDefineCursor(W_Display, win->window, new); + + win->cursor = new; } void W_DefineTextCursor(window) *************** *** 1826,1834 **** --- 1850,1863 ---- XQueryColor(W_Display, W_Colormap, &f); XQueryColor(W_Display, W_Colormap, &b); + if(win->cursor) + XFreeCursor(W_Display, win->cursor); + new = XCreateFontCursor(W_Display, XC_xterm); XRecolorCursor(W_Display, new, &f, &b); XDefineCursor(W_Display, win->window, new); + + win->cursor = new; } #endif ------------------------------ Newsgroups: rec.games.netrek From: siegl@risc.uni-linz.ac.at (Kurt Siegl) Subject: Re: X-Server doesn't work with Netrek!^#$!@ Date: Wed, 3 Feb 1993 09:32:57 GMT In article <1993Feb2.175625.47017@kuhub.cc.ukans.edu>, nazario@kuhub.cc.ukans.edu writes: > I am running the netrek client on an RS/6000 and trying to display the > screen on an IBMPC running OS/2 2.0, IBM TCP/IP 1.2.1 and PMX (IBM's > X-Server for OS/2) v 1.2.4. > > When ever I run the program I get the following output from the > x11netrek program running on the RS/6000: > > X Error of failed request: BadAccess (attempt to access private > resource denie) > Major opcode of failed request: 89 (X_StoreColors) > Minor opcode of failed request: 0 > Resource id in failed request: 0x0 > Serial number of failed request: 48 > Current serial number in output stream: 53 > The old Color problem problem again. I guess you are using a 16 color mode and the Client can't allocate 3 free planes. It has been fixed in most of the newer clients, but the latest version of the Berkeley RSA client has introduced this bug again. I suggest to client deveoper that they test this part after changing GetColors() in x11windows.c A qick hack around it is to replace the line } else if(DefaultDepth(W_Display, W_Screen) == 8) with } else if(1) in the Berkeley client and it works again. A solution for peoples without source: Just set forcemono: on in your .xtekrc and it should work. Kurt (007) Server GOD at melmac.risc.uni-linz.ac.at ------------------------------ End of CLIENT PATCHES *********************