From modemhero at users.sourceforge.net Mon May 1 11:10:20 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 01 May 2006 16:10:20 +0000 Subject: [netrek-cvs] client/netrekxp/src data.c, 1.14, 1.15 death.c, 1.3, 1.4 mswindow.c, 1.9, 1.10 newwin.c, 1.15, 1.16 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26913/src Modified Files: data.c death.c mswindow.c newwin.c Log Message: Added pretty geno bitmap (no it's not Kathy Ireland, it's a color galaxy picture) Index: death.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/death.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- death.c 21 Apr 2006 12:00:06 -0000 1.3 +++ death.c 1 May 2006 16:10:18 -0000 1.4 @@ -112,20 +112,20 @@ break; case KPHASER: sprintf (deathmessage, - "You were phasered to death by %s (%c%c)", + "You were phasered to death by %s (%c%c).", players[me->p_whodead].p_name, teamlet[players[me->p_whodead].p_team], shipnos[me->p_whodead]); break; case KPLANET: sprintf (deathmessage, - "You were killed by planetary fire from %s (%c)", + "You were killed by planetary fire from %s (%c).", planets[me->p_whodead].pl_name, teamlet[planets[me->p_whodead].pl_owner]); break; case KSHIP: sprintf (deathmessage, - "You were killed by the explosion of %s (%c%c)", + "You were killed by the explosion of %s (%c%c).", players[me->p_whodead].p_name, teamlet[players[me->p_whodead].p_team], shipnos[me->p_whodead]); @@ -134,12 +134,13 @@ strcpy (deathmessage, "You were killed by a dying daemon."); break; case KWINNER: - sprintf (deathmessage, "Galaxy has been conquered by %s (%c%c) %s", + sprintf (deathmessage, "Galaxy has been conquered by %s (%c%c) %s.", players[me->p_whodead].p_name, teamlet[players[me->p_whodead].p_team], shipnos[players[me->p_whodead].p_no], teamstring[players[me->p_whodead].p_team]); deathFont = W_BoldFont; + W_TileWindow (mapw, genopic); break; case KGHOST: strcpy (deathmessage, "You were killed by a confused daemon."); @@ -158,7 +159,7 @@ break; case KPLASMA: sprintf (deathmessage, - "You were SMACKed by a plasma torpedo from %s (%c%c) ", + "You were SMACKed by a plasma torpedo from %s (%c%c).", players[me->p_whodead].p_name, teamlet[players[me->p_whodead].p_team], shipnos[me->p_whodead]); @@ -176,13 +177,13 @@ strcpy (deathmessage, "Your netrek executable didn't verify correctly."); break; case KTORP2: - strcpy (deathmessage, "You were killed by detonated torpedo"); + strcpy (deathmessage, "You were killed by detonated torpedo."); break; case KSHIP2: - strcpy (deathmessage, "You were killed by chain reaction explosion"); + strcpy (deathmessage, "You were killed by chain reaction explosion."); break; case KPLASMA2: - strcpy (deathmessage, "You were killed by zapped plasma"); + strcpy (deathmessage, "You were killed by zapped plasma."); break; default: strcpy (deathmessage, "You were killed by something unknown to this game?"); Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- newwin.c 30 Apr 2006 15:59:40 -0000 1.15 +++ newwin.c 1 May 2006 16:10:18 -0000 1.16 @@ -1030,6 +1030,9 @@ clockpic = W_StoreBitmap3 ("bitmaps/misclib/clock.bmp", BMP_CLOCK_WIDTH, BMP_CLOCK_HEIGHT, BMP_CLOCK, qwin, LR_MONOCHROME); + genopic = + W_StoreBitmap3 ("bitmaps/misclib/genocide.bmp", WINSIDE, + WINSIDE, BMP_GENO, w, LR_DEFAULTCOLOR); } @@ -1383,6 +1386,7 @@ for (i = 0; i < 4; i++) W_UnmapWindow (teamWin[i]); W_UnmapWindow (qwin); + W_UnTileWindow (mapw); } Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- mswindow.c 30 Apr 2006 15:59:40 -0000 1.9 +++ mswindow.c 1 May 2006 16:10:18 -0000 1.10 @@ -497,6 +497,7 @@ free (cloakicon); free (stipple); + free (genopic); //Remove default objects while (defaults) Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- data.c 29 Apr 2006 19:22:38 -0000 1.14 +++ data.c 1 May 2006 16:10:18 -0000 1.15 @@ -236,7 +236,7 @@ extern double Sin[], Cos[]; -W_Icon stipple, clockpic, icon; +W_Icon stipple, clockpic, genopic, icon; W_Color borderColor, backColor, textColor, myColor, warningColor, shipCol[5], rColor, yColor, gColor, unColor, foreColor; From modemhero at users.sourceforge.net Mon May 1 11:10:20 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 01 May 2006 16:10:20 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.12, 1.13 build.cmd, 1.10, 1.11 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26913 Modified Files: NetrekXP to do list.C build.cmd Log Message: Added pretty geno bitmap (no it's not Kathy Ireland, it's a color galaxy picture) Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- NetrekXP to do list.C 1 May 2006 00:55:10 -0000 1.12 +++ NetrekXP to do list.C 1 May 2006 16:10:17 -0000 1.13 @@ -19,6 +19,8 @@ 4b) Locking onto iggy caues the observer sound to mess up for shields up/down (this is server side problem, both for the not being able to lock back onto your team, and the shield packet not being sent) +5) KWINNER called to all players at genocide, not KGENOCIDE, and observers don't get +any state at all (head to default which is error message). Things to do: 1) Add warning hull. @@ -35,9 +37,7 @@ - option server/servernick/servertype needs to be saved 5) A lot of annoying pop up windows (like macro window, default controls) should be closeable by shift right click. -6) genoed as obs on team with no planets -> you were killed by something not in this -game -7) Explore how changing SCALE breaks the client, and fix it: for future bitmap upgrades. +6) Explore how changing SCALE breaks the client, and fix it: for future bitmap upgrades. Might be done: 1) mouse scroll in message windows gets the up/down coord wrong when main title @@ -60,13 +60,11 @@ - whydead dies when out of range (not confirmed) - add "reset to defaults" to options menu + add installer -- maybe add two column playerlist - add bitmap themes option (change default bitmap naming and processing) - add shiftMouse, controlMouse on/off - add timestamps for messages (no place for timestamp) - fix accelerated scroll for microsoft mice - add msg.phaser to enable formatting of phaser messages -- add geno bitmap - add detCircle - add copy/paste possibility from message windows (richtext ?) - add clickable urls from message windows (richtext ?) Index: build.cmd =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/build.cmd,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- build.cmd 30 Apr 2006 15:59:38 -0000 1.10 +++ build.cmd 1 May 2006 16:10:17 -0000 1.11 @@ -441,6 +441,7 @@ copy resources\misclib\mono\shield.bmp %InstCWD%\netrek\bitmaps\misclib copy resources\misclib\mono\stipple.bmp %InstCWD%\netrek\bitmaps\misclib copy resources\misclib\mono\vshield.bmp %InstCWD%\netrek\bitmaps\misclib +copy resources\misclib\color\genocide.bmp %InstCWD%\netrek\bitmaps\misclib copy resources\fonts\ntfonts2.fon %InstCWD%\netrek From modemhero at users.sourceforge.net Mon May 1 11:10:20 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 01 May 2006 16:10:20 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt,1.34,1.35 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26913/resources/docs Modified Files: changes.txt Log Message: Added pretty geno bitmap (no it's not Kathy Ireland, it's a color galaxy picture) Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- changes.txt 1 May 2006 00:55:11 -0000 1.34 +++ changes.txt 1 May 2006 16:10:18 -0000 1.35 @@ -1,4 +1,5 @@ Version TBA: +- added pretty geno bitmap (no it's not Kathy Ireland, it's a color galaxy picture) - Added new plasma_kill sound (Fatality!) for when someone dies to plasma (note the sound fires based on kill messages, so if reportKills is off, you won't hear it). - fixed the reportKills option, it wasn't working, now it does. From modemhero at users.sourceforge.net Mon May 1 11:10:20 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 01 May 2006 16:10:20 +0000 Subject: [netrek-cvs] client/netrekxp/resources/weaplibm/color mtorpC.bmp, 1.1, 1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/weaplibm/color In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26913/resources/weaplibm/color Modified Files: mtorpC.bmp Log Message: Added pretty geno bitmap (no it's not Kathy Ireland, it's a color galaxy picture) Index: mtorpC.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/weaplibm/color/mtorpC.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsAovChz and /tmp/cvsjIlT9C differ From modemhero at users.sourceforge.net Mon May 1 11:10:20 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 01 May 2006 16:10:20 +0000 Subject: [netrek-cvs] client/netrekxp/include bitmaps.h, 1.5, 1.6 data.h, 1.10, 1.11 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26913/include Modified Files: bitmaps.h data.h Log Message: Added pretty geno bitmap (no it's not Kathy Ireland, it's a color galaxy picture) Index: bitmaps.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/bitmaps.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- bitmaps.h 29 Apr 2006 19:22:38 -0000 1.5 +++ bitmaps.h 1 May 2006 16:10:18 -0000 1.6 @@ -77,6 +77,7 @@ #define BMP_SHIELD 16 #define BMP_VSHIELD 17 #define BMP_STIPPLE 22 +#define BMP_GENO 23 #define BMP_SHIPEXPL_FRAMES 5 #define BMP_SBEXPL_FRAMES 7 Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- data.h 29 Apr 2006 19:22:38 -0000 1.10 +++ data.h 1 May 2006 16:10:18 -0000 1.11 @@ -232,7 +232,7 @@ extern double Sin[], Cos[]; -extern W_Icon stipple, clockpic; +extern W_Icon stipple, clockpic, genopic; extern W_Icon base_expview; extern W_Icon expview[BMP_SHIPEXPL_FRAMES]; From modemhero at users.sourceforge.net Mon May 1 11:10:20 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 01 May 2006 16:10:20 +0000 Subject: [netrek-cvs] client/netrekxp/resources/misclib/color genocide.bmp, NONE, 1.1 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/misclib/color In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26913/resources/misclib/color Added Files: genocide.bmp Log Message: Added pretty geno bitmap (no it's not Kathy Ireland, it's a color galaxy picture) --- NEW FILE: genocide.bmp --- (This appears to be a binary file; contents omitted.) From modemhero at users.sourceforge.net Mon May 1 13:06:24 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 01 May 2006 18:06:24 +0000 Subject: [netrek-cvs] client/netrekxp/src mswindow.c,1.10,1.11 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23153/src Modified Files: mswindow.c Log Message: Added new scaling function that will allow us to use higher resolution bitmaps - requires a set of x,y coords for the source bitmap (all defined in bitmap.h already) and a set for the diplay coords (defined in data.h for most bitmaps already). Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- mswindow.c 1 May 2006 16:10:18 -0000 1.10 +++ mswindow.c 1 May 2006 18:06:22 -0000 1.11 @@ -3765,6 +3765,63 @@ ReleaseDC (bitmap->hwnd, hdc); } +// Modified WriteBitmap for scaling images - BB, 5/1/2006 +void +W_WriteScaleBitmap (int x, + int y, + float SCALEX, + float SCALEY, + W_Icon icon, + W_Color color) +{ + register struct Icon *bitmap = (struct Icon *) icon; + register int border, width, height; + register int srcx, srcy; + HDC hdc; + + //Fast (I hope) rectangle intersection, don't overwrite our borders + srcx = bitmap->x; + srcy = bitmap->y; + border = bitmap->ClipRectAddr->top; + x += border; + y += border; + + if (x < border) + { + width = bitmap->width - (border - x); + srcx += border - x; + x = border; + } + else if ((width = bitmap->ClipRectAddr->right - x) > bitmap->width) + width = bitmap->width; + if (y < border) + { + height = bitmap->height - (border - y); + srcy += (border - y); + y = border; + } + else if ((height = bitmap->ClipRectAddr->bottom - y) > bitmap->height) + height = bitmap->height; + + hdc = GetDC (bitmap->hwnd); + if (NetrekPalette) + { + SelectPalette (hdc, NetrekPalette, FALSE); + RealizePalette (hdc); + } + SelectObject (GlobalMemDC, bitmap->bm); + + //Set the color of the bitmap + //(oddly enough, 1-bit = bk color, 0-bit = text (fg) color) + SetBkColor (hdc, colortable[color].rgb); + SetTextColor (hdc, colortable[BLACK].rgb); + SetStretchBltMode(hdc, HALFTONE); // Best quality + StretchBlt (hdc, x, y, //Copy the bitmap + (int)(height/SCALEX), (int)(width/SCALEY), GlobalMemDC, srcx, srcy, width, height, SRCPAINT); // <-- using OR mode + + ReleaseDC (bitmap->hwnd, hdc); +} + void W_WriteBitmapGrey (int x, int y, From modemhero at users.sourceforge.net Mon May 1 13:06:24 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 01 May 2006 18:06:24 +0000 Subject: [netrek-cvs] client/netrekxp/include proto.h, 1.10, 1.11 wlib.h, 1.2, 1.3 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23153/include Modified Files: proto.h wlib.h Log Message: Added new scaling function that will allow us to use higher resolution bitmaps - requires a set of x,y coords for the source bitmap (all defined in bitmap.h already) and a set for the diplay coords (defined in data.h for most bitmaps already). Index: wlib.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/wlib.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- wlib.h 12 Apr 2006 04:20:03 -0000 1.2 +++ wlib.h 1 May 2006 18:06:21 -0000 1.3 @@ -127,6 +127,12 @@ int y, W_Icon bit, W_Color color); +extern void W_WriteScaleBitmap (int x, + int y, + float SCALEX, + float SCALEY, + W_Icon icon, + W_Color color); extern void W_ClearArea (W_Window window, int x, int y, Index: proto.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- proto.h 29 Apr 2006 22:48:06 -0000 1.10 +++ proto.h 1 May 2006 18:06:21 -0000 1.11 @@ -626,6 +626,12 @@ int y, W_Icon icon, W_Color color); +void W_WriteScaleBitmap (int x, + int y, + float SCALEX, + float SCALEY, + W_Icon icon, + W_Color color); void W_WriteBitmapGrey (int x, int y, W_Icon icon, From modemhero at users.sourceforge.net Mon May 1 13:06:23 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 01 May 2006 18:06:23 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C,1.13,1.14 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23153 Modified Files: NetrekXP to do list.C Log Message: Added new scaling function that will allow us to use higher resolution bitmaps - requires a set of x,y coords for the source bitmap (all defined in bitmap.h already) and a set for the diplay coords (defined in data.h for most bitmaps already). Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- NetrekXP to do list.C 1 May 2006 16:10:17 -0000 1.13 +++ NetrekXP to do list.C 1 May 2006 18:06:20 -0000 1.14 @@ -37,7 +37,7 @@ - option server/servernick/servertype needs to be saved 5) A lot of annoying pop up windows (like macro window, default controls) should be closeable by shift right click. -6) Explore how changing SCALE breaks the client, and fix it: for future bitmap upgrades. +6) With new scaling function, implement Defcom's new bitmaps Might be done: 1) mouse scroll in message windows gets the up/down coord wrong when main title From modemhero at users.sourceforge.net Mon May 1 13:06:24 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 01 May 2006 18:06:24 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt,1.35,1.36 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23153/resources/docs Modified Files: changes.txt Log Message: Added new scaling function that will allow us to use higher resolution bitmaps - requires a set of x,y coords for the source bitmap (all defined in bitmap.h already) and a set for the diplay coords (defined in data.h for most bitmaps already). Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- changes.txt 1 May 2006 16:10:18 -0000 1.35 +++ changes.txt 1 May 2006 18:06:22 -0000 1.36 @@ -1,4 +1,5 @@ Version TBA: +- added new scaling function that will allow us to use higher resolution bitmaps - added pretty geno bitmap (no it's not Kathy Ireland, it's a color galaxy picture) - Added new plasma_kill sound (Fatality!) for when someone dies to plasma (note the sound fires based on kill messages, so if reportKills is off, you won't hear it). From modemhero at users.sourceforge.net Mon May 1 19:55:54 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 02 May 2006 00:55:54 +0000 Subject: [netrek-cvs] client/netrekxp/src cowmain.c, 1.10, 1.11 data.c, 1.15, 1.16 defaults.c, 1.13, 1.14 local.c, 1.16, 1.17 mswindow.c, 1.11, 1.12 newwin.c, 1.16, 1.17 option.c, 1.11, 1.12 playback.c, 1.11, 1.12 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29360/src Modified Files: cowmain.c data.c defaults.c local.c mswindow.c newwin.c option.c playback.c Log Message: Attempt to incorporate Defcom's high resolution bitmaps (80x80) into game . Right now all that is in, is a fed bitmaps, and they don't rotate yet (goal is to have CPU rotate ships for you). Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- mswindow.c 1 May 2006 18:06:22 -0000 1.11 +++ mswindow.c 2 May 2006 00:55:52 -0000 1.12 @@ -406,6 +406,7 @@ // Remove the ship bitmap structures we've created for (j = 0; j < NUM_TYPES; j++) + { for (k = 0; k < SHIP_VIEWS; k++) { free (fed_bitmapsT[j][k]); @@ -434,7 +435,12 @@ free (rom_bitmaps1[j][k]); free (rom_bitmaps[j][k]); } - + free (fed_bitmapsHR[j]); + free (ind_bitmapsHR[j]); + free (kli_bitmapsHR[j]); + free (ori_bitmapsHR[j]); + free (rom_bitmapsHR[j]); + } free (ship_bitmaps[0]); free (ship_bitmaps[1]); free (ship_bitmaps[2]); Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- newwin.c 1 May 2006 16:10:18 -0000 1.16 +++ newwin.c 2 May 2006 00:55:52 -0000 1.17 @@ -421,6 +421,63 @@ } /******************************************************************************/ +/*** loadweaponsHR() - high quality ship bitmaps, 80x80 +/******************************************************************************/ +void loadbitmapsHR() +{ + int j; + + if ( access("bitmaps/shiplib/fedshipHR.bmp", R_OK) == 0 + && access("bitmaps/shiplib/indshipHR.bmp", R_OK) == 0 + && access("bitmaps/shiplib/klishipHR.bmp", R_OK) == 0 + && access("bitmaps/shiplib/orishipHR.bmp", R_OK) == 0 + && access("bitmaps/shiplib/romshipHR.bmp", R_OK) == 0 ) + { + ship_bitmapsHR[0] = + W_StoreBitmap3 (fed_ship_bmp_HR, BMP_SHIP_WIDTH_HR * 8, + BMP_SHIP_HEIGHT_HR, BMP_FED_SHIP, w, + LR_DEFAULTCOLOR); + ship_bitmapsHR[1] = + W_StoreBitmap3 (ind_ship_bmp_HR, BMP_SHIP_WIDTH_HR * 8, + BMP_SHIP_HEIGHT_HR, BMP_IND_SHIP, w, + LR_DEFAULTCOLOR); + ship_bitmapsHR[2] = + W_StoreBitmap3 (kli_ship_bmp_HR, BMP_SHIP_WIDTH_HR * 8, + BMP_SHIP_HEIGHT_HR, BMP_KLI_SHIP, w, + LR_DEFAULTCOLOR); + ship_bitmapsHR[3] = + W_StoreBitmap3 (ori_ship_bmp_HR, BMP_SHIP_WIDTH_HR * 8, + BMP_SHIP_HEIGHT_HR, BMP_ORI_SHIP, w, + LR_DEFAULTCOLOR); + ship_bitmapsHR[4] = + W_StoreBitmap3 (rom_ship_bmp_HR, BMP_SHIP_WIDTH_HR * 8, + BMP_SHIP_HEIGHT_HR, BMP_ROM_SHIP, w, + LR_DEFAULTCOLOR); + } + else // No bitmaps, doh! + return; + + for (j = 0; j < NUM_TYPES; j++) + { + fed_bitmapsHR[j] = + W_PointBitmap2 (ship_bitmapsHR[0], j, 0, BMP_SHIP_WIDTH_HR, + BMP_SHIP_HEIGHT_HR); + ind_bitmapsHR[j] = + W_PointBitmap2 (ship_bitmapsHR[1], j, 0, BMP_SHIP_WIDTH_HR, + BMP_SHIP_HEIGHT_HR); + kli_bitmapsHR[j] = + W_PointBitmap2 (ship_bitmapsHR[2], j, 0, BMP_SHIP_WIDTH_HR, + BMP_SHIP_HEIGHT_HR); + ori_bitmapsHR[j] = + W_PointBitmap2 (ship_bitmapsHR[3], j, 0, BMP_SHIP_WIDTH_HR, + BMP_SHIP_HEIGHT_HR); + rom_bitmapsHR[j] = + W_PointBitmap2 (ship_bitmapsHR[4], j, 0, BMP_SHIP_WIDTH_HR, + BMP_SHIP_HEIGHT_HR); + } +} + +/******************************************************************************/ /*** loadweaponsC() - colorized weapons /******************************************************************************/ void loadweaponsC() @@ -863,6 +920,9 @@ loadbitmapsT(); loadbitmapsG(); break; + case 4: /* HR bitmaps */ + loadbitmapsHR(); + break; default: /* mono */ loadbitmapsM(); break; @@ -875,6 +935,7 @@ loadbitmapsG(); loadbitmapsT(); loadbitmapsM(); + loadbitmapsHR(); } #ifdef BEEPLITE Index: cowmain.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/cowmain.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- cowmain.c 26 Apr 2006 02:04:24 -0000 1.10 +++ cowmain.c 2 May 2006 00:55:52 -0000 1.11 @@ -747,6 +747,27 @@ if ((stringDefault ("indshipMbmpfile")) != NULL) ind_ship_bmp_M = stringDefault ("indshipMbmpfile"); + // HR bitmaps + fed_ship_bmp_HR = "bitmaps/shiplib/fedshipHR.bmp"; + if ((stringDefault ("fedshipHRbmpfile")) != NULL) + fed_ship_bmp_HR = stringDefault ("fedshipHRbmpfile"); + + rom_ship_bmp_HR = "bitmaps/shiplib/romshipHR.bmp"; + if ((stringDefault ("romshipHRbmpfile")) != NULL) + rom_ship_bmp_HR = stringDefault ("romshipHRbmpfile"); + + kli_ship_bmp_HR = "bitmaps/shiplib/klishipHR.bmp"; + if ((stringDefault ("klishipHRbmpfile")) != NULL) + kli_ship_bmp_HR = stringDefault ("klishipHRbmpfile"); + + ori_ship_bmp_HR = "bitmaps/shiplib/orishipHR.bmp"; + if ((stringDefault ("orishipHRbmpfile")) != NULL) + ori_ship_bmp_HR = stringDefault ("orishipHRbmpfile"); + + ind_ship_bmp_HR = "bitmaps/shiplib/indshipHR.bmp"; + if ((stringDefault ("indshipHRbmpfile")) != NULL) + ind_ship_bmp_HR = stringDefault ("indshipHRbmpfile"); + newwin (display_host, name); #ifdef META Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- local.c 29 Apr 2006 21:00:43 -0000 1.16 +++ local.c 2 May 2006 00:55:52 -0000 1.17 @@ -454,6 +454,7 @@ int newdx, newdy, distance, angle; /* For newSound */ W_Icon (*ship_bits)[SHIP_VIEWS]; + W_Icon (*ship_bitsHR); /* Kludge to try to fix missing ID chars on tactical (short range) display. */ @@ -667,13 +668,14 @@ /* Logic of color scheme is as follows: 1) Mono bitmaps (colorClient 0) and new bitmaps (colorClient 1) - are the same for both player and everyone else. + and high-res bitmaps (colorClient 4) are the same for both player + and everyone else. 2) Single color bitmaps (colorClient 2) and shaded single color bitmaps (colorClient 3) have a monochrome version (bitmap set G) that will be used for the player's ship, to set it apart in color from the rest of the team */ - if (colorClient <= 0 || colorClient > 3) + if (colorClient <= 0 || colorClient > 4) { switch (j->p_team) { @@ -757,6 +759,27 @@ break; } } + else if (colorClient == 4) + { + switch (j->p_team) + { + case FED: + ship_bitsHR = fed_bitmapsHR; + break; + case ROM: + ship_bitsHR = rom_bitmapsHR; + break; + case KLI: + ship_bitsHR = kli_bitmapsHR; + break; + case ORI: + ship_bitsHR = ori_bitmapsHR; + break; + default: + ship_bitsHR = ind_bitmapsHR; + break; + } + } else /* Default to bitmap set G (greyscale) for player's ship */ { switch (j->p_team) @@ -778,14 +801,25 @@ break; } } - - W_WriteBitmap (dx - (j->p_ship.s_width / 2), + + if (colorClient != 4) + { + W_WriteBitmap (dx - (j->p_ship.s_width / 2), dy - (j->p_ship.s_height / 2), ship_bits[j->p_ship. s_type][rosette (j->p_dir)], - playerColor (j)); - + } + else + { + W_WriteScaleBitmap (dx - (j->p_ship.s_width / 2), + dy - (j->p_ship.s_height / 2), + (float)(BMP_SHIP_WIDTH_HR/j->p_ship.s_width), + (float)(BMP_SHIP_HEIGHT_HR/j->p_ship.s_height), + ship_bitsHR[j->p_ship.s_type], + playerColor (j)); + } + if (j->p_cloakphase > 0) { W_WriteBitmap (dx - (cloak_width / 2), Index: playback.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/playback.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- playback.c 26 Apr 2006 02:04:24 -0000 1.11 +++ playback.c 2 May 2006 00:55:52 -0000 1.12 @@ -177,6 +177,27 @@ if ((stringDefault ("indshipMbmpfile")) != NULL) ind_ship_bmp_M = stringDefault ("indshipMbmpfile"); + // HR bitmaps + fed_ship_bmp_HR = "bitmaps/shiplib/fedshipHR.bmp"; + if ((stringDefault ("fedshipHRbmpfile")) != NULL) + fed_ship_bmp_HR = stringDefault ("fedshipHRbmpfile"); + + rom_ship_bmp_HR = "bitmaps/shiplib/romshipHR.bmp"; + if ((stringDefault ("romshipHRbmpfile")) != NULL) + rom_ship_bmp_HR = stringDefault ("romshipHRbmpfile"); + + kli_ship_bmp_HR = "bitmaps/shiplib/klishipHR.bmp"; + if ((stringDefault ("klishipHRbmpfile")) != NULL) + kli_ship_bmp_HR = stringDefault ("klishipHRbmpfile"); + + ori_ship_bmp_HR = "bitmaps/shiplib/orishipHR.bmp"; + if ((stringDefault ("orishipHRbmpfile")) != NULL) + ori_ship_bmp_HR = stringDefault ("orishipHRbmpfile"); + + ind_ship_bmp_HR = "bitmaps/shiplib/indshipHR.bmp"; + if ((stringDefault ("indshipHRbmpfile")) != NULL) + ind_ship_bmp_HR = stringDefault ("indshipHRbmpfile"); + newwin (display_host, name); resetdefaults (); Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- defaults.c 30 Apr 2006 20:17:47 -0000 1.13 +++ defaults.c 2 May 2006 00:55:52 -0000 1.14 @@ -84,7 +84,8 @@ "0 - mono", "1 - new color bitmaps (default)", "2 - old color bitmaps", - "3 - shaded old color bitmaps", + "3 - shaded old color bitmaps" + "4 - experimental high res bitmaps", NULL } }, Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- data.c 1 May 2006 16:10:18 -0000 1.15 +++ data.c 2 May 2006 00:55:52 -0000 1.16 @@ -300,6 +300,11 @@ kli_bitmapsT[NUM_TYPES][SHIP_VIEWS], rom_bitmapsT[NUM_TYPES][SHIP_VIEWS], ori_bitmapsT[NUM_TYPES][SHIP_VIEWS], ind_bitmapsT[NUM_TYPES][SHIP_VIEWS]; +W_Icon ship_bitmapsHR[5]; +W_Icon fed_bitmapsHR[NUM_TYPES], + kli_bitmapsHR[NUM_TYPES], rom_bitmapsHR[NUM_TYPES], + ori_bitmapsHR[NUM_TYPES], ind_bitmapsHR[NUM_TYPES]; + // Planets W_Icon base_planets; W_Icon base_mplanets; @@ -659,6 +664,11 @@ char *kli_ship_bmp_M; char *ori_ship_bmp_M; char *ind_ship_bmp_M; +char *fed_ship_bmp_HR; +char *rom_ship_bmp_HR; +char *kli_ship_bmp_HR; +char *ori_ship_bmp_HR; +char *ind_ship_bmp_HR; // Added to fix thread creation issue HANDLE MainThread = NULL; Index: option.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/option.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- option.c 30 Apr 2006 20:17:48 -0000 1.11 +++ option.c 2 May 2006 00:55:52 -0000 1.12 @@ -133,6 +133,7 @@ "New color bitmaps", "Old color bitmaps", "Shaded old color bitmaps", + "Experimental high res bitmaps", "" }; @@ -218,7 +219,7 @@ /* range of menus. Will be updated when menu list is assembled */ struct int_range Menus_Range = { 0, 1, 1 }; -struct int_range bitmap_range = { 0, 3, 1 }; +struct int_range bitmap_range = { 0, 4, 1 }; struct int_range keepInfo_range = { 0, 100, 1 }; From modemhero at users.sourceforge.net Mon May 1 19:55:54 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 02 May 2006 00:55:54 +0000 Subject: [netrek-cvs] client/netrekxp/resources/misclib/color genocide.bmp, 1.1, 1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/misclib/color In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29360/resources/misclib/color Modified Files: genocide.bmp Log Message: Attempt to incorporate Defcom's high resolution bitmaps (80x80) into game . Right now all that is in, is a fed bitmaps, and they don't rotate yet (goal is to have CPU rotate ships for you). Index: genocide.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/misclib/color/genocide.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs9pjSTG and /tmp/cvs7l903f differ From modemhero at users.sourceforge.net Mon May 1 19:55:54 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 02 May 2006 00:55:54 +0000 Subject: [netrek-cvs] client/netrekxp/resources/htmlhelp/html generalconfig.html, 1.6, 1.7 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29360/resources/htmlhelp/html Modified Files: generalconfig.html Log Message: Attempt to incorporate Defcom's high resolution bitmaps (80x80) into game . Right now all that is in, is a fed bitmaps, and they don't rotate yet (goal is to have CPU rotate ships for you). Index: generalconfig.html =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html/generalconfig.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- generalconfig.html 29 Apr 2006 19:22:38 -0000 1.6 +++ generalconfig.html 2 May 2006 00:55:52 -0000 1.7 @@ -136,6 +136,7 @@
  • 1 (default) - new color bitmaps
  • 2 - old color bitmaps
  • 3 - shaded old color bitmaps
  • +
  • 4 - experimental high res bitmaps
  • From modemhero at users.sourceforge.net Mon May 1 19:55:54 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 02 May 2006 00:55:54 +0000 Subject: [netrek-cvs] client/netrekxp/resources/htmlhelp netrek.chm, 1.5, 1.6 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/htmlhelp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29360/resources/htmlhelp Modified Files: netrek.chm Log Message: Attempt to incorporate Defcom's high resolution bitmaps (80x80) into game . Right now all that is in, is a fed bitmaps, and they don't rotate yet (goal is to have CPU rotate ships for you). Index: netrek.chm =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/netrek.chm,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 Binary files /tmp/cvsBRqHMu and /tmp/cvsR0O8p3 differ From modemhero at users.sourceforge.net Mon May 1 19:55:54 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 02 May 2006 00:55:54 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs netrekrc_options.txt, 1.4, 1.5 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29360/resources/docs Modified Files: netrekrc_options.txt Log Message: Attempt to incorporate Defcom's high resolution bitmaps (80x80) into game . Right now all that is in, is a fed bitmaps, and they don't rotate yet (goal is to have CPU rotate ships for you). Index: netrekrc_options.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc_options.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- netrekrc_options.txt 29 Apr 2006 19:22:38 -0000 1.4 +++ netrekrc_options.txt 2 May 2006 00:55:52 -0000 1.5 @@ -28,6 +28,7 @@ # 1 - new color bitmaps # 2 - old color bitmaps # 3 - shaded old color bitmaps +# 4 - experimental high res bitmaps colorfulPhasers: (on/off) make your phasers multicolored colorWeapons: (on/off) use colored bitmaps for torps and plasmas From modemhero at users.sourceforge.net Mon May 1 19:55:54 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 02 May 2006 00:55:54 +0000 Subject: [netrek-cvs] client/netrekxp/include bitmaps.h, 1.6, 1.7 data.h, 1.11, 1.12 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29360/include Modified Files: bitmaps.h data.h Log Message: Attempt to incorporate Defcom's high resolution bitmaps (80x80) into game . Right now all that is in, is a fed bitmaps, and they don't rotate yet (goal is to have CPU rotate ships for you). Index: bitmaps.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/bitmaps.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- bitmaps.h 1 May 2006 16:10:18 -0000 1.6 +++ bitmaps.h 2 May 2006 00:55:52 -0000 1.7 @@ -10,12 +10,16 @@ * #define rosette(x) ((((x) + 256/VIEWS/2) / (256/VIEWS) + VIEWS) % VIEWS) * - This function is more generic * An example using 16 views: - * (((x + 8) / 16 + 16) % 16) */ + * (((x + 8) / 16 + 16) % 16) + * Or 32 views: + * (((x + 4) / 8 + 32) % 32) */ #define rosette(x) ((((x) + 256/SHIP_VIEWS/2) / (256/SHIP_VIEWS) + SHIP_VIEWS) % SHIP_VIEWS) #define BMP_SHIP_WIDTH 20 #define BMP_SHIP_HEIGHT 20 +#define BMP_SHIP_WIDTH_HR 80 +#define BMP_SHIP_HEIGHT_HR 80 #define BMP_FED_SHIP 1 #define BMP_ORI_SHIP 4 Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- data.h 1 May 2006 16:10:18 -0000 1.11 +++ data.h 2 May 2006 00:55:52 -0000 1.12 @@ -296,6 +296,11 @@ kli_bitmapsT[NUM_TYPES][SHIP_VIEWS], rom_bitmapsT[NUM_TYPES][SHIP_VIEWS], ori_bitmapsT[NUM_TYPES][SHIP_VIEWS], ind_bitmapsT[NUM_TYPES][SHIP_VIEWS]; +extern W_Icon ship_bitmapsHR[5]; +extern W_Icon fed_bitmapsHR[NUM_TYPES], + kli_bitmapsHR[NUM_TYPES], rom_bitmapsHR[NUM_TYPES], + ori_bitmapsHR[NUM_TYPES], ind_bitmapsHR[NUM_TYPES]; + extern W_Icon base_planets; extern W_Icon base_mplanets; extern W_Icon bplanets[PLANET_VIEWS]; @@ -548,6 +553,11 @@ extern char *kli_ship_bmp_M; extern char *ori_ship_bmp_M; extern char *ind_ship_bmp_M; +extern char *fed_ship_bmp_HR; +extern char *rom_ship_bmp_HR; +extern char *kli_ship_bmp_HR; +extern char *ori_ship_bmp_HR; +extern char *ind_ship_bmp_HR; // Added to fix thread creation issue HANDLE MainThread; From modemhero at users.sourceforge.net Mon May 1 19:58:17 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 02 May 2006 00:58:17 +0000 Subject: [netrek-cvs] client/netrekxp/resources/ships/highres - New directory Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/ships/highres In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31393/highres Log Message: Directory /cvsroot/netrek/client/netrekxp/resources/ships/highres added to the repository From ahn at users.sourceforge.net Thu May 4 17:33:28 2006 From: ahn at users.sourceforge.net (Dave Ahn) Date: Thu, 04 May 2006 22:33:28 +0000 Subject: [netrek-cvs] CVSROOT loginfo,1.12,1.13 Message-ID: Update of /cvsroot/netrek/CVSROOT In directory sc8-pr-cvs7-new.sourceforge.net:/tmp/cvs-serv11633 Modified Files: loginfo Log Message: * Remove netrek-vanilla-cvs at lists.sourceforge.net. Index: loginfo =================================================================== RCS file: /cvsroot/netrek/CVSROOT/loginfo,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- loginfo 3 Feb 2006 05:20:09 -0000 1.12 +++ loginfo 4 May 2006 22:33:26 -0000 1.13 @@ -26,4 +26,4 @@ #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog # # Just testing -DEFAULT $CVSROOT/CVSROOT/syncmail -u %{sVv} netrek-vanilla-cvs at lists.sourceforge.net netrek-cvs at us.netrek.org +DEFAULT $CVSROOT/CVSROOT/syncmail -u %{sVv} netrek-cvs at us.netrek.org From ahn at users.sourceforge.net Thu May 4 18:40:00 2006 From: ahn at users.sourceforge.net (Dave Ahn) Date: Thu, 04 May 2006 23:40:00 +0000 Subject: [netrek-cvs] server/Vanilla/robots auto-archive.pl,1.1,1.2 Message-ID: Update of /cvsroot/netrek/server/Vanilla/robots In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6473/robots Modified Files: auto-archive.pl Log Message: * Update stats archiver mailing list. Index: auto-archive.pl =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robots/auto-archive.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- auto-archive.pl 21 Mar 2005 05:23:46 -0000 1.1 +++ auto-archive.pl 4 May 2006 23:39:58 -0000 1.2 @@ -36,7 +36,7 @@ # Archiver address. DO NOT CHANGE. # To never send stats to the central archive, comment it out. -$archiver = 'stats-archive at genocide.netrek.org'; +$archiver = 'stats-archive at orion.netrek.org'; ###### # Name of your clue server. Visit http://www.netrek.org/stats/ and From ahn at users.sourceforge.net Thu May 4 18:40:00 2006 From: ahn at users.sourceforge.net (Dave Ahn) Date: Thu, 04 May 2006 23:40:00 +0000 Subject: [netrek-cvs] server/Vanilla ChangeLog,1.36,1.37 Message-ID: Update of /cvsroot/netrek/server/Vanilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6473 Modified Files: ChangeLog Log Message: * Update stats archiver mailing list. Index: ChangeLog =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ChangeLog,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- ChangeLog 27 Apr 2006 00:24:07 -0000 1.36 +++ ChangeLog 4 May 2006 23:39:58 -0000 1.37 @@ -1,3 +1,6 @@ +Thu May 4 19:34:10 EDT 2006 Dave Ahn + * Update auto archiver email. + Thu Apr 27 09:32:33 2006 James Cameron * include/genspkt.h: add separate prototypes for genspkt.c since From modemhero at users.sourceforge.net Sat May 6 00:40:02 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 06 May 2006 05:40:02 +0000 Subject: [netrek-cvs] client/netrekxp/include proto.h, 1.11, 1.12 struct.h, 1.4, 1.5 wlib.h, 1.3, 1.4 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26644/include Modified Files: proto.h struct.h wlib.h Log Message: - *.tamu.edu removed from metaserver listing, and direct connect via -h servername also removed. This is due to the policy of blocking all players with the default login that comes with the client. - added new scaling/rotation function that allows us to use higher resolution bitmaps. The new bitmap set (made by Defcom) are stored in 80x80 pixel blocks (rather than 20x20 for all other bitmap sets). In addition, only 1 bitmap per ship is needed rather than 32 for each ship position - the rotation is done on the fly by Windows. To take advantage of the high res bitmap set, Windows 2000 or later is required. So far 2 bitmap sets have been completed. Index: wlib.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/wlib.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- wlib.h 1 May 2006 18:06:21 -0000 1.3 +++ wlib.h 6 May 2006 05:40:00 -0000 1.4 @@ -131,6 +131,7 @@ int y, float SCALEX, float SCALEY, + unsigned char p_dir, W_Icon icon, W_Color color); extern void W_ClearArea (W_Window window, Index: struct.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/struct.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- struct.h 26 Apr 2006 02:04:24 -0000 1.4 +++ struct.h 6 May 2006 05:40:00 -0000 1.5 @@ -629,12 +629,12 @@ W_Callback HandleKeyup; W_Callback HandleButton; W_Callback HandleExpose; - struct tagWindow *parent; - char name[32]; - int orig_x; - int orig_y; - int orig_width; - int orig_height; + struct tagWindow *parent; + char name[32]; + int orig_x; + int orig_y; + int orig_width; + int orig_height; int wam; /* Window Allowed Messages */ } Window; Index: proto.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- proto.h 1 May 2006 18:06:21 -0000 1.11 +++ proto.h 6 May 2006 05:40:00 -0000 1.12 @@ -630,6 +630,7 @@ int y, float SCALEX, float SCALEY, + unsigned char p_dir, W_Icon icon, W_Color color); void W_WriteBitmapGrey (int x, From modemhero at users.sourceforge.net Sat May 6 00:40:02 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 06 May 2006 05:40:02 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt,1.36,1.37 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26644/resources/docs Modified Files: changes.txt Log Message: - *.tamu.edu removed from metaserver listing, and direct connect via -h servername also removed. This is due to the policy of blocking all players with the default login that comes with the client. - added new scaling/rotation function that allows us to use higher resolution bitmaps. The new bitmap set (made by Defcom) are stored in 80x80 pixel blocks (rather than 20x20 for all other bitmap sets). In addition, only 1 bitmap per ship is needed rather than 32 for each ship position - the rotation is done on the fly by Windows. To take advantage of the high res bitmap set, Windows 2000 or later is required. So far 2 bitmap sets have been completed. Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- changes.txt 1 May 2006 18:06:22 -0000 1.36 +++ changes.txt 6 May 2006 05:40:00 -0000 1.37 @@ -1,5 +1,12 @@ Version TBA: -- added new scaling function that will allow us to use higher resolution bitmaps +- *.tamu.edu removed from metaserver listing, and direct connect via -h servername + also removed. This is due to the policy of blocking all players with the default + login that comes with the client. +- added new scaling/rotation function that allows us to use higher resolution bitmaps. + The new bitmap set (made by Defcom) are stored in 80x80 pixel blocks (rather than 20x20 + for all other bitmap sets). In addition, only 1 bitmap per ship is needed rather than + 32 for each ship position - the rotation is done on the fly by Windows. To take + advantage of the high res bitmap set, Windows 2000 or later is required. - added pretty geno bitmap (no it's not Kathy Ireland, it's a color galaxy picture) - Added new plasma_kill sound (Fatality!) for when someone dies to plasma (note the sound fires based on kill messages, so if reportKills is off, you won't hear it). From modemhero at users.sourceforge.net Sat May 6 00:40:02 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 06 May 2006 05:40:02 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.14, 1.15 build.cmd, 1.11, 1.12 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26644 Modified Files: NetrekXP to do list.C build.cmd Log Message: - *.tamu.edu removed from metaserver listing, and direct connect via -h servername also removed. This is due to the policy of blocking all players with the default login that comes with the client. - added new scaling/rotation function that allows us to use higher resolution bitmaps. The new bitmap set (made by Defcom) are stored in 80x80 pixel blocks (rather than 20x20 for all other bitmap sets). In addition, only 1 bitmap per ship is needed rather than 32 for each ship position - the rotation is done on the fly by Windows. To take advantage of the high res bitmap set, Windows 2000 or later is required. So far 2 bitmap sets have been completed. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- NetrekXP to do list.C 1 May 2006 18:06:20 -0000 1.14 +++ NetrekXP to do list.C 6 May 2006 05:39:59 -0000 1.15 @@ -38,6 +38,10 @@ 5) A lot of annoying pop up windows (like macro window, default controls) should be closeable by shift right click. 6) With new scaling function, implement Defcom's new bitmaps +6a) Issue with flickering. +7) Sorted playerlist messing up with multiple teams , with playerlistobs set to anything +but ingame players only, or observers only +7a) When someone leaves, in playersthenobservers option, last line isn't cleared Might be done: 1) mouse scroll in message windows gets the up/down coord wrong when main title Index: build.cmd =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/build.cmd,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- build.cmd 1 May 2006 16:10:17 -0000 1.11 +++ build.cmd 6 May 2006 05:39:59 -0000 1.12 @@ -411,6 +411,12 @@ copy resources\ships\tinted\ori\orishipT.bmp %InstCWD%\netrek\bitmaps\shiplib copy resources\ships\tinted\rom\romshipT.bmp %InstCWD%\netrek\bitmaps\shiplib +copy resources\ships\highres\fedshipHR.bmp %InstCWD%\netrek\bitmaps\shiplib +copy resources\ships\highres\indshipHR.bmp %InstCWD%\netrek\bitmaps\shiplib +copy resources\ships\highres\klishipHR.bmp %InstCWD%\netrek\bitmaps\shiplib +copy resources\ships\highres\orishipHR.bmp %InstCWD%\netrek\bitmaps\shiplib +copy resources\ships\highres\romshipHR.bmp %InstCWD%\netrek\bitmaps\shiplib + mkdir %InstCWD%\netrek\bitmaps\weaplibm mkdir %InstCWD%\netrek\bitmaps\weaplibm\mono copy resources\weaplibm\mono\*.bmp %InstCWD%\netrek\bitmaps\weaplibm\mono From modemhero at users.sourceforge.net Sat May 6 00:40:03 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 06 May 2006 05:40:03 +0000 Subject: [netrek-cvs] client/netrekxp/resources/ships/highres fedshipHR.bmp, NONE, 1.1 romshipHR.bmp, NONE, 1.1 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/ships/highres In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26644/resources/ships/highres Added Files: fedshipHR.bmp romshipHR.bmp Log Message: - *.tamu.edu removed from metaserver listing, and direct connect via -h servername also removed. This is due to the policy of blocking all players with the default login that comes with the client. - added new scaling/rotation function that allows us to use higher resolution bitmaps. The new bitmap set (made by Defcom) are stored in 80x80 pixel blocks (rather than 20x20 for all other bitmap sets). In addition, only 1 bitmap per ship is needed rather than 32 for each ship position - the rotation is done on the fly by Windows. To take advantage of the high res bitmap set, Windows 2000 or later is required. So far 2 bitmap sets have been completed. --- NEW FILE: fedshipHR.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: romshipHR.bmp --- (This appears to be a binary file; contents omitted.) From modemhero at users.sourceforge.net Sat May 6 00:40:02 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 06 May 2006 05:40:02 +0000 Subject: [netrek-cvs] client/netrekxp/src local.c, 1.17, 1.18 main.c, 1.3, 1.4 mswindow.c, 1.12, 1.13 newwin.c, 1.17, 1.18 parsemeta.c, 1.4, 1.5 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26644/src Modified Files: local.c main.c mswindow.c newwin.c parsemeta.c Log Message: - *.tamu.edu removed from metaserver listing, and direct connect via -h servername also removed. This is due to the policy of blocking all players with the default login that comes with the client. - added new scaling/rotation function that allows us to use higher resolution bitmaps. The new bitmap set (made by Defcom) are stored in 80x80 pixel blocks (rather than 20x20 for all other bitmap sets). In addition, only 1 bitmap per ship is needed rather than 32 for each ship position - the rotation is done on the fly by Windows. To take advantage of the high res bitmap set, Windows 2000 or later is required. So far 2 bitmap sets have been completed. Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- mswindow.c 2 May 2006 00:55:52 -0000 1.12 +++ mswindow.c 6 May 2006 05:40:00 -0000 1.13 @@ -27,6 +27,7 @@ #include #include #include +#include #include "copyright2.h" #include "config.h" @@ -3560,6 +3561,7 @@ return NULL; } + // Simplified version of StoreBitmap // Loads bitmap from resource file // This one is a bit more of a hog, no more giant bitmaps @@ -3621,6 +3623,7 @@ return NULL; } + // Simplified version of StoreBitmap // Loads bitmap from .BMP file W_Icon @@ -3771,61 +3774,104 @@ ReleaseDC (bitmap->hwnd, hdc); } -// Modified WriteBitmap for scaling images - BB, 5/1/2006 + +// Modified WriteBitmap for scaling and rotating images - BB, 5/1/2006 void W_WriteScaleBitmap (int x, - int y, - float SCALEX, - float SCALEY, - W_Icon icon, - W_Color color) + int y, + float SCALEX, + float SCALEY, + unsigned char p_dir, + W_Icon icon, + W_Color color) { register struct Icon *bitmap = (struct Icon *) icon; - register int border, width, height; + register int borderx, bordery, width, height; register int srcx, srcy; HDC hdc; + HBITMAP newbmp; + XFORM xForm; + double radians; + float cosine, sine, Point1x, Point1y, Point2x, Point2y, Point3x, Point3y; + float xscale, yscale; + float eDx, eDy; //Fast (I hope) rectangle intersection, don't overwrite our borders srcx = bitmap->x; srcy = bitmap->y; - border = bitmap->ClipRectAddr->top; - x += border; - y += border; - - if (x < border) - { - width = bitmap->width - (border - x); - srcx += border - x; - x = border; - } - else if ((width = bitmap->ClipRectAddr->right - x) > bitmap->width) - width = bitmap->width; - if (y < border) - { - height = bitmap->height - (border - y); - srcy += (border - y); - y = border; - } - else if ((height = bitmap->ClipRectAddr->bottom - y) > bitmap->height) - height = bitmap->height; + borderx = bitmap->ClipRectAddr->left; + x += borderx; + bordery = bitmap->ClipRectAddr->top; + y += bordery; + width = bitmap->width; + height = bitmap->height; + hdc = GetDC (bitmap->hwnd); + newbmp = CreateCompatibleBitmap ( hdc, width, height ); + if (NetrekPalette) { SelectPalette (hdc, NetrekPalette, FALSE); RealizePalette (hdc); } SelectObject (GlobalMemDC, bitmap->bm); - + SelectObject (GlobalMemDC2, newbmp); + + // Copy selected section of main bitmap into newbmp before rotation + BitBlt (GlobalMemDC2, 0, 0, width, height, GlobalMemDC, srcx, srcy, SRCPAINT); + //Set the color of the bitmap //(oddly enough, 1-bit = bk color, 0-bit = text (fg) color) SetBkColor (hdc, colortable[color].rgb); SetTextColor (hdc, colortable[BLACK].rgb); - SetStretchBltMode(hdc, HALFTONE); // Best quality - StretchBlt (hdc, x, y, //Copy the bitmap - (int)(height/SCALEX), (int)(width/SCALEY), GlobalMemDC, srcx, srcy, width, height, SRCPAINT); // <-- using OR mode + + //Convert p_dir to radians + radians=(2*3.14159*p_dir*360/255)/360; + cosine=(float)cos(radians); + sine=(float)sin(radians); + + // Scale used to find bitmap center + xscale = (float)(width/SCALEX/2); + yscale = (float)(height/SCALEY/2); + + // Compute dimensions of the resulting bitmap + // First get the coordinates of the 3 corners other than origin + Point1x=(height*sine); + Point1y=(height*cosine); + Point2x=(width*cosine+height*sine); + Point2y=(height*cosine-width*sine); + Point3x=(width*cosine); + Point3y=-(width*sine); + eDx = x + xscale - cosine*(xscale) + sine*(yscale); + eDy = y + yscale - cosine*(yscale) - sine*(xscale); + SetGraphicsMode(hdc,GM_ADVANCED); + + xForm.eM11=cosine/SCALEX; + xForm.eM12=sine/SCALEX; + xForm.eM21=-sine/SCALEY; + xForm.eM22=cosine/SCALEY; + xForm.eDx = eDx; + xForm.eDy = eDy; + + SetWorldTransform(hdc,&xForm); + BitBlt(hdc, 0, 0, width, height, GlobalMemDC2, 0, 0, SRCPAINT); + ReleaseDC (bitmap->hwnd, hdc); + DeleteObject (newbmp); + +/* Alternative method using PlgBlt, left in for reference purposes + + P[0].x = (long)(x + xscale - xscale*cos(angle) + yscale*sin(angle)); + P[0].y = (long)(y + yscale - yscale*cos(angle) - xscale*sin(angle)); + P[1].x = (long)(x + xscale - xscale*cos(angle+PI/2) + yscale*sin(angle+PI/2)); + P[1].y = (long)(y + yscale - yscale*cos(angle+PI/2) - xscale*sin(angle+PI/2)); + P[2].x = (long)(x + xscale - xscale*cos(angle-PI/2) + yscale*sin(angle-PI/2)); + P[2].y = (long)(y + yscale - yscale*cos(angle-PI/2) - xscale*sin(angle-PI/2)); + + PlgBlt (hdc, P, GlobalMemDC, srcx, srcy, width, height, 0, 0, 0 ); +*/ } void Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- newwin.c 2 May 2006 00:55:52 -0000 1.17 +++ newwin.c 6 May 2006 05:40:00 -0000 1.18 @@ -424,9 +424,9 @@ /*** loadweaponsHR() - high quality ship bitmaps, 80x80 /******************************************************************************/ void loadbitmapsHR() -{ +{ int j; - + if ( access("bitmaps/shiplib/fedshipHR.bmp", R_OK) == 0 && access("bitmaps/shiplib/indshipHR.bmp", R_OK) == 0 && access("bitmaps/shiplib/klishipHR.bmp", R_OK) == 0 @@ -1094,7 +1094,7 @@ genopic = W_StoreBitmap3 ("bitmaps/misclib/genocide.bmp", WINSIDE, WINSIDE, BMP_GENO, w, LR_DEFAULTCOLOR); - + } Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- local.c 2 May 2006 00:55:52 -0000 1.17 +++ local.c 6 May 2006 05:40:00 -0000 1.18 @@ -806,8 +806,7 @@ { W_WriteBitmap (dx - (j->p_ship.s_width / 2), dy - (j->p_ship.s_height / 2), - ship_bits[j->p_ship. - s_type][rosette (j->p_dir)], + ship_bits[j->p_ship.s_type][rosette (j->p_dir)], playerColor (j)); } else @@ -816,8 +815,9 @@ dy - (j->p_ship.s_height / 2), (float)(BMP_SHIP_WIDTH_HR/j->p_ship.s_width), (float)(BMP_SHIP_HEIGHT_HR/j->p_ship.s_height), + j->p_dir, ship_bitsHR[j->p_ship.s_type], - playerColor (j)); + playerColor (j)); } if (j->p_cloakphase > 0) Index: main.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/main.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- main.c 21 Apr 2006 12:00:07 -0000 1.3 +++ main.c 6 May 2006 05:40:00 -0000 1.4 @@ -256,6 +256,8 @@ if (i < argc) { servertmp = argv[i + 1]; + if (strstr(servertmp,".tamu.edu") != NULL) + exit (0); usemeta = 0; i++; } @@ -366,9 +368,9 @@ if (!usemeta && !servertmp) /* no meta type was selected, pick metaserver */ usemeta = 1; - - if (hideConsole) - FreeConsole (); + + if (hideConsole) + FreeConsole (); if (usage || err) { Index: parsemeta.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/parsemeta.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- parsemeta.c 21 Apr 2006 12:00:07 -0000 1.4 +++ parsemeta.c 6 May 2006 05:40:00 -0000 1.5 @@ -299,8 +299,8 @@ slist->pkt_rtt[i] = -1; #endif - /* Don't list Paradise Servers */ - if (slist->typeflag != 'P') + /* Don't list Paradise Servers or *.tamu.edu */ + if (slist->typeflag != 'P' && strstr(slist->address,".tamu.edu") == NULL) { #ifdef DEBUG @@ -572,27 +572,31 @@ metarefresh (int i) /* Refresh line i in the list */ { - struct servers *slist; - W_Color color = textColor; + struct servers *slist; + W_Color color = textColor; char buf[LINE + 1]; #ifdef METAPING - DWORD lag = 0; - int idx, replies = 0; + DWORD lag = 0; + int idx, replies = 0; #endif - slist = serverlist + i; - + slist = serverlist + i; + + // Don't list *.tamu.edu + if (strstr(slist->address,".tamu.edu") != NULL) + return; + #ifdef METAPING - if (metaPing) - sprintf (buf, "%-34s %14s ", - slist->address, statusStrings[slist->status]); - else + if (metaPing) + sprintf (buf, "%-34s %14s ", + slist->address, statusStrings[slist->status]); + else #endif sprintf (buf, "%-40s %14s ", slist->address, statusStrings[slist->status]); - if (slist->status == statusConnecting) color = W_Yellow; + if (slist->status == statusConnecting) color = W_Yellow; if (slist->status <= statusNull) { @@ -634,44 +638,44 @@ break; } } - else - { - strcat (buf, " "); - } + else + { + strcat (buf, " "); + } #ifdef METAPING - if (metaPing) + if (metaPing) + { + /* Print out the lag statistics */ + for (idx = 0; idx < RTT_AVG_BUFLEN; ++idx) { - /* Print out the lag statistics */ - for (idx = 0; idx < RTT_AVG_BUFLEN; ++idx) + if (serverlist[i].pkt_rtt[idx] != -3 && + serverlist[i].pkt_rtt[idx] != -2 && + serverlist[i].pkt_rtt[idx] != -1) // dont count these non-values { - if (serverlist[i].pkt_rtt[idx] != -3 && - serverlist[i].pkt_rtt[idx] != -2 && - serverlist[i].pkt_rtt[idx] != -1) // dont count these non-values - { - //printf ("i=%d idx=%d replies=%d rtt=%ld lag=%ld\n", i , idx, replies, serverlist[i].pkt_rtt[idx], lag); - lag += serverlist[i].pkt_rtt[idx]; - replies++; - } + //printf ("i=%d idx=%d replies=%d rtt=%ld lag=%ld\n", i , idx, replies, serverlist[i].pkt_rtt[idx], lag); + lag += serverlist[i].pkt_rtt[idx]; + replies++; } + } - //printf("i=%d replies=%ld idx=%ld rtt=%ld %s\n", i, replies, - // ((serverlist[i].cur_idx + RTT_AVG_BUFLEN - 1) % RTT_AVG_BUFLEN), - // serverlist[i].pkt_rtt[(serverlist[i].cur_idx + RTT_AVG_BUFLEN - 1) % RTT_AVG_BUFLEN], - // serverlist[i].address); + //printf("i=%d replies=%ld idx=%ld rtt=%ld %s\n", i, replies, + // ((serverlist[i].cur_idx + RTT_AVG_BUFLEN - 1) % RTT_AVG_BUFLEN), + // serverlist[i].pkt_rtt[(serverlist[i].cur_idx + RTT_AVG_BUFLEN - 1) % RTT_AVG_BUFLEN], + // serverlist[i].address); - if (replies > 0) - { - lag = lag / replies; - if (lag < 1000) sprintf (buf + strlen (buf), " %3ldms", lag); - else strcat(buf, " >1sec"); - } - else if (replies == 0 && serverlist[i].pkt_rtt[0] == -2) - strcat(buf, " Unknw"); // Unknown host - else if (replies == 0 && serverlist[i].pkt_rtt[0] == -3) - strcat(buf, " TmOut"); // TimeOut - else strcat(buf, " "); + if (replies > 0) + { + lag = lag / replies; + if (lag < 1000) sprintf (buf + strlen (buf), " %3ldms", lag); + else strcat(buf, " >1sec"); } + else if (replies == 0 && serverlist[i].pkt_rtt[0] == -2) + strcat(buf, " Unknw"); // Unknown host + else if (replies == 0 && serverlist[i].pkt_rtt[0] == -3) + strcat(buf, " TmOut"); // TimeOut + else strcat(buf, " "); + } #endif W_WriteText (metaWin, 0, i, color, buf, strlen (buf), 0); From modemhero at users.sourceforge.net Sat May 6 01:25:18 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 06 May 2006 06:25:18 +0000 Subject: [netrek-cvs] client/netrekxp/src newwin.c, 1.18, 1.19 playerlist.c, 1.6, 1.7 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12174/src Modified Files: newwin.c playerlist.c Log Message: Playerlist bug fix, as well as increasing playerlist window from 21 to 32 lines Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- newwin.c 6 May 2006 05:40:00 -0000 1.18 +++ newwin.c 6 May 2006 06:25:16 -0000 1.19 @@ -616,7 +616,7 @@ rankw = W_MakeTextWindow ("rank", 50, 300, 65, NUMRANKS + 9, w, 2); W_SetWindowExposeHandler (rankw, ranklist); - playerw = W_MakeTextWindow ("player", 0, WINSIDE + 50, PlistMaxWidth (), 21, baseWin, 2); + playerw = W_MakeTextWindow ("player", 0, WINSIDE + 50, PlistMaxWidth (), 32, baseWin, 2); W_SetWindowExposeHandler (playerw, RedrawPlayerList); playerw2 = W_MakeTextWindow ("player2", 140, 100, PlistMaxWidth2 (), 32, baseWin, 2); Index: playerlist.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/playerlist.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- playerlist.c 30 Apr 2006 20:29:33 -0000 1.6 +++ playerlist.c 6 May 2006 06:25:16 -0000 1.7 @@ -594,7 +594,6 @@ row = --plistLastRow; else row = --(teamPos[remap[current->p_team]]); - row = --(teamPos[remap[current->p_team]]); if ((!updatePlayer[i]) && plistPos[i] == row) continue; From modemhero at users.sourceforge.net Sat May 6 01:25:18 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 06 May 2006 06:25:18 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt,1.37,1.38 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12174/resources/docs Modified Files: changes.txt Log Message: Playerlist bug fix, as well as increasing playerlist window from 21 to 32 lines Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- changes.txt 6 May 2006 05:40:00 -0000 1.37 +++ changes.txt 6 May 2006 06:25:16 -0000 1.38 @@ -1,4 +1,5 @@ Version TBA: +- fixed some playerlist bugs, and increased playerlist window from 21 to 32 lines - *.tamu.edu removed from metaserver listing, and direct connect via -h servername also removed. This is due to the policy of blocking all players with the default login that comes with the client. From modemhero at users.sourceforge.net Sat May 6 01:25:18 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 06 May 2006 06:25:18 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C,1.15,1.16 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12174 Modified Files: NetrekXP to do list.C Log Message: Playerlist bug fix, as well as increasing playerlist window from 21 to 32 lines Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- NetrekXP to do list.C 6 May 2006 05:39:59 -0000 1.15 +++ NetrekXP to do list.C 6 May 2006 06:25:14 -0000 1.16 @@ -39,9 +39,7 @@ closeable by shift right click. 6) With new scaling function, implement Defcom's new bitmaps 6a) Issue with flickering. -7) Sorted playerlist messing up with multiple teams , with playerlistobs set to anything -but ingame players only, or observers only -7a) When someone leaves, in playersthenobservers option, last line isn't cleared +6b) Issue with 0 degree messing up bitmap. Might be done: 1) mouse scroll in message windows gets the up/down coord wrong when main title From modemhero at users.sourceforge.net Sat May 6 01:36:38 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 06 May 2006 06:36:38 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt,1.38,1.39 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16827/resources/docs Modified Files: changes.txt Log Message: Hack to fix poor display on HR ships at angle = 0.000000 Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- changes.txt 6 May 2006 06:25:16 -0000 1.38 +++ changes.txt 6 May 2006 06:36:35 -0000 1.39 @@ -1,4 +1,5 @@ Version TBA: +- hack to fix poor display on HR ships at angle = 0 - fixed some playerlist bugs, and increased playerlist window from 21 to 32 lines - *.tamu.edu removed from metaserver listing, and direct connect via -h servername also removed. This is due to the policy of blocking all players with the default From modemhero at users.sourceforge.net Sat May 6 01:36:38 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 06 May 2006 06:36:38 +0000 Subject: [netrek-cvs] client/netrekxp/src mswindow.c,1.13,1.14 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16827/src Modified Files: mswindow.c Log Message: Hack to fix poor display on HR ships at angle = 0.000000 Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- mswindow.c 6 May 2006 05:40:00 -0000 1.13 +++ mswindow.c 6 May 2006 06:36:36 -0000 1.14 @@ -3828,6 +3828,9 @@ //Convert p_dir to radians radians=(2*3.14159*p_dir*360/255)/360; + //Setworldtransform screws up at angle = 0, slight hack to fix + if (radians == 0.0) + radians = 0.0000001; cosine=(float)cos(radians); sine=(float)sin(radians); From quozl at users.sourceforge.net Sat May 6 07:01:02 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Sat, 06 May 2006 12:01:02 +0000 Subject: [netrek-cvs] server/Vanilla PROJECTS,1.8,1.9 Message-ID: Update of /cvsroot/netrek/server/Vanilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2967 Modified Files: PROJECTS Log Message: Index: PROJECTS =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/PROJECTS,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- PROJECTS 22 Apr 2006 11:31:52 -0000 1.8 +++ PROJECTS 6 May 2006 12:01:00 -0000 1.9 @@ -3,60 +3,41 @@ List of things to do in the future - - metaserver begins to list robots on a server after the - server has stopped sending player count updates by perhaps - the TCP query from the server is mistaken. + - dist-minimal target, to make ntserv & include only? - - vote per IP address only, not per slot + - config.h.in settings to move to configure --enable-feature + options, so that a separate config.h.in does not need to be + maintained by server administrators. - - separate ban and eject votes, ban to include effect of - eject, ban for an hour, or while the players that voted - still have the same slot (ban based on an a mask of slots - that voted for it) + - banned login for client with tryudp on seems to begin udp + negotiation, making it hard for the player to see the cause + of hang. -quozl's working notes ... { + - banned login can still tie up a slot for as long as it takes + for it to time out or the player to hit QUIT. -expiry by time - check list, remove based on time (time_t) -expiry by departure - check list, remove if any voters have gone (MAXPLAYER x p_no, p_pos) -connect - do expiry - pass if observer - check list of temporary bans, by ip address (p_monitor?) -login - do expiry - pass if guest - pass if observer (but set :ita for all) - check list of temporary bans, by p_name -refit mask wait - do not offer a team they have been banned from? -queue wait - do not accept a slot if they are banned from that team -eject vote - do expiry - insert entry into list - (time_t, p_name, p_monitor, n_voted MAXPLAYER(p_no, p_pos)) - if they are not banned from the other team, offer them a ship there -data - MAXPERSISTENTBANS (time_t, p_name, p_monitor, MAXPLAYER(p_no, p_updates, p_team, p_pos)) + - perm and temp bans in netrekd, have it access shmem and + detach. -BFGOD -BFTEAM -struct ban { - u_int b_flags; - time_t b_when; - char p_name[NAME_LEN]; - char p_ip[NAME_LEN]; - struct ban_matrix { - int p_no; - int p_updates; - short p_team; - pid_t p_process; - } b_matrix[MAXPLAYER]; -} bans[MAXBANS]; + - queue dump, once a sufficient queue has built, for each of + the queued players close the shared memory section for one + game and open a new one. Forward link from queue to next + section. -} quozl's working notes + - genocide, pause game, reveal cloakers, declare result, wait + five to ten seconds (sysdef GENOCIDE_WAIT), resume, blow + everyone up, reset galactic, if no queue do a balance + (sysdef GENOCIDE_BALANCE), if queue purge the slots. + + - timercide, pause game, reveal cloakers, declare result, wait + five to ten seconds (sysdef TIMERCIDE_WAIT), resume, blow + losing team up. + + - metaserver begins to list robots on a server after the + server has stopped sending player count updates by perhaps + the TCP query from the server is mistaken. + + - vote per IP address only, not per slot - prevent eject in initial two-minutes of ship time, if ship active, From quozl at users.sourceforge.net Sat May 6 07:00:21 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Sat, 06 May 2006 12:00:21 +0000 Subject: [netrek-cvs] server/Vanilla CHANGES,1.1,1.2 Message-ID: Update of /cvsroot/netrek/server/Vanilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2787 Modified Files: CHANGES Log Message: Index: CHANGES =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/CHANGES,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CHANGES 21 Mar 2005 05:23:33 -0000 1.1 +++ CHANGES 6 May 2006 12:00:19 -0000 1.2 @@ -618,5 +618,5 @@ cameron at stl.dec.com Edit voting status messages to indicate who we are waiting on. - NOTE: FURTHER CHANGES ARE TRACKED IN THE FILE ChangeLog + NOTE: FURTHER CHANGES ARE TRACKED IN THE FILE ChangeLog and NEWS From quozl at users.sourceforge.net Sat May 6 07:02:51 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Sat, 06 May 2006 12:02:51 +0000 Subject: [netrek-cvs] server/Vanilla Makefile.in,1.10,1.11 Message-ID: Update of /cvsroot/netrek/server/Vanilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3936 Modified Files: Makefile.in Log Message: add draft minimal dist Index: Makefile.in =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/Makefile.in,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Makefile.in 22 Apr 2006 11:31:52 -0000 1.10 +++ Makefile.in 6 May 2006 12:02:49 -0000 1.11 @@ -215,6 +215,34 @@ GZIP=--best tar cfz $(NAME).tar.gz $(NAME) rm -rf $(NAME) +dist-minimal: + mkdir $(NAME)-minimal + # what has changed + cp -p ChangeLog NEWS $(NAME)-minimal/ + # top level documentation + cp -p INSTALL INSTALL.INL INSTALL.Newbie INSTALL.RSA README \ + README.developers $(NAME)-minimal/ + # configuration + cp -p configure.in Makefile.in system.mk.in configure install-sh \ + name.c $(NAME)-minimal/ + # subdirectories + cp -rp docs include keycomp newstartd ntserv res-rsa robots robotd \ + $(NAME)-minimal/ + # packaging subdirectories (debian) + mkdir $(NAME)-minimal/debian $(NAME)-minimal/rpm + cp -p debian/README.Debian debian/changelog debian/control \ + debian/copyright debian/init debian/postinst debian/rules \ + $(NAME)-minimal/debian + # packaging subdirectories (rpm) + cp -rp rpm $(NAME)-minimal/ + # strip out surplus + rm -rf $(NAME)-minimal/*/CVS $(NAME)-minimal/*/*/CVS + rm -rf $(NAME)-minimal/.cvsignore $(NAME)-minimal/*/.cvsignore + rm -rf $(NAME)-minimal/*/.deps $(NAME)-minimal/*~ $(NAME)-minimal/*/*~ + # build + GZIP=--best tar cfz $(NAME)-minimal.tar.gz $(NAME)-minimal + rm -rf $(NAME)-minimal + # # Maintainer's Debian packaging section # From quozl at users.sourceforge.net Sat May 6 07:05:59 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Sat, 06 May 2006 12:05:59 +0000 Subject: [netrek-cvs] server/Vanilla/ntserv commands.c,1.5,1.6 Message-ID: Update of /cvsroot/netrek/server/Vanilla/ntserv In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5335/ntserv Modified Files: commands.c Log Message: remove unused code Index: commands.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/commands.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- commands.c 26 Apr 2006 09:52:43 -0000 1.5 +++ commands.c 6 May 2006 12:05:57 -0000 1.6 @@ -1,5 +1,6 @@ /* * Commands.c + * Not part of ntserv or daemon */ /* @@ -53,31 +54,6 @@ int do_generic_vote(char *comm, int who); int do_start_robot(); -#if !defined(INL) -int do_player_eject(); -#endif - -#if defined (AUTO_INL) && !defined(INL) -int do_start_inl(); -#endif - -#if defined (AUTO_PRACTICE) && !defined(BASEP) -int do_start_basep(); -#endif - -#if defined(AUTO_HOCKEY) && !defined(PUCK) -int do_start_puck(); -#endif - -#if defined(AUTO_DOGFIGHT) && !defined(DOG) -int do_start_mars(); -#endif - -#if defined (TRIPLE_PLANET_MAYHEM) -int do_balance(); -int do_triple_planet_mayhem(); -#endif - #if defined (DOG) || defined (PUCK) /* DOG-FIGHTING & PUCK stuff */ extern int do_score_msg(); @@ -394,31 +370,6 @@ struct vote_handler votes[] = { { NULL, 0, 0, 0, NULL, 0, NULL}, /* record 0 */ -#if !defined(INL) - { "EJECT", - VC_TEAM | VC_GLOG | VC_PLAYER, - 2, - 0, - "To eject a player. Ex: 'EJECT 0'", - 120, - do_player_eject }, /* EJECT */ -#endif -#if defined(TRIPLE_PLANET_MAYHEM) && !defined(ROBOT) - { "TRIPLE", - VC_ALL | VC_GLOG, - 2, - 22, - "Start triple planet mayhem by vote", - 0, - do_triple_planet_mayhem }, - { "BALANCE", - VC_ALL | VC_GLOG, - 4, - 23, - "Request team randomise & balance", - 0, - do_balance }, -#endif #if defined (DOG) || defined (PUCK) { "NEWGAME", VC_ALL, @@ -437,15 +388,6 @@ 0, do_change_timekeep }, /* Short game */ #endif -#if defined(AUTO_INL) && !defined(ROBOT) - { "INL", - VC_ALL|VC_GLOG, - 1, - 20, - "Start game under INL rules.", - 0, - do_start_inl}, -#endif #if (defined(AUTO_INL) && defined(INL)) || (defined(BASEP) && defined(AUTO_PRACTICE)) || (defined(AUTO_HOCKEY) && defined(PUCK)) || (defined(AUTO_DOGFIGHT) && defined (DOG)) { "EXIT", VC_ALL, @@ -455,33 +397,6 @@ 0, cleanup}, #endif -#if defined(AUTO_PRACTICE) && !defined(ROBOT) - { "PRACTICE", - VC_ALL, - 1, - 20, - "Start basepractice by majority vote.", - 0, - do_start_basep}, -#endif -#if defined(AUTO_HOCKEY) && !defined(ROBOT) - { "HOCKEY", - VC_ALL|VC_GLOG, - 1, - 20, - "Start hockey by majority vote.", - 0, - do_start_puck}, -#endif -#if defined(AUTO_DOGFIGHT) && !defined(ROBOT) - { "DOGFIGHT", - VC_ALL|VC_GLOG, - 1, - 20, - "Start dogfight tournament by majority vote.", - 0, - do_start_mars}, -#endif }; @@ -592,460 +507,6 @@ return what; } - - - - -#if defined(TRIPLE_PLANET_MAYHEM) -/* -** 16-Jul-1994 James Cameron -** -** Balances teams according to player statistics. -** Intended for use with Triple Planet Mayhem -*/ - -/* -** Tell all that player will be moved -*/ -static void moveallmsg ( int p_no, int ours, int theirs ) -{ - struct player *k = &players[p_no]; - pmessage(0, MALL, "GOD->ALL", - "Balance: %16s (%c%c) is to join the %s", - k->p_name, teamlet[k->p_team], shipnos[p_no], team_name(ours)); -} - -/* -** Move a player to the specified team, if they are not yet there. -** Make them peaceful with the new team, and hostile/at war with the -** other team. -*/ -static void -move(int p_no, int ours, int theirs) -{ - struct player *k = &players[p_no]; - int queue; - - if ( k->p_team != ours ) { - pmessage(k->p_no, MINDIV, addr_mess(k->p_no,MINDIV), - "%s: please SWAP SIDES to the %s", k->p_name, team_name(ours)); - } - else { - pmessage(k->p_no, MINDIV, addr_mess(k->p_no,MINDIV), - "%s: please remain with the %s", k->p_name, team_name(ours)); - } - - printf("Balance: %16s (%s) is to join the %s\n", - k->p_name, k->p_mapchars, team_name(ours)); - - /* cope with a balance during INL pre-game, if we don't shift players who - are on the QU_HOME or QU_AWAY queues then the queue masks will force - them to join the team they were on anyway. */ - queue = ( ours == FED ) ? QU_HOME : QU_AWAY; - if (k->w_queue != QU_PICKUP && k->w_queue != queue) { - queues[k->w_queue].free_slots++; - k->w_queue = queue; - queues[k->w_queue].free_slots--; - } - - k->p_hostile |= theirs; - k->p_swar |= theirs; - k->p_hostile &= ~ours; - k->p_swar &= ~ours; - k->p_war = (k->p_hostile | k->p_swar); - k->p_team = ours; - sprintf(k->p_mapchars, "%c%c", teamlet[k->p_team], shipnos[p_no]); - sprintf(k->p_longname, "%s (%s)", k->p_name, k->p_mapchars); - - k->p_status = PEXPLODE; - k->p_whydead = KPROVIDENCE; /* should be KTOURNSTART? */ - if (k->p_ship.s_type == STARBASE) - k->p_explode = 2 * SBEXPVIEWS; - else - k->p_explode = 10; - k->p_ntorp = 0; - k->p_nplasmatorp = 0; - k->p_hostile = (FED | ROM | ORI | KLI); - k->p_war = (k->p_hostile | k->p_swar); -} - -/* -** Return two team masks corresponding to the teams of the first two -** teams found in the player list. -*/ -static void sides ( int *one, int *two ) -{ - struct player *k; - int i; - int unseen; - - unseen = (FED | ROM | ORI | KLI); - *one = 0; - *two = 0; - k = &players[0]; - for(i=0;ip_status != PFREE) && (!(k->p_flags & PFROBOT))) - { - if ( ( unseen & k->p_team ) != 0 ) - { - if ( *one == 0 ) - { - *one = k->p_team; - unseen &= ~k->p_team; - k++; - continue; - } - *two = k->p_team; - return; - } - } - k++; - } -} - -/* -** Calculate a player value -*/ -static int value ( struct player *k ) -{ - return - (int) - ( - (float) - ( -#ifdef LTD_STATS - ltd_bombing_rating(k) + - ltd_planet_rating(k) + - ltd_offense_rating(k) -#else - bombingRating(k) + - planetRating(k) + - offenseRating(k) -#endif - ) * 100.0 - ); -} - -/* -** Balance the teams -** -** Uses an exhaustive algorithm (I'm exhausted!) to find the best combination -** of the current players that balances the teams in terms of statistics. -** The algorithm will support only the number of players that fits into the -** number of bits in an int. -** -** If there are multiple "best" combinations, then the combination -** involving the least number of team swaps will be chosen. -*/ -int do_balance(void) -{ - int i, j; /* miscellaneous counters */ - int records; /* number of players in game */ - int one; /* team number one mask */ - int two; /* team number two mask */ - - struct player *k; /* pointer to current player */ - - struct item - { - int p_no; /* player number */ - int p_value; /* calculated player value */ - int p_team; /* team player on previously */ - } list[MAXPLAYER]; /* working array */ - - struct - { - int combination; /* combination number */ - int value; /* team balance difference */ - int one; /* team one total value */ - int two; /* team two total value */ - int swaps; /* number of swaps involved */ - } best; /* best team combination */ - - /* which teams are playing? give up if only one found */ - sides ( &one, &two ); - if ( two == 0 ) - { - pmessage ( 0, MALL, "GOD->ALL", - "Can't balance only one team!" ); - pmessage ( 0, MALL, "GOD->ALL", - "Please could somebody move to another team, then all vote again?" ); - return 0; - } - - /* initialise best to worst case */ - best.combination = -1; - best.value = 1<<30; - best.one = 0; - best.two = 0; - best.swaps = 1<<30; - - /* reset working array */ - for(i=0;ip_status != PFREE) && (!(k->p_flags & PFROBOT))) - { - list[records].p_no = k->p_no; - list[records].p_value = value ( k ); - list[records].p_team = k->p_team; - records++; - } - k++; - } - - /* randomise the working array; may cause different team mixes */ - for(i=0;i 1 ) continue; - - /* reset team total for attempt */ - value_a = 0; - value_b = 0; - - /* calculate team total stats */ - for(j=0;jALL", - "The %s total rating will be %.2f", - team_name(one), - (float) ( best.one / 100.0 ) ); - - pmessage ( 0, MALL, "GOD->ALL", - "The %s total rating will be %.2f", - team_name(two), - (float) ( best.two / 100.0 ) ); - - return 0; -} - -int do_triple_planet_mayhem(void) -{ - int i; - - struct player* j; - - /* balance the teams */ - do_balance(); - - /* move all planets off the galaxy */ - for (i=0; iALL", list[i] ); - } - return 0; -} -#endif /* TRIPLE_PLANET_MAYHEM */ - - -#if !defined(INL) -int do_player_eject(int who, int player, int mflags, int sendto) -{ - register struct player *j; - - j = &players[player]; - - if (j->p_status == PFREE){ - pmessage(sendto, mflags, addr_mess(who,MTEAM), - "That player is not in the game"); - return; - } - if (j->p_flags & PFROBOT) { - pmessage(sendto, mflags, addr_mess(players[who].p_team,MTEAM), - "You cannot eject a robot, twinks!"); - return; - } - if (j->p_team != players[who].p_team){ - pmessage(players[who].p_team, MTEAM, - addr_mess(players[who].p_team,MTEAM), - "You can only eject your own teammates, twinks!"); - return; - } - - pmessage(0, MALL, addr_mess(who,MALL), - " %2s has been ejected by the players", j->p_mapchars); - -#if defined (DOG) - reset_player(j->p_no); - dont_score(j->p_no); -#endif - - eject_player(j->p_no); - if (freeslot(j) < 0) { - ERROR(1,("do_player_eject: freeslot failed\n")); - } -} - -eject_player(int who) -{ - struct player* j; - - j = &players[who]; - j->p_ship.s_type = STARBASE; - j->p_whydead=KQUIT; - j->p_explode=10; - j->p_status=PEXPLODE; - j->p_whodead=me->p_no; -} -#endif - check_listing(comm) char *comm; { @@ -1197,54 +658,6 @@ return 1; } -#if defined(AUTO_PRACTICE) && !defined(BASEP) -int do_start_basep(who, mflags, sendto) -int who, mflags,sendto; -{ - if (vfork() == 0) { - (void) SIGNAL(SIGALRM,SIG_DFL); - execl(Basep, "basep", 0); - perror(Basep); - } -} -#endif - -#if defined(AUTO_INL) && !defined(INL) -int do_start_inl(who, mflags, sendto) -int who, mflags, sendto; -{ - if (vfork() == 0) { - (void) SIGNAL(SIGALRM,SIG_DFL); - execl(Inl, "inl", 0); - perror(Inl); - } -} -#endif - -#if defined(AUTO_HOCKEY) && !defined(PUCK) -int do_start_puck(who, mflags, sendto) -int who, mflags, sendto; -{ - if (vfork() == 0) { - (void) SIGNAL(SIGALRM,SIG_DFL); - execl(Puck, "puck", 0); - perror(Puck); - } -} -#endif - -#if defined(AUTO_DOGFIGHT) && !defined(DOG) -int do_start_mars(who, mflags, sendto) -int who, mflags, sendto; -{ - if (vfork() == 0) { - (void) SIGNAL(SIGALRM,SIG_DFL); - execl(Mars, "mars", 0); - perror(Mars); - } -} -#endif - char *addr_mess(who,type) int who,type; { @@ -1335,6 +748,7 @@ votes[i].type, ch, votes[i].desc); } } + return; } #ifndef INL From quozl at users.sourceforge.net Sat May 6 07:05:59 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Sat, 06 May 2006 12:05:59 +0000 Subject: [netrek-cvs] server/Vanilla/robots puckdefs.h,1.2,1.3 Message-ID: Update of /cvsroot/netrek/server/Vanilla/robots In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5335/robots Modified Files: puckdefs.h Log Message: remove unused code Index: puckdefs.h =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robots/puckdefs.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- puckdefs.h 21 Mar 2005 10:17:18 -0000 1.2 +++ puckdefs.h 6 May 2006 12:05:57 -0000 1.3 @@ -39,7 +39,6 @@ #define ANNOUNCER /*define for more loquacious commentary*/ #define NEWGAME_RESET /*define to have newgame reset stats*/ #define WALL_BOUNCE /*define to keep players in the rink*/ -#define ALLOW_EJECT #define SHOT_DESC /*define to have on goal descriptions. */ #define LIGHT_PLANETS /*define to have planets show the score*/ From quozl at users.sourceforge.net Sat May 6 07:06:41 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Sat, 06 May 2006 12:06:41 +0000 Subject: [netrek-cvs] server/Vanilla/ntserv cluecheck.c, 1.1, 1.2 conquer.c, 1.1, 1.2 coup.c, 1.1, 1.2 daemonII.c, 1.12, 1.13 data.c, 1.6, 1.7 db.c, 1.1, 1.2 genspkt.c, 1.4, 1.5 main.c, 1.8, 1.9 ntscmds.c, 1.9, 1.10 Message-ID: Update of /cvsroot/netrek/server/Vanilla/ntserv In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5657/ntserv Modified Files: cluecheck.c conquer.c coup.c daemonII.c data.c db.c genspkt.c main.c ntscmds.c Log Message: compilation fixes from -Wall Index: ntscmds.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/ntscmds.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- ntscmds.c 26 Apr 2006 09:52:43 -0000 1.9 +++ ntscmds.c 6 May 2006 12:06:39 -0000 1.10 @@ -13,10 +13,7 @@ #include #include #include -#include -#include #include -#include #include #include "defs.h" #include "struct.h" @@ -354,7 +351,7 @@ { if (vfork() == 0) { (void) SIGNAL(SIGALRM,SIG_DFL); - execl(Basep, "basep", 0); + execl(Basep, "basep", (char *) NULL); perror(Basep); } } @@ -376,7 +373,7 @@ { if (vfork() == 0) { (void) SIGNAL(SIGALRM,SIG_DFL); - execl(Puck, "puck", 0); + execl(Puck, "puck", (char *) NULL); perror(Puck); } } @@ -387,7 +384,7 @@ { if (vfork() == 0) { (void) SIGNAL(SIGALRM,SIG_DFL); - execl(Mars, "mars", 0); + execl(Mars, "mars", (char *) NULL); perror(Mars); } } @@ -1180,7 +1177,7 @@ char *one, *two; /* guests have no player file position */ - if (me->p_pos < 0) { + if (p->p_pos < 0) { pmessage(who, MINDIV, addr, "You can't change your password, sorry!"); return; @@ -1298,11 +1295,9 @@ { int whofrom = mess->m_from; struct player *p = &players[whofrom]; - struct player *victim; char *addr = addr_mess(whofrom,MINDIV); - char *who, *what; + char *what; char *usage = "transwarp usage: 'TRANSWARP ON|GREEN|YELLOW|SHIELD|OFF'"; - int slot; if (p->p_ship.s_type != STARBASE) { pmessage(whofrom, MINDIV, addr, "transwarp: must be a starbase to use this"); Index: coup.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/coup.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- coup.c 21 Mar 2005 05:23:43 -0000 1.1 +++ coup.c 6 May 2006 12:06:39 -0000 1.2 @@ -2,9 +2,6 @@ * coup.c */ #include "copyright.h" - -#include -#include #include "defs.h" #include "struct.h" #include "data.h" Index: db.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/db.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- db.c 21 Mar 2005 09:40:45 -0000 1.1 +++ db.c 6 May 2006 12:06:39 -0000 1.2 @@ -5,7 +5,10 @@ #include "config.h" #include +#include #include +#define _XOPEN_SOURCE +#include #include INC_MATH #include #include @@ -72,7 +75,7 @@ free(content.dptr); gdbm_close(dbf); ERROR(8,("db.c: db_index_fetch: gdbm_fetch('%s'): index says position '%d'\n", - namePick, position)); + namePick, (int) position)); return position; } @@ -94,14 +97,14 @@ /* store this key and position */ if (gdbm_store(dbf, key, content, GDBM_REPLACE) < 0) { ERROR(8,("db.c: db_index_store: gdbm_store('%s' -> '%d'): %s, %s\n", - player->name, position, gdbm_strerror(gdbm_errno), + player->name, (int) position, gdbm_strerror(gdbm_errno), strerror(errno))); gdbm_close(dbf); return; } ERROR(8,("db.c: db_index_store: gdbm_store('%s' -> '%d'): ok\n", - player->name, position)); + player->name, (int) position)); gdbm_close(dbf); } @@ -143,15 +146,18 @@ if (strcmp(namePick, player->name)==0) { close(fd); ERROR(8,("db.c: findplayer: ok, '%s' is indeed at position '%d'\n", - namePick, position)); + namePick, (int) position)); #ifdef DB_TIMING - ERROR(8,("db.c: timing, cached resolution, %f\n", g_timer_elapsed(timer, NULL))); + ERROR(8,("db.c: timing, cached resolution, %f\n", + g_timer_elapsed(timer, NULL))); g_timer_destroy(timer); #endif return position; } /* otherwise there's an inconsistency that we can recover from */ - ERROR(2,("db.c: findplayer: player index inconsistent with player file, entered name '%s', index says position '%d', but file entry name '%s'\n", namePick, position, player->name)); + ERROR(2,("db.c: findplayer: player index inconsistent with player file, " + "entered name '%s', index says position '%d', but file entry name '%s'\n", + namePick, (int) position, player->name)); /* return file to start for sequential search */ lseek(fd, 0, SEEK_SET); } @@ -167,7 +173,7 @@ db_index_store(player, position); #endif ERROR(8,("db.c: findplayer: '%s' found in sequential scan at position '%d'\n", - namePick, position)); + namePick, (int) position)); #ifdef DB_TIMING ERROR(8,("db.c: timing, sequential resolution, %f\n", g_timer_elapsed(timer, NULL))); g_timer_destroy(timer); Index: conquer.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/conquer.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- conquer.c 24 Apr 2006 10:12:18 -0000 1.1 +++ conquer.c 6 May 2006 12:06:39 -0000 1.2 @@ -1,8 +1,12 @@ +#include #include "copyright.h" #include "config.h" #include "defs.h" #include "struct.h" #include "data.h" +#include "proto.h" +#include "daemon.h" +#include "conquer.h" /* conquest gloating parade */ Index: data.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/data.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- data.c 26 Apr 2006 09:52:43 -0000 1.6 +++ data.c 6 May 2006 12:06:39 -0000 1.7 @@ -6,9 +6,6 @@ #include "struct.h" #include "data.h" -#include /* needed to define fd_set for inputMask */ -#include INC_SYS_SELECT - struct player *players; struct player *me; struct torp *torps; Index: genspkt.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/genspkt.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- genspkt.c 27 Apr 2006 00:24:07 -0000 1.4 +++ genspkt.c 6 May 2006 12:06:39 -0000 1.5 @@ -11,15 +11,10 @@ #include #include -#include -#include -#include +#include #include #include #include "defs.h" -#include INC_UNISTD -#include INC_STRINGS -#include INC_SYS_SELECT #include "struct.h" #include "data.h" #include "packets.h" Index: cluecheck.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/cluecheck.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- cluecheck.c 21 Mar 2005 05:23:43 -0000 1.1 +++ cluecheck.c 6 May 2006 12:06:39 -0000 1.2 @@ -2,17 +2,12 @@ */ #include "copyright.h" -#include -#include #include #include "defs.h" #include "struct.h" #include "data.h" -#include "packets.h" - #include "proto.h" - struct Question { char *quest; char *help[5]; @@ -250,5 +245,3 @@ if ((me->p_status != POBSERV) && (me->p_armies>0)) save_armies(); } } - - Index: main.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/main.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- main.c 26 Apr 2006 09:52:43 -0000 1.8 +++ main.c 6 May 2006 12:06:39 -0000 1.9 @@ -4,19 +4,13 @@ #include "copyright.h" #include -#include #include #include #include -#include #include -#include #include -#include -#include #include #include "defs.h" -#include INC_STRINGS #include INC_UNISTD #include INC_SYS_WAIT #include "struct.h" @@ -28,7 +22,6 @@ #ifdef SENDFLAGS #include "../cflags.h" #endif - #include "proto.h" #ifndef TRUE Index: daemonII.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/daemonII.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- daemonII.c 26 Apr 2006 09:52:43 -0000 1.12 +++ daemonII.c 6 May 2006 12:06:39 -0000 1.13 @@ -6,30 +6,20 @@ #include #include #include -#include -#ifdef AUTOMOTD -#include -#endif -#include -#include -#include -#include -#include #include #include #include -#include -#include #include #include "defs.h" #include "struct.h" #include "data.h" #include "planets.h" #include "proto.h" +#include "conquer.h" +#include "daemon.h" #include INC_UNISTD #include INC_SYS_FCNTL -#include INC_STRINGS #include INC_SYS_TIME #ifdef AUTOMOTD @@ -118,7 +108,6 @@ static void conquerMessage(int winner); static void displayBest(FILE *conqfile, int team, int type); static void fork_robot(int robot); -void doResources(void); /* static void doRotateGalaxy(void); */ static void signal_servers(void); @@ -395,7 +384,6 @@ FILE *fp; struct tm *today; time_t gmtsecs; - char *jptr, *iptr; for (i=0; it_attribute & TDETTEAMSAFE) && - (j->p_team == players[torp->t_whodet].p_team)) + (j->p_team == players[(int)torp->t_whodet].p_team)) continue; } } @@ -1959,7 +1946,7 @@ #ifdef CHAIN_REACTION if ((torp->t_whodet != NODET) && (torp->t_whodet != j->p_no) - && (players[torp->t_whodet].p_team != j->p_team)) + && (players[(int)torp->t_whodet].p_team != j->p_team)) k = player_(torp->t_whodet); else k = player_(torp->t_owner); @@ -2953,7 +2940,7 @@ { register int i; register struct player *j; - register struct planet *l; + register struct planet *l = NULL; char buf1[MSG_LEN]; for (i = 0, j = &players[i]; i < MAXPLAYER; i++, j++) { @@ -3720,7 +3707,6 @@ { register int i, h; register struct planet *l; - register struct player *j; int team[MAXTEAM + 1]; int teamtemp[MAXTEAM + 1]; @@ -4231,34 +4217,34 @@ case NO_ROBOT: break; #ifdef BASEPRACTICE case BASEP_ROBOT: - execl(Basep, "basep", 0); + execl(Basep, "basep", (char *) NULL); perror(Basep); break; #endif #ifdef NEWBIESERVER case NEWBIE_ROBOT: - execl(Newbie, "newbie", 0); + execl(Newbie, "newbie", (char *) NULL); perror(Newbie); break; #endif #ifdef PRETSERVER case PRET_ROBOT: - execl(PreT, "pret", 0); + execl(PreT, "pret", (char *) NULL); perror(PreT); break; #endif #ifdef DOGFIGHT case MARS_ROBOT: - execl(Mars, "mars", 0); + execl(Mars, "mars", (char *) NULL); perror(Mars); break; #endif case PUCK_ROBOT: - execl(Puck, "puck", 0); + execl(Puck, "puck", (char *) NULL); perror(Puck); break; case INL_ROBOT: - execl(Inl, "inl", 0); + execl(Inl, "inl", (char *) NULL); perror(Inl); break; default: ERROR(1,( "Unknown Robot: %d\n", robot )); From quozl at users.sourceforge.net Sat May 6 07:09:34 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Sat, 06 May 2006 12:09:34 +0000 Subject: [netrek-cvs] server/Vanilla FAQ,NONE,1.1 Message-ID: Update of /cvsroot/netrek/server/Vanilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7091 Added Files: FAQ Log Message: --- NEW FILE: FAQ --- 1. Should it be run as root? No. Run as a non-privileged user. 2. How do we get client keys? crontab updated From quozl at users.sourceforge.net Sat May 6 07:09:34 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Sat, 06 May 2006 12:09:34 +0000 Subject: [netrek-cvs] server/Vanilla/gum missing,1.2,1.3 Message-ID: Update of /cvsroot/netrek/server/Vanilla/gum In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7091/gum Modified Files: missing Log Message: Index: missing =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/gum/missing,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- missing 10 Apr 2006 04:24:50 -0000 1.2 +++ missing 6 May 2006 12:09:32 -0000 1.3 @@ -1,7 +1,7 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2005-02-08.22 +scriptversion=2005-06-08.21 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. @@ -19,8 +19,8 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -297,6 +297,9 @@ # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 touch $file ;; From quozl at users.sourceforge.net Sat May 6 07:08:53 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Sat, 06 May 2006 12:08:53 +0000 Subject: [netrek-cvs] server/Vanilla/ntserv glog.c,NONE,1.1 Message-ID: Update of /cvsroot/netrek/server/Vanilla/ntserv In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6725/ntserv Added Files: glog.c Log Message: --- NEW FILE: glog.c --- #include "copyright.h" #include "config.h" #include #include #include #include "defs.h" #include "struct.h" #include "data.h" static FILE *glog = NULL; void glog_close(void) { if (glog != NULL) { fclose(glog); glog = NULL; } } int glog_open() { if (glog != NULL) return 0; glog = fopen(GodLog, "a"); if (glog != NULL) { atexit(glog_close); return 0; } perror(GodLog); return -1; } void glog_printf(const char *fmt, ...) { va_list args; va_start(args, fmt); vfprintf(glog, fmt, args); va_end(args); } void glog_flush() { fflush(glog); } From quozl at users.sourceforge.net Sat May 6 07:17:32 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Sat, 06 May 2006 12:17:32 +0000 Subject: [netrek-cvs] server/Vanilla BUGS,1.4,1.5 PROJECTS,1.9,1.10 Message-ID: Update of /cvsroot/netrek/server/Vanilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10573 Modified Files: BUGS PROJECTS Log Message: minor progress update Index: BUGS =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/BUGS,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- BUGS 12 Apr 2006 12:58:11 -0000 1.4 +++ BUGS 6 May 2006 12:17:29 -0000 1.5 @@ -3,6 +3,8 @@ List of things that are defects + - find causes of jammed slots and expire them sooner. + - Player "^%^" took a planet and it said "Planet taken by ^" reported by zu22 (Zach Uram) on 2006-04-05. This is also a client issue. Index: PROJECTS =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/PROJECTS,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- PROJECTS 6 May 2006 12:01:00 -0000 1.9 +++ PROJECTS 6 May 2006 12:17:29 -0000 1.10 @@ -3,6 +3,12 @@ List of things to do in the future + - list connection failure scenarios and response by server, + so that we can reduce jammed slots. + + - use response time on metaserver solicitation packet as + indicator of lag to the server. Client coding required. + - dist-minimal target, to make ntserv & include only? - config.h.in settings to move to configure --enable-feature @@ -33,6 +39,12 @@ five to ten seconds (sysdef TIMERCIDE_WAIT), resume, blow losing team up. + - list connection failure scenarios and response by server, + so that we can reduce jammed slots. + + - use response time on metaserver solicitation packet as + indicator of lag to the server. Client coding required. + - metaserver begins to list robots on a server after the server has stopped sending player count updates by perhaps the TCP query from the server is mistaken. @@ -41,8 +53,26 @@ - prevent eject in initial two-minutes of ship time, if ship active, - - RSS feed for genos, so that people can subscribe and be told when the - galactic is recently reset. Jerub expressed an interest in doing it. + - RSS feed for genos, so that people can subscribe and be told + when the galactic is recently reset. Jerub expressed an + interest in doing it. + + Content area on netrek.org showing recent contested genos, + length of game leading up to it, number of players seen, + players per hour, keep latest ten, feed from multiple + servers. Server generated screen shot of final frame. + + Separate feed for adminstrivia, with server CLI script for + adding to the feed. + + INL server specific feed, containing game results, summary, + ltd stats by player. + + Metaserver specific feed ... new servers listed, delistings, + weekly summary of query counts with history. + + netrekd forked HTTP responder, or scripts to send stuff to a + web server? - If you are observing a friendly player who is t-warping, you can lock on to other players, but you will not swap to From quozl at users.sourceforge.net Sat May 6 07:23:32 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Sat, 06 May 2006 12:23:32 +0000 Subject: [netrek-cvs] server/Vanilla/tools players.c,1.5,1.6 Message-ID: Update of /cvsroot/netrek/server/Vanilla/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13292/tools Modified Files: players.c Log Message: describe a local server as on this computer Index: players.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/tools/players.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- players.c 22 Apr 2006 02:16:47 -0000 1.5 +++ players.c 6 May 2006 12:23:30 -0000 1.6 @@ -4,6 +4,8 @@ #include #include #include +#include +#include #include "defs.h" #include "struct.h" #include "data.h" @@ -185,16 +187,16 @@ } /* server comment */ -static char *comment() { +static char *comment_get() { #define MAXPATH 256 char name[MAXPATH]; snprintf(name, MAXPATH, "%s/%s", SYSCONFDIR, "comment"); FILE *file = fopen(name, "r"); - if (file == NULL) return ""; + if (file == NULL) return NULL; static char text[80]; char *res = fgets(text, 80, file); fclose(file); - if (res == NULL) return ""; + if (res == NULL) return NULL; res[strlen(res)-1] = '\0'; return res; } @@ -216,10 +218,10 @@ static void udp() { char buf[2]; - struct sockaddr addr; + struct sockaddr_in addr; socklen_t addrlen = sizeof(addr); int sock = 0; - int stat = recvfrom(sock, buf, 1, MSG_TRUNC, &addr, &addrlen); + int stat = recvfrom(sock, buf, 1, MSG_TRUNC, (struct sockaddr *) &addr, &addrlen); if (stat < 0 && errno == ENOTSOCK) fprintf(stderr, "players: must be called by netrekd with UDP file descriptor setup\n"); if (stat < 0) { perror("players: recvfrom"); return; } @@ -231,24 +233,35 @@ /* compose a reply packet */ char packet[128]; + /* default the comment */ + char *comment = comment_get(); + if (comment == NULL) { + char *ip = inet_ntoa(addr.sin_addr); + if (!strcmp(ip,"127.0.0.1")) { + comment = "server on this computer"; + } else { + comment = "a nearby netrek server"; + } + } + /* s,type,comment,ports,port,players,queue[,port,players,queue] */ /* if server isn't running, send simple reply */ if (!openmem(-1)) { - sprintf(packet, "s,B,%s,1,2592,%d,%d\n", comment(), 0, 0); + sprintf(packet, "s,B,%s,1,2592,%d,%d\n", comment, 0, 0); } else { if (status->gameup & GU_INROBOT) { int q1 = QU_HOME; int q2 = QU_AWAY; sprintf(packet, "s,B,%s,2,4566,%d,%d,4577,%d,%d\n", - comment(), pc(q1), ql(q1), pc(q2), ql(q2)); + comment, pc(q1), ql(q1), pc(q2), ql(q2)); } else { int q = QU_PICKUP; - sprintf(packet, "s,B,%s,1,2592,%d,%d\n", comment(), pc(q), ql(q)); + sprintf(packet, "s,B,%s,1,2592,%d,%d\n", comment, pc(q), ql(q)); } } /* send the reply */ - stat = sendto(sock, packet, strlen(packet), 0, &addr, addrlen); + stat = sendto(sock, packet, strlen(packet), 0, (struct sockaddr *) &addr, addrlen); if (stat < 0) { perror("players: sendto"); return; } } From quozl at users.sourceforge.net Sat May 6 07:23:32 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Sat, 06 May 2006 12:23:32 +0000 Subject: [netrek-cvs] server/Vanilla ChangeLog,1.37,1.38 NEWS,1.19,1.20 Message-ID: Update of /cvsroot/netrek/server/Vanilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13292 Modified Files: ChangeLog NEWS Log Message: describe a local server as on this computer Index: NEWS =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/NEWS,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- NEWS 26 Apr 2006 13:10:04 -0000 1.19 +++ NEWS 6 May 2006 12:23:30 -0000 1.20 @@ -1,3 +1,4 @@ +- describe a local unnamed server as "server on this computer" [Cameron] - fix cambot regression [Cameron] - convert voting, ejecting and banning to site policy in sysdef [Cameron] - add vote to temporarily ban a player [Cameron] Index: ChangeLog =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ChangeLog,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- ChangeLog 4 May 2006 23:39:58 -0000 1.37 +++ ChangeLog 6 May 2006 12:23:29 -0000 1.38 @@ -1,6 +1,14 @@ Thu May 4 19:34:10 EDT 2006 Dave Ahn + * Update auto archiver email. +Fri Apr 28 20:39:32 2006 James Cameron + + * tools/players.c (udp): if the comment file is not present, + provide a default comment. If the client that requested + information is on localhost, return a default "server on this + computer". Such a default is more descriptive. + Thu Apr 27 09:32:33 2006 James Cameron * include/genspkt.h: add separate prototypes for genspkt.c since From quozl at users.sourceforge.net Sat May 6 07:28:23 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Sat, 06 May 2006 12:28:23 +0000 Subject: [netrek-cvs] server/Vanilla/robots inl.c,1.3,1.4 Message-ID: Update of /cvsroot/netrek/server/Vanilla/robots In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15404/robots Modified Files: inl.c Log Message: fix INL confine for orbiting ships Index: inl.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robots/inl.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- inl.c 22 Apr 2006 02:16:46 -0000 1.3 +++ inl.c 6 May 2006 12:28:20 -0000 1.4 @@ -250,6 +250,14 @@ } +static void +inl_confine_deorbit(struct player *j) +{ + if (j->p_flags & PFORBIT) { + j->p_flags &= ~(PFBOMB | PFORBIT | PFBEAMUP | PFBEAMDOWN); + } +} + void inl_confine(void) { @@ -257,14 +265,22 @@ for (j = firstPlayer; j <= lastPlayer; j++) { - if (j->p_x < cbounds[j->p_team][0]) + if (j->p_x < cbounds[j->p_team][0]) { + inl_confine_deorbit(j); j->p_x = cbounds[j->p_team][0]; - if (j->p_y < cbounds[j->p_team][1]) + } + if (j->p_y < cbounds[j->p_team][1]) { + inl_confine_deorbit(j); j->p_y = cbounds[j->p_team][1]; - if (j->p_x > cbounds[j->p_team][2]) + } + if (j->p_x > cbounds[j->p_team][2]) { + inl_confine_deorbit(j); j->p_x = cbounds[j->p_team][2]; - if (j->p_y > cbounds[j->p_team][3]) + } + if (j->p_y > cbounds[j->p_team][3]) { + inl_confine_deorbit(j); j->p_y = cbounds[j->p_team][3]; + } } } From quozl at users.sourceforge.net Sat May 6 07:28:22 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Sat, 06 May 2006 12:28:22 +0000 Subject: [netrek-cvs] server/Vanilla BUGS, 1.5, 1.6 ChangeLog, 1.38, 1.39 NEWS, 1.20, 1.21 Message-ID: Update of /cvsroot/netrek/server/Vanilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15404 Modified Files: BUGS ChangeLog NEWS Log Message: fix INL confine for orbiting ships Index: NEWS =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/NEWS,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- NEWS 6 May 2006 12:23:30 -0000 1.20 +++ NEWS 6 May 2006 12:28:20 -0000 1.21 @@ -1,3 +1,4 @@ +- fix INL confine to knock ships out of orbit [Cameron] - describe a local unnamed server as "server on this computer" [Cameron] - fix cambot regression [Cameron] - convert voting, ejecting and banning to site policy in sysdef [Cameron] Index: BUGS =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/BUGS,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- BUGS 6 May 2006 12:17:29 -0000 1.5 +++ BUGS 6 May 2006 12:28:20 -0000 1.6 @@ -32,13 +32,6 @@ running make causes configure to be re-run but without the appropriate --prefix, thus building for the wrong place. - - inl confine doesn't knock ships out of orbit, ships may - remain outside their confined zone. - - - configure script, add recognition of --with-inl, and thus - define all the appropriate defines that INSTALL.INL says we - have to do, change PKEY too. - - configure to set CONFIRM=1 if it finds res-rsa, and Makefile to recommend the execution of updated at least once. Index: ChangeLog =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ChangeLog,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- ChangeLog 6 May 2006 12:23:29 -0000 1.38 +++ ChangeLog 6 May 2006 12:28:20 -0000 1.39 @@ -9,6 +9,11 @@ information is on localhost, return a default "server on this computer". Such a default is more descriptive. +Fri Apr 28 20:28:37 2006 James Cameron + + * robots/inl.c (inl_confine_deorbit): fix INL confine to knock + ships out of orbit if they are outside the confinement boundary. + Thu Apr 27 09:32:33 2006 James Cameron * include/genspkt.h: add separate prototypes for genspkt.c since From quozl at users.sourceforge.net Sat May 6 08:12:58 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Sat, 06 May 2006 13:12:58 +0000 Subject: [netrek-cvs] server/Vanilla/include proto.h,1.6,1.7 Message-ID: Update of /cvsroot/netrek/server/Vanilla/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3659/include Modified Files: proto.h Log Message: fix compilation errors on sequencer following previous commands.c change Index: proto.h =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/include/proto.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- proto.h 23 Apr 2006 10:39:10 -0000 1.6 +++ proto.h 6 May 2006 13:12:56 -0000 1.7 @@ -6,6 +6,12 @@ #ifndef __INCLUDED_proto_h__ #define __INCLUDED_proto_h__ +/* balance.c */ +#if defined (TRIPLE_PLANET_MAYHEM) +void do_balance(void); +void do_triple_planet_mayhem(void); +#endif + /* bay.c */ void bay_consistency_check(struct player *base); struct player *bay_owner(struct player *me); From quozl at users.sourceforge.net Sat May 6 08:12:58 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Sat, 06 May 2006 13:12:58 +0000 Subject: [netrek-cvs] server/Vanilla ChangeLog,1.39,1.40 Message-ID: Update of /cvsroot/netrek/server/Vanilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3659 Modified Files: ChangeLog Log Message: fix compilation errors on sequencer following previous commands.c change Index: ChangeLog =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ChangeLog,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- ChangeLog 6 May 2006 12:28:20 -0000 1.39 +++ ChangeLog 6 May 2006 13:12:55 -0000 1.40 @@ -1,6 +1,12 @@ -Thu May 4 19:34:10 EDT 2006 Dave Ahn +Sat May 6 23:07:29 2006 James Cameron + + * sequencer/sequencer.c, ntserv/balance.c, ntserv/ntscmds.c: + reduce includes, move balance and triple to new file, in order to + fix compilation errors after + +Thu May 4 19:34:10 2006 Dave Ahn - * Update auto archiver email. + * robots/auto-archive.pl: update auto archiver email address Fri Apr 28 20:39:32 2006 James Cameron From quozl at users.sourceforge.net Sat May 6 08:12:58 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Sat, 06 May 2006 13:12:58 +0000 Subject: [netrek-cvs] server/Vanilla/ntserv Makefile.in, 1.6, 1.7 ntscmds.c, 1.10, 1.11 Message-ID: Update of /cvsroot/netrek/server/Vanilla/ntserv In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3659/ntserv Modified Files: Makefile.in ntscmds.c Log Message: fix compilation errors on sequencer following previous commands.c change Index: Makefile.in =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/Makefile.in,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile.in 24 Apr 2006 10:12:17 -0000 1.6 +++ Makefile.in 6 May 2006 13:12:56 -0000 1.7 @@ -11,7 +11,7 @@ # libnetrek object files -L_OBJS = bay.o \ +L_OBJS = balance.o bay.o \ coup.o \ data.o db.o detonate.o distress.o \ enter.o \ Index: ntscmds.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/ntscmds.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ntscmds.c 6 May 2006 12:06:39 -0000 1.10 +++ ntscmds.c 6 May 2006 13:12:56 -0000 1.11 @@ -42,10 +42,6 @@ void do_start_mars(void); #endif -#if defined (TRIPLE_PLANET_MAYHEM) -void do_balance(void); -void do_triple_planet_mayhem(void); -#endif void do_password(char *comm, struct message *mess); void do_nodock(char *comm, struct message *mess); void do_transwarp(char *comm, struct message *mess); @@ -749,426 +745,6 @@ nowobble ? "on (new test mode)" : "off (classic mode)", nowobble, comm ); } -#ifdef TRIPLE_PLANET_MAYHEM -/* -** 16-Jul-1994 James Cameron -** -** Balances teams according to player statistics. -** Intended for use with Triple Planet Mayhem -*/ - -/* -** Tell all that player will be moved -*/ -static void moveallmsg(int p_no, int ours, int theirs, int p_value) -{ - struct player *k = &players[p_no]; - pmessage(0, MALL, addr_mess(p_no, MALL), - "Balance: %16s (slot %c, rating %.2f) is to join the %s", - k->p_name, shipnos[p_no], - (float) ( p_value / 100.0 ), - team_name(ours)); - - /* annoying compiler warning */ - if (theirs) ; -} - -/* -** Move a player to the specified team, if they are not yet there. -** Make them peaceful with the new team, and hostile/at war with the -** other team. -*/ -static void move(int p_no, int ours, int theirs) -{ - struct player *k = &players[p_no]; - int queue; - - if ( k->p_team != ours ) { - pmessage(k->p_no, MINDIV, addr_mess(k->p_no,MINDIV), - "%s: please SWAP SIDES to the --> %s <--", k->p_name, team_name(ours)); - } - else { - pmessage(k->p_no, MINDIV, addr_mess(k->p_no,MINDIV), - "%s: please remain with the --> %s <--", k->p_name, team_name(ours)); - } - - printf("Balance: %16s (%s) is to join the %s\n", - k->p_name, k->p_mapchars, team_name(ours)); - - /* cope with a balance during INL pre-game, if we don't shift players who - are on the QU_HOME or QU_AWAY queues then the queue masks will force - them to join the team they were on anyway. */ - queue = ( ours == FED ) ? QU_HOME : QU_AWAY; - if (k->w_queue != QU_PICKUP && k->w_queue != queue) { - queues[k->w_queue].free_slots++; - k->w_queue = queue; - queues[k->w_queue].free_slots--; - } - - k->p_hostile |= theirs; - k->p_swar |= theirs; - k->p_hostile &= ~ours; - k->p_swar &= ~ours; - k->p_war = (k->p_hostile | k->p_swar); - k->p_team = ours; - sprintf(k->p_mapchars, "%c%c", teamlet[k->p_team], shipnos[p_no]); - sprintf(k->p_longname, "%s (%s)", k->p_name, k->p_mapchars); - - k->p_status = PEXPLODE; - k->p_whydead = KPROVIDENCE; /* should be KTOURNSTART? */ - if (k->p_ship.s_type == STARBASE) - k->p_explode = 2 * SBEXPVIEWS; - else - k->p_explode = 10; - k->p_ntorp = 0; - k->p_nplasmatorp = 0; - k->p_hostile = (FED | ROM | ORI | KLI); - k->p_war = (k->p_hostile | k->p_swar); -} - -/* -** Return two team masks corresponding to the teams of the first two -** teams found in the player list. -*/ -static void sides (int *one, int *two) -{ - struct player *k; - int i; - int unseen; - - unseen = (FED | ROM | ORI | KLI); - *one = 0; - *two = 0; - k = &players[0]; - for(i=0;ip_status != PFREE) && (!(k->p_flags & PFROBOT))) - { - if ( ( unseen & k->p_team ) != 0 ) - { - if ( *one == 0 ) - { - *one = k->p_team; - unseen &= ~k->p_team; - k++; - continue; - } - *two = k->p_team; - return; - } - } - k++; - } -} - -/* -** Calculate a player value -*/ -static int value (struct player *k) -{ - return - (int) - ( - (float) - ( -#ifdef LTD_STATS - ltd_bombing_rating(k) * BALANCE_BOMBING + - ltd_planet_rating(k) * BALANCE_PLANET + - ltd_defense_rating(k) * BALANCE_DEFENSE + - ltd_offense_rating(k) * BALANCE_OFFENSE -#else - bombingRating(k) * BALANCE_BOMBING + - planetRating(k) * BALANCE_PLANET + - defenseRating(k) * BALANCE_DEFENSE + - offenseRating(k) * BALANCE_OFFENSE -#endif /* LTD_STATS */ - ) - ); -} - -/* -** Balance the teams -** -** Uses an exhaustive algorithm (I'm exhausted!) to find the best combination -** of the current players that balances the teams in terms of statistics. -** The algorithm will support only the number of players that fits into the -** number of bits in an int. -** -** If there are multiple "best" combinations, then the combination -** involving the least number of team swaps will be chosen. -*/ -void do_balance(void) -{ - int i, j; /* miscellaneous counters */ - int records; /* number of players in game */ - int one; /* team number one mask */ - int two; /* team number two mask */ - - struct player *k; /* pointer to current player */ - - struct item - { - int p_no; /* player number */ - int p_value; /* calculated player value */ - int p_team; /* team player on previously */ - } list[MAXPLAYER]; /* working array */ - - struct - { - int combination; /* combination number */ - int value; /* team balance difference */ - int one; /* team one total value */ - int two; /* team two total value */ - int swaps; /* number of swaps involved */ - } best; /* best team combination */ - - /* which teams are playing? give up if only one found */ - sides ( &one, &two ); - if ( two == 0 ) - { - /* addr_mess shouldn't be called with 0 as first arg - * for MALL, but we don't have a player numer here. - * Let addr_mess catch it. -da - */ - - pmessage ( 0, MALL, addr_mess(0 ,MALL), - "Can't balance only one team!" ); - pmessage ( 0, MALL, addr_mess(0 ,MALL), - "Please could somebody move to another team, then all vote again?" ); - return; - } - - /* initialise best to worst case */ - best.combination = -1; - best.value = 1<<30; - best.one = 0; - best.two = 0; - best.swaps = 1<<30; - - /* reset working array */ - for(i=0;ip_status != PFREE) && (!(k->p_flags & PFROBOT))) - { - list[records].p_no = k->p_no; - list[records].p_value = value ( k ); - list[records].p_team = k->p_team; - records++; - } - k++; - } - - /* randomise the working array; may cause different team mixes */ - for(i=0;i 1 ) continue; - - /* reset team total for attempt */ - value_a = 0; - value_b = 0; - - /* calculate team total stats */ - for(j=0;jm_from; From quozl at users.sourceforge.net Sat May 6 08:12:58 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Sat, 06 May 2006 13:12:58 +0000 Subject: [netrek-cvs] server/Vanilla/sequencer roboshar.c, 1.2, 1.3 sequencer.c, 1.1, 1.2 Message-ID: Update of /cvsroot/netrek/server/Vanilla/sequencer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3659/sequencer Modified Files: roboshar.c sequencer.c Log Message: fix compilation errors on sequencer following previous commands.c change Index: sequencer.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/sequencer/sequencer.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- sequencer.c 21 Mar 2005 05:23:46 -0000 1.1 +++ sequencer.c 6 May 2006 13:12:56 -0000 1.2 @@ -1,23 +1,11 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include "defs.h" #include "struct.h" #include "data.h" #include "planets.h" #include "proto.h" -#include INC_STRINGS #define KTOURNSTART 0x0e @@ -80,13 +68,6 @@ { MCOPY (pdata, planets, sizeof (pdata)); -/* - for (i = 0; i < MAXPLANETS; i++) - { - planets[i].pl_info = ALLTEAM; - } -*/ - for (i = 0; i < 4; i++) { /* one core AGRI */ @@ -200,15 +181,18 @@ do_nuke ( void *nothing ) { obliterate ( 0, KPROVIDENCE ); - - /* get rid of annoying compiler warning, -O will remove this code */ - if (nothing) return; } /* -** Balance the teams by statistics. +** Balance the teams. */ -extern void do_balance(char *); +#if defined (TRIPLE_PLANET_MAYHEM) +void +do_local_balance ( void *nothing ) +{ + do_balance(); +} +#endif /* ** Reset planets, save planet state and player state for later scoring @@ -218,9 +202,6 @@ { doResources(1); /* save planet/player state ? */ - - /* get rid of annoying compiler warning, -O will remove this code */ - if (nothing) return; } /* @@ -230,9 +211,6 @@ do_pause ( void *nothing ) { status->gameup |= (GU_PRACTICE | GU_PAUSED); - - /* get rid of annoying compiler warning, -O will remove this code */ - if (nothing) return; } /* @@ -242,9 +220,6 @@ do_continue ( void *nothing ) { status->gameup &= ~(GU_PRACTICE | GU_PAUSED); - - /* get rid of annoying compiler warning, -O will remove this code */ - if (nothing) return; } /* @@ -255,9 +230,6 @@ do_score ( char *nothing ) { printf ( "Score...\n" ); - - /* get rid of annoying compiler warning, -O will remove this code */ - if (nothing) return; } /* @@ -267,9 +239,6 @@ do_eject ( void *nothing ) { obliterate ( 0, KQUIT ); - - /* get rid of annoying compiler warning, -O will remove this code */ - if (nothing) return; } /* @@ -289,9 +258,6 @@ do_exit ( void *nothing ) { exit(0); - - /* get rid of annoying compiler warning, -O will remove this code */ - if (nothing) return; } /* @@ -329,7 +295,7 @@ COMMAND ( "say", do_say ); COMMAND ( "nuke", do_nuke ); #if defined (TRIPLE_PLANET_MAYHEM) - COMMAND ( "balance", do_balance ); /* see commands.c */ + COMMAND ( "balance", do_local_balance ); #endif COMMAND ( "reset", do_reset ); COMMAND ( "pause", do_pause ); Index: roboshar.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/sequencer/roboshar.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- roboshar.c 21 Mar 2005 10:17:18 -0000 1.2 +++ roboshar.c 6 May 2006 13:12:56 -0000 1.3 @@ -3,6 +3,11 @@ #include "defs.h" #include "struct.h" #include "data.h" +#include "proto.h" + +#ifndef M_PI +#include +#endif /* Each robot must declare the following variables as globals */ @@ -12,10 +17,7 @@ * The following routines are shared code */ -/* ARGSUSED */ -void message_flag(cur,address) -struct message *cur; -char *address; +void message_flag(struct message *cur, char *address) { /* This is to prevent false sending with SP_S_WARNING */ cur->args[0] = DINVALID; @@ -24,38 +26,29 @@ /*#include "warnings.h"*/ /* only the fct, robots cannot set send_short */ -/* ARGSUSED */ -void swarning( whichmessage, argument,argument2) -unsigned char whichmessage,argument,argument2; +void swarning(unsigned char whichmessage, unsigned char argument, + unsigned char argument2) { } -/* ARGSUSED */ -void spwarning(text,index) -char *text; -int index; +void spwarning(char *text, int index) { } /* ARGSUSED */ -void s_warning(text,index) -char *text; -int index; +void s_warning(char *text, int index) { } /* Only stubs to silence the linker */ -void new_warning(index,mess) -int index; -char *mess; +void new_warning(int index, const char *mess, ...) { if (debug) ERROR(1,("warning: (%d)%s\n", index,mess)); } -void warning(mess) -int mess; +void warning(char *mess) { if (debug) ERROR(1,("warning: %s\n", mess)); @@ -66,8 +59,7 @@ * This routine sets up the robot at nowhere name */ -void robonameset(myself) -struct player *myself; +void robonameset(struct player *myself) { (void) strncpy(myself->p_login, "Robot", sizeof (myself->p_login)); @@ -103,12 +95,12 @@ * c) Forge a message by setting mynum to whatever it wants. */ -void messAll(int mynum,char *name,...) +void messAll(int mynum, char *name, const char *fmt, ...) { va_list args; char addrbuf[15]; - va_start(args, name); + va_start(args, fmt); /* +++ 2.6pl0 cameron at sna.dec.com */ #if defined(__alpha) @@ -117,7 +109,7 @@ sprintf(addrbuf, "%s->ALL", name ); #endif /* --- */ - do_message(0, MALL, addrbuf, mynum, args); + do_message(0, MALL, addrbuf, mynum, fmt, args); va_end(args); } @@ -127,7 +119,7 @@ * The same comments as messAll apply here, too. */ -void messOne(int mynum,char *name,int who, ...) +void messOne(int mynum, char *name, int who, const char *fmt, ...) { va_list args; char addrbuf[15]; @@ -139,36 +131,39 @@ return; /* hack: don't message self :) */ } sprintf(addrbuf, "%s->%2s", name, players[who].p_mapchars); - va_start(args, who); - do_message(who, MINDIV, addrbuf, mynum, args); + va_start(args, fmt); + do_message(who, MINDIV, addrbuf, mynum, fmt, args); va_end(args); } -int game_pause(comm,mess) -char *comm; -struct message *mess; +void game_pause(char *comm, struct message *mess) { status->gameup|=GU_PAUSED; } -int game_resume(comm,mess) -char *comm; -struct message *mess; +int game_resume(char *comm, struct message *mess) { status->gameup&= ~GU_PAUSED; + return 1; } -#ifndef M_PI -#include -#endif - /* * This returns the direction needed to travel to get from * (x1,y1) to (x2,y2). (x1,y1) are commonly me->p_x and me->p_y. */ -u_char getcourse2(int x1,int y1,int x2,int y2) +u_char getcourse2(int x1, int y1, int x2, int y2) { return((u_char) nint((atan2((double) (x2 - x1), (double) (y1 - y2)) / M_PI * 128.))); } + +/* + * Null client packet sending function for ntserv specific code in + * enter.c and interface.c so that we can avoid compiling it in the + * robots directory, and use libnetrek instead. + */ +void sendClientPacket(void *ignored) +{ + return; +} From quozl at users.sourceforge.net Sat May 6 09:02:39 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Sat, 06 May 2006 14:02:39 +0000 Subject: [netrek-cvs] server/Vanilla/include proto.h,1.7,1.8 Message-ID: Update of /cvsroot/netrek/server/Vanilla/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26988/include Modified Files: proto.h Log Message: compilation fixes for /ntserv under gcc 4.0.3 Index: proto.h =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/include/proto.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- proto.h 6 May 2006 13:12:56 -0000 1.7 +++ proto.h 6 May 2006 14:02:37 -0000 1.8 @@ -30,6 +30,7 @@ /* db.c */ int findplayer(char *namePick, struct statentry *player); void savestats(void); +int newplayer(struct statentry *player); void changepassword(char *passPick); void savepass(const struct statentry *); @@ -80,6 +81,7 @@ void clearSPackets(int update_all, int update_sall); void sendFeature(struct feature_spacket *packet); int addSequence(char *outbuf, LONG *seq_no); +void addSequenceFlags(void *buf); void sendQueuePacket(short pos); void sendPickokPacket(int state); void sendClientLogin(struct stats *stats); @@ -177,6 +179,12 @@ int queues_purge(void); int queue_setname(int w_queue, char *name); +/* rsa_key.c */ +void makeRSAPacket(void *packet); +int decryptRSAPacket (void *spacket, + void *cpacket, + char *serverName); + /* redraw.c */ void intrupt(void); From quozl at users.sourceforge.net Sat May 6 09:02:39 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Sat, 06 May 2006 14:02:39 +0000 Subject: [netrek-cvs] server/Vanilla ChangeLog,1.40,1.41 Message-ID: Update of /cvsroot/netrek/server/Vanilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26988 Modified Files: ChangeLog Log Message: compilation fixes for /ntserv under gcc 4.0.3 Index: ChangeLog =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ChangeLog,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- ChangeLog 6 May 2006 13:12:55 -0000 1.40 +++ ChangeLog 6 May 2006 14:02:35 -0000 1.41 @@ -1,3 +1,10 @@ +Sat May 6 23:58:10 2006 James Cameron + + * proto.h, db.c, findslot.c, genspkt.c, getname.c, openmem.c, + phaser.c, rsa_key.c, socket.c, solicit.c, startrobot.c, + sysdefaults.c: compilation fixes under GCC 4.0.3 with -Wall, + ntserv/ now clean apart from crypt(3) issue. + Sat May 6 23:07:29 2006 James Cameron * sequencer/sequencer.c, ntserv/balance.c, ntserv/ntscmds.c: From quozl at users.sourceforge.net Sat May 6 09:02:41 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Sat, 06 May 2006 14:02:41 +0000 Subject: [netrek-cvs] server/Vanilla/ntserv db.c, 1.2, 1.3 findslot.c, 1.4, 1.5 genspkt.c, 1.5, 1.6 getname.c, 1.2, 1.3 openmem.c, 1.3, 1.4 phaser.c, 1.3, 1.4 rsa_key.c, 1.2, 1.3 socket.c, 1.7, 1.8 solicit.c, 1.6, 1.7 startrobot.c, 1.1, 1.2 sysdefaults.c, 1.2, 1.3 Message-ID: Update of /cvsroot/netrek/server/Vanilla/ntserv In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26988/ntserv Modified Files: db.c findslot.c genspkt.c getname.c openmem.c phaser.c rsa_key.c socket.c solicit.c startrobot.c sysdefaults.c Log Message: compilation fixes for /ntserv under gcc 4.0.3 Index: sysdefaults.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/sysdefaults.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- sysdefaults.c 26 Apr 2006 09:52:43 -0000 1.2 +++ sysdefaults.c 6 May 2006 14:02:39 -0000 1.3 @@ -2,6 +2,7 @@ */ #include +#include #include #include "defs.h" #include "struct.h" Index: rsa_key.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/rsa_key.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- rsa_key.c 22 Apr 2006 02:16:46 -0000 1.2 +++ rsa_key.c 6 May 2006 14:02:38 -0000 1.3 @@ -8,6 +8,11 @@ #include "copyright2.h" #include #include +#include +#include +#include +#include +#include #include #include #include @@ -20,10 +25,15 @@ #include "struct.h" #include "data.h" #include "packets.h" +#include "proto.h" -makeRSAPacket(packet) -struct rsa_key_spacket *packet; +/* from res-rsa/rsa_encode.c */ +void rsa_encode(unsigned char *out, unsigned char *message, + unsigned char *key, unsigned char *global, const int digits); + +void makeRSAPacket(void *p) { + struct rsa_key_spacket *packet = (struct rsa_key_spacket *) p; int i; for (i=0; igameup & GU_INROBOT) { sendClientLogin(NULL); @@ -181,7 +178,7 @@ /* race condition: Two new players joining at once * can screw up the database. */ - if (entries = newplayer(&player) < 0) { + if ((entries = newplayer(&player)) < 0) { sendClientLogin(NULL); } else { me->p_pos = entries; Index: phaser.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/phaser.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- phaser.c 24 Apr 2006 10:12:18 -0000 1.3 +++ phaser.c 6 May 2006 14:02:37 -0000 1.4 @@ -20,8 +20,8 @@ void phaser(u_char course) { - struct player *j, *target_player; - struct torp *t, *target_plasma; + struct player *j, *target_player = NULL; + struct torp *t, *target_plasma = NULL; int pstatus; double s, C,D; LONG A,B, E,F; Index: db.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/db.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- db.c 6 May 2006 12:06:39 -0000 1.2 +++ db.c 6 May 2006 14:02:37 -0000 1.3 @@ -7,20 +7,13 @@ #include #include #include -#define _XOPEN_SOURCE -#include -#include INC_MATH -#include #include -#include -#include #include #include #ifdef PLAYER_INDEX #include #endif #include "defs.h" -#include INC_STRINGS #include INC_UNISTD #include "struct.h" #include "data.h" @@ -213,6 +206,7 @@ { saltbuf sb; struct statentry se; + /* implicitly defined on linux, anyone know where to find it? */ strcpy(se.password, (char *) crypt(passPick, salt(me->p_name, sb))); savepass(&se); } Index: findslot.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/findslot.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- findslot.c 22 Apr 2006 02:16:46 -0000 1.4 +++ findslot.c 6 May 2006 14:02:37 -0000 1.5 @@ -14,11 +14,13 @@ #include "defs.h" #include "struct.h" #include "data.h" +#include "packets.h" #include "proto.h" +#ifdef NO_DUPLICATE_HOSTS /* return true if the host is not already in the game */ static int absent(int w_queue, char *host) { - int i, here = 0; + int i; for (i=0; i #include #include +#include #include #include #include Index: socket.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/socket.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- socket.c 22 Apr 2006 11:31:53 -0000 1.7 +++ socket.c 6 May 2006 14:02:38 -0000 1.8 @@ -1713,8 +1713,6 @@ static void handleDockingReq(struct dockperm_cpacket *packet) { - int i; - if (me->p_ship.s_type == STARBASE) { if (packet->state) { me->p_flags |= PFDOCKOK; @@ -1876,7 +1874,7 @@ MCOPY(testdata, mysp.data, RESERVED_SIZE); serverName[0] = '\0'; if (gethostname(serverName, 64)) - ERROR(1,( "%s: gethostname() failed\n", whoami(), + ERROR(1,( "%s: gethostname() failed with %s", whoami(), strerror(errno))); encryptReservedPacket(&mysp, &mycp, serverName, me->p_no); if (MCMP(packet->resp, mycp.resp, RESERVED_SIZE) != 0) { @@ -1893,7 +1891,6 @@ static void handleRSAKey(struct rsa_key_cpacket *packet) { - struct rsa_key_cpacket mycp; struct rsa_key_spacket mysp; char serverName[64]; @@ -1903,7 +1900,7 @@ serverName[0] = '\0'; if (gethostname(serverName, 64)) - ERROR(1,( "%s: gethostname() failed\n", whoami(), + ERROR(1,( "%s: gethostname() failed with %s\n", whoami(), strerror(errno))); if (decryptRSAPacket(&mysp, packet, serverName)) { @@ -2835,7 +2832,7 @@ (packet->group & MGOD))){ static int counter = 0; - if(glog_open() != 0) return; + if(glog_open() != 0) return 0; glog_printf("%s\n", buf); glog_flush(); counter++; From quozl at users.sourceforge.net Sat May 6 19:28:20 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Sun, 07 May 2006 00:28:20 +0000 Subject: [netrek-cvs] server/Vanilla FAQ,1.1,1.2 Message-ID: Update of /cvsroot/netrek/server/Vanilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5654 Modified Files: FAQ Log Message: Index: FAQ =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/FAQ,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- FAQ 6 May 2006 12:09:32 -0000 1.1 +++ FAQ 7 May 2006 00:28:18 -0000 1.2 @@ -5,3 +5,37 @@ 2. How do we get client keys? crontab updated + +-- + +D1. How do I update my darcs repo to pull in these changes? + +darcs pull + +This will pull in these changes from the repository you last did a get +or pull from. Chances are this is the repository you want. + +Remember there are multiple repositories, and they may not have the same +changes. That's the whole idea of decentralised development. The +netrek.org repository tracks CVS on SourceForge until 1st June 2006. My +public repository has some changes that are not and never will be in +CVS. + +The changes you saw on the Netrek CVS mailing list are the changes made +to CVS on SourceForge. If these are the only changes you want in your +darcs repository, then you should pull from only the netrek.org +repository. + +To make that explicit rather than having darcs default to the last used +repository, add the URL of the repository to the end of the pull +command, like so: + +darcs pull http://www.netrek.org/repos/netrek-server/ + + +Please read this section of the manual: + +Switching from CVS +Darcs commands for CVS users +http://www.darcs.net/manual/node2.html#SECTION00220000000000000000 + From modemhero at users.sourceforge.net Sun May 7 11:59:29 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 07 May 2006 16:59:29 +0000 Subject: [netrek-cvs] client/netrekxp/src/cursors makefile,1.1.1.1,1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src/cursors In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5894/src/cursors Modified Files: makefile Log Message: Major features in this patch are: Merge of Stas' latest source into client. - Lots of double buffering code - Cleanup of protoyping functions and proper variable initialization - Addition of working RSA key generator mkkey.exe (this necessitates another DLL in the source) - Updated compile instructions, and a new document on how to make a RSA key - Working version of winkey with BCC compiler - Bug fixes as per listed in his change log Cleanup of changes list to remove bug fix/stuff only coders need to know. Removal of buildexe script - Stas rewrote build to make this obsolete Addition of HR bitmap set (including a few placeholder bitmaps until art is done) Metablock patch accepted (not working proper yet though due to retrieving login issue) Probably a few other things I forgot about! Index: makefile =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/cursors/makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- makefile 21 Jan 2003 21:28:44 -0000 1.1.1.1 +++ makefile 7 May 2006 16:59:27 -0000 1.2 @@ -1,18 +1,6 @@ # -# ========================================================================= -# COW on Win32 Makefile -# # This makefile is written for Borland C++ 5.5 # -# - -# Definitions needed to be changed before compile - -#DEBUG = 1 - -RSA = 1 - -RSAKEY = \netrek_files\rsa\NetrekXP-Mod-RSA-Key-Win32.secret # Borland C++ 5.5 cc = bcc32 @@ -20,20 +8,6 @@ link = ilink32 compileandlink = bcc32 -# Linker options -# -Tpd This tells the linker the type of file you want to create. You can use -Tpe to create an exe. -# -aa This tells the linker that this will be a 32 bit Windows application. -# -V4.0 This specifies the target Windows version that this DLL will be used for. 4.0 represents Windows 95 and later. -# -c This tells the linker that you want case sensitive symbols. I'm not sure that this is critical but since C is case sensitive it's a good idea to include it. -# -x This suppresses the creation of a MAP file. A MAP file is a text file which list all the memory locations of the symbols of a C program. Since this is simply a resource file we're making, it's not that useful to have a MAP file. -# c0d32.obj This object file is required to link into the dll. It allows the DLL to be loaded into memory only when needed. -# myresource.dll This is the output DLL file that will be created. -# import32.lib and cw32i.lib These libraries are needed for the DLL. They're used to access the Windows API. -# myresource.res This is your compiled RES file that will be linked. - -# --------------------------------------------------------------------------- -# - Start of makefile proper - all: curslib.dll RESOURCES = curslib.res @@ -41,7 +15,8 @@ $(RESOURCES): curslib.rc $(rc) -FOcurslib.res curslib.rc - curslib.dll: $(RESOURCES) $(link) -Tpd -aa -V4.0 -c -x C0d32.OBJ, curslib.dll,, import32.lib cw32i.lib, , $(RESOURCES) +clean: + del curslib.dll curslib.ilc curslib.ild curslib.ilf curslib.ils curslib.res curslib.tds \ No newline at end of file From modemhero at users.sourceforge.net Sun May 7 11:59:28 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 07 May 2006 16:59:28 +0000 Subject: [netrek-cvs] client/netrekxp rsa.txt, NONE, 1.1 NetrekXP to do list.C, 1.16, 1.17 build.cmd, 1.12, 1.13 compile.txt, 1.7, 1.8 buildexe.cmd, 1.4, NONE Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5894 Modified Files: NetrekXP to do list.C build.cmd compile.txt Added Files: rsa.txt Removed Files: buildexe.cmd Log Message: Major features in this patch are: Merge of Stas' latest source into client. - Lots of double buffering code - Cleanup of protoyping functions and proper variable initialization - Addition of working RSA key generator mkkey.exe (this necessitates another DLL in the source) - Updated compile instructions, and a new document on how to make a RSA key - Working version of winkey with BCC compiler - Bug fixes as per listed in his change log Cleanup of changes list to remove bug fix/stuff only coders need to know. Removal of buildexe script - Stas rewrote build to make this obsolete Addition of HR bitmap set (including a few placeholder bitmaps until art is done) Metablock patch accepted (not working proper yet though due to retrieving login issue) Probably a few other things I forgot about! Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- NetrekXP to do list.C 6 May 2006 06:25:14 -0000 1.16 +++ NetrekXP to do list.C 7 May 2006 16:59:26 -0000 1.17 @@ -11,10 +11,9 @@ Things not gonna happen, or server problems: 1) Player list messaging doesn't work if you can't see player (cloaked, too far away, etc). Don't think this is fixable. -2) Get mkkey working. 3) torp_other and plasma_other not working right due to lack of torp fuse info 4) cloaking/shields at warp 0 doesn't update someone else's tactical on what you did - -server not sending right info. +server not sending right info - short packets! 4a) observer sound messes up when someone flips shields at warp 0, again a server problem 4b) Locking onto iggy caues the observer sound to mess up for shields up/down (this is server side problem, both for the not being able to lock back onto your team, and @@ -23,6 +22,7 @@ any state at all (head to default which is error message). Things to do: +0) Eventually add the SDL dll files to the source. 1) Add warning hull. 2) resizeable message windows. Perhaps memory of window positions if you choose to save settings. Text in windows should adjust to new window size. @@ -39,17 +39,11 @@ closeable by shift right click. 6) With new scaling function, implement Defcom's new bitmaps 6a) Issue with flickering. -6b) Issue with 0 degree messing up bitmap. - -Might be done: -1) mouse scroll in message windows gets the up/down coord wrong when main title -bar is turned on. -2) CRASH BUG! Resize main window and try to do mouse scroll, it will crash client. -3) Disable window move stuff still broken. -4) save_options keymap: not saving right -5) if waiting on queue and get in, quit clock missing -6) right click on all_review window, get message "obsolete!" -7) winkey working with BCC +6b) Border issue +6c) The new smooth turning only working on self, not obs or others - short packets! +6d) Not working with BCC +7) right click on all_review window, get message "obsolete!" +8) login not read in before metaserver info (for metablocking purposes) Stas's list: - color coded playerlist. --- buildexe.cmd DELETED --- --- NEW FILE: rsa.txt --- This client incorporates RES-RSA code that uniquely identifies client binary on server side. If you are willing to build the client without RSA support you will have to figure out how to do that by yourself. It is a matter of altering project files and removing RSA definitions. In order to create RSA key you should use mkkey.exe utility located under tools directory in source distribution. To create key you will have to provide mkkey.exe with following information: key_name - general name for the key file client_type - actual client name that will be shown by server after verification architecture - Win32 in our case creator - your mail address for bugs/suggestions comment - free text After running mkkey.exe with parameters you will have following files created: key_name - public key part key_name.secret - private key part rsa_box*.c - obfuscated C code containing key identification sequence The key file is composed of options and their values. Options separated by columns. Here's how typical key file looks: NetrekXP-Mod-RSA-Key-Win32:ct=NetrekXP Mod:cr=keyos at keyos.org:\ :cd=January 2003:ar=Win32\ :cm=NetrekXP Modification for Windows 9x/NT/2000/XP:\ :gk=b160145c4205bba8815db0a908fcac9b99a0303ee44c204469374109e09bb782:\ :pk=8b0f3d3f1b1b8528d86545d3be9d8900f2e3130cb52248df9a5ec63ff9a15e11: In order for the key file to work with netrek servers you'll have to add another option called 'client compatibility'. For example NetrekXP Mod is standard2 and inl compatible, so its key contains 'cl=inl,standard2' option in addition to others. Here's how public file for NetrekXP Mod looks like: NetrekXP-Mod-RSA-Key-Win32:ct=NetrekXP Mod:cr=keyos at keyos.org:\ :cd=January 2003:ar=Win32:cl=inl,standard2:\ :cm=NetrekXP Modification for Windows 9x/NT/2000/XP:\ :gk=b160145c4205bba8815db0a908fcac9b99a0303ee44c204469374109e09bb782:\ :pk=8b0f3d3f1b1b8528d86545d3be9d8900f2e3130cb52248df9a5ec63ff9a15e11: At the moment you have rsa_box*.c files created you can use them to compile your client. However having the client compiled with RSA doesn't mean that you will be able to play on any server that requires RSA verification. After adding client compatibility option to both key_name and key_name.secret files you can distribute the public key file to server admins or central key repository that is stored on clientkeys.netrek.org (port 3530) In order to add key to central repository you should contact clientkeys at clientkeys.netrek.org In order to add key to specific server you should talk to server admin When the key is added to central repository it is still required that keys update utility will be run on each server. That's all. Stas Pirogov (keyos at keyos.org) Index: compile.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/compile.txt,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- compile.txt 30 Apr 2006 15:59:39 -0000 1.7 +++ compile.txt 7 May 2006 16:59:26 -0000 1.8 @@ -1,22 +1,48 @@ This source tree was tested with MS Visual C++ 6.0 and Borland C Builder 5.5 -- Edit build.cmd to set following variables: +I'd like however to discourage you from using Borland's compiler unless you know how +to debug its binaries. The output is also slower even though speed optimizations +are used. + +Step 1: +-------- +Edit build.cmd to set following variables: RSAKey = path to your RSA-KEY.secret file -Compiler = VCC or BCC (default BCC) +Compiler = VCC or BCC (default VCC) InstCWD = path to folder to copy files to (default \netrek_files) +HelpCompiler = path to hhc.exe from Microsoft's HTML Help Workshop (available from microsoft.com) -- Edit clientr.dsp and change \netrek_files to be same as InstCWD (only if using VCC) +Step 2: +-------- +If you're building with MS Visual C++: + +- Edit clientr.dsp and change \netrek_files to be same as InstCWD - Edit src\cursors\curslib.dsp and change \netrek_files to be same as InstCWD - (again only necessary if using VCC) -- Get SDL.dll and SDL_mixer.dll from the SDL website (you will need these to - run the client, they must be in the installer package) -After compilation under BCC, there will be one folder under InstCWD - netrek. -Netrek contains the ready to distribute netrek client tree. -After compilation under VCC, there will be an additional directory called -tmp which can be deleted. +- Edit src\winkey\winkey.dsp and change \netrek_files to be same as InstCWD +If you're building with Borland C Builder: + +Make sure you have configuration set correctly for the builder itself. +Follow setup instructions from builder readme file to create proper configuration +files. Otherwise the compiler and linker won't find the correct paths. + +Step 3: +-------- +Open command prompt in the source tree directory and run build.cmd + +If everything is correct and working then after a couple of minutes you will have compiled +a working client under InstCWD\netrek. +If you were compiling with Visual C++ you will also have a InstCWD\tmp folder containing +lots of objects. Just delete it. + +Step 4: +------- +Get SDL.dll and SDL_mixer.dll from the SDL website (you will need these to run the client, +they must be in the installer package) +Other Notes: +------------ Additional instructions for compiling with Microsoft Visual C++ 2005 Express Edition, aka Microsoft Visual Studio 2005 @@ -27,7 +53,8 @@ that used cscript to compile the source since that command doesn't work with Visual Studio. +That's pretty much all. Stas Pirogov (keyos at keyos.org) -Instructions modified by Bill Balcerski +Instructions modified by Bill Balcerski \ No newline at end of file Index: build.cmd =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/build.cmd,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- build.cmd 6 May 2006 05:39:59 -0000 1.12 +++ build.cmd 7 May 2006 16:59:26 -0000 1.13 @@ -1,16 +1,22 @@ -SET RSAKey=\netrek_files\rsa\NetrekXP-Mod-RSA-Key-Win32.secret -Set Compiler=BCC -Set InstCWD=\netrek_files -rem Set Compiler=VCC +set RSAKey="\netrek_files\rsa\NetrekXP-2006-RSA-Key-Win32.secret" +set InstCWD="\netrek_files" +set HelpCompiler="C:\Program Files\HTML Help Workshop\hhc.exe" +rem set Compiler=VCC +set Compiler=BCC @echo off Set MyCWD=%cd% if /I "%1" == "clean" goto :clean +if /I "%1" == "cleanrsa" goto :cleanrsa if /I "%1" == "dist" goto :dist +if /I "%1" == "build" goto :build +if /I "%1" == "pics" goto :pics mkdir %InstCWD% mkdir %InstCWD%\netrek +:pics + pushd resources\ships\color\fed echo Making resources\ships\color\fed... %MyCWD%\tools\imagemagick\montage -mode concatenate -tile 1x32 fed_as01.bmp fed_as02.bmp fed_as03.bmp fed_as04.bmp fed_as05.bmp fed_as06.bmp fed_as07.bmp fed_as08.bmp fed_as09.bmp fed_as10.bmp fed_as11.bmp fed_as12.bmp fed_as13.bmp fed_as14.bmp fed_as15.bmp fed_as16.bmp fed_as17.bmp fed_as18.bmp fed_as19.bmp fed_as20.bmp fed_as21.bmp fed_as22.bmp fed_as23.bmp fed_as24.bmp fed_as25.bmp fed_as26.bmp fed_as27.bmp fed_as28.bmp fed_as29.bmp fed_as30.bmp fed_as31.bmp fed_as32.bmp fed_as.bmp @@ -341,6 +347,20 @@ %MyCWD%\tools\imagemagick\montage -colors 256 -mode concatenate -tile 1x5 shexpl0.bmp shexpl1.bmp shexpl2.bmp shexpl3.bmp shexpl4.bmp shexpl.bmp popd +if /I "%1" == "pics" goto :end + +:build + +pushd resources +pushd htmlhelp +%HelpCompiler% netrek.hhp +popd +popd + +pushd src +%MyCWD%\tools\mkkey -k %RSAKEY% +popd + if /I "%Compiler%" == "BCC" goto :CompilerBCC if /I "%Compiler%" == "VCC" goto :CompilerVCC @@ -348,23 +368,20 @@ goto :end :CompilerVCC -pushd src -%MyCWD%\tools\mkkey -nt -k %RSAKEY% +pushd src\cursors +cscript %MyCWD%\tools\vcmake.vbs curslib.dsw "Win32 Release" popd -rem pushd src\cursors -rem cscript %MyCWD%\tools\vcmake.vbs curslib.dsw "Win32 Release" -rem popd - -rem pushd src\winkey -rem cscript %MyCWD%\tools\vcmake.vbs winkey.dsw "Win32 Release" -rem popd +pushd src\winkey +cscript %MyCWD%\tools\vcmake.vbs winkey.dsw "Win32 Release" +popd -rem cscript %MyCWD%\tools\vcmake.vbs clientr.dsw "Win32 Release" +cscript %MyCWD%\tools\vcmake.vbs clientr.dsw "Win32 Release" pushd %InstCWD%\netrek %MyCWD%\tools\stampver -v%MyCWD%\src\stampver.inf netrek.exe popd + goto :dist :CompilerBCC @@ -372,6 +389,9 @@ pushd cursors make popd +pushd winkey +make +popd make %MyCWD%\tools\stampver -v%MyCWD%\src\stampver.inf netrek.exe popd @@ -380,6 +400,8 @@ :dist +copy resources\htmlhelp\netrek.chm %InstCWD%\netrek + mkdir %InstCWD%\netrek\bitmaps\shiplib copy resources\ships\color\fed\fedship.bmp %InstCWD%\netrek\bitmaps\shiplib copy resources\ships\color\ind\indship.bmp %InstCWD%\netrek\bitmaps\shiplib @@ -459,12 +481,15 @@ mkdir %InstCWD%\netrek\sounds copy resources\sounds\*.wav %InstCWD%\netrek\sounds -if /I "%Compiler%" == "BCC" copy src\netrek.exe %InstCWD%\netrek if /I "%Compiler%" == "BCC" copy src\cursors\curslib.dll %InstCWD%\netrek\bitmaps +if /I "%Compiler%" == "BCC" copy src\winkey\winkey.dll %InstCWD%\netrek\bitmaps +if /I "%Compiler%" == "BCC" copy src\netrek.exe %InstCWD%\netrek goto end :clean +del resources\htmlhelp\netrek.chm + del resources\ships\color\fed\fedship.bmp resources\ships\color\fed\fed_??.bmp del resources\ships\color\ind\indship.bmp resources\ships\color\ind\ind_??.bmp del resources\ships\color\kli\kliship.bmp resources\ships\color\kli\kli_??.bmp @@ -510,12 +535,13 @@ if /I "%Compiler%" == "BCC" goto :CleanBCC if /I "%Compiler%" == "VCC" goto :CleanVCC + echo You must set which compiler you have at the top of this batch file. + goto :end :CleanVCC pushd src -del rsa*.c pushd cursors del *.ncb del *.opt @@ -532,13 +558,22 @@ :CleanBCC pushd src -del *.obj *.res netrek.exe netrek.tds netrek.map +make clean pushd cursors -del curslib.ilf curslib.ilc curslib.ild curslib.ils curslib.tds curslib.dll +make clean popd pushd winkey -del winkey.ilf winkey.ilc winkey.ild winkey.ils winkey.tds winkey.dll +make clean popd popd +goto :end + +:cleanrsa +pushd src +del rsa*.c +popd + +goto :end + :end From modemhero at users.sourceforge.net Sun May 7 11:59:28 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 07 May 2006 16:59:28 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt,1.39,1.40 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5894/resources/docs Modified Files: changes.txt Log Message: Major features in this patch are: Merge of Stas' latest source into client. - Lots of double buffering code - Cleanup of protoyping functions and proper variable initialization - Addition of working RSA key generator mkkey.exe (this necessitates another DLL in the source) - Updated compile instructions, and a new document on how to make a RSA key - Working version of winkey with BCC compiler - Bug fixes as per listed in his change log Cleanup of changes list to remove bug fix/stuff only coders need to know. Removal of buildexe script - Stas rewrote build to make this obsolete Addition of HR bitmap set (including a few placeholder bitmaps until art is done) Metablock patch accepted (not working proper yet though due to retrieving login issue) Probably a few other things I forgot about! Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- changes.txt 6 May 2006 06:36:35 -0000 1.39 +++ changes.txt 7 May 2006 16:59:26 -0000 1.40 @@ -1,5 +1,4 @@ Version TBA: -- hack to fix poor display on HR ships at angle = 0 - fixed some playerlist bugs, and increased playerlist window from 21 to 32 lines - *.tamu.edu removed from metaserver listing, and direct connect via -h servername also removed. This is due to the policy of blocking all players with the default @@ -45,13 +44,10 @@ - add 2 new sounds for enter/exiting transwarp, and observer support for hearing these as well - replaced red alert sound with one less staticy -- fixed beeplite observer bug - fixed up viewbox so map refreshes properly when toggled - fixed LAB dashboard to properly display armies/kills for observers -- fixed a bunch of compiler warnings - change to warning sounds: changed current "warning" sound to the yellow alert sound, and - made the red_alert sound file the red alert sound. Added additional measures to stop - playing the alert sound if you go down in alert status + made the red_alert sound file the red alert sound. - change to plasma_other sounds: uses closest other_plasma for sound location, as there is no good way to determine which torp on screen is most recent for sound purposes. - change to plasma_hit sounds: nothing special other than stereo effect @@ -78,24 +74,21 @@ - added "newSound: (on)/off". Allows one to choose not to use the new sound system. Note that this option is not settable in game through options menu, only through the .netrekrc file. -- added Mix_CloseAudio calls when exiting to clean up memory -- initial SDL implementation +- SDL implementation - up to 16 sounds can play at once, with sound volume scaling with + the distance of the sound event from your ship - continuousMouse and continuousMouseFix now default to on - fixed the mono fed sb bitmaps so they rotate more cleanly - updated NetrekXP manual (in docs folder), removed old cow manuals. - all greyscale and shaded old color starbase bitmaps now rotate. - the new color fed starbase bitmaps now rotate. -- Keeppeace default is now "on". -- rewrote find bitmap routine in a smarter way (thanks Quozl) -- fixed bccnetrek.rc to have proper header so icon works +- keeppeace default is now "on". - tidied up the save_options function, fixing some spacing errors, and putting the keymap/buttonmap on the top of the list due to its importance. Also added the sounddir option. -- fixed mainResizeable loading from rc/saving. Also made default setting = on. +- fixed mainResizeable loading/saving from netrekrc. Also made default setting = on. - rewrote TTS centering/refresh code so that text is properly centered and clears properly when the message expires. Updated manual to reflect change of tts_pos variable to tts_ypos. -- fixed crash bug in save options due to renaming of .sav file from xtrekrc to netrekrc. - readded beeplite functionality. Configuration options described in cow manual. Basic rc options are useLite: on/off to turn beeplite on and off, and defLite: on/off to use the default settings. The beeplite option is highly configurable, see manual @@ -112,7 +105,6 @@ - phasering plasma now has less of an effect on phaser average damage statistics, it is counted as your average damage hit, rather than the previous way of counting it as a 38 point phaser hit. -- fixed bug with phaser messages going blank due to improper buffering - added "dynamicBitmap: (on)/off". Enables dynamic bitmap switching from the options menu - renumbered the ship bitmap sets for the colorClient option. Choices are 0=mono, @@ -125,8 +117,6 @@ - added some more hints to the hint database - fixed hint messages so they properly loop - added Maximize button to title bar -- added buildexe script for compiling solely the source code and not the bitmaps -- disabled RSA mkkey check (-nt) until I get a valid one Version 4.4.0.4: (changes by stas, added 18-Apr-2006 ) - added "allowWheelActions: (on)/off" to be able to disable wheel in non-scrolling windows @@ -138,7 +128,10 @@ message window using scrollbar (which forced him close client window and reconnect) - fixed incorrect behavior of 'windowMove: off' feature. Previously window would snap back to wrong place if the main window top-left corner was not (0,0) coordinates -- long lines are now wrapped by words instead of by chars. Maximum message length was +- fixed old conditional macro bug when having first part false would produce '0' as output instead + of nothing +- fixed couple of scrolling bugs when main window wasn't at (0,0) coordinates +- long lines are now wrapped by words instead of by chars. maximum message length was reduced to 4 full message lines (4 * 69 characters) - message input window will now show Sender->Recipient even when the input line is longer than 69 characters From modemhero at users.sourceforge.net Sun May 7 12:01:09 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 07 May 2006 17:01:09 +0000 Subject: [netrek-cvs] client/netrekxp/src/winkey makefile, NONE, 1.1 winkeybcc.def, NONE, 1.1 winkeyshared.cpp, NONE, 1.1 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src/winkey In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7011/src/winkey Added Files: makefile winkeybcc.def winkeyshared.cpp Log Message: Winkey support for BCC --- NEW FILE: makefile --- # # This makefile is written for Borland C++ 5.5 # # Borland C++ 5.5 cc = bcc32 rc = brcc32 link = ilink32 compileandlink = bcc32 !IFDEF DEBUG cflags = -O2 -5 -v -pr -DWIN32 -DBorland -tW -tWM ccompileonly = -c !ELSE cflags = -O2 -5 -pr -DWIN32 -DBorland -tW -tWM ccompileonly = -c !ENDIF # Borland Libs LIBOPTS = /LC:\Borland\bcc55\lib;c:\Borland\bcc55\lib\psdk;..\Win32\lib\BCC /Tpe all: winkey.dll .cpp.obj: $(cc) $(cflags) $(ccompileonly) $< winkey.dll: winkey.obj winkeyshared.obj $(link) $(LIBOPTS) -Tpd -aa -V4.0 -c -x -GS:SHSEG=rws C0d32.OBJ winkey.obj winkeyshared.obj, winkey.dll,, import32.lib cw32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib, winkeybcc.def clean: del winkey.dll *.obj *.ilc *.ild *.ilf *.ils *.tds --- NEW FILE: winkeyshared.cpp --- #pragma option -zRSHSEG // sets segment name for this source file to SHARESEG #pragma option -zTSHARECLS // sets class name for segment to SHARECLS #include HHOOK g_hMsgHook = NULL; HHOOK g_hKeyHook = NULL; int g_iFlags = NULL; --- NEW FILE: winkeybcc.def --- LIBRARY SHAREDDLL SEGMENTS SHSEG CLASS 'SHCLASS' SHARED From modemhero at users.sourceforge.net Sun May 7 11:59:29 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 07 May 2006 16:59:29 +0000 Subject: [netrek-cvs] client/netrekxp/src console.c, 1.1, 1.2 cowmain.c, 1.11, 1.12 dashboard.c, 1.2, 1.3 dashboard3.c, 1.3, 1.4 data.c, 1.16, 1.17 death.c, 1.4, 1.5 defaults.c, 1.14, 1.15 defwin.c, 1.3, 1.4 distress.c, 1.2, 1.3 docwin.c, 1.2, 1.3 enter.c, 1.2, 1.3 findslot.c, 1.5, 1.6 getname.c, 1.4, 1.5 helpwin.c, 1.3, 1.4 input.c, 1.8, 1.9 interface.c, 1.1.1.1, 1.2 local.c, 1.18, 1.19 main.c, 1.4, 1.5 makefile, 1.7, 1.8 map.c, 1.5, 1.6 mswindow.c, 1.14, 1.15 newwin.c, 1.19, 1.20 option.c, 1.12, 1.13 parsemeta.c, 1.5, 1.6 ping.c, 1.2, 1.3 pingstats.c, 1.1.1.1, 1.2 playback.c, 1.12, 1.13 redraw.c, 1.5, 1.6 reserved.c, 1.2, 1.3 rotate.c, 1.1.1.1, 1.2 senddist.c, 1.3, 1.4 short.c, 1.5, 1.6 smessage.c, 1.3, 1.4 socket.c, 1.4, 1.5 stats.c, 1.1.1.1, 1.2 string_util.c, 1.2, 1.3 udpopt.c, 1.2, 1.3 util.c, 1.2, 1.3 warning.c, 1.4, 1.5 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5894/src Modified Files: console.c cowmain.c dashboard.c dashboard3.c data.c death.c defaults.c defwin.c distress.c docwin.c enter.c findslot.c getname.c helpwin.c input.c interface.c local.c main.c makefile map.c mswindow.c newwin.c option.c parsemeta.c ping.c pingstats.c playback.c redraw.c reserved.c rotate.c senddist.c short.c smessage.c socket.c stats.c string_util.c udpopt.c util.c warning.c Log Message: Major features in this patch are: Merge of Stas' latest source into client. - Lots of double buffering code - Cleanup of protoyping functions and proper variable initialization - Addition of working RSA key generator mkkey.exe (this necessitates another DLL in the source) - Updated compile instructions, and a new document on how to make a RSA key - Working version of winkey with BCC compiler - Bug fixes as per listed in his change log Cleanup of changes list to remove bug fix/stuff only coders need to know. Removal of buildexe script - Stas rewrote build to make this obsolete Addition of HR bitmap set (including a few placeholder bitmaps until art is done) Metablock patch accepted (not working proper yet though due to retrieving login issue) Probably a few other things I forgot about! Index: findslot.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/findslot.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- findslot.c 26 Apr 2006 02:04:24 -0000 1.5 +++ findslot.c 7 May 2006 16:59:27 -0000 1.6 @@ -52,11 +52,11 @@ /*** mapWaitQuit() ***/ /******************************************************************************/ static void -mapWaitQuit (W_Window qwin) +mapWaitQuit (W_Window waitqWin) { char *s = "Quit"; - W_WriteText (qwin, 10, 15, textColor, s, strlen (s), W_RegularFont); + W_WriteText (waitqWin, 10, 15, textColor, s, strlen (s), W_RegularFont); } /******************************************************************************/ @@ -139,7 +139,7 @@ foreColor); countWin = W_MakeWindow ("count", WAITWIDTH / 3, WAITTITLE, WAITWIDTH / 3, WAITHEIGHT - WAITTITLE, waitWin, 1, foreColor); - qwin = W_MakeWindow ("waitquit", 0, WAITTITLE, WAITWIDTH / 3, + waitqWin = W_MakeWindow ("waitquit", 0, WAITTITLE, WAITWIDTH / 3, WAITHEIGHT - WAITTITLE, waitWin, 1, foreColor); motdButtonWin = W_MakeWindow ("motdbutton", 2 * WAITWIDTH / 3, WAITTITLE, WAITWIDTH / 3, WAITHEIGHT - WAITTITLE, @@ -147,7 +147,7 @@ W_MapWindow (waitWin); W_MapWindow (countWin); W_MapWindow (motdButtonWin); - W_MapWindow (qwin); + W_MapWindow (waitqWin); if (showMotd) { motdWin = W_MakeWindow ("waitmotd", 1, WAITWIDTH + 1, WINSIDE, @@ -222,7 +222,7 @@ } showMotd = !showMotd; } - else if (event.Window == qwin) + else if (event.Window == waitqWin) { #if defined(SOUND) @@ -245,9 +245,9 @@ { showMotdWin (motdWin, WaitMotdLine); } - else if (event.Window == qwin) + else if (event.Window == waitqWin) { - mapWaitQuit (qwin); + mapWaitQuit (waitqWin); } else if (event.Window == countWin) { Index: stats.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/stats.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- stats.c 21 Jan 2003 21:28:43 -0000 1.1.1.1 +++ stats.c 7 May 2006 16:59:27 -0000 1.2 @@ -82,14 +82,12 @@ static int st_width = -1; static void -box (filled, - x, - y, - wid, - hei, - color) - int filled, x, y, wid, hei; - W_Color color; +box (int filled, + int x, + int y, + int wid, + int hei, + W_Color color) { if (wid == 0) return; Index: enter.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/enter.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- enter.c 12 Apr 2006 04:20:03 -0000 1.2 +++ enter.c 7 May 2006 16:59:27 -0000 1.3 @@ -71,7 +71,7 @@ for (i = 0; i < MAXPLAYER * MAXTORP; i++) { torps[i].t_status = TFREE; - torps[i].t_owner = (i / MAXTORP); + torps[i].t_owner = (short) (i / MAXTORP); } for (i = 0; i < MAXPLAYER; i++) phasers[i].ph_status = PHFREE; @@ -79,7 +79,7 @@ for (i = 0; i < MAXPLAYER * MAXPLASMA; i++) { plasmatorps[i].pt_status = PTFREE; - plasmatorps[i].pt_owner = (i / MAXPLASMA); + plasmatorps[i].pt_owner = (short) (i / MAXPLASMA); } for (i = 0; i < MAXPLANETS; i++) Index: smessage.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/smessage.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- smessage.c 21 Apr 2006 12:00:07 -0000 1.3 +++ smessage.c 7 May 2006 16:59:27 -0000 1.4 @@ -419,7 +419,6 @@ char * str1; /* temporary string 1 */ char * str2; /* temporary string 2 */ char buf[100]; /* temporary buffer */ - int i = 0; str1 = str; /* save original string pointer */ Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- defaults.c 2 May 2006 00:55:52 -0000 1.14 +++ defaults.c 7 May 2006 16:59:27 -0000 1.15 @@ -840,7 +840,7 @@ } else { - keysused[macro[macrocnt].key] = macrocnt + 1; + keysused[macro[macrocnt].key] = (unsigned char) (macrocnt + 1); } #endif /* MULTILINE_MACROS */ @@ -927,7 +927,7 @@ } else { - keysused[macro[macrocnt].key] = macrocnt + 1; + keysused[macro[macrocnt].key] = (unsigned char) (macrocnt + 1); } #endif /* MULTILINE_MACROS */ @@ -1224,6 +1224,7 @@ /*** grr... are you telling me this sort of function isn't in the std ***/ /*** libraries somewhere?! sons of satan... - jn ***/ /******************************************************************************/ +int strncmpi (char *str1, char *str2, int max) { char chr1, chr2; @@ -1242,8 +1243,8 @@ for (duh = 0; duh < stop; duh++) { - chr1 = isupper (str1[duh]) ? str1[duh] : toupper (str1[duh]); - chr2 = isupper (str2[duh]) ? str2[duh] : toupper (str2[duh]); + chr1 = (char) (isupper (str1[duh]) ? str1[duh] : toupper (str1[duh])); + chr2 = (char) (isupper (str2[duh]) ? str2[duh] : toupper (str2[duh])); if (chr1 == 0 || chr2 == 0) { return (0); @@ -1277,6 +1278,7 @@ /******************************************************************************/ /*** booleanDefault() ***/ /******************************************************************************/ +int booleanDefault (char *def, int preferred) { char *str; @@ -1297,6 +1299,7 @@ /******************************************************************************/ /*** intDefault() ***/ /******************************************************************************/ +int intDefault (char *def, int preferred) { char *str; @@ -1814,6 +1817,8 @@ // we're going to print only keymap that differs from standard one // we have to start from second key, because first one is space str[0] = '\0'; + str1[0] = '\0'; + for (c = 1; c < 95; c++) { if (c + 32 != mystats->st_keymap[c]) @@ -1821,14 +1826,20 @@ if (mystats->st_keymap[c] != 'X' && (mystats->st_keymap[c] > 32 && mystats->st_keymap[c] < 127)) - sprintf (str, "%s%c%c", str, c + 32, mystats->st_keymap[c]); + { + sprintf (str1, "%c%c", c + 32, mystats->st_keymap[c]); + strcat (str, str1); + } else sprintf (macroKey, "%c", c + 32); } } // space time if (mystats->st_keymap[0] != 32) - sprintf (str, "%s %c", str, mystats->st_keymap[0]); + { + sprintf (str1, " %c", mystats->st_keymap[0]); + strcat (str, str1); + } if (saveBig && strlen (str) != 0) fputs ("# Key mapping\n", fp); if (strlen (str) != 0) Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- data.c 2 May 2006 00:55:52 -0000 1.16 +++ data.c 7 May 2006 16:59:27 -0000 1.17 @@ -348,7 +348,7 @@ warnw, helpWin, teamWin[4], qwin, messwa, messwt, messwi, messwk, playerw, playerw2, planetw, rankw, optionWin = 0, reviewWin; W_Window udpWin, phaserwin, hintWin; -W_Window waitWin, qwin, countWin, motdButtonWin, motdWin; +W_Window waitWin, waitqWin, countWin, motdButtonWin, motdWin; #ifdef SHORT_PACKETS W_Window spWin = NULL; @@ -412,57 +412,57 @@ * dist_type */ /* the character specification is ignored now, kept here anyway for reference */ struct dmacro_list dist_defaults[] = { - {'X', "no zero", "this should never get looked at"}, + {(unsigned char) ('X'), "no zero", "this should never get looked at"}, /* ^t */ - {'\xd4', "taking", " %T%c->%O (%S) Carrying %a to %l%?%n>-1%{ @ %n%}\0"}, + {(unsigned char) ('\xd4'), "taking", " %T%c->%O (%S) Carrying %a to %l%?%n>-1%{ @ %n%}\0"}, /* ^o */ - {'\xcf', "ogg", " %T%c->%O Help Ogg %p at %l\0"}, + {(unsigned char) ('\xcf'), "ogg", " %T%c->%O Help Ogg %p at %l\0"}, /* ^b */ - {'\xc2', "bomb", " %T%c->%O %?%n>4%{bomb %l @ %n%!bomb%}\0"}, + {(unsigned char) ('\xc2'), "bomb", " %T%c->%O %?%n>4%{bomb %l @ %n%!bomb%}\0"}, /* ^c */ - {'\xc3', "space_control", " %T%c->%O Help Control at %L\0"}, + {(unsigned char) ('\xc3'), "space_control", " %T%c->%O Help Control at %L\0"}, /* ^1 */ - {'\x91', "save_planet", " %T%c->%O Emergency at %L!!!!\0"}, + {(unsigned char) ('\x91'), "save_planet", " %T%c->%O Emergency at %L!!!!\0"}, /* ^2 */ - {'\x92', "base_ogg", " %T%c->%O Sync with --]> %g <[-- OGG ogg OGG base!!\0"}, + {(unsigned char) ('\x92'), "base_ogg", " %T%c->%O Sync with --]> %g <[-- OGG ogg OGG base!!\0"}, /* ^3 */ - {'\x93', "help1", " %T%c->%O Help me! %d%% dam, %s%% shd, %f%% fuel %a armies.\0"}, + {(unsigned char) ('\x93'), "help1", " %T%c->%O Help me! %d%% dam, %s%% shd, %f%% fuel %a armies.\0"}, /* ^4 */ - {'\x94', "help2", " %T%c->%O Help me! %d%% dam, %s%% shd, %f%% fuel %a armies.\0"}, + {(unsigned char) ('\x94'), "help2", " %T%c->%O Help me! %d%% dam, %s%% shd, %f%% fuel %a armies.\0"}, /* ^e */ - {'\xc5', "escorting", " %T%c->%O ESCORTING %g (%d%%D %s%%S %f%%F)\0"}, + {(unsigned char) ('\xc5'), "escorting", " %T%c->%O ESCORTING %g (%d%%D %s%%S %f%%F)\0"}, /* ^p */ - {'\xd0', "ogging", " %T%c->%O Ogging %h\0"}, + {(unsigned char) ('\xd0'), "ogging", " %T%c->%O Ogging %h\0"}, /* ^m */ - {'\xcd', "bombing", " %T%c->%O Bombing %l @ %n\0"}, + {(unsigned char) ('\xcd'), "bombing", " %T%c->%O Bombing %l @ %n\0"}, /* ^l */ - {'\xcc', "controlling", " %T%c->%O Controlling at %l\0"}, + {(unsigned char) ('\xcc'), "controlling", " %T%c->%O Controlling at %l\0"}, /* ^5 */ - {'\x95', "asw", " %T%c->%O Anti-bombing %p near %b.\0"}, + {(unsigned char) ('\x95'), "asw", " %T%c->%O Anti-bombing %p near %b.\0"}, /* ^6 */ - {'\x96', "asbomb", " %T%c->%O DON'T BOMB %l. Let me bomb it (%S)\0"}, + {(unsigned char) ('\x96'), "asbomb", " %T%c->%O DON'T BOMB %l. Let me bomb it (%S)\0"}, /* ^7 */ - {'\x97', "doing1", " %T%c->%O (%i)%?%a>0%{ has %a arm%?%a=1%{y%!ies%}%} at %l. (%d%% dam, %s%% shd, %f%% fuel)\0"}, + {(unsigned char) ('\x97'), "doing1", " %T%c->%O (%i)%?%a>0%{ has %a arm%?%a=1%{y%!ies%}%} at %l. (%d%% dam, %s%% shd, %f%% fuel)\0"}, /* ^8 */ - {'\x98', "doing2", " %T%c->%O (%i)%?%a>0%{ has %a arm%?%a=1%{y%!ies%}%} at %l. (%d%% dam, %s%% shd, %f%% fuel)\0"}, + {(unsigned char) ('\x98'), "doing2", " %T%c->%O (%i)%?%a>0%{ has %a arm%?%a=1%{y%!ies%}%} at %l. (%d%% dam, %s%% shd, %f%% fuel)\0"}, /* ^f */ - {'\xc6', "free_beer", " %T%c->%O %p is free beer\0"}, + {(unsigned char) ('\xc6'), "free_beer", " %T%c->%O %p is free beer\0"}, /* ^n */ - {'\xce', "no_gas", " %T%c->%O %p @ %l has no gas\0"}, + {(unsigned char) ('\xce'), "no_gas", " %T%c->%O %p @ %l has no gas\0"}, /* ^h */ - {'\xc8', "crippled", " %T%c->%O %p @ %l crippled\0"}, + {(unsigned char) ('\xc8'), "crippled", " %T%c->%O %p @ %l crippled\0"}, /* ^9 */ - {'\x99', "pickup", " %T%c->%O %p++ @ %l\0"}, + {(unsigned char) ('\x99'), "pickup", " %T%c->%O %p++ @ %l\0"}, /* ^0 */ - {'\x90', "pop", " %T%c->%O %l%?%n>-1%{ @ %n%}!\0"}, + {(unsigned char) ('\x90'), "pop", " %T%c->%O %l%?%n>-1%{ @ %n%}!\0"}, /* F */ - {'F', "carrying", " %T%c->%O %?%S=SB%{Your Starbase is c%!C%}arrying %?%a>0%{%a%!NO%} arm%?%a=1%{y%!ies%}.\0"}, + {(unsigned char) ('F'), "carrying", " %T%c->%O %?%S=SB%{Your Starbase is c%!C%}arrying %?%a>0%{%a%!NO%} arm%?%a=1%{y%!ies%}.\0"}, /* ^@ */ - {'\xa0', "other1", " %T%c->%O (%i)%?%a>0%{ has %a arm%?%a=1%{y%!ies%}%} at %l. (%d%%D, %s%%S, %f%%F)\0"}, + {(unsigned char) ('\xa0'), "other1", " %T%c->%O (%i)%?%a>0%{ has %a arm%?%a=1%{y%!ies%}%} at %l. (%d%%D, %s%%S, %f%%F)\0"}, /* ^# */ - {'\x83', "other2", " %T%c->%O (%i)%?%a>0%{ has %a arm%?%a=1%{y%!ies%}%} at %l. (%d%%D, %s%%S, %f%%F)\0"}, + {(unsigned char) ('\x83'), "other2", " %T%c->%O (%i)%?%a>0%{ has %a arm%?%a=1%{y%!ies%}%} at %l. (%d%%D, %s%%S, %f%%F)\0"}, /* E */ - {'E', "help", " %T%c->%O Help(%S)! %s%% shd, %d%% dmg, %f%% fuel,%?%S=SB%{ %w%% wtmp,%!%}%E%{ ETEMP!%}%W%{ WTEMP!%} %a armies!\0"}, + {(unsigned char) ('E'), "help", " %T%c->%O Help(%S)! %s%% shd, %d%% dmg, %f%% fuel,%?%S=SB%{ %w%% wtmp,%!%}%E%{ ETEMP!%}%W%{ WTEMP!%} %a armies!\0"}, {'\0', '\0', '\0'}, }; @@ -724,9 +724,10 @@ struct stringlist *defaults = NULL; -/* DoubleBuffering */ +#ifdef DOUBLE_BUFFERING SDBUFFER * localSDB = NULL; SDBUFFER * mapSDB = NULL; +#endif int disableWinkey = 1; /* disable WinKey + ContextKey by default */ Index: defwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defwin.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- defwin.c 21 Apr 2006 12:00:06 -0000 1.3 +++ defwin.c 7 May 2006 16:59:27 -0000 1.4 @@ -18,30 +18,23 @@ * the use of it.) * * $Log$ - * Revision 1.3 2006/04/21 12:00:06 modemhero - * This large patch brings the client up to Stas's version 4.4.0.4. The visible changes to the user are: - * - added "allowWheelActions: (on)/off" to be able to disable wheel in non-scrolling windows - * - added new window "player2" that behaves exactly as player list window, but allows to - * select alternate custom layout and could be toggled with 'A' key - * - added "playerList2: (string)" option that allows to select different player list layout - * for alternate player list window, by default it will be "n T R N l M K W L r O D d " - * - fixed bug that caused main thread to continue in case player died while scrolling - * message window using scrollbar (which forced him close client window and reconnect) - * - fixed incorrect behavior of 'windowMove: off' feature. Previously window would snap - * back to wrong place if the main window top-left corner was not (0,0) coordinates - * - long lines are now wrapped by words instead of by chars. Maximum message length was - * reduced to 4 full message lines (4 * 69 characters) - * - message input window will now show Sender->Recipient even when the input line is longer - * than 69 characters - * - changed 'Forum' URL on metaserver window to open Google's r.g.n location - * - * There are also several internal changes, such as a new format for error messages. - * - * Revision 1.2 2006/04/12 04:20:03 modemhero - * Update to version 4.4.0.3 + * Revision 1.4 2006/05/07 16:59:27 modemhero + * Major features in this patch are: + * Merge of Stas' latest source into client. + * - Lots of double buffering code + * - Cleanup of protoyping functions and proper variable initialization + * - Addition of working RSA key generator mkkey.exe (this necessitates another DLL in the source) + * - Updated compile instructions, and a new document on how to make a RSA key + * - Working version of winkey with BCC compiler + * - Bug fixes as per listed in his change log + * Cleanup of changes list to remove bug fix/stuff only coders need to know. + * Removal of buildexe script - Stas rewrote build to make this obsolete + * Addition of HR bitmap set (including a few placeholder bitmaps until art is done) + * Metablock patch accepted (not working proper yet though due to retrieving login issue) + * Probably a few other things I forgot about! * - * Revision 1.1.1.1 2004/02/09 23:56:10 stas_p - * First import of full source + * Revision 1.2 2004/08/11 00:12:56 stas_p + * replaced printf by more generic console functions fro console.c * * Revision 1.2 1999/06/13 05:51:49 sheldon * Added code for Cambot playback Index: parsemeta.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/parsemeta.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- parsemeta.c 6 May 2006 05:40:00 -0000 1.5 +++ parsemeta.c 7 May 2006 16:59:27 -0000 1.6 @@ -168,6 +168,15 @@ return (sock); } +int +metablock (char *host) +/* Block connections to known servers not willing to handle default logins */ +{ + if ( ((!strcmp(login, "new-be-nice") || !strcmp(login, "netrek-player")) && (strstr(host,".tamu.edu") != NULL)) + || (strstr(host,".tamu.edu") != NULL) ) + return 1; + return 0; +} static void parseInput (char *in, @@ -233,7 +242,7 @@ if (!rtn) /* use a zero to mark end of buffer */ return; - *(point++) = rtn; + *(point++) = (char) rtn; } while (rtn != EOF && rtn != '\n'); @@ -296,11 +305,11 @@ #ifdef METAPING /* Initialize the ping rtt fields */ for (i = 0; i < RTT_AVG_BUFLEN; ++i ) - slist->pkt_rtt[i] = -1; + slist->pkt_rtt[i] = (unsigned long) -1; #endif - /* Don't list Paradise Servers or *.tamu.edu */ - if (slist->typeflag != 'P' && strstr(slist->address,".tamu.edu") == NULL) + /* Don't list servers we cannot use */ + if (slist->typeflag != 'P' && !metablock(slist->address)) { #ifdef DEBUG @@ -329,7 +338,7 @@ char tmpFileName[PATH_MAX]; char *sockbuf, *buf; int bufleft = BUF - 1; - int len; + int len = 0; int sock = 0; int i = 0; @@ -583,8 +592,7 @@ slist = serverlist + i; - // Don't list *.tamu.edu - if (strstr(slist->address,".tamu.edu") != NULL) + if (metablock(slist->address)) return; #ifdef METAPING @@ -644,38 +652,38 @@ } #ifdef METAPING - if (metaPing) - { - /* Print out the lag statistics */ - for (idx = 0; idx < RTT_AVG_BUFLEN; ++idx) + if (metaPing) { - if (serverlist[i].pkt_rtt[idx] != -3 && - serverlist[i].pkt_rtt[idx] != -2 && - serverlist[i].pkt_rtt[idx] != -1) // dont count these non-values + /* Print out the lag statistics */ + for (idx = 0; idx < RTT_AVG_BUFLEN; ++idx) { - //printf ("i=%d idx=%d replies=%d rtt=%ld lag=%ld\n", i , idx, replies, serverlist[i].pkt_rtt[idx], lag); - lag += serverlist[i].pkt_rtt[idx]; - replies++; + if (serverlist[i].pkt_rtt[idx] != -3 && + serverlist[i].pkt_rtt[idx] != -2 && + serverlist[i].pkt_rtt[idx] != -1) // dont count these non-values + { + //printf ("i=%d idx=%d replies=%d rtt=%ld lag=%ld\n", i , idx, replies, serverlist[i].pkt_rtt[idx], lag); + lag += serverlist[i].pkt_rtt[idx]; + replies++; + } } - } - //printf("i=%d replies=%ld idx=%ld rtt=%ld %s\n", i, replies, - // ((serverlist[i].cur_idx + RTT_AVG_BUFLEN - 1) % RTT_AVG_BUFLEN), - // serverlist[i].pkt_rtt[(serverlist[i].cur_idx + RTT_AVG_BUFLEN - 1) % RTT_AVG_BUFLEN], - // serverlist[i].address); + //printf("i=%d replies=%ld idx=%ld rtt=%ld %s\n", i, replies, + // ((serverlist[i].cur_idx + RTT_AVG_BUFLEN - 1) % RTT_AVG_BUFLEN), + // serverlist[i].pkt_rtt[(serverlist[i].cur_idx + RTT_AVG_BUFLEN - 1) % RTT_AVG_BUFLEN], + // serverlist[i].address); - if (replies > 0) - { - lag = lag / replies; - if (lag < 1000) sprintf (buf + strlen (buf), " %3ldms", lag); - else strcat(buf, " >1sec"); + if (replies > 0) + { + lag = lag / replies; + if (lag < 1000) sprintf (buf + strlen (buf), " %3ldms", lag); + else strcat(buf, " >1sec"); + } + else if (replies == 0 && serverlist[i].pkt_rtt[0] == -2) + strcat(buf, " Unknw"); // Unknown host + else if (replies == 0 && serverlist[i].pkt_rtt[0] == -3) + strcat(buf, " TmOut"); // TimeOut + else strcat(buf, " "); } - else if (replies == 0 && serverlist[i].pkt_rtt[0] == -2) - strcat(buf, " Unknw"); // Unknown host - else if (replies == 0 && serverlist[i].pkt_rtt[0] == -3) - strcat(buf, " TmOut"); // TimeOut - else strcat(buf, " "); - } #endif W_WriteText (metaWin, 0, i, color, buf, strlen (buf), 0); @@ -818,7 +826,7 @@ #ifdef METAPING DWORD IDThread; - metaPing_procId = _getpid() & 0xFFFF; + metaPing_procId = (unsigned short) (_getpid() & 0xFFFF); if (metaPing) { @@ -958,7 +966,7 @@ */ sum = (sum >> 16) + (sum & 0xffff); /* add hi 16 to low 16 */ sum += (sum >> 16); /* add carry */ - answer = ~sum; /* truncate to 16 bits */ + answer = (unsigned short) (~sum); /* truncate to 16 bits */ return (answer); } @@ -1087,7 +1095,7 @@ if (rawSocket == SOCKET_ERROR) { metaPing_ReportError("socket()"); - return -1; + return (unsigned long) -1; } while (!thread_ready) @@ -1106,12 +1114,12 @@ // Send ICMP echo request //printf("\nPinging %s [%s]", serverlist[i].address, inet_ntoa(saDest.sin_addr)); if (metaPing_sendEchoRequest(rawSocket, &saDest, idx) == SOCKET_ERROR) - serverlist[i].pkt_rtt[idx] = -1; // Error + serverlist[i].pkt_rtt[idx] = (unsigned long) -1; // Error else - serverlist[i].pkt_rtt[idx] = -3; // Waiting for ping reply + serverlist[i].pkt_rtt[idx] = (unsigned long) -3; // Waiting for ping reply } else if (serverlist[i].ip_addr == INADDR_NONE) - serverlist[i].pkt_rtt[idx] = -2; // Unknown Host + serverlist[i].pkt_rtt[idx] = (unsigned long) -2; // Unknown Host } // Listen for about one second between for possible replies @@ -1149,7 +1157,7 @@ for (i = 0; i < num_servers; ++i) metarefresh(i); // Proceed to the next cycle of ping samples - idx = (idx + 1) % RTT_AVG_BUFLEN; + idx = (unsigned short) ((idx + 1) % RTT_AVG_BUFLEN); } if (closesocket(rawSocket) == SOCKET_ERROR) Index: helpwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/helpwin.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- helpwin.c 21 Apr 2006 12:00:07 -0000 1.3 +++ helpwin.c 7 May 2006 16:59:27 -0000 1.4 @@ -247,7 +247,7 @@ helpaction (W_Event * data) { int i, message_number = -1; - int row, column; + int row, column = 0; /* Let's find row and column from mouse coordinates */ row = (data->y - 4)/ W_Textheight; @@ -364,7 +364,7 @@ if (i == 0) helpmessage[1 + num_mapped] = 2; /* Let's draw space-like character */ else - helpmessage[1 + num_mapped] = i + 32; + helpmessage[1 + num_mapped] = (char) (i + 32); } Index: dashboard3.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/dashboard3.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- dashboard3.c 26 Apr 2006 15:54:04 -0000 1.3 +++ dashboard3.c 7 May 2006 16:59:27 -0000 1.4 @@ -34,42 +34,42 @@ char *buf = s; - *buf = '0' + (v / 100000); + *buf = (char) ('0' + (v / 100000)); if (*buf != '0') { buf++; } - *buf = '0' + ((v % 100000) / 10000); + *buf = (char) ('0' + ((v % 100000) / 10000)); if ((*buf != '0') || (v >= 100000)) { buf++; } - *buf = '0' + ((v % 10000) / 1000); + *buf = (char) ('0' + ((v % 10000) / 1000)); if ((*buf != '0') || (v >= 10000)) { buf++; } - *buf = '0' + ((v % 1000) / 100); + *buf = (char) ('0' + ((v % 1000) / 100)); if ((*buf != '0') || (v >= 1000)) { buf++; } - *buf = '0' + ((v % 100) / 10); + *buf = (char) ('0' + ((v % 100) / 10)); if ((*buf != '0') || (v >= 100)) { buf++; } - *buf++ = '0' + (v % 10); + *buf++ = (char) ('0' + (v % 10)); return buf - s; } @@ -86,18 +86,18 @@ if (v >= 100.0) { - *buf++ = '0' + ((int) (v / 100)); - *buf++ = '0' + ((int) (((int) v % 100) / 10)); + *buf++ = (char) ('0' + ((int) (v / 100))); + *buf++ = (char) ('0' + ((int) (((int) v % 100) / 10))); } else if (v >= 10.0) { - *buf++ = '0' + ((int) (v / 10)); + *buf++ = (char) ('0' + ((int) (v / 10))); } - *buf++ = '0' + (((int) v) % 10); + *buf++ = (char) ('0' + (((int) v) % 10)); *buf++ = '.'; - *buf++ = '0' + (((int) (v * 10)) % 10); - *buf++ = '0' + (((int) (v * 100)) % 10); + *buf++ = (char) ('0' + (((int) (v * 10)) % 10)); + *buf++ = (char) ('0' + (((int) (v * 100)) % 10)); return buf - s; } @@ -246,14 +246,14 @@ static void db_flags (int fr) { - static unsigned int old_flags = -1; - static unsigned char old_tourn = -1; + static unsigned int old_flags = (unsigned int) -1; + static unsigned char old_tourn = (unsigned char) -1; char buf[13]; if (fr || (old_flags != me->p_flags) || (old_tourn != status->tourn)) { - buf[0] = (me->p_flags & PFSHIELD ? 'S' : ' '); + buf[0] = (char) ((me->p_flags & PFSHIELD ? 'S' : ' ')); if (me->p_flags & PFGREEN) { @@ -268,23 +268,23 @@ buf[1] = 'R'; } - buf[2] = (me->p_flags & (PFPLLOCK | PFPLOCK) ? 'L' : ' '); - buf[3] = (me->p_flags & PFREPAIR ? 'R' : ' '); - buf[4] = (me->p_flags & PFBOMB ? 'B' : ' '); - buf[5] = (me->p_flags & PFORBIT ? 'O' : ' '); + buf[2] = (char) (me->p_flags & (PFPLLOCK | PFPLOCK) ? 'L' : ' '); + buf[3] = (char) (me->p_flags & PFREPAIR ? 'R' : ' '); + buf[4] = (char) (me->p_flags & PFBOMB ? 'B' : ' '); + buf[5] = (char) (me->p_flags & PFORBIT ? 'O' : ' '); if (me->p_ship.s_type == STARBASE) { - buf[6] = (me->p_flags & PFDOCKOK ? 'D' : ' '); + buf[6] = (char) (me->p_flags & PFDOCKOK ? 'D' : ' '); } else { - buf[6] = (me->p_flags & PFDOCK ? 'D' : ' '); + buf[6] = (char) (me->p_flags & PFDOCK ? 'D' : ' '); } - buf[7] = (me->p_flags & PFCLOAK ? 'C' : ' '); - buf[8] = (me->p_flags & PFWEP ? 'W' : ' '); - buf[9] = (me->p_flags & PFENG ? 'E' : ' '); + buf[7] = (char) (me->p_flags & PFCLOAK ? 'C' : ' '); + buf[8] = (char) (me->p_flags & PFWEP ? 'W' : ' '); + buf[9] = (char) (me->p_flags & PFENG ? 'E' : ' '); if (me->p_flags & PFPRESS) { Index: pingstats.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/pingstats.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- pingstats.c 21 Jan 2003 21:28:42 -0000 1.1.1.1 +++ pingstats.c 7 May 2006 16:59:27 -0000 1.2 @@ -88,11 +88,13 @@ extern int ping_av; /* average rt */ extern int ping_sd; /* standard deviation */ +int pStatsHeight (void) { return STAT_HEIGHT; } +int pStatsWidth (void) { return STAT_WIDTH; @@ -164,6 +166,7 @@ } } +void updatePStats (void) { int i, value, diff, old_x, new_x; Index: udpopt.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/udpopt.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- udpopt.c 21 Apr 2006 12:00:07 -0000 1.2 +++ udpopt.c 7 May 2006 16:59:27 -0000 1.3 @@ -22,6 +22,7 @@ #define UDPLEN 35 /* Set up the UDP control window */ +void udpwindow (void) { register int i; @@ -34,6 +35,7 @@ } /* Refresh item i */ +void udprefresh (int i) { char buf[BUFSIZ]; @@ -229,6 +231,7 @@ } } +void udpdone (void) { /* Unmap window */ Index: input.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/input.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- input.c 30 Apr 2006 20:17:47 -0000 1.8 +++ input.c 7 May 2006 16:59:27 -0000 1.9 @@ -316,7 +316,7 @@ register struct planet *k; int g_x, g_y; double dist, closedist; - register int targtyp, targnum; + register int targtyp = 0, targnum = -1; if (ww == mapw) { @@ -364,12 +364,12 @@ if (targtyp == PLAYERTYPE) { sendPlaylockReq (targnum); - me->p_playerl = targnum; + me->p_playerl = (short) targnum; } else { sendPlanlockReq (targnum); - me->p_planet = targnum; + me->p_planet = (short) targnum; } } @@ -390,7 +390,7 @@ /* check for '^' key being specified with "^^" */ if (*str != '^') - c = *str + 96; + c = (unsigned char) (*str + 96); else c = *str; } @@ -412,7 +412,7 @@ if (c == '^' || (c >= 32 && c <= 127)) return c; else - return (c - 96); + return (unsigned char) (c - 96); } @@ -474,7 +474,7 @@ if (*str >= 32 && *str < MAXASCII) { - c1 = getctrlkey (&str) - 32; + c1 = (unsigned char) (getctrlkey (&str) - 32); c2 = getctrlkey (&str); mystats->st_keymap[c1] = c2; } @@ -1412,7 +1412,7 @@ { if (key >= 32 && key < 176) { - int offset; + int offset = 0; switch (data->modifier) { @@ -1551,7 +1551,7 @@ message_on (); data->key = 'A'; smessage (data->key); - return; + return; } return; } @@ -1600,17 +1600,17 @@ if (data->key == W_RBUTTON) { - course = getcourse (data->Window, data->x, data->y); + course = (unsigned char) (getcourse (data->Window, data->x, data->y)); set_course (course); } else if (data->key == W_LBUTTON) { - course = getcourse (data->Window, data->x, data->y); + course = (unsigned char) (getcourse (data->Window, data->x, data->y)); sendTorpReq (course); } else if (data->key == W_MBUTTON) { - course = getcourse (data->Window, data->x, data->y); + course = (unsigned char) (getcourse (data->Window, data->x, data->y)); sendPhaserReq (course); } else if (data->key == W_XBUTTON1) @@ -1628,7 +1628,7 @@ sendPlasmaReq (course); } #else - course = getcourse (data->Window, data->x, data->y); + course = (unsigned char) (getcourse (data->Window, data->x, data->y)); sendPlasmaReq (course); #endif /* AUTOKEY */ } @@ -1743,7 +1743,7 @@ target = gettarget (data->Window, data->x, data->y, TARG_PLAYER); if (target->o_num == -1) return; - me->p_tractor = target->o_num; + me->p_tractor = (short) (target->o_num); sendTractorReq (1, (char) (target->o_num)); } } @@ -1762,7 +1762,7 @@ target = gettarget (data->Window, data->x, data->y, TARG_PLAYER); if (target->o_num == -1) return; - me->p_tractor = target->o_num; + me->p_tractor = (short) (target->o_num); sendRepressReq (1, (char) (target->o_num)); } } @@ -1786,19 +1786,19 @@ players[target->o_num].p_y != -10000) { sendPlaylockReq (target->o_num); - me->p_playerl = target->o_num; + me->p_playerl = (short) (target->o_num); } } else { sendPlaylockReq (target->o_num); - me->p_playerl = target->o_num; + me->p_playerl = (short) (target->o_num); } } else { /* It's a planet */ sendPlanlockReq (target->o_num); - me->p_planet = target->o_num; + me->p_planet = (short) (target->o_num); } } else if (data->key == W_XBUTTON2_4) @@ -2776,7 +2776,7 @@ target = gettarget (data->Window, data->x, data->y, TARG_PLAYER); if (target->o_num == -1) return; - me->p_tractor = target->o_num; + me->p_tractor = (short) (target->o_num); if (key == 'T') { sendTractorReq (1, (char) (target->o_num)); @@ -2892,7 +2892,7 @@ target = gettarget (data->Window, data->x, data->y, TARG_PLAYER); if (target->o_num == -1) return; - me->p_tractor = target->o_num; + me->p_tractor = (short) (target->o_num); sendRepressReq (1, (char) (target->o_num)); } @@ -2907,7 +2907,7 @@ target = gettarget (data->Window, data->x, data->y, TARG_PLAYER); if (target->o_num == -1) return; - me->p_tractor = target->o_num; + me->p_tractor = (short) (target->o_num); sendTractorReq (1, (char) (target->o_num)); } @@ -3021,7 +3021,7 @@ sendPlasmaReq (course); } #else - course = getcourse (data->Window, data->x, data->y); + course = (unsigned char) (getcourse (data->Window, data->x, data->y)); sendPlasmaReq (course); #endif /* AUTOKEY */ @@ -3097,7 +3097,7 @@ { unsigned char course; - course = getcourse (data->Window, data->x, data->y); + course = (unsigned char) (getcourse (data->Window, data->x, data->y)); set_course (course); me->p_flags &= ~(PFPLOCK | PFPLLOCK); } @@ -3126,19 +3126,19 @@ players[target->o_num].p_y != -10000) { sendPlaylockReq (target->o_num); - me->p_playerl = target->o_num; + me->p_playerl = (short) (target->o_num); } } else { sendPlaylockReq (target->o_num); - me->p_playerl = target->o_num; + me->p_playerl = (short) (target->o_num); } } else { /* It's a planet */ sendPlanlockReq (target->o_num); - me->p_planet = target->o_num; + me->p_planet = (short) (target->o_num); } } @@ -3203,7 +3203,7 @@ sendPhaserReq (course); } #else - course = getcourse (data->Window, data->x, data->y); + course = (unsigned char) (getcourse (data->Window, data->x, data->y)); sendPhaserReq (course); #endif /* AUTOKEY */ @@ -3264,7 +3264,7 @@ sendTorpReq (course); } #else - course = getcourse (data->Window, data->x, data->y); + course = (unsigned char) (getcourse (data->Window, data->x, data->y)); sendTorpReq (course); #endif /* AUTOKEY */ } @@ -3336,7 +3336,7 @@ target = gettarget (data->Window, data->x, data->y, TARG_PLAYER); if (target->o_num == -1) return; - me->p_tractor = target->o_num; + me->p_tractor = (short) (target->o_num); if (key == 'T') { sendTractorReq (1, (char) (target->o_num)); Index: makefile =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/makefile,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- makefile 26 Apr 2006 02:04:24 -0000 1.7 +++ makefile 7 May 2006 16:59:27 -0000 1.8 @@ -1,92 +1,34 @@ # -# ========================================================================= -# COW on Win32 Makefile -# # This makefile is written for Borland C++ 5.5 # -# - -# Definitions needed to be changed before compile #DEBUG = 1 - RSA = 1 -RSAKEY = \netrek_files\rsa\NetrekXP-Mod-RSA-Key-Win32.secret - # Borland C++ 5.5 cc = bcc32 rc = brcc32 link = ilink32 compileandlink = bcc32 -# Borland C++ 5.5 options -# /MT - Multi-threaded app -# /Ox - max optimization -# /Od - disable optimizations -# -4 - 486 optimized code -# -5 - Pentium optimized code -# -c - compile only -# -v - debugging info -# -O1 - Optimize for size -# -O2 - Optimize for speed - - +# Compiler and linker flags !IFDEF DEBUG cflags = -O2 -5 -v -DWIN32 -DBorland -tW -tWM ccompileonly = -c +ldebug = -Gn -v +DEBUGDEFS = -DDEBUG !ELSE cflags = -O2 -5 -DWIN32 -DBorland -tW -tWM ccompileonly = -c +ldebug = -Gn -w-dup !ENDIF -# resource compiler -rcvars = -DWIN32 - -######################################## -# Link flags -# - -!IFDEF DEBUG -ldebug = /Gn /v -!ELSE -ldebug = /Gn /w-dup -!ENDIF - -######################################## - -# declarations common to all linker options - -#Dunno here... -conlflags = $(lflags) /NODEFAULTLIB /SUBSYSTEM:CONSOLE /MACHINE:IX86 -lout = "/OUT:" - -#LIBS = libcmt.lib user32.lib gdi32.lib\ -# wsock32.lib kernel32.lib shell32.lib winmm.lib mpr.lib - # Borland Libs LIBOPTS = /LC:\Borland\bcc55\lib;c:\Borland\bcc55\lib\psdk;..\Win32\lib\BCC /Tpe -!IFDEF RSA -GMPLIB = ..\Win32\lib\BCC\libgmpbcc.lib -#..\Win32\lib\BCC\libmpbcc.lib -!ENDIF - LIBS = SDL.LIB SDL_mixer.LIB SDLmain.LIB CW32mt.LIB IMPORT32.LIB user32.lib gdi32.lib wsock32.lib kernel32.lib shell32.lib winmm.lib mpr.lib $(GMPLIB) -# --------------------------------------------------------------------------- -# - Start of makefile proper - INCS = -I..\win32 -I..\win32\h -I..\win32\SDL -I..\win32\h\gmp -I..\include -ARCH = Intel/Win32 - -!IFDEF RSA -RSADEFS = -DRSA -!endif - -!ifdef DEBUG -DEBUGDEFS = -DDEBUG -!endif ROBJ = beeplite.obj check.obj colors.obj console.obj data.obj death.obj defaults.obj dmessage.obj\ enter.obj findslot.obj getname.obj getship.obj helpwin.obj hintwin.obj inform.obj\ @@ -115,26 +57,25 @@ MAINSRC = main.c !ifdef RSA +GMPLIB = ..\Win32\lib\BCC\libgmpbcc.lib +RSADEFS = -DRSA RSASRC = rsa_box.c rsa_box_0.c rsa_box_1.c rsa_box_2.c\ - rsa_box_3.c rsa_box_4.c + rsa_box_3.c rsa_box_4.c RSAOBJ = rsa_box.obj rsa_box_0.obj rsa_box_1.obj rsa_box_2.obj\ - rsa_box_3.obj rsa_box_4.obj + rsa_box_3.obj rsa_box_4.obj !endif WIN32_SRCS = winmain.c mswindow.c winsndlib.c WIN32_OBJS = winmain.obj mswindow.obj winsndlib.obj -RANDOMOBJ = random.obj - INCLUDES = struct.h packets.h defs.h copyright.h bitmaps.h data.h\ oldbitmaps.h tngbitmaps.h hullbitmaps.h rabbitbitmaps.h\ sound.h audio.h litebitmaps.h copyright2.h Wlib.h\ - playerlist.h version.h moobitmaps.h\ - parsemeta.h spopt.h map.h string_util.h wtext.h local.h + playerlist.h version.h moobitmaps.h\ + parsemeta.h spopt.h map.h string_util.h wtext.h local.h all: netrek.exe - OBJS = $(ROBJ) $(MAINOBJ) $(RSAOBJ) $(INPUTOBJ) $(WIN32_OBJS) .c.obj: $(cc) $(cflags) $(ccompileonly) $(cdebug) $(DEFS) $(RSADEFS) $(DEBUGDEFS) $(INCS) $< @@ -144,13 +85,9 @@ $(RESOURCES): bccnetrek.rc $(rc) bccnetrek.rc -rsa_box.c: - ..\tools\mkkey -nt -k $(RSAKEY) - netrek.exe: $(OBJS) $(RESOURCES) main.ico $(link) $(ldebug) $(LIBOPTS) $(OBJS) C0x32.OBJ, netrek.exe,, $(LIBS), , $(RESOURCES) clean: del *.obj - del rsa*.c del netrek.exe netrek.ilc netrek.ild netrek.ild netrek.ilf netrek.ils netrek.map bccnetrek.res netrek.tds \ No newline at end of file Index: short.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/short.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- short.c 1 May 2006 00:55:11 -0000 1.5 +++ short.c 7 May 2006 16:59:27 -0000 1.6 @@ -228,7 +228,7 @@ #define SPWINSIDE 500 /* To make it safe */ LONG spgwidth = GWIDTH; - +void sendThreshold (short unsigned int v) { struct threshold_cpacket p; @@ -447,7 +447,6 @@ handleVPlayer (unsigned char *sbuf) { register int x, y, i, numofplayers, pl_no, save; - unsigned char *savebuf = sbuf; register struct player *pl; numofplayers = (unsigned char) sbuf[1] & 0x3f; @@ -481,11 +480,11 @@ pl->p_flags &= ~PFCLOAK; } - Pdir[pl_no] = (unsigned char) *sbuf >> 4; /* DIR */ - pl->p_dir = (unsigned char) Pdir[pl_no] * 16; /* real DIR */ + Pdir[pl_no] = (unsigned char) (*sbuf >> 4); /* DIR */ + pl->p_dir = (unsigned char) (Pdir[pl_no] * 16); /* real DIR */ sbuf++; - x = (unsigned char) *sbuf++; - y = (unsigned char) *sbuf++; /* The lower 8 Bits are + x = (unsigned char) (*sbuf++); + y = (unsigned char) (*sbuf++); /* The lower 8 Bits are * saved */ /* Now we must preprocess the coordinates */ if ((unsigned char) save & 64) @@ -605,11 +604,11 @@ pl->p_flags &= ~PFCLOAK; } - Pdir[pl_no] = (unsigned char) *sbuf >> 4; /* DIR */ - pl->p_dir = (unsigned char) Pdir[pl_no] * 16; /* real DIR */ + Pdir[pl_no] = (unsigned char) (*sbuf >> 4); /* DIR */ + pl->p_dir = (unsigned char) (Pdir[pl_no] * 16); /* real DIR */ sbuf++; - x = (unsigned char) *sbuf++; - y = (unsigned char) *sbuf++; /* The lower 8 Bits are + x = (unsigned char) (*sbuf++); + y = (unsigned char) (*sbuf++); /* The lower 8 Bits are * saved */ /* Now we must preprocess the coordinates */ if ((unsigned char) save & 64) @@ -773,11 +772,11 @@ pl->p_flags &= ~PFCLOAK; } - Pdir[pl_no] = (unsigned char) *sbuf >> 4; /* DIR */ - pl->p_dir = (unsigned char) Pdir[pl_no] * 16; /* real DIR */ + Pdir[pl_no] = (unsigned char) (*sbuf >> 4); /* DIR */ + pl->p_dir = (unsigned char) (Pdir[pl_no] * 16); /* real DIR */ sbuf++; - x = (unsigned char) *sbuf++; - y = (unsigned char) *sbuf++; /* The lower 8 Bits are + x = (unsigned char) (*sbuf++); + y = (unsigned char) (*sbuf++); /* The lower 8 Bits are * saved */ /* Now we must preprocess the coordinates */ if ((unsigned char) save & 64) @@ -1072,8 +1071,8 @@ /* Now the TorpInfo */ if (*infobitset & 01) { - war = (unsigned char) *infodata & 15 /* 0x0f */ ; - status = ((unsigned char) *infodata & 0xf0) >> 4; + war = (char) ((unsigned char) *infodata & 15) /* 0x0f */ ; + status = (char) (((unsigned char) *infodata & 0xf0) >> 4); infodata++; if (status == TEXPLODE && thetorp->t_status == TFREE) { @@ -1195,6 +1194,7 @@ } +void resetWeaponInfo (void) /* * Give all weapons for all ships the status of not being active. @@ -1224,7 +1224,7 @@ shortReq.type = CP_S_REQ; shortReq.req = state; - shortReq.version = shortversion; /* need a var now because 2 + shortReq.version = (char) shortversion; /* need a var now because 2 * S_P versions exist S_P2 */ switch (state) { @@ -1468,8 +1468,8 @@ #ifndef RCM float kills; #endif - victim = (unsigned char) packet->argument & 0x3f; - killer = (unsigned char) packet->argument2 & 0x3f; + victim = (unsigned char) (((unsigned char) packet->argument) & 0x3f); + killer = (unsigned char) (((unsigned char) packet->argument2) & 0x3f); /* that's only a temp */ damage = (unsigned char) karg3; damage |= (karg4 & 127) << 8; @@ -1482,10 +1482,10 @@ sprintf (killmess, "%0.2f", kills); #endif - armies = - (((unsigned char) packet-> + armies = (unsigned char) + ((((unsigned char) packet-> argument >> 6) | ((unsigned char) packet-> - argument2 & 192) >> 4); + argument2 & 192) >> 4)); if (karg4 & 128) armies |= 16; @@ -1494,9 +1494,9 @@ dist.sender = victim; dist.tclose_j = killer; dist.arms = armies; - dist.dam = damage / 100; - dist.shld = damage % 100; - dist.wtmp = karg5; + dist.dam = (unsigned char) (damage / 100); + dist.shld = (unsigned char) (damage % 100); + dist.wtmp = (unsigned char) karg5; makedistress (&dist, msg.mesg, rcm_msg[1].macro); msg.m_flags = MALL | MVALID | MKILL; #else @@ -1526,7 +1526,7 @@ } if (why_dead) { - add_whydead (msg.mesg, karg5); + add_whydead (msg.mesg, karg5); karg5 = 0; } #endif @@ -1562,7 +1562,7 @@ dist.dam = '\0'; dist.shld = '\0'; dist.tclose_pl = packet->argument2; - dist.wtmp = karg5; + dist.wtmp = (unsigned char) karg5; makedistress (&dist, msg.mesg, rcm_msg[2].macro); #else (void) sprintf (msg.mesg, "GOD->ALL %s (%c%c) killed by %s (%c)", @@ -1601,10 +1601,10 @@ dist.sender = packet->argument; dist.tclose_j = packet->argument; dist.arms = '\0'; - dist.dam = arg3; + dist.dam = (unsigned char) arg3; dist.shld = '\0'; dist.tclose_pl = packet->argument2; - dist.wtmp = karg5; + dist.wtmp = (unsigned char) karg5; makedistress (&dist, msg.mesg, rcm_msg[3].macro); #else (void) sprintf (buf, "%-3s->%-3s", @@ -1624,7 +1624,7 @@ msg.type = SP_MESSAGE; msg.mesg[79] = '\0'; msg.m_flags = MTEAM | MBOMB | MVALID; - msg.m_recpt = planets[(unsigned char) packet->argument2].pl_owner; + msg.m_recpt = (unsigned char) (planets[(unsigned char) packet->argument2].pl_owner); msg.m_from = 255; handleMessage (&msg); } @@ -1641,7 +1641,7 @@ dist.dam = '\0'; dist.shld = '\0'; dist.tclose_pl = packet->argument; - dist.wtmp = karg5; + dist.wtmp = (unsigned char) karg5; makedistress (&dist, msg.mesg, rcm_msg[4].macro); #else char buf1[80]; @@ -1662,7 +1662,7 @@ msg.type = SP_MESSAGE; msg.mesg[79] = '\0'; msg.m_flags = MTEAM | MDEST | MVALID; - msg.m_recpt = planets[(unsigned char) packet->argument].pl_owner; + msg.m_recpt = (unsigned char) (planets[(unsigned char) packet->argument].pl_owner); msg.m_from = 255; handleMessage (&msg); } @@ -1679,7 +1679,7 @@ dist.dam = '\0'; dist.shld = '\0'; dist.tclose_pl = packet->argument; - dist.wtmp = karg5; + dist.wtmp = (unsigned char) karg5; makedistress (&dist, msg.mesg, rcm_msg[5].macro); #else char buf1[80]; @@ -1716,9 +1716,9 @@ dist.sender = packet->argument; dist.tclose_j = packet->argument; dist.arms = '\0'; - dist.dam = damage / 100; - dist.shld = damage % 100; - dist.wtmp = karg5; + dist.dam = (unsigned char) (damage / 100); + dist.shld = (unsigned char) (damage % 100); + dist.wtmp = (unsigned char) karg5; makedistress (&dist, msg.mesg, rcm_msg[6].macro); #else (void) sprintf (msg.mesg, @@ -1899,6 +1899,7 @@ #define MY_SIZEOF(a) (sizeof(a) / sizeof(*(a))) +void add_whydead (char *s, int m) /* 7/22/93 LAB */ { @@ -1914,8 +1915,7 @@ /* S_P2 */ void -handleVKills (sbuf) - unsigned char *sbuf; +handleVKills (unsigned char *sbuf) { register int i, numofkills, pnum; register unsigned short pkills; @@ -1957,8 +1957,7 @@ } /* handleVKills */ void -handleVPhaser (sbuf) - unsigned char *sbuf; +handleVPhaser (unsigned char *sbuf) { struct phaser *phas; struct phaser_s_spacket *packet = (struct phaser_s_spacket *) &sbuf[0]; @@ -1993,11 +1992,11 @@ break; } phas = &phasers[pnum]; - phas->ph_status = status; - phas->ph_dir = dir; + phas->ph_status = (unsigned char) status; + phas->ph_dir = (unsigned char) dir; phas->ph_x = x; phas->ph_y = y; - phas->ph_target = target; + phas->ph_target = (short) target; phas->ph_fuse = 0; phas->ph_updateFuse = PHASER_UPDATE_FUSE; phas->ph_maxfuse = (players[pnum].p_ship.s_phaserfuse * updatesPerSec) / 10; @@ -2013,8 +2012,7 @@ } void -handle_s_Stats (packet) - struct stats_s_spacket *packet; +handle_s_Stats (struct stats_s_spacket *packet) { register struct player *pl; Index: getname.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/getname.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- getname.c 26 Apr 2006 02:04:24 -0000 1.4 +++ getname.c 7 May 2006 16:59:27 -0000 1.5 @@ -415,15 +415,15 @@ // Reset the keymap for our player record for (j = 0; j < 95; j++) { - mystats->st_keymap[j] = j + 32; - mystats->st_keymap[j + 96] = j + 32 + 96; + mystats->st_keymap[j] = (unsigned char) (j + 32); + mystats->st_keymap[j + 96] = (unsigned char) (j + 32 + 96); #ifdef MOUSE_AS_SHIFT - mystats->st_keymap[j + 192] = j + 32; - mystats->st_keymap[j + 288] = j + 32; - mystats->st_keymap[j + 384] = j + 32; - mystats->st_keymap[j + 480] = j + 32; - mystats->st_keymap[j + 576] = j + 32; + mystats->st_keymap[j + 192] = (unsigned char) (j + 32); + mystats->st_keymap[j + 288] = (unsigned char) (j + 32); + mystats->st_keymap[j + 384] = (unsigned char) (j + 32); + mystats->st_keymap[j + 480] = (unsigned char) (j + 32); + mystats->st_keymap[j + 576] = (unsigned char) (j + 32); #endif } mystats->st_keymap[95] = 0; Index: playback.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/playback.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- playback.c 2 May 2006 00:55:52 -0000 1.12 +++ playback.c 7 May 2006 16:59:27 -0000 1.13 @@ -241,15 +241,15 @@ mystats->st_tticks = 1; for (i = 0; i < 95; i++) { - mystats->st_keymap[i] = i + 32; - mystats->st_keymap[i + 96] = i + 32 + 96; + mystats->st_keymap[i] = (unsigned char) (i + 32); + mystats->st_keymap[i + 96] = (unsigned char) (i + 32 + 96); #ifdef MOUSE_AS_SHIFT - mystats->st_keymap[i + 192] = i + 32; - mystats->st_keymap[i + 288] = i + 32; - mystats->st_keymap[i + 384] = i + 32; - mystats->st_keymap[i + 480] = i + 32; - mystats->st_keymap[i + 576] = i + 32; + mystats->st_keymap[i + 192] = (unsigned char) (i + 32); + mystats->st_keymap[i + 288] = (unsigned char) (i + 32); + mystats->st_keymap[i + 384] = (unsigned char) (i + 32); + mystats->st_keymap[i + 480] = (unsigned char) (i + 32); + mystats->st_keymap[i + 576] = (unsigned char) (i + 32); #endif } mystats->st_keymap[95] = 0; @@ -365,10 +365,9 @@ while (1) { -#ifdef nodef +#ifdef BRMH fd_set readfds; struct timeval timeout; - int xsock = W_Socket (); timeout.tv_sec = 0; timeout.tv_usec = 0; @@ -383,7 +382,11 @@ process_event (); } +#ifdef BRMH + intrupt (&readfds); +#else intrupt (); +#endif Sleep (pbdelay); } } Index: map.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/map.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- map.c 26 Apr 2006 23:18:14 -0000 1.5 +++ map.c 7 May 2006 16:59:27 -0000 1.6 @@ -124,9 +124,9 @@ for (y = startY; y <= endY; y++) { if (roughMap[x][y] == -1) - roughMap[x][y] = k; + roughMap[x][y] = (char) k; else - roughMap2[x][y] = k; + roughMap2[x][y] = (char) k; } } } @@ -301,18 +301,21 @@ ody = pl_update[l->pl_no].plu_y * WINSIDE / GWIDTH; /* XFIX */ +#ifndef DOUBLE_BUFFERING W_ClearArea (mapw, odx - (BMP_MPLANET_WIDTH / 2), ody - (BMP_MPLANET_HEIGHT / 2), BMP_MPLANET_WIDTH, BMP_MPLANET_HEIGHT); - /*W_ClearAreaDB (mapSDB, odx - (BMP_MPLANET_WIDTH / 2), - ody - (BMP_MPLANET_HEIGHT / 2), - BMP_MPLANET_WIDTH, BMP_MPLANET_HEIGHT);*/ W_WriteText (mapw, odx - (BMP_MPLANET_WIDTH / 2), ody + (BMP_MPLANET_HEIGHT / 2), backColor, l->pl_name, 3, planetFont (l)); - /*W_WriteTextDB (mapSDB, odx - (BMP_MPLANET_WIDTH / 2), +#else + W_ClearAreaDB (mapSDB, odx - (BMP_MPLANET_WIDTH / 2), + ody - (BMP_MPLANET_HEIGHT / 2), + BMP_MPLANET_WIDTH, BMP_MPLANET_HEIGHT); + W_WriteTextDB (mapSDB, odx - (BMP_MPLANET_WIDTH / 2), ody + (BMP_MPLANET_HEIGHT / 2), - backColor, l->pl_name, 3, planetFont (l));*/ + backColor, l->pl_name, 3, planetFont (l)); +#endif pl_update[l->pl_no].plu_update = 0; } else @@ -320,12 +323,15 @@ /* Clear the planet normally */ /* XFIX */ +#ifndef DOUBLE_BUFFERING W_ClearArea (mapw, dx - (BMP_MPLANET_WIDTH / 2 + 4), dy - (BMP_MPLANET_HEIGHT / 2 + 4), BMP_MPLANET_WIDTH + 8, BMP_MPLANET_HEIGHT + 8); - /*W_ClearAreaDB (mapSDB, dx - (BMP_MPLANET_WIDTH / 2 + 4), +#else + W_ClearAreaDB (mapSDB, dx - (BMP_MPLANET_WIDTH / 2 + 4), dy - (BMP_MPLANET_HEIGHT / 2 + 4), - BMP_MPLANET_WIDTH + 8, BMP_MPLANET_HEIGHT + 8);*/ + BMP_MPLANET_WIDTH + 8, BMP_MPLANET_HEIGHT + 8); +#endif l->pl_flags &= ~PLCLEAR; } @@ -337,14 +343,23 @@ { int seq_n = emph_planet_seq_n[l->pl_no] % emph_planet_seq_frames; +#ifndef DOUBLE_BUFFERING W_OverlayBitmap(dx - (emph_planet_seq_width / 2 + 1), dy - (emph_planet_seq_height / 2), emph_planet_seq[seq_n], W_White); W_WriteBitmap(dx - (BMP_MPLANET_WIDTH / 2), dy - (BMP_MPLANET_HEIGHT / 2), - planetmBitmap(l), planetColor(l)); + planetmBitmap(l), planetColor(l)); +#else + W_OverlayBitmapDB(mapSDB, dx - (emph_planet_seq_width / 2 + 1), + dy - (emph_planet_seq_height / 2), + emph_planet_seq[seq_n], + W_White); + W_WriteBitmapDB(localSDB, dx - (BMP_MPLANET_WIDTH / 2), dy - (BMP_MPLANET_HEIGHT / 2), + planetmBitmap(l), planetColor(l)); +#endif emph_planet_seq_n[l->pl_no] -= 1; l->pl_flags |= PLREDRAW; /* Leave redraw on until * * * done highlighting */ @@ -354,12 +369,15 @@ else { #endif +#ifndef DOUBLE_BUFFERING W_OverlayBitmap (dx - (BMP_MPLANET_WIDTH / 2), dy - (BMP_MPLANET_HEIGHT / 2), planetmBitmap (l), planetColor (l)); - /*W_OverlayBitmapDB (mapSDB, dx - (BMP_MPLANET_WIDTH / 2), +#else + W_OverlayBitmapDB (mapSDB, dx - (BMP_MPLANET_WIDTH / 2), dy - (BMP_MPLANET_HEIGHT / 2), planetmBitmap (l), - planetColor (l));*/ + planetColor (l)); +#endif #ifdef BEEPLITE } #endif @@ -368,34 +386,43 @@ { if (agriCAPS) { - agri_name[0] = toupper (l->pl_name[0]); - agri_name[1] = toupper (l->pl_name[1]); - agri_name[2] = toupper (l->pl_name[2]); + agri_name[0] = (char) (toupper (l->pl_name[0])); + agri_name[1] = (char) (toupper (l->pl_name[1])); + agri_name[2] = (char) (toupper (l->pl_name[2])); +#ifndef DOUBLE_BUFFERING W_WriteText (mapw, dx - (BMP_MPLANET_WIDTH / 2), dy + (BMP_MPLANET_HEIGHT / 2), getAgriColor (l), agri_name, 3, planetFont (l)); - /*W_WriteTextDB (mapSDB, dx - (BMP_MPLANET_WIDTH / 2), +#else + W_WriteTextDB (mapSDB, dx - (BMP_MPLANET_WIDTH / 2), dy + (BMP_MPLANET_HEIGHT / 2), getAgriColor (l), - agri_name, 3, planetFont (l));*/ + agri_name, 3, planetFont (l)); +#endif } else { +#ifndef DOUBLE_BUFFERING W_WriteText (mapw, dx - (BMP_MPLANET_WIDTH / 2), dy + (BMP_MPLANET_HEIGHT / 2), getAgriColor (l), l->pl_name, 3, planetFont (l)); - /*W_WriteTextDB (mapSDB, dx - (BMP_MPLANET_WIDTH / 2), +#else + W_WriteTextDB (mapSDB, dx - (BMP_MPLANET_WIDTH / 2), dy + (BMP_MPLANET_HEIGHT / 2), getAgriColor (l), - l->pl_name, 3, planetFont (l));*/ + l->pl_name, 3, planetFont (l)); +#endif } } else { +#ifndef DOUBLE_BUFFERING W_WriteText (mapw, dx - (BMP_MPLANET_WIDTH / 2), dy + (BMP_MPLANET_HEIGHT / 2), planetColor (l), l->pl_name, 3, planetFont (l)); - /*W_WriteTextDB (mapSDB, dx - (BMP_MPLANET_WIDTH / 2), +#else + W_WriteTextDB (mapSDB, dx - (BMP_MPLANET_WIDTH / 2), dy + (BMP_MPLANET_HEIGHT / 2), planetColor (l), - l->pl_name, 3, planetFont (l));*/ + l->pl_name, 3, planetFont (l)); +#endif } if (showIND && ((l->pl_info & me->p_team) @@ -404,35 +431,41 @@ #endif ) && (l->pl_owner == NOBODY)) { +#ifndef DOUBLE_BUFFERING W_MakeLine (mapw, dx + (BMP_MPLANET_WIDTH / 2 - 1), dy + (BMP_MPLANET_HEIGHT / 2 - 1), dx - (BMP_MPLANET_WIDTH / 2), dy - (BMP_MPLANET_HEIGHT / 2), W_White); - /*W_MakeLineDB (mapSDB, dx + (BMP_MPLANET_WIDTH / 2 - 1), - dy + (BMP_MPLANET_HEIGHT / 2 - 1), - dx - (BMP_MPLANET_WIDTH / 2), - dy - (BMP_MPLANET_HEIGHT / 2), W_White);*/ W_MakeLine (mapw, dx - (BMP_MPLANET_WIDTH / 2), dy + (BMP_MPLANET_HEIGHT / 2 - 1), dx + (BMP_MPLANET_WIDTH / 2 - 1), dy - (BMP_MPLANET_HEIGHT / 2), W_White); - /*W_MakeLineDB (mapSDB, dx - (BMP_MPLANET_WIDTH / 2), +#else + W_MakeLineDB (mapSDB, dx + (BMP_MPLANET_WIDTH / 2 - 1), + dy + (BMP_MPLANET_HEIGHT / 2 - 1), + dx - (BMP_MPLANET_WIDTH / 2), + dy - (BMP_MPLANET_HEIGHT / 2), W_White); + W_MakeLineDB (mapSDB, dx - (BMP_MPLANET_WIDTH / 2), dy + (BMP_MPLANET_HEIGHT / 2 - 1), dx + (BMP_MPLANET_WIDTH / 2 - 1), - dy - (BMP_MPLANET_HEIGHT / 2), W_White);*/ + dy - (BMP_MPLANET_HEIGHT / 2), W_White); +#endif } if (showPlanetOwner) { - ch = ((l->pl_info & me->p_team) + ch = (char) (((l->pl_info & me->p_team) #ifdef RECORDGAME || playback #endif - )? tolower (teamlet[l->pl_owner]) : '?'; + )? tolower (teamlet[l->pl_owner]) : '?'); +#ifndef DOUBLE_BUFFERING W_WriteText (mapw, dx + (BMP_MPLANET_WIDTH / 2) + 2, dy - 6, planetColor (l), &ch, 1, planetFont (l)); - /*W_WriteTextDB (mapSDB, dx + (BMP_MPLANET_WIDTH / 2) + 2, - dy - 6, planetColor (l), &ch, 1, planetFont (l));*/ +#else + W_WriteTextDB (mapSDB, dx + (BMP_MPLANET_WIDTH / 2) + 2, + dy - 6, planetColor (l), &ch, 1, planetFont (l)); +#endif } } } @@ -444,15 +477,15 @@ DrawGalaxyHockeyLines (void) { register struct s_line *sl; - const int HALF_WINSIDE = WINSIDE / 2; for (sl = map_hockey_lines + NUM_HOCKEY_LINES - 1; sl >= map_hockey_lines; --sl) { - W_CacheLine (mapw, sl->begin_x, sl->begin_y, - sl->end_x, sl->end_y, sl->color); - /*W_CacheLineDB (mapSDB, sl->begin_x, sl->begin_y, - sl->end_x, sl->end_y, sl->color);*/ +#ifndef DOUBLE_BUFFERING + W_CacheLine (mapw, sl->begin_x, sl->begin_y, sl->end_x, sl->end_y, sl->color); +#else + W_CacheLineDB (mapSDB, sl->begin_x, sl->begin_y, sl->end_x, sl->end_y, sl->color); +#endif } } @@ -466,7 +499,7 @@ int ori_light = FED; char kli_score_line[5]; char ori_score_line[5]; - int ori_offset, kli_offset; + int ori_offset, kli_offset; int i; @@ -497,31 +530,34 @@ /* Now we have scores, so let's draw them */ sprintf (ori_score_line, "%2d", ori_score); sprintf (kli_score_line, "%-2d", kli_score); + + /* If we rotate galaxy 180 degrees the scoreboard flips */ + if (rotate == 2) + { + ori_offset = 8; + kli_offset = 3; + } + else + { + ori_offset = 3; + kli_offset = 8; + } - /* If we rotate galaxy 180 degrees the scoreboard flips */ - if (rotate == 2) - { - ori_offset = 8; - kli_offset = 3; - } - else - { - ori_offset = 3; - kli_offset = 8; - } - +#ifndef DOUBLE_BUFFERING W_WriteText (mapw, ori_offset * W_Textwidth, 1 * W_Textheight, W_Ori, ori_score_line, strlen (ori_score_line), W_RegularFont); - /*W_WriteTextDB (mapSDB, ori_offset * W_Textwidth, 1 * W_Textheight, W_Ori, - ori_score_line, strlen (ori_score_line), W_RegularFont);*/ W_WriteText (mapw, 6 * W_Textwidth, 1 * W_Textheight, W_White, ":", 1, W_RegularFont); - /*W_WriteTextDB (mapSDB, 6 * W_Textwidth, 1 * W_Textheight, W_White, - ":", 1, W_RegularFont);*/ W_WriteText (mapw, kli_offset * W_Textwidth, 1 * W_Textheight, W_Kli, kli_score_line, strlen (kli_score_line), W_RegularFont); - /*W_WriteTextDB (mapSDB, kli_offset * W_Textwidth, 1 * W_Textheight, W_Kli, - kli_score_line, strlen (kli_score_line), W_RegularFont);*/ +#else + W_WriteTextDB (mapSDB, ori_offset * W_Textwidth, 1 * W_Textheight, W_Ori, + ori_score_line, strlen (ori_score_line), W_RegularFont); + W_WriteTextDB (mapSDB, 6 * W_Textwidth, 1 * W_Textheight, W_White, + ":", 1, W_RegularFont); + W_WriteTextDB (mapSDB, kli_offset * W_Textwidth, 1 * W_Textheight, W_Kli, + kli_score_line, strlen (kli_score_line), W_RegularFont); +#endif } #endif /* HOCKEY_LINES */ @@ -554,8 +590,9 @@ int view = WINSIDE * SCALE / 2; int mvx, mvy; - /* DoubleBuffering */ - //W_Win2Mem (mapSDB); +#ifdef DOUBLE_BUFFERING + W_Win2Mem (mapSDB); +#endif dx = (me->p_x) / (GWIDTH / WINSIDE); dy = (me->p_y) / (GWIDTH / WINSIDE); @@ -574,8 +611,11 @@ return; } +#ifndef DOUBLE_BUFFERING W_ClearWindow (mapw); - //W_ClearWindowDB (mapSDB); +#else + W_ClearWindowDB (mapSDB); +#endif clearlock = 0; clearviewbox = 0; viewboxcleared = 0; @@ -597,10 +637,13 @@ if (clearlock) { clearlock = 0; +#ifndef DOUBLE_BUFFERING W_WriteTriangle (mapw, clearlmark[0], clearlmark[1], clearlmark[2], clearlmark[3], backColor); - /*W_WriteTriangleDB (mapSDB, clearlmark[0], clearlmark[1], - clearlmark[2], clearlmark[3], backColor);*/ +#else + W_WriteTriangleDB (mapSDB, clearlmark[0], clearlmark[1], + clearlmark[2], clearlmark[3], backColor); +#endif } if (clearviewbox) @@ -608,17 +651,29 @@ clearviewbox = 0; /* clear old dots - placed here for less flicker */ if (viewx + viewdist < WINSIDE && viewy + viewdist < WINSIDE) - W_MakePoint (mapw, viewx + viewdist, viewy + viewdist, backColor); - +#ifndef DOUBLE_BUFFERING + W_MakePoint (mapw, viewx + viewdist, viewy + viewdist, backColor); +#else + W_MakePointDB (mapSDB, viewx + viewdist, viewy + viewdist, backColor); +#endif if (viewx + viewdist < WINSIDE && viewy - viewdist > 0) - W_MakePoint (mapw, viewx + viewdist, viewy - viewdist, backColor); - +#ifndef DOUBLE_BUFFERING + W_MakePoint (mapw, viewx + viewdist, viewy - viewdist, backColor); +#else + W_MakePointDB (mapSDB, viewx + viewdist, viewy - viewdist, backColor); +#endif if (viewx - viewdist > 0 && viewy + viewdist < WINSIDE) - W_MakePoint (mapw, viewx - viewdist, viewy + viewdist, backColor); - +#ifndef DOUBLE_BUFFERING + W_MakePoint (mapw, viewx - viewdist, viewy + viewdist, backColor); +#else + W_MakePointDB (mapSDB, viewx - viewdist, viewy + viewdist, backColor); +#endif if (viewx - viewdist > 0 && viewy - viewdist > 0) - W_MakePoint (mapw, viewx - viewdist, viewy - viewdist, backColor); - +#ifndef DOUBLE_BUFFERING + W_MakePoint (mapw, viewx - viewdist, viewy - viewdist, backColor); +#else + W_MakePointDB (mapSDB, viewx - viewdist, viewy - viewdist, backColor); +#endif /* redraw any planets they overwrote */ mvx = viewx * (GWIDTH / WINSIDE); /* correct from view scale */ @@ -642,10 +697,13 @@ if (mclearzone[2][i]) { /* XFIX */ +#ifndef DOUBLE_BUFFERING W_ClearArea (mapw, mclearzone[0][i], mclearzone[1][i], mclearzone[2][i], mclearzone[3][i]); - /*W_ClearAreaDB (mapSDB, mclearzone[0][i], mclearzone[1][i], - mclearzone[2][i], mclearzone[3][i]);*/ +#else + W_ClearAreaDB (mapSDB, mclearzone[0][i], mclearzone[1][i], + mclearzone[2][i], mclearzone[3][i]); +#endif /* Redraw the hole just left next update */ checkRedraw (mclearzone[4][i], mclearzone[5][i]); @@ -685,25 +743,29 @@ { /* draw the new points */ if (dx + viewdist < WINSIDE && dy + viewdist < WINSIDE) +#ifndef DOUBLE_BUFFERING W_MakePoint (mapw, dx + viewdist, dy + viewdist, W_White); - /*W_MakeLine (mapw, dx + viewdist, dy + viewdist, - dx - viewdist, dy + viewdist, W_White);*/ - //W_MakePointDB (mapSDB, dx + viewdist, dy + viewdist, W_White); +#else + W_MakePointDB (mapSDB, dx + viewdist, dy + viewdist, W_White); +#endif if (dx + viewdist < WINSIDE && dy - viewdist > 0) +#ifndef DOUBLE_BUFFERING W_MakePoint (mapw, dx + viewdist, dy - viewdist, W_White); - /*W_MakeLine (mapw, dx + viewdist, dy - viewdist, - dx + viewdist, dy + viewdist, W_White);*/ - //W_MakePointDB (mapSDB, dx + viewdist, dy - viewdist, W_White); +#else + W_MakePointDB (mapSDB, dx + viewdist, dy - viewdist, W_White); +#endif if (dx - viewdist > 0 && dy + viewdist < WINSIDE) +#ifndef DOUBLE_BUFFERING W_MakePoint (mapw, dx - viewdist, dy + viewdist, W_White); - /*W_MakeLine (mapw, dx - viewdist, dy + viewdist, - dx - viewdist, dy - viewdist, W_White);*/ - //W_MakePointDB (mapSDB, dx - viewdist, dy + viewdist, W_White); +#else + W_MakePointDB (mapSDB, dx - viewdist, dy + viewdist, W_White); +#endif if (dx - viewdist > 0 && dy - viewdist > 0) +#ifndef DOUBLE_BUFFERING W_MakePoint (mapw, dx - viewdist, dy - viewdist, W_White); - /*W_MakeLine (mapw, dx - viewdist, dy - viewdist, - dx + viewdist, dy - viewdist, W_White);*/ - //W_MakePointDB (mapSDB, dx - viewdist, dy - viewdist, W_White); +#else + W_MakePointDB (mapSDB, dx - viewdist, dy - viewdist, W_White); +#endif viewx = dx; /* store the points for later */ viewy = dy; /* clearing */ @@ -712,16 +774,16 @@ } #ifdef HOCKEY_LINES - if (hockey_mode ()) - { + if (hockey_mode ()) + { /* Draw Hockey Lines */ - if (showHockeyLinesMap) - DrawGalaxyHockeyLines (); + if (showHockeyLinesMap) + DrawGalaxyHockeyLines (); /* Draw Hockey Score */ if (showHockeyScore) - DrawGalaxyHockeyScore (); - } + DrawGalaxyHockeyScore (); + } #endif /* HOCKEY_LINES */ /* Draw ships */ @@ -749,36 +811,48 @@ if (j->p_flags & PFCLOAK) { if (omitTeamLetter) +#ifndef DOUBLE_BUFFERING W_WriteText (mapw, dx - (W_Textwidth / 2), dy - W_Textheight / 2, unColor, cloakChars, 1, W_RegularFont); - /*W_WriteTextDB (mapSDB, dx - (W_Textwidth / 2), +#else + W_WriteTextDB (mapSDB, dx - (W_Textwidth / 2), dy - W_Textheight / 2, unColor, cloakChars, - (cloakChars[1] == '\0' ? 1 : 2), W_RegularFont);*/ + (cloakChars[1] == '\0' ? 1 : 2), W_RegularFont); +#endif else +#ifndef DOUBLE_BUFFERING W_WriteText (mapw, dx - W_Textwidth, dy - W_Textheight / 2, unColor, cloakChars, (cloakChars[1] == '\0' ? 1 : 2), W_RegularFont); - /*W_WriteTextDB (mapSDB, dx - W_Textwidth, +#else + W_WriteTextDB (mapSDB, dx - W_Textwidth, dy - W_Textheight / 2, unColor, cloakChars, - (cloakChars[1] == '\0' ? 1 : 2), W_RegularFont);*/ + (cloakChars[1] == '\0' ? 1 : 2), W_RegularFont); +#endif } else { if (omitTeamLetter) +#ifndef DOUBLE_BUFFERING W_WriteText (mapw, dx - (W_Textwidth / 2), dy - W_Textheight / 2, playerColor (j), (j->p_mapchars)+1, 1, shipFont (j)); - /*W_WriteTextDB (mapSDB, dx - (W_Textwidth / 2), +#else + W_WriteTextDB (mapSDB, dx - (W_Textwidth / 2), dy - W_Textheight / 2, playerColor (j), - (j->p_mapchars)+1, 1, shipFont (j));*/ + (j->p_mapchars)+1, 1, shipFont (j)); +#endif else +#ifndef DOUBLE_BUFFERING W_WriteText (mapw, dx - W_Textwidth, dy - W_Textheight / 2, playerColor (j), j->p_mapchars, 2, shipFont (j)); - /*W_WriteTextDB (mapSDB, dx - W_Textwidth, +#else + W_WriteTextDB (mapSDB, dx - W_Textwidth, dy - W_Textheight / 2, playerColor (j), - j->p_mapchars, 2, shipFont (j));*/ + j->p_mapchars, 2, shipFont (j)); +#endif } #ifdef BEEPLITE @@ -787,10 +861,17 @@ { int seq_n = emph_player_seq_n[i] % emph_player_seq_frames; +#ifndef DOUBLE_BUFFERING W_WriteBitmap(dx - (emph_player_seq_width / 2 - 1), dy - (emph_player_seq_height / 2 + 1), emph_player_seq[seq_n], W_White); +#else + W_WriteBitmapDB(localSDB, dx - (emph_player_seq_width / 2 - 1), + dy - (emph_player_seq_height / 2 + 1), + emph_player_seq[seq_n], + W_White); +#endif emph_player_seq_n[i] -= 1; mclearzone[0][i] = dx - (emph_player_seq_width / 2 - 1); mclearzone[1][i] = dy - (emph_player_seq_height / 2 + 1); @@ -830,8 +911,11 @@ { dx = j->p_x * WINSIDE / GWIDTH; dy = j->p_y * WINSIDE / GWIDTH; +#ifndef DOUBLE_BUFFERING W_WriteTriangle (mapw, dx, dy + 6, 4, 1, foreColor); - //W_WriteTriangleDB (mapSDB, dx, dy + 6, 4, 1, foreColor); +#else + W_WriteTriangleDB (mapSDB, dx, dy + 6, 4, 1, foreColor); +#endif clearlmark[0] = dx; clearlmark[1] = dy + 6; @@ -846,10 +930,11 @@ dx = l->pl_x * WINSIDE / GWIDTH; dy = l->pl_y * WINSIDE / GWIDTH; - W_WriteTriangle (mapw, dx, dy - (BMP_MPLANET_HEIGHT) / 2 - 4, - 4, 0, foreColor); - /*W_WriteTriangleDB (mapSDB, dx, dy - (BMP_MPLANET_HEIGHT) / 2 - 4, - 4, 0, foreColor);*/ +#ifndef DOUBLE_BUFFERING + W_WriteTriangle (mapw, dx, dy - (BMP_MPLANET_HEIGHT) / 2 - 4, 4, 0, foreColor); +#else + W_WriteTriangleDB (mapSDB, dx, dy - (BMP_MPLANET_HEIGHT) / 2 - 4, 4, 0, foreColor); +#endif clearlmark[0] = dx; clearlmark[1] = dy - (BMP_MPLANET_HEIGHT) / 2 - 4; @@ -858,6 +943,7 @@ clearlock = 1; } - /* DoubleBuffering */ - //W_Mem2Win (mapSDB); -} +#ifdef DOUBLE_BUFFERING + W_Mem2Win (mapSDB); +#endif +} \ No newline at end of file Index: console.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/console.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- console.c 21 Apr 2006 12:03:23 -0000 1.1 +++ console.c 7 May 2006 16:59:27 -0000 1.2 @@ -74,7 +74,7 @@ } else { - tmp = (struct cons_buffer *) malloc (sizeof (struct cons_buffer)); + tmp = (struct cons_buffer *) malloc (sizeof (struct cons_buffer)); consTail = consTail->next; consTail = tmp; consTail->string = (char *) malloc (sizeof (char) * strlen (str) + 1); Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- mswindow.c 6 May 2006 06:36:36 -0000 1.14 +++ mswindow.c 7 May 2006 16:59:27 -0000 1.15 @@ -27,7 +27,6 @@ #include #include #include -#include #include "copyright2.h" #include "config.h" @@ -392,7 +391,7 @@ strcpy (FileName, GetExeDir ()); strcat (FileName, FontFileName); - RemoveFontResource (FileName); + RemoveFontResourceEx (FileName, FR_PRIVATE | FR_NOT_ENUM, 0); //Select the original bitmaps back and delete our memory DCs SelectObject (GlobalMemDC, GlobalOldMemDCBitmap); @@ -535,7 +534,7 @@ p = tmp; } - /* DoubleBuffer */ +#ifdef DOUBLE_BUFFERING SelectObject (localSDB->mem_dc, localSDB->old_bmp); DeleteObject (localSDB->mem_bmp); ReleaseDC (((Window *)localSDB->window)->hwnd, localSDB->win_dc); @@ -547,6 +546,7 @@ ReleaseDC (((Window *)mapSDB->window)->hwnd, mapSDB->win_dc); free (mapSDB->window); free (mapSDB); +#endif //WinKey Kill Library Stop if (pfnFastCallKill != NULL) @@ -564,6 +564,9 @@ free (consHead); consHead = tmp; } + + if (saveFile) + free (saveFile); } #define MakeTeamCursor(upper, team) \ @@ -666,30 +669,36 @@ //Create the fonts that we need. The fonts are actually in our resource file strcpy (FileName, GetExeDir ()); strcat (FileName, FontFileName); - AddFontResource (FileName); + AddFontResourceEx (FileName, FR_PRIVATE | FR_NOT_ENUM, 0); memset (&lf, 0, sizeof (LOGFONT)); + + lf.lfCharSet = ANSI_CHARSET; + lf.lfOutPrecision = OUT_TT_PRECIS; + lf.lfClipPrecision = CLIP_DEFAULT_PRECIS; + lf.lfQuality = DEFAULT_QUALITY; + lf.lfPitchAndFamily = FF_MODERN | FIXED_PITCH; + strcpy (lf.lfFaceName, "Netrek"); -// lf.lfWidth = 6; -// lf.lfHeight=10; - lf.lfHeight = intDefault ("fontsize", 10); + lf.lfHeight = -intDefault ("fontsize", 10); lf.lfWeight = FW_REGULAR; + W_RegularFont = (W_Font) CreateFontIndirect (&lf); - lf.lfWeight = FW_BOLD; strcpy (lf.lfFaceName, "Netrek"); + lf.lfWeight = FW_BOLD; W_HighlightFont = (W_Font) CreateFontIndirect (&lf); + strcpy (lf.lfFaceName, "Netrek"); lf.lfWeight = FW_REGULAR; lf.lfUnderline = TRUE; - strcpy (lf.lfFaceName, "Netrek"); W_UnderlineFont = (W_Font) CreateFontIndirect (&lf); //Use arial for the BigFont + strcpy (lf.lfFaceName, "Arial"); lf.lfUnderline = FALSE; lf.lfWeight = FW_MEDIUM; - strcpy (lf.lfFaceName, "Arial"); - lf.lfHeight = 52; // 52 + lf.lfHeight = 52; lf.lfWidth = 32; W_BigFont = (W_Font) CreateFontIndirect (&lf); @@ -727,9 +736,9 @@ /* Converted SHR's to TESTs, faster on x86 -SAC */ if (!(res & 0xff00)) //!highbyte == no shift,ctrl,alt - VKMap[res] = i; + VKMap[res] = (char) i; else if (res & 0x100) //Bit 1 of high byte = shift key - VKShiftMap[res & 0xff] = i; + VKShiftMap[res & 0xff] = (char) i; } VKMap[VK_ESCAPE] = 27; // 27 is mapped as Ctrl-[ by Windows VKMap[VK_TAB] = (char) 201; //'i'+96; // Make it look like '^i' so macroKey: TAB will work @@ -754,7 +763,7 @@ VKShiftMap[VK_ESCAPE] = 27; // Map shift+escape-> escape MainThreadID = GetCurrentThreadId (); // Save main thread ID so we can tell - MainThread = GetCurrentThread; // Also save main thread handle + MainThread = GetCurrentThread (); // Also save main thread handle // which thread we're in later // Get the current system colors @@ -928,7 +937,6 @@ //Create the various pens and brushes for each color for (i = 0; i < COLORS; i++) { - DWORD dashbits[] = { 1, 2 }; colortable[i].brush = CreateSolidBrush (colortable[i].rgb); colortable[i].pen = CreatePen (PS_SOLID | PS_INSIDEFRAME, 1, colortable[i].rgb); @@ -1075,8 +1083,8 @@ color = WHITE; //Set the various attributes to default states - window->type = type; - window->border = border; + window->type = (short) type; + window->border = (short) border; window->BorderColor = color; window->cursor = LoadCursor (NULL, IDC_ARROW); @@ -1221,8 +1229,8 @@ return (0); //Store the original textheight, width - newwin->TextHeight = height; - newwin->TextWidth = width; + newwin->TextHeight = (short) height; + newwin->TextWidth = (short) width; /* Set original coordinates, so we will be able to restore to them */ newwin->orig_x = orig_x; @@ -1271,8 +1279,8 @@ return (0); //Store the original textheight, width - newwin->TextHeight = height; - newwin->TextWidth = width; + newwin->TextHeight = (short) height; + newwin->TextWidth = (short) width; /* Set original coordinates, so we will be able to restore to them */ newwin->orig_x = orig_x; @@ -1340,8 +1348,8 @@ items[i].color = W_White; } newwin->items = items; - newwin->NumItems = height; - newwin->TextHeight = height; + newwin->NumItems = (short) height; + newwin->TextHeight = (short) height; /* Set original coordinates, so we will be able to restore to them */ newwin->orig_x = orig_x; @@ -1805,6 +1813,7 @@ (win->hwnd == ((Window *) baseWin)->hwnd) || (((Window *) metaWin != NULL && win->hwnd == ((Window *) metaWin)->hwnd)) || (((Window *) waitWin != NULL && win->hwnd == ((Window *) waitWin)->hwnd)) || + (((Window *) waitqWin != NULL && win->hwnd == ((Window *) waitqWin)->hwnd)) || (((Window *) countWin != NULL && win->hwnd == ((Window *) countWin)->hwnd)) || (((Window *) motdButtonWin != NULL && win->hwnd == ((Window *) motdButtonWin)->hwnd)) || (((Window *) motdWin != NULL && win->hwnd == ((Window *) motdWin)->hwnd))) @@ -1819,14 +1828,31 @@ movingr.bottom = winRect.bottom - baseRect.top; /* In case of WS_CAPTION (titlebar on) we have to subtract caption size and - additional borders to get screen coordinates */ - if (GetWindowLongPtr (((Window *) baseWin)->hwnd, GWL_STYLE) & WS_CAPTION) + additional borders to get screen coordinates. + If the main window is also resizeable then border sizes change from SM_CnFIXEDFRAME + to SM_CnSIZEFRAME + */ + if (GetWindowLongPtr (((Window *) baseWin)->hwnd, GWL_STYLE) & WS_CAPTION && !mainResizeable) { movingr.left -= GetSystemMetrics (SM_CXFIXEDFRAME); movingr.top -= (GetSystemMetrics (SM_CYFIXEDFRAME) + GetSystemMetrics (SM_CYCAPTION)); movingr.right -= GetSystemMetrics (SM_CXFIXEDFRAME); movingr.bottom -= (GetSystemMetrics (SM_CYFIXEDFRAME) + GetSystemMetrics (SM_CYCAPTION)); } + else if (GetWindowLongPtr (((Window *) baseWin)->hwnd, GWL_STYLE) & WS_CAPTION && mainResizeable) + { + movingr.left -= GetSystemMetrics (SM_CXSIZEFRAME); + movingr.top -= (GetSystemMetrics (SM_CYSIZEFRAME) + GetSystemMetrics (SM_CYCAPTION)); + movingr.right -= GetSystemMetrics (SM_CXSIZEFRAME); + movingr.bottom -= (GetSystemMetrics (SM_CYSIZEFRAME) + GetSystemMetrics (SM_CYCAPTION)); + } + else if (!(GetWindowLongPtr (((Window *) baseWin)->hwnd, GWL_STYLE) & WS_CAPTION) && mainResizeable) + { + movingr.left -= GetSystemMetrics (SM_CXSIZEFRAME) - 1; + movingr.top -= GetSystemMetrics (SM_CYSIZEFRAME) - 1; + movingr.right -= GetSystemMetrics (SM_CXSIZEFRAME) - 1; + movingr.bottom -= GetSystemMetrics (SM_CYSIZEFRAME) - 1; + } /* If our window has parent we have to subtract parent's border as well */ if (win->parent != (Window *) baseWin) @@ -1848,6 +1874,7 @@ (win->hwnd == ((Window *) baseWin)->hwnd) || (((Window *) metaWin != NULL && win->hwnd == ((Window *) metaWin)->hwnd)) || (((Window *) waitWin != NULL && win->hwnd == ((Window *) waitWin)->hwnd)) || + (((Window *) waitqWin != NULL && win->hwnd == ((Window *) waitqWin)->hwnd)) || (((Window *) countWin != NULL && win->hwnd == ((Window *) countWin)->hwnd)) || (((Window *) motdButtonWin != NULL && win->hwnd == ((Window *) motdButtonWin)->hwnd)) || (((Window *) motdWin != NULL && win->hwnd == ((Window *) motdWin)->hwnd))) @@ -2162,11 +2189,11 @@ #ifdef CONTROL_KEY if (use_control_key && (GetKeyState (VK_CONTROL) & ~0x1)) - EventQueue[EventTail].key = (char) j + 96; + EventQueue[EventTail].key = (unsigned char) (j + 96); else - EventQueue[EventTail].key = (char) j; + EventQueue[EventTail].key = (unsigned char) j; #else - EventQueue[EventTail].key = (char) j; + EventQueue[EventTail].key = (unsigned char) j; #endif return (0); @@ -2603,38 +2630,68 @@ return (0); case WM_MOUSEWHEEL: + { + RECT baseRect; // wheel could be 1/-1 to show the direction of wheel move - wheel = (signed short) HIWORD (wParam) / WHEEL_DELTA; + wheel = (short) (GET_WHEEL_DELTA_WPARAM(wParam) / WHEEL_DELTA); pos.x = (long) LOWORD (lParam); pos.y = (long) HIWORD (lParam); + + /* Fix in case main window isn't at (0,0) coordinates */ + GetWindowRect (((Window *) baseWin)->hwnd, &baseRect); + pos.x -= baseRect.left; + pos.y -= baseRect.top; + + /* Fix in case main window has caption or resizeable */ + if (GetWindowLongPtr (((Window *) baseWin)->hwnd, GWL_STYLE) & WS_CAPTION && !mainResizeable) + { + pos.x -= GetSystemMetrics (SM_CXFIXEDFRAME); + pos.y -= (GetSystemMetrics (SM_CYFIXEDFRAME) + GetSystemMetrics (SM_CYCAPTION)); + } + else if (GetWindowLongPtr (((Window *) baseWin)->hwnd, GWL_STYLE) & WS_CAPTION && mainResizeable) + { + pos.x -= GetSystemMetrics (SM_CXSIZEFRAME); + pos.y -= (GetSystemMetrics (SM_CYSIZEFRAME) + GetSystemMetrics (SM_CYCAPTION)); + } + else if (!(GetWindowLongPtr (((Window *) baseWin)->hwnd, GWL_STYLE) & WS_CAPTION) && mainResizeable) + { + pos.x -= GetSystemMetrics (SM_CXSIZEFRAME) - 1; + pos.y -= GetSystemMetrics (SM_CYSIZEFRAME) - 1; + } + hwnd = ChildWindowFromPoint (((Window *) baseWin)->hwnd, pos); + + if (!hwnd) + return (0); + GET_STRUCT_PTR; // If we're not in message windows then we'll map wheel up and // wheel down events as regular mouse events if (win->type == WIN_GRAPH || win->type == WIN_TEXT || win->type == WIN_MENU) - { + { //BringWindowToTop (hwnd); //GET_STRUCT_PTR; /* Let's see whether we should process wheel messages */ if (!allowWheelActions) return (1); - STORE_EVENT_MOUSE; - LastPressHwnd = hwnd; - if (wheel > 0) - { - EventQueue[EventTail].key = W_WHEELUP; - EventQueue[EventTail].type = W_EV_BUTTON; - } - else if (wheel < 0) - { - EventQueue[EventTail].key = W_WHEELDOWN; - EventQueue[EventTail].type = W_EV_BUTTON; - } + STORE_EVENT_MOUSE; + LastPressHwnd = hwnd; + + if (wheel > 0) + { + EventQueue[EventTail].key = W_WHEELUP; + EventQueue[EventTail].type = W_EV_BUTTON; + } + else if (wheel < 0) + { + EventQueue[EventTail].key = W_WHEELDOWN; + EventQueue[EventTail].type = W_EV_BUTTON; + } return (0); - } + } else if (win->type == WIN_SCROLL) { i = GetScrollPos (hwnd, SB_VERT); @@ -2691,7 +2748,7 @@ } else return (1); - + } //Trap WM_ERASEBKGRND, to handle windows with tiled backgrounds case WM_ERASEBKGND: GET_STRUCT_PTR; @@ -3013,7 +3070,7 @@ d1 = (unsigned __int32) ((((__int64) d3) << 32) / d2); else d1 = 1; - d2 = CINIT; + d2 = (unsigned __int32) CINIT; Md = x0 < x1 ? 1 : -1; md = y0 < y1 ? 1 : -1; dp = 0; @@ -3052,7 +3109,7 @@ d1 = (unsigned __int32) ((((__int64) d2) << 32) / d3); else d1 = 1; - d2 = CINIT; + d2 = (unsigned __int32) CINIT; Md = y0 < y1 ? 1 : -1; md = x0 < x1 ? 1 : -1; @@ -3737,7 +3794,7 @@ border = bitmap->ClipRectAddr->top; x += border; y += border; - + if (x < border) { width = bitmap->width - (border - x); @@ -3934,9 +3991,9 @@ colorsum = (colorsum / 3 + 96); if (colorsum > 255) colorsum = 255; - rgbq[i].rgbRed = colorsum; - rgbq[i].rgbBlue = colorsum; - rgbq[i].rgbGreen = colorsum; + rgbq[i].rgbRed = (unsigned char) colorsum; + rgbq[i].rgbBlue = (unsigned char) colorsum; + rgbq[i].rgbGreen = (unsigned char) colorsum; } SetDIBColorTable (GreyBitmapDC, 0, 256, (LPRGBQUAD) rgbq); @@ -4085,7 +4142,7 @@ strncpy (p->string, str, len); p->color = color; - p->len = len; + p->len = (short) len; hdc = GetDC (win->hwnd); if (NetrekPalette) @@ -4154,7 +4211,7 @@ p = p2; //Point p to the new string - win->NumItems = ++NumStrings; //Inc the string number + win->NumItems = (short) (++NumStrings); //Inc the string number } else //Re-use the first string, place it at the end of the list { @@ -4515,6 +4572,7 @@ return (booleanDefault (buf, 0)); } +int checkMappedPref (char *name, int preferred) { char buf[100]; @@ -4745,8 +4803,8 @@ if (!window) return; - win->TextHeight = newh; - win->TextWidth = neww; + win->TextHeight = (short) newh; + win->TextWidth = (short) neww; W_ResizeWindow (window, neww * W_Textwidth + WIN_EDGE * 2, newh * W_Textheight + WIN_EDGE * 2); } @@ -4758,9 +4816,9 @@ { FNHEADER_VOID; - win->NumItems = newh; - win->TextHeight = newh; - win->TextWidth = neww; + win->NumItems = (short) newh; + win->TextHeight = (short) newh; + win->TextWidth = (short) neww; W_ResizeWindow (window, neww * W_Textwidth + WIN_EDGE * 2, newh * (W_Textheight + MENU_PAD * 2) + (newh - @@ -5166,7 +5224,7 @@ } -/* DoubleBuffering */ +#ifdef DOUBLE_BUFFERING #define DBHEADER\ register Window *win;\ if (!sdb->window)\ @@ -5522,7 +5580,7 @@ d1 = (unsigned __int32) ((((__int64) d3) << 32) / d2); else d1 = 1; - d2 = CINIT; + d2 = (unsigned __int32) CINIT; Md = x0 < x1 ? 1 : -1; md = y0 < y1 ? 1 : -1; dp = 0; @@ -5561,7 +5619,7 @@ d1 = (unsigned __int32) ((((__int64) d2) << 32) / d3); else d1 = 1; - d2 = CINIT; + d2 = (unsigned __int32) CINIT; Md = y0 < y1 ? 1 : -1; md = x0 < x1 ? 1 : -1; @@ -5782,6 +5840,88 @@ width, height, GlobalMemDC, srcx, srcy, SRCPAINT); // <-- using OR mode } + +void +W_WriteScaleBitmapDB (SDBUFFER * sdb, int x, int y, float SCALEX, float SCALEY, + unsigned char p_dir, W_Icon icon, W_Color color) +{ + register struct Icon *bitmap = (struct Icon *) icon; + register int borderx, bordery, width, height; + register int srcx, srcy; + HBITMAP newbmp; + XFORM xForm; + double radians; + float cosine, sine, Point1x, Point1y, Point2x, Point2y, Point3x, Point3y; + float xscale, yscale; + float eDx, eDy; + + //Fast (I hope) rectangle intersection, don't overwrite our borders + srcx = bitmap->x; + srcy = bitmap->y; + borderx = bitmap->ClipRectAddr->left; + x += borderx; + bordery = bitmap->ClipRectAddr->top; + y += bordery; + + width = bitmap->width; + height = bitmap->height; + + newbmp = CreateCompatibleBitmap ( sdb->mem_dc, width, height ); + + if (NetrekPalette) + { + SelectPalette (sdb->mem_dc, NetrekPalette, FALSE); + RealizePalette (sdb->mem_dc); + } + SelectObject (GlobalMemDC, bitmap->bm); + SelectObject (GlobalMemDC2, newbmp); + + // Copy selected section of main bitmap into newbmp before rotation + BitBlt (GlobalMemDC2, 0, 0, width, height, GlobalMemDC, srcx, srcy, SRCPAINT); + + //Set the color of the bitmap + //(oddly enough, 1-bit = bk color, 0-bit = text (fg) color) + SetBkColor (sdb->mem_dc, colortable[color].rgb); + SetTextColor (sdb->mem_dc, colortable[BLACK].rgb); + + //Convert p_dir to radians + radians=(2*3.14159*p_dir*360/255)/360; + //Setworldtransform screws up at angle = 0, slight hack to fix + if (radians == 0.0) + radians = 0.0000001; + cosine=(float)cos(radians); + sine=(float)sin(radians); + + // Scale used to find bitmap center + xscale = (float)(width/SCALEX/2); + yscale = (float)(height/SCALEY/2); + + // Compute dimensions of the resulting bitmap + // First get the coordinates of the 3 corners other than origin + Point1x=(height*sine); + Point1y=(height*cosine); + Point2x=(width*cosine+height*sine); + Point2y=(height*cosine-width*sine); + Point3x=(width*cosine); + Point3y=-(width*sine); + + eDx = x + xscale - cosine*(xscale) + sine*(yscale); + eDy = y + yscale - cosine*(yscale) - sine*(xscale); + SetGraphicsMode(sdb->mem_dc,GM_ADVANCED); + + xForm.eM11=cosine/SCALEX; + xForm.eM12=sine/SCALEX; + xForm.eM21=-sine/SCALEY; + xForm.eM22=cosine/SCALEY; + xForm.eDx = eDx; + xForm.eDy = eDy; + + SetWorldTransform(sdb->mem_dc,&xForm); + BitBlt(sdb->mem_dc, 0, 0, width, height, GlobalMemDC2, 0, 0, SRCPAINT); + + DeleteObject (newbmp); +} + void W_WriteBitmapGreyDB (SDBUFFER * sdb, int x, int y, W_Icon icon, W_Color color) { @@ -5833,9 +5973,9 @@ colorsum = (colorsum / 3 + 96); if (colorsum > 255) colorsum = 255; - rgbq[i].rgbRed = colorsum; - rgbq[i].rgbBlue = colorsum; - rgbq[i].rgbGreen = colorsum; + rgbq[i].rgbRed = (unsigned char) colorsum; + rgbq[i].rgbBlue = (unsigned char) colorsum; + rgbq[i].rgbGreen = (unsigned char) colorsum; } SetDIBColorTable (GreyBitmapDC, 0, 256, (LPRGBQUAD) rgbq); @@ -5890,7 +6030,7 @@ BitBlt (sdb->mem_dc, x, y, //Copy the bitmap width, height, GlobalMemDC, srcx, srcy, SRCPAINT); // <-- using OR mode } - +#endif /* DOUBLE_BUFFERING */ // Make a WIN_SCROLL type window. // We use a scrollbar so we can look through the text, something the X version Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- newwin.c 6 May 2006 06:25:16 -0000 1.19 +++ newwin.c 7 May 2006 16:59:27 -0000 1.20 @@ -48,6 +48,15 @@ #define STATSIZE (MESSAGESIZE * 2 + BORDER) #define YOFF -25 +/* Local function prototypes */ +void loadbitmaps (void); +void loadbitmaps1 (void); +void loadbitmapsT (void); +void loadbitmapsM (void); +void loadbitmapsG (void); +void loadbitmapsHR (void); +void loadweaponsC (void); + /******************************************************************************/ /*** loadbitmaps(), loadbitmaps1(), loadbitmapsT(), loadbitmapsG(), loadbitmapsM() @@ -577,6 +586,7 @@ /******************************************************************************/ /*** newwin() /******************************************************************************/ +void newwin (char *hostmon, char *progname) { @@ -587,11 +597,17 @@ baseWin = W_MakeWindow ("netrek", 0, 0, 1024, 768, NULL, BORDER, gColor); w = W_MakeWindow ("local", 0, 0, WINSIDE, WINSIDE, baseWin, THICKBORDER, foreColor); + +#ifdef DOUBLE_BUFFERING localSDB = W_InitSDB (w); +#endif mapw = W_MakeWindow ("map", WINSIDE + 6, 0, WINSIDE, WINSIDE, baseWin, THICKBORDER, foreColor); + +#ifdef DOUBLE_BUFFERING mapSDB = W_InitSDB (mapw); +#endif tstatw = W_MakeWindow ("tstat", 0, WINSIDE + 6, WINSIDE + 3, STATSIZE + 2, baseWin, BORDER, foreColor); @@ -795,6 +811,7 @@ /******************************************************************************/ /*** newsoundwin() - Need to map it after reset_defaults, so pulled out of newwin /******************************************************************************/ +void newsoundwin (char *hostmon, char *progname) { @@ -819,6 +836,7 @@ /******************************************************************************/ /*** mapAll() /******************************************************************************/ +void mapAll (void) { initinput (); @@ -881,6 +899,7 @@ /******************************************************************************/ /*** savebitmaps() /******************************************************************************/ +void savebitmaps (void) { int i, k; @@ -1455,6 +1474,7 @@ /*** teamRequest() /*** Attempt to pick specified team & ship /******************************************************************************/ +int teamRequest (int team, int ship) { @@ -1498,6 +1518,7 @@ /******************************************************************************/ /*** numShips() /******************************************************************************/ +int numShips (int owner) { int i, num = 0; @@ -1513,6 +1534,7 @@ /******************************************************************************/ /*** realNumShips() /******************************************************************************/ +int realNumShips (int owner) { int i, num = 0; @@ -1528,6 +1550,7 @@ /******************************************************************************/ /*** deadTeam() /******************************************************************************/ +int deadTeam (int owner) /* The team is dead if it has no planets and cannot coup it's home planet */ { @@ -1552,6 +1575,7 @@ /******************************************************************************/ /*** checkBold() /******************************************************************************/ +int checkBold (char *line) /* Determine if that line should be highlighted on sign-on screen */ /* Which is done when it is the players own score being displayed */ @@ -1602,6 +1626,7 @@ /******************************************************************************/ /*** showMotdWin() /******************************************************************************/ +void showMotdWin (W_Window motdwin, int atline) { int i, length, top, center; @@ -1628,7 +1653,7 @@ data = motddata; while (data != NULL) { - data->bold = checkBold (data->data); + data->bold = (char) (checkBold (data->data)); data = data->next; } } @@ -1768,6 +1793,7 @@ /******************************************************************************/ /*** getResources() /******************************************************************************/ +void getResources (char *prog) { getColorDefs (); @@ -1803,6 +1829,7 @@ /******************************************************************************/ /*** redrawQuit() /******************************************************************************/ +void redrawQuit (void) { W_WriteText (qwin, 5, 5, textColor, "Quit NetrekXP", 13, W_RegularFont); @@ -1820,6 +1847,7 @@ /******************************************************************************/ /*** showTimeLeft() /******************************************************************************/ +void showTimeLeft (time_t time, time_t max) { char buf[BUFSIZ], *cp; Index: main.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/main.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- main.c 6 May 2006 05:40:00 -0000 1.4 +++ main.c 7 May 2006 16:59:27 -0000 1.5 @@ -21,6 +21,7 @@ #include "struct.h" #include "proto.h" #include "data.h" +#include "parsemeta.h" char *servertmp = NULL; @@ -94,7 +95,6 @@ int hset = 0; #endif - int first = 1; int xtrekPort = -1; name = argv[0]; @@ -256,8 +256,11 @@ if (i < argc) { servertmp = argv[i + 1]; - if (strstr(servertmp,".tamu.edu") != NULL) + if (metablock(servertmp)) + { + LineToConsole ("Default logins not welcome there, please edit your netrekrc file and add a 'login: yourhandle' line\n"); exit (0); + } usemeta = 0; i++; } @@ -339,13 +342,13 @@ break; case 'n': /* don't hide console window */ - hideConsole = 0; - break; + hideConsole = 0; + break; case 'v': /* output version info */ hideConsole = 0; - LineToConsole ("%s %s\n", version, mvers); - LineToConsole ("%s\n", CBUGS); + LineToConsole ("%s %s\n", version, mvers); + LineToConsole ("%s\n", CBUGS); #ifdef RSA LineToConsole ("RSA key installed: %s --- Created by: %s\n", key_name, client_creator); LineToConsole ("Client type: %s\n", client_type); @@ -370,7 +373,7 @@ usemeta = 1; if (hideConsole) - FreeConsole (); + FreeConsole (); if (usage || err) { Index: option.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/option.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- option.c 2 May 2006 00:55:52 -0000 1.12 +++ option.c 7 May 2006 16:59:27 -0000 1.13 @@ -463,6 +463,7 @@ } /* blank out option line 'i' */ +void OptionClear (int i) { char *blanktext = " "; @@ -549,7 +550,7 @@ } if (islower (buf[0])) - buf[0] = toupper (buf[0]); + buf[0] = (char) (toupper (buf[0])); if (op->op_num == 0) W_WriteText (optionWin, 0, op->op_num, W_Yellow, buf, strlen (buf), 0); @@ -923,6 +924,7 @@ /* find the menu in the menus linked list that matches the one in the * * argument */ +void SetMenuPage (int pagenum) { int i = 1; @@ -935,6 +937,7 @@ W_ResizeMenuToNumItems (optionWin, CurrentMenu->numopt); } +void optiondone (void) { char *str; Index: redraw.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/redraw.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- redraw.c 21 Apr 2006 12:00:07 -0000 1.5 +++ redraw.c 7 May 2006 16:59:27 -0000 1.6 @@ -34,9 +34,11 @@ static unsigned long lastredraw = 0; #ifdef BRMH +void intrupt (fd_set * readfds) #else -intrupt () +void +intrupt (void) #endif { time_t time (time_t *); @@ -92,6 +94,7 @@ } } +void redraw (void) { /* erase warning line if necessary */ @@ -148,7 +151,7 @@ map (); } - +void stline (int flag) { static char buf1[80]; @@ -157,7 +160,7 @@ register char *buf, *oldbuf; register char *s; register int i, j; - int k; + int k = 0; struct player *plr; if ((me->p_flags & (PFPLOCK | PFOBSERV)) == (PFPLOCK | PFOBSERV)) @@ -182,24 +185,24 @@ buf = buf2; oldbuf = buf1; } - buf[0] = (me->p_flags & PFSHIELD ? 'S' : ' '); + buf[0] = (char) (me->p_flags & PFSHIELD ? 'S' : ' '); if (me->p_flags & PFGREEN) buf[1] = 'G'; else if (me->p_flags & PFYELLOW) buf[1] = 'Y'; else if (me->p_flags & PFRED) buf[1] = 'R'; - buf[2] = (me->p_flags & (PFPLLOCK | PFPLOCK) ? 'L' : ' '); - buf[3] = (me->p_flags & PFREPAIR ? 'R' : ' '); - buf[4] = (me->p_flags & PFBOMB ? 'B' : ' '); - buf[5] = (me->p_flags & PFORBIT ? 'O' : ' '); + buf[2] = (char) (me->p_flags & (PFPLLOCK | PFPLOCK) ? 'L' : ' '); + buf[3] = (char) (me->p_flags & PFREPAIR ? 'R' : ' '); + buf[4] = (char) (me->p_flags & PFBOMB ? 'B' : ' '); + buf[5] = (char) (me->p_flags & PFORBIT ? 'O' : ' '); if (me->p_ship.s_type == STARBASE) - buf[6] = (me->p_flags & PFDOCKOK ? 'D' : ' '); + buf[6] = (char) (me->p_flags & PFDOCKOK ? 'D' : ' '); else - buf[6] = (me->p_flags & PFDOCK ? 'D' : ' '); - buf[7] = (me->p_flags & PFCLOAK ? 'C' : ' '); - buf[8] = (me->p_flags & PFWEP ? 'W' : ' '); - buf[9] = (me->p_flags & PFENG ? 'E' : ' '); + buf[6] = (char) (me->p_flags & PFDOCK ? 'D' : ' '); + buf[7] = (char) (me->p_flags & PFCLOAK ? 'C' : ' '); + buf[8] = (char) (me->p_flags & PFWEP ? 'W' : ' '); + buf[9] = (char) (me->p_flags & PFENG ? 'E' : ' '); if (me->p_flags & PFPRESS) buf[10] = 'P'; else if (me->p_flags & PFTRACT) @@ -212,98 +215,98 @@ buf[11] = 'd'; else buf[11] = ' '; - buf[12] = (status->tourn) ? 't' : ' '; + buf[12] = (char) ((status->tourn) ? 't' : ' '); buf[13] = ' '; - buf[14] = '0' + ((me->p_speed % 100) / 10); + buf[14] = (char) ('0' + ((me->p_speed % 100) / 10)); if (buf[14] == '0') buf[14] = ' '; - buf[15] = '0' + (me->p_speed % 10); /* speed */ + buf[15] = (char) ('0' + (me->p_speed % 10)); /* speed */ buf[16] = ' '; buf[17] = ' '; - buf[18] = '0' + (me->p_damage / 100); + buf[18] = (char) ('0' + (me->p_damage / 100)); if (buf[18] == '0') buf[18] = ' '; - buf[19] = '0' + ((me->p_damage % 100) / 10); + buf[19] = (char) ('0' + ((me->p_damage % 100) / 10)); if ((buf[19] == '0') && (me->p_damage < 100)) buf[19] = ' '; - buf[20] = '0' + (me->p_damage % 10); + buf[20] = (char) ('0' + (me->p_damage % 10)); buf[21] = ' '; - buf[22] = '0' + (me->p_shield / 100); + buf[22] = (char) ('0' + (me->p_shield / 100)); if (buf[22] == '0') buf[22] = ' '; - buf[23] = '0' + ((me->p_shield % 100) / 10); + buf[23] = (char) ('0' + ((me->p_shield % 100) / 10)); if ((buf[23] == '0') && (me->p_shield < 100)) buf[23] = ' '; - buf[24] = '0' + (me->p_shield % 10); + buf[24] = (char) ('0' + (me->p_shield % 10)); buf[25] = ' '; buf[26] = ' '; - buf[27] = '0' + ((plr->p_ntorp % 100) / 10); + buf[27] = (char) ('0' + ((plr->p_ntorp % 100) / 10)); if (buf[27] == '0') buf[27] = ' '; - buf[28] = '0' + (plr->p_ntorp % 10); + buf[28] = (char) ('0' + (plr->p_ntorp % 10)); buf[29] = ' '; buf[30] = ' '; buf[31] = ' '; - buf[32] = '0' + ((int) (plr->p_kills / 100)); + buf[32] = (char) ('0' + ((int) (plr->p_kills / 100))); if (buf[32] == '0') buf[32] = ' '; - buf[33] = '0' + ((int) (plr->p_kills / 10)) % 10; + buf[33] = (char) ('0' + ((int) (plr->p_kills / 10)) % 10); if (buf[32] == ' ' && buf[33] == '0') buf[33] = ' '; - buf[34] = '0' + (((int) plr->p_kills) % 10); + buf[34] = (char) ('0' + (((int) plr->p_kills) % 10)); buf[35] = '.'; - buf[36] = '0' + (((int) (plr->p_kills * 10)) % 10); - buf[37] = '0' + (((int) (plr->p_kills * 100)) % 10); + buf[36] = (char) ('0' + (((int) (plr->p_kills * 10)) % 10)); + buf[37] = (char) ('0' + (((int) (plr->p_kills * 100)) % 10)); buf[38] = ' '; buf[39] = ' '; buf[40] = ' '; buf[41] = ' '; - buf[42] = '0' + ((me->p_armies % 100) / 10); + buf[42] = (char) ('0' + ((me->p_armies % 100) / 10)); if (buf[42] == '0') buf[42] = ' '; - buf[43] = '0' + (me->p_armies % 10); + buf[43] = (char) ('0' + (me->p_armies % 10)); buf[44] = ' '; buf[45] = ' '; - buf[46] = '0' + (me->p_fuel / 100000); + buf[46] = (char) ('0' + (me->p_fuel / 100000)); if (buf[46] == '0') buf[46] = ' '; - buf[47] = '0' + ((me->p_fuel % 100000) / 10000); + buf[47] = (char) ('0' + ((me->p_fuel % 100000) / 10000)); if ((buf[47] == '0') && (me->p_fuel < 100000)) buf[47] = ' '; - buf[48] = '0' + ((me->p_fuel % 10000) / 1000); + buf[48] = (char) ('0' + ((me->p_fuel % 10000) / 1000)); if ((buf[48] == '0') && (me->p_fuel < 10000)) buf[48] = ' '; - buf[49] = '0' + ((me->p_fuel % 1000) / 100); + buf[49] = (char) ('0' + ((me->p_fuel % 1000) / 100)); if ((buf[49] == '0') && (me->p_fuel < 1000)) buf[49] = ' '; - buf[50] = '0' + ((me->p_fuel % 100) / 10); + buf[50] = (char) ('0' + ((me->p_fuel % 100) / 10)); if ((buf[50] == '0') && (me->p_fuel < 100)) buf[50] = ' '; - buf[51] = '0' + (me->p_fuel % 10); + buf[51] = (char) ('0' + (me->p_fuel % 10)); buf[52] = ' '; buf[53] = ' '; buf[54] = ' '; - buf[55] = '0' + ((me->p_wtemp / 10) / 100); + buf[55] = (char) ('0' + ((me->p_wtemp / 10) / 100)); if (buf[55] == '0') buf[55] = ' '; - buf[56] = '0' + (((me->p_wtemp / 10) % 100) / 10); + buf[56] = (char) ('0' + (((me->p_wtemp / 10) % 100) / 10)); if ((buf[56] == '0') && (me->p_wtemp < 1000)) buf[56] = ' '; - buf[57] = '0' + ((me->p_wtemp / 10) % 10); + buf[57] = (char) ('0' + ((me->p_wtemp / 10) % 10)); buf[58] = ' '; buf[59] = ' '; buf[60] = ' '; - buf[61] = '0' + ((me->p_etemp / 10) / 100); + buf[61] = (char) ('0' + ((me->p_etemp / 10) / 100)); if (buf[61] == '0') buf[61] = ' '; - buf[62] = '0' + (((me->p_etemp / 10) % 100) / 10); + buf[62] = (char) ('0' + (((me->p_etemp / 10) % 100) / 10)); if ((buf[62] == '0') && (me->p_etemp < 1000)) buf[62] = ' '; - buf[63] = '0' + ((me->p_etemp / 10) % 10); + buf[63] = (char) ('0' + ((me->p_etemp / 10) % 10)); if (whichbuf == 0) { @@ -314,7 +317,7 @@ else { /* Hacks to make it print * only what is necessary */ - whichbuf = 3 - whichbuf; + whichbuf = (char) (3 - whichbuf); j = -1; for (i = 0; i < 64; i++) { Index: warning.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/warning.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- warning.c 26 Apr 2006 02:04:24 -0000 1.4 +++ warning.c 7 May 2006 16:59:27 -0000 1.5 @@ -24,13 +24,15 @@ /* * The warning in text will be printed in the warning window. * The message * will last WARNTIME/10 seconds unless another message * comes through and * overwrites it. */ +void warning (char *text) { int doPhaser; time_t curtime; struct tm *tm; char newtext[128]; - char newtext2[128]; + char tmptext[128]; // addition to fix sprintf bug when compiling with bcc32 + if (warncount > 0) { /* XFIX */ @@ -62,10 +64,11 @@ time (&curtime); tm = localtime (&curtime); #ifdef PHASER_STATS - sprintf (newtext2, "%.100s %02d:%02d:%02d", - (doPhaser && phaserStats) ? newtext : text, tm->tm_hour, + strcpy (tmptext, newtext); + sprintf (newtext, "%.100s %02d:%02d:%02d", + (doPhaser && phaserStats) ? tmptext : text, tm->tm_hour, #else - sprintf (newtext2, "%.100s %02d:%02d:%02d", text, tm->tm_hour, + sprintf (newtext, "%.100s %02d:%02d:%02d", text, tm->tm_hour, #endif tm->tm_min, tm->tm_sec); warncount = (warncount > 100) ? 109 : warncount + 9; @@ -74,14 +77,14 @@ { if (logFile != NULL) { - fprintf (logFile, "%s\n", newtext2); + fprintf (logFile, "%s\n", newtext); fflush (logFile); } else - puts (newtext2); + puts (newtext); } if (doPhaser) - W_MessageAllowedWindows (WAM_PHASER, 0, 0, textColor, newtext2, warncount, 0); + W_MessageAllowedWindows (WAM_PHASER, 0, 0, textColor, newtext, warncount, 0); } } Index: dashboard.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/dashboard.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- dashboard.c 12 Apr 2006 04:20:03 -0000 1.2 +++ dashboard.c 7 May 2006 16:59:27 -0000 1.3 @@ -211,7 +211,9 @@ int digits, int color) { - register int wt, wv, tw, tc; + register int wt, wv; + register int tc = 11; + register int tw = W_Textwidth * tc; char valstr[32]; switch (digits) @@ -271,7 +273,7 @@ { static float old_kills = -1.0; static int old_torp = -1; - static unsigned int old_flags = -1; + static unsigned int old_flags = (unsigned int) -1; static int old_tourn = -1; char buf[16]; struct player *plr; @@ -283,24 +285,24 @@ if (fr || me->p_flags != old_flags) { - buf[0] = (me->p_flags & PFSHIELD ? 'S' : ' '); + buf[0] = (char) (me->p_flags & PFSHIELD ? 'S' : ' '); if (me->p_flags & PFGREEN) buf[1] = 'G'; else if (me->p_flags & PFYELLOW) buf[1] = 'Y'; else buf[1] = 'R'; - buf[2] = (me->p_flags & (PFPLLOCK | PFPLOCK) ? 'L' : ' '); - buf[3] = (me->p_flags & PFREPAIR ? 'R' : ' '); - buf[4] = (me->p_flags & PFBOMB ? 'B' : ' '); - buf[5] = (me->p_flags & PFORBIT ? 'O' : ' '); + buf[2] = (char) (me->p_flags & (PFPLLOCK | PFPLOCK) ? 'L' : ' '); + buf[3] = (char) (me->p_flags & PFREPAIR ? 'R' : ' '); + buf[4] = (char) (me->p_flags & PFBOMB ? 'B' : ' '); + buf[5] = (char) (me->p_flags & PFORBIT ? 'O' : ' '); if (me->p_ship.s_type == STARBASE) - buf[6] = (me->p_flags & PFDOCKOK ? 'D' : ' '); + buf[6] = (char) (me->p_flags & PFDOCKOK ? 'D' : ' '); else - buf[6] = (me->p_flags & PFDOCK ? 'D' : ' '); - buf[7] = (me->p_flags & PFCLOAK ? 'C' : ' '); - buf[8] = (me->p_flags & PFWEP ? 'W' : ' '); - buf[9] = (me->p_flags & PFENG ? 'E' : ' '); + buf[6] = (char) (me->p_flags & PFDOCK ? 'D' : ' '); + buf[7] = (char) (me->p_flags & PFCLOAK ? 'C' : ' '); + buf[8] = (char) (me->p_flags & PFWEP ? 'W' : ' '); + buf[9] = (char) (me->p_flags & PFENG ? 'E' : ' '); if (me->p_flags & PFPRESS) buf[10] = 'P'; else if (me->p_flags & PFTRACT) @@ -352,7 +354,7 @@ { W_WriteText (tstatw, 346, 30, textColor, "Torps:", 6, W_RegularFont); - buf[0] = plr->p_ntorp % 10 + '0'; + buf[0] = (char) (plr->p_ntorp % 10 + '0'); W_WriteText (tstatw, 386, 30, textColor, buf, 1, W_RegularFont); } else Index: ping.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/ping.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ping.c 21 Apr 2006 12:00:07 -0000 1.2 +++ ping.c 7 May 2006 16:59:27 -0000 1.3 @@ -59,6 +59,7 @@ updatePStats (); } +void startPing (void) { static struct ping_cpacket packet; @@ -75,6 +76,7 @@ } } +void stopPing (void) { static struct ping_cpacket packet; @@ -91,7 +93,7 @@ } } - +void sendServerPingResponse (int number) /* CP_PING_RESPONSE */ { struct ping_cpacket packet; Index: rotate.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/rotate.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- rotate.c 21 Jan 2003 21:28:42 -0000 1.1.1.1 +++ rotate.c 7 May 2006 16:59:27 -0000 1.2 @@ -16,6 +16,7 @@ #include "proto.h" #ifdef ROTATERACE +void rotate_dir (unsigned char *d, int r) { Index: cowmain.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/cowmain.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- cowmain.c 2 May 2006 00:55:52 -0000 1.11 +++ cowmain.c 7 May 2006 16:59:27 -0000 1.12 @@ -955,7 +955,7 @@ if (getteam[i] == me->p_mapchars[0]) break; - me->p_team = i; + me->p_team = (short) i; if (me->p_damage > me->p_ship.s_maxdamage) { Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- local.c 6 May 2006 05:40:00 -0000 1.18 +++ local.c 7 May 2006 16:59:27 -0000 1.19 @@ -190,7 +190,7 @@ static void -redrawStarSector (sectorx, sectory) +redrawStarSector (int sectorx, int sectory) { register int i, dx, dy, dxx, dyy; register int xbase = sectorx * fullview; @@ -266,8 +266,11 @@ dx = scaleLocal (dx); [...967 lines suppressed...] + W_MakeTractLineDB (localSDB, tractrunner->sx, tractrunner->sy, tractrunner->d2x, tractrunner->d2y, - backColor);*/ + backColor); +#endif } tractcurrent = tracthead; +#ifndef DOUBLE_BUFFERING W_MakeLines (w, clearline[0], clearline[1], clearline[2], clearline[3], clearlcount, backColor); - /*W_MakeLinesDB (localSDB, clearline[0], clearline[1], clearline[2], - clearline[3], clearlcount, backColor);*/ +#else + W_MakeLinesDB (localSDB, clearline[0], clearline[1], clearline[2], + clearline[3], clearlcount, backColor); +#endif clearlcount = 0; } } Index: death.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/death.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- death.c 1 May 2006 16:10:18 -0000 1.4 +++ death.c 7 May 2006 16:59:27 -0000 1.5 @@ -213,7 +213,7 @@ if (!playback) { /* If we are not playing back a recorded game, do this */ W_TerminateWait (); - ExitThread(0); + ExitThread (0); } else { /* Otherwise we aren't within a thread, so... */ Index: distress.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/distress.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- distress.c 21 Apr 2006 12:00:06 -0000 1.2 +++ distress.c 7 May 2006 16:59:27 -0000 1.3 @@ -39,7 +39,7 @@ pappend = str; \ while(*pappend) \ { \ - *ptr++ = (cap ? toupper(*pappend) : *pappend); \ + *ptr++ = (char) (cap ? toupper(*pappend) : *pappend); \ pappend++; \ } @@ -69,7 +69,7 @@ i = 0; do { - s[i++] = n % 10 + '0'; + s[i++] = (char) (n % 10 + '0'); } while ((n /= 10) > 0); @@ -84,7 +84,7 @@ { c = s[i]; s[i] = s[j]; - s[j] = c; + s[j] = (char) c; } return len; @@ -221,7 +221,7 @@ break; case '?': /* the dreaded conditional, evaluate it */ - bufb[*indb] = '0' + solvetest (bufa, inda); + bufb[*indb] = (char) ('0' + solvetest (bufa, inda)); (*indb)++; state = 0; continue; @@ -464,7 +464,7 @@ while (*s) { if (islower (*s)) - *t++ = toupper (*s++); + *t++ = (char) toupper (*s++); else *t++ = *s++; } @@ -500,30 +500,30 @@ #endif dist->sender = from; - dist->distype = mtext[0] & 0x1f; - dist->macroflag = ((mtext[0] & 0x20) > 0); - dist->fuelp = mtext[1] & 0x7f; - dist->dam = mtext[2] & 0x7f; - dist->shld = mtext[3] & 0x7f; - dist->etmp = mtext[4] & 0x7f; - dist->wtmp = mtext[5] & 0x7f; - dist->arms = mtext[6] & 0x1f; - dist->sts = mtext[7] & 0x7f; - dist->wtmpflag = ((dist->sts & PFWEP) > 0) ? 1 : 0; - dist->etempflag = ((dist->sts & PFENG) > 0) ? 1 : 0; - dist->cloakflag = ((dist->sts & PFCLOAK) > 0) ? 1 : 0; - dist->close_pl = mtext[8] & 0x7f; - dist->close_en = mtext[9] & 0x7f; - dist->tclose_pl = mtext[10] & 0x7f; - dist->tclose_en = mtext[11] & 0x7f; - dist->tclose_j = mtext[12] & 0x7f; - dist->close_j = mtext[13] & 0x7f; - dist->tclose_fr = mtext[14] & 0x7f; - dist->close_fr = mtext[15] & 0x7f; + dist->distype = (unsigned char) (mtext[0] & 0x1f); + dist->macroflag = (unsigned char) ((mtext[0] & 0x20) > 0); + dist->fuelp = (unsigned char) (mtext[1] & 0x7f); + dist->dam = (unsigned char) (mtext[2] & 0x7f); + dist->shld = (unsigned char) (mtext[3] & 0x7f); + dist->etmp = (unsigned char) (mtext[4] & 0x7f); + dist->wtmp = (unsigned char) (mtext[5] & 0x7f); + dist->arms = (unsigned char) (mtext[6] & 0x1f); + dist->sts = (unsigned char) (mtext[7] & 0x7f); + dist->wtmpflag = (unsigned char) (((dist->sts & PFWEP) > 0) ? 1 : 0); + dist->etempflag = (unsigned char) (((dist->sts & PFENG) > 0) ? 1 : 0); + dist->cloakflag = (unsigned char) (((dist->sts & PFCLOAK) > 0) ? 1 : 0); + dist->close_pl = (unsigned char) (mtext[8] & 0x7f); + dist->close_en = (unsigned char) (mtext[9] & 0x7f); + dist->tclose_pl = (unsigned char) (mtext[10] & 0x7f); + dist->tclose_en = (unsigned char) (mtext[11] & 0x7f); + dist->tclose_j = (unsigned char) (mtext[12] & 0x7f); + dist->close_j = (unsigned char) (mtext[13] & 0x7f); + dist->tclose_fr = (unsigned char) (mtext[14] & 0x7f); + dist->close_fr = (unsigned char) (mtext[15] & 0x7f); i = 0; while ((mtext[16 + i] & 0xc0) == 0xc0 && (i < 6)) { - dist->cclist[i] = mtext[16 + i] & 0x1f; + dist->cclist[i] = (unsigned char) (mtext[16 + i] & 0x1f); i++; } dist->cclist[i] = mtext[16 + i]; @@ -722,7 +722,7 @@ cap = 1; case 'b': /* push planet into buf */ l = &planets[dist->close_pl]; - tmp[0] = l->pl_name[0] - 'A' + 'a'; + tmp[0] = (char) (l->pl_name[0] - 'A' + 'a'); tmp[1] = l->pl_name[1]; tmp[2] = l->pl_name[2]; tmp[3] = '\0'; @@ -733,7 +733,7 @@ cap = 1; case 'l': /* push planet into buf */ l = &planets[dist->tclose_pl]; - tmp[0] = l->pl_name[0] - 'A' + 'a'; + tmp[0] = (char) (l->pl_name[0] - 'A' + 'a'); tmp[1] = l->pl_name[1]; tmp[2] = l->pl_name[2]; tmp[3] = '\0'; @@ -881,9 +881,9 @@ case '>': /* push tab stop */ c = '\0'; if (*pm >= '0' && *pm <= '9') - c = (*pm++) - '0'; + c = (char) ((*pm++) - '0'); if (*pm >= '0' && *pm <= '9') - c = c * 10 + ((*pm++) - '0'); + c = (char) (c * 10 + ((*pm++) - '0')); if (c) { *pbuf1++ = '%'; Index: util.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/util.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- util.c 12 Apr 2006 04:20:04 -0000 1.2 +++ util.c 7 May 2006 16:59:27 -0000 1.3 @@ -21,15 +21,16 @@ #include "proto.h" /* * Provide the angular distance between two angles. */ +int angdist (unsigned char x, unsigned char y) { register unsigned char res; if (x > y) - res = x - y; + res = (unsigned char) (x - y); else - res = y - x; + res = (unsigned char) (y - x); if (res > 128) return (256 - (int) res); return ((int) res); @@ -151,14 +152,15 @@ } } +short troop_capacity (void) { if (me->p_ship.s_type == ASSAULT) - return (((me->p_kills * 3) > me->p_ship.s_maxarmies) ? - me->p_ship.s_maxarmies : (int) (me->p_kills * 3)); + return (short) ((((me->p_kills * 3) > me->p_ship.s_maxarmies) ? + me->p_ship.s_maxarmies : (short) (me->p_kills * 3))); else if (me->p_ship.s_type != STARBASE) - return (((me->p_kills * 2) > me->p_ship.s_maxarmies) ? - me->p_ship.s_maxarmies : (int) (me->p_kills * 2)); + return (short) ((((me->p_kills * 2) > me->p_ship.s_maxarmies) ? + me->p_ship.s_maxarmies : (short) (me->p_kills * 2))); else return me->p_ship.s_maxarmies; } Index: string_util.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/string_util.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- string_util.c 12 Apr 2006 04:20:04 -0000 1.2 +++ string_util.c 7 May 2006 16:59:27 -0000 1.3 @@ -46,13 +46,13 @@ h = 0; } - result[j] = (val % (i * 10)) / i + '0'; + result[j] = (char) ((val % (i * 10)) / i + '0'); if (result[j] != '0' && !lead_digit) lead_digit = 1; if (!lead_digit && !pad) - if ((result[j] = (val % (i * 10)) / i + '0') == '0') + if ((result[j] = (char) ((val % (i * 10)) / i + '0')) == '0') result[j] = ' '; } Index: reserved.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/reserved.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- reserved.c 21 Apr 2006 12:00:07 -0000 1.2 +++ reserved.c 7 May 2006 16:59:27 -0000 1.3 @@ -16,13 +16,14 @@ extern unsigned LONG netaddr; #endif +void makeReservedPacket (struct reserved_spacket *packet) { int i; for (i = 0; i < 16; i++) { - packet->data[i] = RANDOM () % 256; + packet->data[i] = (char) (RANDOM () % 256); } packet->type = SP_RESERVED; } @@ -48,6 +49,7 @@ {12, 6, 5, 8, 14, 4, 13, 15, 10, 0, 11, 9, 3, 1, 7, 2} }; +void encryptReservedPacket (struct reserved_spacket *spacket, struct reserved_cpacket *cpacket, int pno) @@ -82,7 +84,7 @@ /* LineToConsole ("Verifying with netaddr %x\n", netaddr); */ mixin1 = (unsigned char) ((netaddr >> 24) & 0xff); - mixin2 = pno; + mixin2 = (unsigned char) pno; mixin3 = (unsigned char) ((netaddr >> 16) & 0xff); mixin4 = (unsigned char) ((netaddr >> 8) & 0xff); mixin5 = (unsigned char) (netaddr & 0xff); Index: docwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/docwin.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- docwin.c 21 Apr 2006 12:00:06 -0000 1.2 +++ docwin.c 7 May 2006 16:59:27 -0000 1.3 @@ -49,7 +49,7 @@ struct list *data; int count; char buf[128]; - W_Font font; + W_Font font = W_RegularFont; if (!docwin) docwin = W_MakeWindow ("DocWin", 0, 181, 500, 500, 0, 2, foreColor); @@ -226,7 +226,7 @@ struct list *data; int count; char buf[128]; - W_Font font; + W_Font font = W_RegularFont; if (!xtrekrcwin) xtrekrcwin = W_MakeWindow ("xtrekrcWin", 0, 200, 500, 500, 0, 2, Index: senddist.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/senddist.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- senddist.c 21 Apr 2006 12:00:07 -0000 1.3 +++ senddist.c 7 May 2006 16:59:27 -0000 1.4 @@ -38,51 +38,51 @@ dist = (struct distress *) malloc (sizeof (struct distress)); - dist->sender = me->p_no; - dist->dam = (100 * me->p_damage) / me->p_ship.s_maxdamage; - dist->shld = (100 * me->p_shield) / me->p_ship.s_maxshield; - dist->arms = me->p_armies; - dist->fuelp = (100 * me->p_fuel) / me->p_ship.s_maxfuel; - dist->wtmp = (100 * me->p_wtemp) / me->p_ship.s_maxwpntemp; + dist->sender = (unsigned char) (me->p_no); + dist->dam = (unsigned char) ((100 * me->p_damage) / me->p_ship.s_maxdamage); + dist->shld = (unsigned char) ((100 * me->p_shield) / me->p_ship.s_maxshield); + dist->arms = (unsigned char) (me->p_armies); + dist->fuelp = (unsigned char) ((100 * me->p_fuel) / me->p_ship.s_maxfuel); + dist->wtmp = (unsigned char) ((100 * me->p_wtemp) / me->p_ship.s_maxwpntemp); /* wtmp can be more than 100% - dont let it wrap */ if (dist->wtmp > 0x7f) { dist->wtmp = 0x7f; } - dist->etmp = (100 * me->p_etemp) / me->p_ship.s_maxegntemp; + dist->etmp = (unsigned char) ((100 * me->p_etemp) / me->p_ship.s_maxegntemp); /* so.. call me paranoid -jmn */ - dist->sts = (me->p_flags & 0xff) | 0x80; - dist->wtmpflag = ((me->p_flags & PFWEP) > 0) ? 1 : 0; - dist->etempflag = ((me->p_flags & PFENG) > 0) ? 1 : 0; - dist->cloakflag = ((me->p_flags & PFCLOAK) > 0) ? 1 : 0; + dist->sts = (unsigned char) ((me->p_flags & 0xff) | 0x80); + dist->wtmpflag = (unsigned char) (((me->p_flags & PFWEP) > 0) ? 1 : 0); + dist->etempflag = (unsigned char) (((me->p_flags & PFENG) > 0) ? 1 : 0); + dist->cloakflag = (unsigned char) (((me->p_flags & PFCLOAK) > 0) ? 1 : 0); - dist->distype = i; + dist->distype = (unsigned char) i; if (dist->distype > generic || dist->distype < take) dist->distype = generic; target = gettarget2 (me->p_x, me->p_y, TARG_PLANET); - dist->close_pl = target->o_num; + dist->close_pl = (unsigned char) (target->o_num); target = gettarget (data->Window, data->x, data->y, TARG_PLANET); - dist->tclose_pl = target->o_num; + dist->tclose_pl = (unsigned char) (target->o_num); target = gettarget2 (me->p_x, me->p_y, TARG_ENEMY); - dist->close_en = target->o_num; + dist->close_en = (unsigned char) (target->o_num); target = gettarget (data->Window, data->x, data->y, TARG_ENEMY); - dist->tclose_en = target->o_num; + dist->tclose_en = (unsigned char) (target->o_num); target = gettarget2 (me->p_x, me->p_y, TARG_FRIEND); - dist->close_fr = target->o_num; + dist->close_fr = (unsigned char) (target->o_num); target = gettarget (data->Window, data->x, data->y, TARG_FRIEND); - dist->tclose_fr = target->o_num; + dist->tclose_fr = (unsigned char) (target->o_num); target = gettarget2 (me->p_x, me->p_y, TARG_PLAYER); - dist->close_j = target->o_num; + dist->close_j = (unsigned char) (target->o_num); target = gettarget (data->Window, data->x, data->y, TARG_PLAYER); - dist->tclose_j = target->o_num; + dist->tclose_j = (unsigned char) (target->o_num); /* lets make sure these aren't something stupid */ dist->cclist[0] = 0x80; @@ -153,6 +153,7 @@ * newmacro syntax into an actual message. * This is about as inefficient as * they come, but how often is the player * going to send a macro?? * 6/3/93 * - jn */ +int pmacro (int mnum, char who, W_Event * data) Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- socket.c 22 Apr 2006 14:11:47 -0000 1.4 +++ socket.c 7 May 2006 16:59:27 -0000 1.5 @@ -334,6 +334,7 @@ fTractor, fRepress; /* reset all the "force command" variables */ +void resetForce (void) { fSpeed = fDirection = fShield = fOrbit = fRepair = fBeamup = fBeamdown = @@ -388,6 +389,7 @@ } \ } +void checkForce (void) { struct speed_cpacket speedReq; @@ -428,6 +430,7 @@ } } +void connectToServer (int port) { int s; @@ -541,6 +544,7 @@ } +void callServer (int port, char *server) { @@ -647,11 +651,13 @@ pickSocket (port); /* new socket != port */ } +int isServerDead (void) { return (serverDead); } +void socketPause (void) { struct timeval timeout; @@ -668,6 +674,7 @@ select (max_fd, &readfds, 0, 0, &timeout); } +int readFromServer (fd_set * readfds) { int retval = 0; @@ -738,6 +745,7 @@ return (retval != 0); /* convert to 1/0 */ } +void dotimers (void) { /* if switching comm mode, decrement timeout counter */ @@ -849,11 +857,7 @@ return size; } - - - - - +int doRead (int asock) { struct timeval timeout; @@ -1225,7 +1229,7 @@ #ifdef INCLUDE_VISTRACT if (packet->tractor & 0x40) - me->p_tractor = (short) packet->tractor & (~0x40); /* ATM - visible + me->p_tractor = (short) ((short) packet->tractor & (~0x40)); /* ATM - visible * tractors */ #endif @@ -1311,6 +1315,7 @@ warning (packet->mesg); } +void sendShortPacket (char type, char state) { @@ -1326,34 +1331,34 @@ switch (type) { case CP_SPEED: - fSpeed = state | 0x100; + fSpeed = (short) (state | 0x100); break; case CP_DIRECTION: - fDirection = state | 0x100; + fDirection = (short) (state | 0x100); break; case CP_SHIELD: - fShield = state | 0xa00; + fShield = (short) (state | 0xa00); break; case CP_ORBIT: - fOrbit = state | 0xa00; + fOrbit = (short) (state | 0xa00); break; case CP_REPAIR: - fRepair = state | 0xa00; + fRepair = (short) (state | 0xa00); break; case CP_CLOAK: - fCloak = state | 0xa00; + fCloak = (short) (state | 0xa00); break; case CP_BOMB: - fBomb = state | 0xa00; + fBomb = (short) (state | 0xa00); break; case CP_DOCKPERM: - fDockperm = state | 0xa00; + fDockperm = (short) (state | 0xa00); break; case CP_PLAYLOCK: - fPlayLock = state | 0xa00; + fPlayLock = (short) (state | 0xa00); break; case CP_PLANLOCK: - fPlanLock = state | 0xa00; + fPlanLock = (short) (state | 0xa00); break; case CP_BEAM: if (state == 1) @@ -1369,10 +1374,10 @@ switch (type) { case CP_PHASER: - fPhaser = state | 0x100; + fPhaser = (short) (state | 0x100); break; case CP_PLASMA: - fPlasma = state | 0x100; + fPlasma = (short) (state | 0x100); break; } } @@ -1609,14 +1614,15 @@ queuePos = ntohs (packet->pos); } +void sendTeamReq (int team, int ship) { struct outfit_cpacket outfitReq; outfitReq.type = CP_OUTFIT; - outfitReq.team = team; - outfitReq.ship = ship; + outfitReq.team = (char) team; + outfitReq.ship = (char) ship; sendServerPacket ((struct player_spacket *) &outfitReq); } @@ -1626,6 +1632,7 @@ pickOk = packet->state; } +void sendLoginReq (char *name, char *pass, char *login, @@ -1656,6 +1663,7 @@ } } +void sendTractorReq (char state, char pnum) { @@ -1667,11 +1675,12 @@ sendServerPacket ((struct player_spacket *) &tractorReq); if (state) - fTractor = pnum | 0x40; + fTractor = (short) (pnum | 0x40); else fTractor = 0; } +void sendRepressReq (char state, char pnum) { @@ -1683,11 +1692,12 @@ sendServerPacket ((struct player_spacket *) &repressReq); if (state) - fRepress = pnum | 0x40; + fRepress = (short) (pnum | 0x40); else fRepress = 0; } +void sendDetMineReq (short int torp) { struct det_mytorp_cpacket detReq; @@ -1795,7 +1805,7 @@ #ifdef INCLUDE_VISTRACT if (packet->tractor & 0x40) - players[packet->pnum].p_tractor = (short) packet->tractor & (~0x40); /* ATM - visible + players[packet->pnum].p_tractor = (short) ((short) packet->tractor & (~0x40)); /* ATM - visible * tractors */ else #endif /* INCLUDE_VISTRACT */ @@ -1884,6 +1894,7 @@ newMotdLine (packet->line); } +void sendMessage (char *mes, int group, int indiv) @@ -1908,8 +1919,8 @@ #endif mesPacket.type = CP_MESSAGE; - mesPacket.group = group; - mesPacket.indiv = indiv; + mesPacket.group = (char) group; + mesPacket.indiv = (char) indiv; STRNCPY (mesPacket.mesg, mes, 80); sendServerPacket ((struct player_spacket *) &mesPacket); } @@ -1921,6 +1932,7 @@ tournMask = packet->mask; } +void sendOptionsPacket (void) { struct options_cpacket optPacket; @@ -1981,6 +1993,7 @@ terminate (1); } +long gwrite (int fd, char *buf, register int bytes) { LONG orig = bytes; @@ -2184,6 +2197,7 @@ redrawPlayer[packet->pnum] = 1; } +void sendUpdatePacket (LONG speed) { struct updates_cpacket packet; @@ -2413,12 +2427,12 @@ struct udp_req_cpacket packet; packet.type = CP_UDP_REQ; - packet.request = req; + packet.request = (char) req; if (req >= COMM_MODE) { packet.request = COMM_MODE; - packet.connmode = req - COMM_MODE; + packet.connmode = (char) (req - COMM_MODE); sendServerPacket ((struct player_spacket *) &packet); return; } @@ -2466,7 +2480,7 @@ } /* send the request */ packet.type = CP_UDP_REQ; - packet.request = req; + packet.request = (char) req; packet.port = htonl (udpLocalPort); #ifdef GATEWAY @@ -2636,6 +2650,7 @@ } #define MAX_PORT_RETRY 10 +int openUdpConn (void) { struct sockaddr_in addr; @@ -2730,6 +2745,7 @@ } #ifdef UDP_PORTSWAP +int connUdpConn () { struct sockaddr_in addr; @@ -2753,6 +2769,7 @@ #endif +int recvUdpConn (void) { fd_set readfds; @@ -2830,6 +2847,7 @@ return (0); } +int closeUdpConn (void) { V_UDPDIAG (("Closing UDP socket\n")); @@ -3066,6 +3084,7 @@ } /* print out out the cool information on packet logging */ +void Dump_Packet_Log_Info (void) { int i; Index: interface.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/interface.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- interface.c 21 Jan 2003 21:28:34 -0000 1.1.1.1 +++ interface.c 7 May 2006 16:59:27 -0000 1.2 @@ -236,14 +236,14 @@ return; tm = localtime (&curtime); - timebuf[0] = tm->tm_hour / 10 + '0'; - timebuf[1] = (tm->tm_hour % 10) + '0'; + timebuf[0] = (char) (tm->tm_hour / 10 + '0'); + timebuf[1] = (char) ((tm->tm_hour % 10) + '0'); timebuf[2] = ':'; - timebuf[3] = tm->tm_min / 10 + '0'; - timebuf[4] = (tm->tm_min % 10) + '0'; + timebuf[3] = (char) (tm->tm_min / 10 + '0'); + timebuf[4] = (char) ((tm->tm_min % 10) + '0'); timebuf[5] = ':'; - timebuf[6] = tm->tm_sec / 10 + '0'; - timebuf[7] = (tm->tm_sec % 10) + '0'; + timebuf[6] = (char) (tm->tm_sec / 10 + '0'); + timebuf[7] = (char) ((tm->tm_sec % 10) + '0'); #else sprintf (timebuf, "%02d:%02d:%02d", tm->tm_hour, tm->tm_min, tm->tm_sec); #endif From modemhero at users.sourceforge.net Sun May 7 11:59:30 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 07 May 2006 16:59:30 +0000 Subject: [netrek-cvs] client/netrekxp/src/winkey winkey.cpp,1.1,1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src/winkey In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5894/src/winkey Modified Files: winkey.cpp Log Message: Major features in this patch are: Merge of Stas' latest source into client. - Lots of double buffering code - Cleanup of protoyping functions and proper variable initialization - Addition of working RSA key generator mkkey.exe (this necessitates another DLL in the source) - Updated compile instructions, and a new document on how to make a RSA key - Working version of winkey with BCC compiler - Bug fixes as per listed in his change log Cleanup of changes list to remove bug fix/stuff only coders need to know. Removal of buildexe script - Stas rewrote build to make this obsolete Addition of HR bitmap set (including a few placeholder bitmaps until art is done) Metablock patch accepted (not working proper yet though due to retrieving login issue) Probably a few other things I forgot about! Index: winkey.cpp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/winkey/winkey.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- winkey.cpp 12 Apr 2006 04:31:04 -0000 1.1 +++ winkey.cpp 7 May 2006 16:59:27 -0000 1.2 @@ -2,12 +2,19 @@ #define STRICT #include +#if defined(__BORLANDC__) +extern HHOOK g_hMsgHook; +extern HHOOK g_hKeyHook; + +extern int g_iFlags; +#else #pragma data_seg(".shared") HHOOK g_hMsgHook = NULL; HHOOK g_hKeyHook = NULL; int g_iFlags = NULL; #pragma data_seg() +#endif const int KILL_WINKEY = 0x0001; const int KILL_CTRLESC = 0x0002; From modemhero at users.sourceforge.net Sun May 7 11:59:29 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 07 May 2006 16:59:29 +0000 Subject: [netrek-cvs] client/netrekxp/resources/htmlhelp/html changes.html, 1.1, 1.2 configfile.html, 1.2, 1.3 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5894/resources/htmlhelp/html Modified Files: changes.html configfile.html Log Message: Major features in this patch are: Merge of Stas' latest source into client. - Lots of double buffering code - Cleanup of protoyping functions and proper variable initialization - Addition of working RSA key generator mkkey.exe (this necessitates another DLL in the source) - Updated compile instructions, and a new document on how to make a RSA key - Working version of winkey with BCC compiler - Bug fixes as per listed in his change log Cleanup of changes list to remove bug fix/stuff only coders need to know. Removal of buildexe script - Stas rewrote build to make this obsolete Addition of HR bitmap set (including a few placeholder bitmaps until art is done) Metablock patch accepted (not working proper yet though due to retrieving login issue) Probably a few other things I forgot about! Index: configfile.html =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html/configfile.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- configfile.html 21 Apr 2006 11:37:05 -0000 1.2 +++ configfile.html 7 May 2006 16:59:27 -0000 1.3 @@ -20,8 +20,8 @@
  • xtrekrc
  • xtrekrc.txt
  • -So if you have one of these files it will be read at startup and the change application -defaults to whatever values set in the configuration file. +So if you have one of these files it will be read at startup and then change application +defaults to whatever values are set in the configuration file.

    Section topics:

      Index: changes.html =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html/changes.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- changes.html 21 Apr 2006 16:47:12 -0000 1.1 +++ changes.html 7 May 2006 16:59:26 -0000 1.2 @@ -7,7 +7,7 @@

      Version Changes

      -This section lists chronological changes incorporated into client. Versions 4.4.0.4 and earlier were done by Stas Pirogov under the client he called "Netrek XP Mod", as a reference to his modifications of the original NetrekXP which was coded by Steve Sheldon. +This section lists chronological changes incorporated into the client. Versions 4.4.0.4 and earlier were done by Stas Pirogov under the client he called "Netrek XP Mod", as a reference to his modifications of the original NetrekXP which was coded by Steve Sheldon.

      Version 4.4.0.4:

      From modemhero at users.sourceforge.net Sun May 7 11:59:30 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 07 May 2006 16:59:30 +0000 Subject: [netrek-cvs] client/netrekxp/win32 config.h,1.7,1.8 Message-ID: Update of /cvsroot/netrek/client/netrekxp/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5894/win32 Modified Files: config.h Log Message: Major features in this patch are: Merge of Stas' latest source into client. - Lots of double buffering code - Cleanup of protoyping functions and proper variable initialization - Addition of working RSA key generator mkkey.exe (this necessitates another DLL in the source) - Updated compile instructions, and a new document on how to make a RSA key - Working version of winkey with BCC compiler - Bug fixes as per listed in his change log Cleanup of changes list to remove bug fix/stuff only coders need to know. Removal of buildexe script - Stas rewrote build to make this obsolete Addition of HR bitmap set (including a few placeholder bitmaps until art is done) Metablock patch accepted (not working proper yet though due to retrieving login issue) Probably a few other things I forgot about! Index: config.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/win32/config.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- config.h 29 Apr 2006 19:22:38 -0000 1.7 +++ config.h 7 May 2006 16:59:28 -0000 1.8 @@ -126,6 +126,9 @@ /* RACE_COLORS - additional bitplane for race colors */ #define RACE_COLORS +/* DOUBLE_BUFFERING - paint using double buffering to remove flicker (not working) */ +#undef DOUBLE_BUFFERING + #define PLIST1 #define PLIST #define CONTROL_KEY From modemhero at users.sourceforge.net Sun May 7 11:59:30 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 07 May 2006 16:59:30 +0000 Subject: [netrek-cvs] client/netrekxp/resources/ships/highres indshipHR.bmp, NONE, 1.1 klishipHR.bmp, NONE, 1.1 orishipHR.bmp, NONE, 1.1 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/ships/highres In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5894/resources/ships/highres Added Files: indshipHR.bmp klishipHR.bmp orishipHR.bmp Log Message: Major features in this patch are: Merge of Stas' latest source into client. - Lots of double buffering code - Cleanup of protoyping functions and proper variable initialization - Addition of working RSA key generator mkkey.exe (this necessitates another DLL in the source) - Updated compile instructions, and a new document on how to make a RSA key - Working version of winkey with BCC compiler - Bug fixes as per listed in his change log Cleanup of changes list to remove bug fix/stuff only coders need to know. Removal of buildexe script - Stas rewrote build to make this obsolete Addition of HR bitmap set (including a few placeholder bitmaps until art is done) Metablock patch accepted (not working proper yet though due to retrieving login issue) Probably a few other things I forgot about! --- NEW FILE: orishipHR.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: klishipHR.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: indshipHR.bmp --- (This appears to be a binary file; contents omitted.) From modemhero at users.sourceforge.net Sun May 7 11:59:28 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 07 May 2006 16:59:28 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h, 1.12, 1.13 parsemeta.h, 1.2, 1.3 proto.h, 1.12, 1.13 struct.h, 1.5, 1.6 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5894/include Modified Files: data.h parsemeta.h proto.h struct.h Log Message: Major features in this patch are: Merge of Stas' latest source into client. - Lots of double buffering code - Cleanup of protoyping functions and proper variable initialization - Addition of working RSA key generator mkkey.exe (this necessitates another DLL in the source) - Updated compile instructions, and a new document on how to make a RSA key - Working version of winkey with BCC compiler - Bug fixes as per listed in his change log Cleanup of changes list to remove bug fix/stuff only coders need to know. Removal of buildexe script - Stas rewrote build to make this obsolete Addition of HR bitmap set (including a few placeholder bitmaps until art is done) Metablock patch accepted (not working proper yet though due to retrieving login issue) Probably a few other things I forgot about! Index: parsemeta.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/parsemeta.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- parsemeta.h 22 Apr 2006 09:13:44 -0000 1.2 +++ parsemeta.h 7 May 2006 16:59:26 -0000 1.3 @@ -47,6 +47,9 @@ * would read in the default server and then call it up before I can * select a server. */ + +int metablock(char *host); +/* Block connections to known servers not willing to handle default logins */ #endif /* defined META */ Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- data.h 2 May 2006 00:55:52 -0000 1.12 +++ data.h 7 May 2006 16:59:26 -0000 1.13 @@ -324,7 +324,7 @@ war, warnw, helpWin, teamWin[4], qwin, messwa, messwt, messwi, messwk, planetw, rankw, playerw, playerw2, optionWin, reviewWin; extern W_Window udpWin, phaserwin, hintWin; -extern W_Window waitWin, qwin, countWin, motdButtonWin, motdWin; +extern W_Window waitWin, waitqWin, countWin, motdButtonWin, motdWin; #ifdef SHORT_PACKETS extern W_Window spWin; @@ -620,9 +620,10 @@ extern struct stringlist * defaults; /* pointer to defaults list */ -/* DoubleBufering */ +#ifdef DOUBLE_BUFFERING extern SDBUFFER * localSDB; /* double buffer for local window */ extern SDBUFFER * mapSDB; /* double buffer for map window */ +#endif extern int disableWinkey; /* disable WinKey + ContextKey during the game */ Index: struct.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/struct.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- struct.h 6 May 2006 05:40:00 -0000 1.5 +++ struct.h 7 May 2006 16:59:26 -0000 1.6 @@ -312,7 +312,7 @@ int t_x; int t_y; short t_fuse; /* Life left in current state */ - short t_updateFuse; /* Updates before torp will expire */ + unsigned char t_updateFuse; /* Updates before torp will expire */ unsigned char t_dir; /* direction */ }; @@ -665,7 +665,7 @@ struct stringlist *next; }; -/* DoubleBuffering */ +#ifdef DOUBLE_BUFFERING typedef struct _sdbuffer { W_Window window; /* window for current buffer */ @@ -675,6 +675,7 @@ HBITMAP mem_bmp; /* memory to handle bitmap */ HBITMAP old_bmp; /* saved bitmap */ }SDBUFFER; +#endif // Linked list for console buffer struct cons_buffer Index: proto.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- proto.h 6 May 2006 05:40:00 -0000 1.12 +++ proto.h 7 May 2006 16:59:26 -0000 1.13 @@ -92,10 +92,10 @@ char *getServerNick (char *srvName); int getServerType (char *srvName); #ifndef __BORLANDC__ -strncmpi (char *str1, char *str2, int max); +int strncmpi (char *str1, char *str2, int max); #endif -booleanDefault (char *def, int preferred); -intDefault (char *def, int preferred); +int booleanDefault (char *def, int preferred); +int intDefault (char *def, int preferred); char *stringDefault (char *str); int findDefaults (char *deffile, char *file); void resetdefaults (void); @@ -167,13 +167,12 @@ /*** feature.c ***/ /******************************************************************************/ #ifdef FEATURE_PACKETS -//static void checkFeature(struct feature_cpacket *packet); void sendFeature (char *name, char feature_type, int value, char arg1, char arg2); -//static void reportFeatures(void); +struct feature_cpacket; void handleFeature (struct feature_cpacket *packet); #endif @@ -675,8 +674,8 @@ int *width, int *height); int checkMapped (char *name); -checkMappedPref (char *name, - int preferred); +int checkMappedPref (char *name, + int preferred); void W_WarpPointer (W_Window window); int findMouseInWin (int *x, int *y, @@ -738,7 +737,7 @@ UINT msg, WPARAM wParam, LPARAM lParam); -/* DoubleBuffering */ +#ifdef DOUBLE_BUFFERING SDBUFFER * W_InitSDB (W_Window window); void W_Win2Mem (SDBUFFER * sdb); void W_Mem2Win (SDBUFFER * sdb); @@ -759,42 +758,41 @@ void W_WriteTextDB (SDBUFFER * sdb, int x, int y, W_Color color, char *str, int len, W_Font font); void W_MaskTextDB (SDBUFFER * sdb, int x, int y, W_Color color, char *str, int len, W_Font font); void W_WriteBitmapDB (SDBUFFER * sdb, int x, int y, W_Icon icon, W_Color color); +void W_WriteScaleBitmapDB (SDBUFFER * sdb, int x, int y, float SCALEX, float SCALEY, + unsigned char p_dir, W_Icon icon, W_Color color); void W_WriteBitmapGreyDB (SDBUFFER * sdb, int x, int y, W_Icon icon, W_Color color); void W_OverlayBitmapDB (SDBUFFER * sdb, int x, int y, W_Icon icon, W_Color color); +#endif /******************************************************************************/ /*** newwin.c /******************************************************************************/ //static void handleMessageWindowKeyDown(W_Event * event); //static void handleMessageWindowButton(W_Event * event); -void loadbitmaps (void); -void loadbitmaps1 (void); -void loadbitmapsT (void); -void loadbitmapsM (void); -void loadbitmapsG (void); -newwin (char *hostmon, +void newwin (char *hostmon, char *progname); -newsoundwin (char *hostmon, +void newsoundwin (char *hostmon, char *progname); -mapAll (void); -savebitmaps (void); +void mapAll (void); +void savebitmaps (void); void entrywindow (int *team, int *s_type); -teamRequest (int team, - int ship); -numShips (int owner); -realNumShips (int owner); -deadTeam (int owner); -checkBold (char *line); -showMotdWin (W_Window motdwin, int atline); +int teamRequest (int team, + int ship); +int numShips (int owner); +int realNumShips (int owner); +int deadTeam (int owner); +int checkBold (char *line); +void showMotdWin (W_Window motdwin, int atline); +struct list; void showValues (struct list *data); void newMotdLine (char *line); -getResources (char *prog); +void getResources (char *prog); void redrawTeam (W_Window win, int teamNo, int *lastnum); -redrawQuit (void); -showTimeLeft (time_t time, time_t max); +void redrawQuit (void); +void showTimeLeft (time_t time, time_t max); void W_DefineFedCursor (W_Window window); void W_DefineRomCursor (W_Window window); void W_DefineKliCursor (W_Window window); @@ -805,13 +803,14 @@ /******************************************************************************/ void optionwindow (void); void RefreshOptions (void); -OptionClear (int i); +void OptionClear (int i); void optionredrawtarget (W_Window win); void optionredrawoption (int *ip); +struct option; void optionrefresh (register struct option *op); void optionaction (W_Event * data); -SetMenuPage (int pagenum); -optiondone (void); +void SetMenuPage (int pagenum); +void optiondone (void); int InitOptionMenus (void); void AddOptMenu (struct option *NewMenu, int updated); @@ -838,20 +837,21 @@ /******************************************************************************/ /*** ping.c /******************************************************************************/ +struct ping_spacket; void handlePing (struct ping_spacket *packet); -startPing (void); -stopPing (void); -sendServerPingResponse (int number); +void startPing (void); +void stopPing (void); +void sendServerPingResponse (int number); void calc_lag (void); /******************************************************************************/ /*** pingstats.c /******************************************************************************/ -pStatsHeight (void); -pStatsWidth (void); +int pStatsHeight (void); +int pStatsWidth (void); void initPStats (void); void redrawPStats (void); -updatePStats (void); +void updatePStats (void); // int box(int filled, int x, int y, int wid, int hei, W_Color color); //static void text(int value, int y); @@ -900,25 +900,31 @@ /******************************************************************************/ /*** redraw.c /******************************************************************************/ -intrupt (); -redraw (void); -stline (int flag); +#ifdef BRMH +void intrupt (fd_set * readfds); +#else +void intrupt (void); +#endif +void redraw (void); +void stline (int flag); void redrawTstats (void); void updateMaxStats (int redraw); /******************************************************************************/ /*** reserved.c /******************************************************************************/ -makeReservedPacket (struct reserved_spacket *packet); -encryptReservedPacket (struct reserved_spacket *spacket, - struct reserved_cpacket *cpacket, - int pno); +struct reserved_spacket; +struct reserved_cpacket; +void makeReservedPacket (struct reserved_spacket *packet); +void encryptReservedPacket (struct reserved_spacket *spacket, + struct reserved_cpacket *cpacket, + int pno); /******************************************************************************/ /*** rotate.c /******************************************************************************/ -rotate_dir (unsigned char *d, - int r); +void rotate_dir (unsigned char *d, + int r); void rotate_coord (int *x, int *y, int d, @@ -953,27 +959,33 @@ /******************************************************************************/ struct distress *loaddistress (enum dist_type i, W_Event * data); void emergency (enum dist_type i, W_Event * data); -pmacro (int mnum, char who, W_Event * data); +int pmacro (int mnum, char who, W_Event * data); /******************************************************************************/ /*** short.c /******************************************************************************/ -sendThreshold (short unsigned int v); +void sendThreshold (short unsigned int v); void handleVTorp (unsigned char *sbuf); +struct youshort_spacket; void handleSelfShort (struct youshort_spacket *packet); +struct youss_spacket; void handleSelfShip (struct youss_spacket *packet); void handleVPlayer (unsigned char *sbuf); +struct mesg_s_spacket; void handleSMessage (struct mesg_s_spacket *packet); +struct shortreply_spacket; void handleShortReply (struct shortreply_spacket *packet); void handleVTorpInfo (unsigned char *sbuf); void handleVPlanet (unsigned char *sbuf); -resetWeaponInfo (void); +void resetWeaponInfo (void); void sendShortReq (char state); +struct warning_s_spacket; void handleSWarning (struct warning_s_spacket *packet); -add_whydead (char *s, - int m); +void add_whydead (char *s, + int m); void handleVKills (unsigned char *sbuf); void handleVPhaser (unsigned char *sbuf); +struct stats_s_spacket; void handle_s_Stats (struct stats_s_spacket *packet); void new_flags (unsigned int data, int which); @@ -1000,89 +1012,118 @@ /******************************************************************************/ /*** socket.c /******************************************************************************/ -resetForce (void); -checkForce (void); +void resetForce (void); +void checkForce (void); void setNoDelay (int fd); -connectToServer (int port); -callServer (int port, - char *server); -isServerDead (void); -socketPause (void); -readFromServer (fd_set * readfds); -dotimers (void); +void connectToServer (int port); +void callServer (int port, + char *server); +int isServerDead (void); +void socketPause (void); +int readFromServer (fd_set * readfds); +void dotimers (void); int getvpsize (char *bufptr); -doRead (int asock); +int doRead (int asock); +struct torp_spacket; void handleTorp (struct torp_spacket *packet); +struct torp_info_spacket; void handleTorpInfo (struct torp_info_spacket *packet); +struct status_spacket; void handleStatus (struct status_spacket *packet); +struct you_spacket; void handleSelf (struct you_spacket *packet); +struct player_spacket; void handlePlayer (struct player_spacket *packet); +struct warning_spacket; void handleWarning (struct warning_spacket *packet); -sendShortPacket (char type, - char state); +void sendShortPacket (char type, + char state); void sendServerPacket (struct player_spacket *packet); +struct planet_spacket; void handlePlanet (struct planet_spacket *packet); +struct phaser_spacket; void handlePhaser (struct phaser_spacket *packet); +struct mesg_spacket; void handleMessage (struct mesg_spacket *packet); +struct queue_spacket; void handleQueue (struct queue_spacket *packet); -sendTeamReq (int team, - int ship); +void sendTeamReq (int team, + int ship); +struct pickok_spacket; void handlePickok (struct pickok_spacket *packet); -sendLoginReq (char *name, - char *pass, - char *login, - char query); +void sendLoginReq (char *name, + char *pass, + char *login, + char query); +struct login_spacket; void handleLogin (struct login_spacket *packet); -sendTractorReq (char state, - char pnum); -sendRepressReq (char state, - char pnum); -sendDetMineReq (short int torp); +void sendTractorReq (char state, + char pnum); +void sendRepressReq (char state, + char pnum); +void sendDetMineReq (short int torp); +struct plasma_info_spacket; void handlePlasmaInfo (struct plasma_info_spacket *packet); +struct flags_spacket; void handleFlags (struct flags_spacket *packet); +struct plasma_spacket; void handlePlasma (struct plasma_spacket *packet); +struct kills_spacket; void handleKills (struct kills_spacket *packet); +struct pstatus_spacket; void handlePStatus (struct pstatus_spacket *packet); +struct motd_spacket; void handleMotd (struct motd_spacket *packet); -sendMessage (char *mes, - int group, - int indiv); +void sendMessage (char *mes, + int group, + int indiv); +struct mask_spacket; void handleMask (struct mask_spacket *packet); -sendOptionsPacket (void); +void sendOptionsPacket (void); void pickSocket (int old); +struct badversion_spacket; void handleBadVersion (struct badversion_spacket *packet); -gwrite (int fd, - char *buf, - register int bytes); +long gwrite (int fd, + char *buf, + register int bytes); +struct hostile_spacket; void handleHostile (struct hostile_spacket *packet); +struct plyr_login_spacket; void handlePlyrLogin (struct plyr_login_spacket *packet, int sock); +struct stats_spacket; void handleStats (struct stats_spacket *packet); +struct plyr_info_spacket; void handlePlyrInfo (struct plyr_info_spacket *packet); -sendUpdatePacket (LONG speed); +void sendUpdatePacket (LONG speed); +struct planet_loc_spacket; void handlePlanetLoc (struct planet_loc_spacket *packet); void handleReserved (struct reserved_spacket *packet, int sock); +struct ship_cap_spacket; void handleShipCap (struct ship_cap_spacket *packet); +struct rsa_key_spacket; void handleRSAKey (struct rsa_key_spacket *packet); #ifdef INCLUDE_SCAN void handleScan (packet) struct scan_spacket *packet; #endif - void sendUdpReq (int req); - void handleUdpReply (struct udp_reply_spacket *packet); -openUdpConn (void); +void sendUdpReq (int req); +struct udp_reply_spacket; +void handleUdpReply (struct udp_reply_spacket *packet); +int openUdpConn (void); #ifdef UDP_PORTSWAP -connUdpConn (); +int connUdpConn (); #endif -recvUdpConn (void); -closeUdpConn (void); +int recvUdpConn (void); +int closeUdpConn (void); void printUdpInfo (void); +struct sequence_spacket; void handleSequence (struct sequence_spacket *packet); void Log_Packet (char type, int act_size); void Log_OPacket (int tpe, int size); -Dump_Packet_Log_Info (void); +void Dump_Packet_Log_Info (void); char *strcpyp_return (register char *s1, register char *s2, register int length); @@ -1151,16 +1192,16 @@ /******************************************************************************/ /*** udpopt.c /******************************************************************************/ -udpwindow (void); -udprefresh (int i); - void udpaction (W_Event * data); -udpdone (void); +void udpwindow (void); +void udprefresh (int i); +void udpaction (W_Event * data); +void udpdone (void); /******************************************************************************/ /*** util.c /******************************************************************************/ -angdist (unsigned char x, - unsigned char y); +int angdist (unsigned char x, + unsigned char y); struct obtype *gettarget (W_Window ww, int x, int y, @@ -1168,60 +1209,60 @@ struct obtype *gettarget2 (int x, int y, int targtype); -troop_capacity (void); +short troop_capacity (void); void setObserverMode (int); /******************************************************************************/ /*** war.c /******************************************************************************/ - void fillwin (int menunum, - char *string, - int hostile, - int warbits, - int team); - void warrefresh (void); - void warwindow (void); - void waraction (W_Event * data); +void fillwin (int menunum, + char *string, + int hostile, + int warbits, + int team); +void warrefresh (void); +void warwindow (void); +void waraction (W_Event * data); /******************************************************************************/ /*** warning.c /******************************************************************************/ -warning (char *text); +void warning (char *text); /******************************************************************************/ /*** winmain.c /******************************************************************************/ - int main (int argc, - char *argv[]); - void WinMainCleanup (void); - int getpid (); - struct passwd *getpwuid (); - void sleep (int seconds); - double rint (double r); - void perror (const char *str); +int main (int argc, + char *argv[]); +void WinMainCleanup (void); +int getpid (); +struct passwd *getpwuid (); +void sleep (int seconds); +double rint (double r); +void perror (const char *str); #ifdef NEW_SELECT - int PASCAL select (int nfds, - fd_set * readfds, - fd_set * writefds, - fd_set * exceptfds, - struct timeval *timeout); +int PASCAL select (int nfds, + fd_set * readfds, + fd_set * writefds, + fd_set * exceptfds, + struct timeval *timeout); #endif - char *GetExeDir (); - void HideConsoleWindow (void); - BOOL CALLBACK EnumWindowsProc (HWND hwnd, LPARAM lparam); +char *GetExeDir (); +void HideConsoleWindow (void); +BOOL CALLBACK EnumWindowsProc (HWND hwnd, LPARAM lparam); /******************************************************************************/ /*** winsndlib.c /******************************************************************************/ - int ParseSoundFile (char *fname, - PCMWAVEFORMAT * header, - DWORD * datalen, - char **data); - struct sound *GetSound (char *name); - void ExitSound (); - int InitSound (); - void StopSound (); - int StartSound (char *name); - int SoundPlaying (); +int ParseSoundFile (char *fname, + PCMWAVEFORMAT * header, + DWORD * datalen, + char **data); +struct sound *GetSound (char *name); +void ExitSound (); +int InitSound (); +void StopSound (); +int StartSound (char *name); +int SoundPlaying (); #endif /* __INCLUDED_proto_h__ */ From modemhero at users.sourceforge.net Sun May 7 11:59:30 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 07 May 2006 16:59:30 +0000 Subject: [netrek-cvs] client/netrekxp/tools cygwin1.dll, NONE, 1.1 mkkey.exe, 1.1.1.1, 1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5894/tools Modified Files: mkkey.exe Added Files: cygwin1.dll Log Message: Major features in this patch are: Merge of Stas' latest source into client. - Lots of double buffering code - Cleanup of protoyping functions and proper variable initialization - Addition of working RSA key generator mkkey.exe (this necessitates another DLL in the source) - Updated compile instructions, and a new document on how to make a RSA key - Working version of winkey with BCC compiler - Bug fixes as per listed in his change log Cleanup of changes list to remove bug fix/stuff only coders need to know. Removal of buildexe script - Stas rewrote build to make this obsolete Addition of HR bitmap set (including a few placeholder bitmaps until art is done) Metablock patch accepted (not working proper yet though due to retrieving login issue) Probably a few other things I forgot about! --- NEW FILE: cygwin1.dll --- (This appears to be a binary file; contents omitted.) Index: mkkey.exe =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/tools/mkkey.exe,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 Binary files /tmp/cvshCcX2A and /tmp/cvs1TPfEK differ From modemhero at users.sourceforge.net Sun May 7 16:10:53 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 07 May 2006 21:10:53 +0000 Subject: [netrek-cvs] client/netrekxp/resources/htmlhelp netrek.chm, 1.6, 1.7 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/htmlhelp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19099/resources/htmlhelp Modified Files: netrek.chm Log Message: Fix to playerlist refreshing problem with player then observer mode. Makefile fixes. Index: netrek.chm =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/netrek.chm,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 Binary files /tmp/cvsUdnln2 and /tmp/cvsIR0CuK differ From modemhero at users.sourceforge.net Sun May 7 16:10:53 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 07 May 2006 21:10:53 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C,1.17,1.18 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19099 Modified Files: NetrekXP to do list.C Log Message: Fix to playerlist refreshing problem with player then observer mode. Makefile fixes. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- NetrekXP to do list.C 7 May 2006 16:59:26 -0000 1.17 +++ NetrekXP to do list.C 7 May 2006 21:10:51 -0000 1.18 @@ -42,8 +42,7 @@ 6b) Border issue 6c) The new smooth turning only working on self, not obs or others - short packets! 6d) Not working with BCC -7) right click on all_review window, get message "obsolete!" -8) login not read in before metaserver info (for metablocking purposes) +7) login not read in before metaserver info (for metablocking purposes) Stas's list: - color coded playerlist. From modemhero at users.sourceforge.net Sun May 7 16:10:54 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 07 May 2006 21:10:54 +0000 Subject: [netrek-cvs] client/netrekxp/src/winkey makefile,1.1,1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src/winkey In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19099/src/winkey Modified Files: makefile Log Message: Fix to playerlist refreshing problem with player then observer mode. Makefile fixes. Index: makefile =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/winkey/makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- makefile 7 May 2006 17:01:07 -0000 1.1 +++ makefile 7 May 2006 21:10:52 -0000 1.2 @@ -16,9 +16,6 @@ ccompileonly = -c !ENDIF -# Borland Libs -LIBOPTS = /LC:\Borland\bcc55\lib;c:\Borland\bcc55\lib\psdk;..\Win32\lib\BCC /Tpe - all: winkey.dll .cpp.obj: From modemhero at users.sourceforge.net Sun May 7 16:10:54 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 07 May 2006 21:10:54 +0000 Subject: [netrek-cvs] client/netrekxp/src input.c, 1.9, 1.10 makefile, 1.8, 1.9 mswindow.c, 1.15, 1.16 playerlist.c, 1.7, 1.8 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19099/src Modified Files: input.c makefile mswindow.c playerlist.c Log Message: Fix to playerlist refreshing problem with player then observer mode. Makefile fixes. Index: playerlist.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/playerlist.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- playerlist.c 6 May 2006 06:25:16 -0000 1.7 +++ playerlist.c 7 May 2006 21:10:52 -0000 1.8 @@ -193,7 +193,7 @@ sortMyTeamFirst = booleanDefault ("sortMyTeamFirst", sortMyTeamFirst); - /* Do we show observers in playerlist? 0 = all, 1 = only players, 2 = only observers */ + /* Do we show observers in playerlist? 0 = all, 1 = only players, 2 = only observers 3 = players then observers */ playerListObserver = intDefault ("playerListObserver", 0); /* plistUpdate[MAXPLAYER] must always be TRUE because thats how we no when @@ -422,8 +422,8 @@ int row, i, last; struct player *current; int teamPos[NUMTEAM + 1]; + int obsPos = 0; int *pos; - int obscount = 0; static int plistLastRow = -1; static int blankLine = -1; @@ -472,7 +472,7 @@ ++teamPos[remap[current->p_team]]; if (!(current->p_mapchars[1] <= 'f')) - obscount++; + ++obsPos; } } else @@ -487,7 +487,7 @@ ++teamPos[remap[current->p_team]]; if (current->p_flags & PFOBSERV) - obscount++; + ++obsPos; } } } @@ -541,6 +541,7 @@ last += teamPos[myTeam]; teamPos[myTeam] = last; } + if (myTeam != NOBODY) { @@ -561,7 +562,11 @@ last += teamPos[NOBODY]; teamPos[NOBODY] = last; } - + if (playerListObserver == 3) + { + last += obsPos; + obsPos = last; + } /* Clear some lines if people have left. */ @@ -572,9 +577,7 @@ } plistLastRow = last; - if (playerListObserver == 3) - plistLastRow += obscount; - + /* Write out each player that has either changed position or has * new stats. */ @@ -591,7 +594,7 @@ if (playerListObserver == 0 || playerListObserver == 3) { if (playerListObserver == 3 && !(current->p_mapchars[1] <= 'f')) - row = --plistLastRow; + row = --obsPos; else row = --(teamPos[remap[current->p_team]]); if ((!updatePlayer[i]) && plistPos[i] == row) @@ -638,7 +641,7 @@ (playerListObserver == 3)) { if (playerListObserver == 3 && (current->p_flags & PFOBSERV)) - row = --plistLastRow; + row = --obsPos; else row = --(teamPos[remap[current->p_team]]); if ((!updatePlayer[i]) && plistPos[i] == row) Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- mswindow.c 7 May 2006 16:59:27 -0000 1.15 +++ mswindow.c 7 May 2006 21:10:52 -0000 1.16 @@ -3914,7 +3914,7 @@ xForm.eM22=cosine/SCALEY; xForm.eDx = eDx; xForm.eDy = eDy; - + SetWorldTransform(hdc,&xForm); BitBlt(hdc, 0, 0, width, height, GlobalMemDC2, 0, 0, SRCPAINT); Index: makefile =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/makefile,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- makefile 7 May 2006 16:59:27 -0000 1.8 +++ makefile 7 May 2006 21:10:52 -0000 1.9 @@ -23,8 +23,8 @@ ldebug = -Gn -w-dup !ENDIF -# Borland Libs -LIBOPTS = /LC:\Borland\bcc55\lib;c:\Borland\bcc55\lib\psdk;..\Win32\lib\BCC /Tpe +# Libs +#LIBOPTS = /L..\Win32\lib\BCC /Tpe LIBS = SDL.LIB SDL_mixer.LIB SDLmain.LIB CW32mt.LIB IMPORT32.LIB user32.lib gdi32.lib wsock32.lib kernel32.lib shell32.lib winmm.lib mpr.lib $(GMPLIB) Index: input.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/input.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- input.c 7 May 2006 16:59:27 -0000 1.9 +++ input.c 7 May 2006 21:10:51 -0000 1.10 @@ -1469,23 +1469,6 @@ return; #endif - -#ifdef SHORT_PACKETS - if (data->Window == reviewWin) - { - if (recv_mesg) - { - sendShortReq (SPK_MOFF); - } - else - { - sendShortReq (SPK_MON); - } - return; - } -#endif - - if (data->Window != w && data->Window != mapw && data->Window != infow && data->Window != playerw) From quozl at users.sourceforge.net Mon May 8 03:02:18 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Mon, 08 May 2006 08:02:18 +0000 Subject: [netrek-cvs] server/Vanilla/ntserv balance.c,NONE,1.1 Message-ID: Update of /cvsroot/netrek/server/Vanilla/ntserv In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11423/ntserv Added Files: balance.c Log Message: --- NEW FILE: balance.c --- #include #include #include "defs.h" #include "struct.h" #include "data.h" #include "gencmds.h" #include "proto.h" #ifdef TRIPLE_PLANET_MAYHEM /* ** 16-Jul-1994 James Cameron ** ** Balances teams according to player statistics. ** Intended for use with Triple Planet Mayhem */ /* ** Tell all that player will be moved */ static void moveallmsg(int p_no, int ours, int theirs, int p_value) { struct player *k = &players[p_no]; pmessage(0, MALL, addr_mess(p_no, MALL), "Balance: %16s (slot %c, rating %.2f) is to join the %s", k->p_name, shipnos[p_no], (float) ( p_value / 100.0 ), team_name(ours)); } /* ** Move a player to the specified team, if they are not yet there. ** Make them peaceful with the new team, and hostile/at war with the ** other team. */ static void move(int p_no, int ours, int theirs) { struct player *k = &players[p_no]; int queue; if ( k->p_team != ours ) { pmessage(k->p_no, MINDIV, addr_mess(k->p_no,MINDIV), "%s: please SWAP SIDES to the --> %s <--", k->p_name, team_name(ours)); } else { pmessage(k->p_no, MINDIV, addr_mess(k->p_no,MINDIV), "%s: please remain with the --> %s <--", k->p_name, team_name(ours)); } printf("Balance: %16s (%s) is to join the %s\n", k->p_name, k->p_mapchars, team_name(ours)); /* cope with a balance during INL pre-game, if we don't shift players who are on the QU_HOME or QU_AWAY queues then the queue masks will force them to join the team they were on anyway. */ queue = ( ours == FED ) ? QU_HOME : QU_AWAY; if (k->w_queue != QU_PICKUP && k->w_queue != queue) { queues[k->w_queue].free_slots++; k->w_queue = queue; queues[k->w_queue].free_slots--; } k->p_hostile |= theirs; k->p_swar |= theirs; k->p_hostile &= ~ours; k->p_swar &= ~ours; k->p_war = (k->p_hostile | k->p_swar); k->p_team = ours; sprintf(k->p_mapchars, "%c%c", teamlet[k->p_team], shipnos[p_no]); sprintf(k->p_longname, "%s (%s)", k->p_name, k->p_mapchars); k->p_status = PEXPLODE; k->p_whydead = KPROVIDENCE; /* should be KTOURNSTART? */ if (k->p_ship.s_type == STARBASE) k->p_explode = 2 * SBEXPVIEWS; else k->p_explode = 10; k->p_ntorp = 0; k->p_nplasmatorp = 0; k->p_hostile = (FED | ROM | ORI | KLI); k->p_war = (k->p_hostile | k->p_swar); } /* ** Return two team masks corresponding to the teams of the first two ** teams found in the player list. */ static void sides (int *one, int *two) { struct player *k; int i; int unseen; unseen = (FED | ROM | ORI | KLI); *one = 0; *two = 0; k = &players[0]; for(i=0;ip_status != PFREE) && (!(k->p_flags & PFROBOT))) { if ( ( unseen & k->p_team ) != 0 ) { if ( *one == 0 ) { *one = k->p_team; unseen &= ~k->p_team; k++; continue; } *two = k->p_team; return; } } k++; } } /* ** Calculate a player value */ static int value (struct player *k) { return (int) ( (float) ( #ifdef LTD_STATS ltd_bombing_rating(k) * BALANCE_BOMBING + ltd_planet_rating(k) * BALANCE_PLANET + ltd_defense_rating(k) * BALANCE_DEFENSE + ltd_offense_rating(k) * BALANCE_OFFENSE #else bombingRating(k) * BALANCE_BOMBING + planetRating(k) * BALANCE_PLANET + defenseRating(k) * BALANCE_DEFENSE + offenseRating(k) * BALANCE_OFFENSE #endif /* LTD_STATS */ ) ); } /* ** Balance the teams ** ** Uses an exhaustive algorithm (I'm exhausted!) to find the best combination ** of the current players that balances the teams in terms of statistics. ** The algorithm will support only the number of players that fits into the ** number of bits in an int. ** ** If there are multiple "best" combinations, then the combination ** involving the least number of team swaps will be chosen. */ void do_balance(void) { int i, j; /* miscellaneous counters */ int records; /* number of players in game */ int one; /* team number one mask */ int two; /* team number two mask */ struct player *k; /* pointer to current player */ struct item { int p_no; /* player number */ int p_value; /* calculated player value */ int p_team; /* team player on previously */ } list[MAXPLAYER]; /* working array */ struct { int combination; /* combination number */ int value; /* team balance difference */ int one; /* team one total value */ int two; /* team two total value */ int swaps; /* number of swaps involved */ } best; /* best team combination */ /* which teams are playing? give up if only one found */ sides ( &one, &two ); if ( two == 0 ) { /* addr_mess shouldn't be called with 0 as first arg * for MALL, but we don't have a player numer here. * Let addr_mess catch it. -da */ pmessage ( 0, MALL, addr_mess(0 ,MALL), "Can't balance only one team!" ); pmessage ( 0, MALL, addr_mess(0 ,MALL), "Please could somebody move to another team, then all vote again?" ); return; } /* initialise best to worst case */ best.combination = -1; best.value = 1<<30; best.one = 0; best.two = 0; best.swaps = 1<<30; /* reset working array */ for(i=0;ip_status != PFREE) && (!(k->p_flags & PFROBOT))) { list[records].p_no = k->p_no; list[records].p_value = value ( k ); list[records].p_team = k->p_team; records++; } k++; } /* randomise the working array; may cause different team mixes */ for(i=0;i 1 ) continue; /* reset team total for attempt */ value_a = 0; value_b = 0; /* calculate team total stats */ for(j=0;j Update of /cvsroot/netrek/server/Vanilla/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12113/include Added Files: conquer.h daemon.h Log Message: --- NEW FILE: conquer.h --- void conquer_update(); void conquer_begin(struct player *winner); --- NEW FILE: daemon.h --- void doResources(void); From quozl at users.sourceforge.net Mon May 8 03:22:44 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Mon, 08 May 2006 08:22:44 +0000 Subject: [netrek-cvs] server/Vanilla/pledit edit.c, 1.2, 1.3 input.c, 1.2, 1.3 pledit.h, 1.2, 1.3 Message-ID: Update of /cvsroot/netrek/server/Vanilla/pledit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23267/pledit Modified Files: edit.c input.c pledit.h Log Message: compilation fixes pledit Index: pledit.h =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/pledit/pledit.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- pledit.h 28 Sep 2005 12:14:05 -0000 1.2 +++ pledit.h 8 May 2006 08:22:42 -0000 1.3 @@ -6,6 +6,11 @@ #include "config.h" +/* prototypes */ +void fatal(int nerrno, const char *fmt, ...); +int get_input(WINDOW *w, int row, int col); +int get_line(WINDOW *w, int row, int col, int width, char *buf); + /* how many seconds to look at a popup (add more for slow terminals) */ #define POP_DELAY 2 Index: edit.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/pledit/edit.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- edit.c 28 Sep 2005 12:14:05 -0000 1.2 +++ edit.c 8 May 2006 08:22:42 -0000 1.3 @@ -9,6 +9,7 @@ #ifndef LTD_STATS #include +#include #include #include #include @@ -464,7 +465,7 @@ } -add_player() +void add_player() { struct statentry *sep; int i; @@ -586,12 +587,12 @@ struct status *glp; { char *crypt(const char*, const char*); - int idx, newidx, res, new; + int idx, newidx, res, new = FALSE; char field[81], tmp[32]; char oldpw[16]; int ival; - float fval; - char *sval; + float fval = 0.0; + char *sval = '\0'; saltbuf sb; strcpy(oldpw, sep->password); Index: input.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/pledit/input.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- input.c 30 Sep 2005 05:57:43 -0000 1.2 +++ input.c 8 May 2006 08:22:42 -0000 1.3 @@ -10,6 +10,7 @@ #include #include +#include #include #include "pledit.h" #include "defs.h" @@ -445,16 +446,12 @@ /* called during editing */ /* (result: 1 = no change, 2 = new string, -1/-2 = same but BKTAB, 3 = ESC) */ -int -get_line(w, row, col, width, buf) -WINDOW *w; -int row, col, width; -char *buf; +int get_line(WINDOW *w, int row, int col, int width, char *buf) { enum { NOTHING, EDITING } mode; int changed, posn; int ch, res; - int match, last_match; + int match, last_match = 0; char new[81], blanks[81]; strcpy(new, buf); @@ -586,10 +583,7 @@ /* called from main loop */ -int -get_input(w, row, col) -WINDOW *w; -int row, col; +int get_input(WINDOW *w, int row, int col) { int key; From quozl at users.sourceforge.net Mon May 8 03:22:44 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Mon, 08 May 2006 08:22:44 +0000 Subject: [netrek-cvs] server/Vanilla ChangeLog,1.41,1.42 Message-ID: Update of /cvsroot/netrek/server/Vanilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23267 Modified Files: ChangeLog Log Message: compilation fixes pledit Index: ChangeLog =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ChangeLog,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- ChangeLog 6 May 2006 14:02:35 -0000 1.41 +++ ChangeLog 8 May 2006 08:22:41 -0000 1.42 @@ -1,3 +1,7 @@ +Mon May 8 18:18:38 2006 James Cameron + + * pledit: fix compilation warnings under GCC 4.0.3 with -Wall. + Sat May 6 23:58:10 2006 James Cameron * proto.h, db.c, findslot.c, genspkt.c, getname.c, openmem.c, From quozl at users.sourceforge.net Mon May 8 03:30:24 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Mon, 08 May 2006 08:30:24 +0000 Subject: [netrek-cvs] server/Vanilla/pledit edit.c, 1.3, 1.4 main.c, 1.2, 1.3 input.c, 1.3, 1.4 Message-ID: Update of /cvsroot/netrek/server/Vanilla/pledit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27597/pledit Modified Files: edit.c main.c input.c Log Message: pledit reduce includes Index: input.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/pledit/input.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- input.c 8 May 2006 08:22:42 -0000 1.3 +++ input.c 8 May 2006 08:30:21 -0000 1.4 @@ -8,7 +8,6 @@ #ifndef LTD_STATS -#include #include #include #include Index: edit.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/pledit/edit.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- edit.c 8 May 2006 08:22:42 -0000 1.3 +++ edit.c 8 May 2006 08:30:21 -0000 1.4 @@ -8,15 +8,12 @@ #ifndef LTD_STATS -#include +#include #include #include #include #include -#include #include -#include -#include /* For malloc 10/20/94 [007] */ #include "pledit.h" #include "defs.h" #include "struct.h" Index: main.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/pledit/main.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- main.c 30 Sep 2005 05:46:19 -0000 1.2 +++ main.c 8 May 2006 08:30:21 -0000 1.3 @@ -19,7 +19,6 @@ #else /* LTD_STATS */ #include -#include #include #include #include From quozl at users.sourceforge.net Mon May 8 03:50:24 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Mon, 08 May 2006 08:50:24 +0000 Subject: [netrek-cvs] server/Vanilla/newstartd newaccess.c, 1.3, 1.4 newstartd.c, 1.8, 1.9 Message-ID: Update of /cvsroot/netrek/server/Vanilla/newstartd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6838/newstartd Modified Files: newaccess.c newstartd.c Log Message: netrekd compilation fixes Index: newstartd.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/newstartd/newstartd.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- newstartd.c 22 Apr 2006 02:16:46 -0000 1.8 +++ newstartd.c 8 May 2006 08:50:21 -0000 1.9 @@ -36,21 +36,14 @@ #include #include -#include #include #include -#include -#include -#include -#include -#include -#include -#include +#include #include #include +#include #include "defs.h" -#include INC_STRINGS #include INC_FCNTL #include "struct.h" #include "data.h" @@ -383,7 +376,7 @@ struct sockaddr_in naddr; socklen_t addrlen; fd_set accept_fds; - int len, i, st, newsock; + int i, st, newsock; int foo = 1; @@ -617,22 +610,22 @@ pr = &(prog[port_idx]); switch (pr->nargs) { case 0: - execl (pr->prog, pr->progname, peerhostname, 0); + execl (pr->prog, pr->progname, peerhostname, (char *) NULL); break; case 1: - execl (pr->prog, pr->progname, pr->arg[0], peerhostname, 0); + execl (pr->prog, pr->progname, pr->arg[0], peerhostname, (char *) NULL); break; case 2: execl (pr->prog, pr->progname, pr->arg[0], pr->arg[1], - peerhostname, 0); + peerhostname, (char *) NULL); break; case 3: execl (pr->prog, pr->progname, pr->arg[0], pr->arg[1], - pr->arg[2], peerhostname, 0); + pr->arg[2], peerhostname, (char *) NULL); break; case 4: execl (pr->prog, pr->progname, pr->arg[0], pr->arg[1], - pr->arg[2], pr->arg[3], peerhostname, 0); + pr->arg[2], pr->arg[3], peerhostname, (char *) NULL); break; default: ; } Index: newaccess.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/newstartd/newaccess.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- newaccess.c 22 Apr 2006 02:16:46 -0000 1.3 +++ newaccess.c 8 May 2006 08:50:21 -0000 1.4 @@ -13,6 +13,7 @@ #include #include #include +#include #include @@ -53,10 +54,10 @@ char line[256]; register char *cp; int canplay; - int ncanplay; - int netmatch; + int ncanplay = 0; + int netmatch = 0; int count, sockt; - unsigned LONG net_addr; + in_addr_t net_addr; struct netent *np; struct sockaddr_in addr; socklen_t addrlen; @@ -66,7 +67,7 @@ char snet_name[256]; int snetmatch; int sncanplay; - unsigned LONG snet_addr; + in_addr_t snet_addr; static int snet_gotconf = 0; #endif @@ -147,9 +148,9 @@ np = getnetbyaddr(net_addr, AF_INET); if (np != NULL) - (void) strcpy(net_name, np->n_name); + strcpy(net_name, np->n_name); else - (void) strcpy(net_name,inet_ntoa(*(struct in_addr *)&net_addr)); + strcpy(net_name,inet_ntoa(*(struct in_addr *)&net_addr)); #ifdef SUBNET snet_addr = inet_snetof(addr.sin_addr.s_addr); From modemhero at users.sourceforge.net Thu May 11 20:55:05 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 01:55:05 +0000 Subject: [netrek-cvs] client/netrekxp/resources/ships/color/fed fed_ga13.bmp, 1.1.1.1, 1.2 fed_ga19.bmp, 1.1.1.1, 1.2 fed_ga20.bmp, 1.1.1.1, 1.2 fed_ga21.bmp, 1.1.1.1, 1.2 fed_ga22.bmp, 1.1.1.1, 1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/ships/color/fed In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24560/resources/ships/color/fed Modified Files: fed_ga13.bmp fed_ga19.bmp fed_ga20.bmp fed_ga21.bmp fed_ga22.bmp Log Message: Conversion from old to new sourceforge directory - changes since May 6 basically, plus whatever else SF decides is different. Index: fed_ga21.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color/fed/fed_ga21.bmp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 Binary files /tmp/cvsZE4Mky and /tmp/cvsCAJZdO differ Index: fed_ga20.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color/fed/fed_ga20.bmp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 Binary files /tmp/cvsB3Pfrx and /tmp/cvsqUJ7mN differ Index: fed_ga13.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color/fed/fed_ga13.bmp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 Binary files /tmp/cvsFSYXuB and /tmp/cvsO15ptR differ Index: fed_ga19.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color/fed/fed_ga19.bmp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 Binary files /tmp/cvsH2DgvA and /tmp/cvsJmXcwQ differ Index: fed_ga22.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color/fed/fed_ga22.bmp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 Binary files /tmp/cvsx0mujC and /tmp/cvsEMkcnS differ From modemhero at users.sourceforge.net Thu May 11 20:56:08 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 01:56:08 +0000 Subject: [netrek-cvs] client/netrekxp/resources/ships/grayscale/rom rom_ga19.bmp, 1.1, 1.2 rom_ga20.bmp, 1.1, 1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/rom In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24624/resources/ships/grayscale/rom Modified Files: rom_ga19.bmp rom_ga20.bmp Log Message: Conversion from old to new sourceforge directory - changes since May 6 basically, plus whatever else SF decides is different. Index: rom_ga19.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/rom/rom_ga19.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsJd9k9Y and /tmp/cvspvH4Pf differ Index: rom_ga20.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/rom/rom_ga20.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsfELYq2 and /tmp/cvsSgiWcj differ From modemhero at users.sourceforge.net Thu May 11 20:56:08 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 01:56:08 +0000 Subject: [netrek-cvs] client/netrekxp/resources/ships/grayscale/ori ori_ga13.bmp, 1.1, 1.2 ori_ga19.bmp, 1.1, 1.2 ori_ga20.bmp, 1.1, 1.2 ori_ga21.bmp, 1.1, 1.2 ori_ga22.bmp, 1.1, 1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/ori In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24624/resources/ships/grayscale/ori Modified Files: ori_ga13.bmp ori_ga19.bmp ori_ga20.bmp ori_ga21.bmp ori_ga22.bmp Log Message: Conversion from old to new sourceforge directory - changes since May 6 basically, plus whatever else SF decides is different. Index: ori_ga13.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/ori/ori_ga13.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs8GT4iS and /tmp/cvsgwxcO8 differ Index: ori_ga21.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/ori/ori_ga21.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsOE4FgX and /tmp/cvsKvy3Td differ Index: ori_ga20.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/ori/ori_ga20.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsY4qV5Y and /tmp/cvsxaD5Mf differ Index: ori_ga22.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/ori/ori_ga22.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsEKeVD0 and /tmp/cvsIFn2qh differ Index: ori_ga19.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/ori/ori_ga19.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsRsR7U2 and /tmp/cvsPIsNLj differ From modemhero at users.sourceforge.net Thu May 11 20:56:08 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 01:56:08 +0000 Subject: [netrek-cvs] client/netrekxp/resources/ships/highres indshipHR.bmp, 1.1, 1.2 orishipHR.bmp, 1.1, 1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/ships/highres In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24624/resources/ships/highres Modified Files: indshipHR.bmp orishipHR.bmp Log Message: Conversion from old to new sourceforge directory - changes since May 6 basically, plus whatever else SF decides is different. Index: orishipHR.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/highres/orishipHR.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsmarF1g and /tmp/cvsaQYmgy differ Index: indshipHR.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/highres/indshipHR.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs1AiaFl and /tmp/cvsiD1mXC differ From modemhero at users.sourceforge.net Thu May 11 20:55:31 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 01:55:31 +0000 Subject: [netrek-cvs] client/netrekxp/resources/ships/grayscale/kli kli_ga04.bmp, 1.1, 1.2 kli_ga05.bmp, 1.1, 1.2 kli_ga06.bmp, 1.1, 1.2 kli_ga07.bmp, 1.1, 1.2 kli_ga12.bmp, 1.1, 1.2 kli_ga13.bmp, 1.1, 1.2 kli_ga14.bmp, 1.1, 1.2 kli_ga15.bmp, 1.1, 1.2 kli_ga19.bmp, 1.1, 1.2 kli_ga20.bmp, 1.1, 1.2 kli_ga21.bmp, 1.1, 1.2 kli_ga22.bmp, 1.1, 1.2 kli_ga23.bmp, 1.1, 1.2 kli_ga28.bmp, 1.1, 1.2 kli_ga29.bmp, 1.1, 1.2 kli_ga30.bmp, 1.1, 1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/kli In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24584/resources/ships/grayscale/kli Modified Files: kli_ga04.bmp kli_ga05.bmp kli_ga06.bmp kli_ga07.bmp kli_ga12.bmp kli_ga13.bmp kli_ga14.bmp kli_ga15.bmp kli_ga19.bmp kli_ga20.bmp kli_ga21.bmp kli_ga22.bmp kli_ga23.bmp kli_ga28.bmp kli_ga29.bmp kli_ga30.bmp Log Message: Conversion from old to new sourceforge directory - changes since May 6 basically, plus whatever else SF decides is different. Index: kli_ga20.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/kli/kli_ga20.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsm4wbtA and /tmp/cvscgHXUF differ Index: kli_ga04.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/kli/kli_ga04.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsPHgs1B and /tmp/cvs3gsyvH differ Index: kli_ga13.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/kli/kli_ga13.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsUE7n2A and /tmp/cvsMeeLyG differ Index: kli_ga05.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/kli/kli_ga05.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsBrkdLE and /tmp/cvsO4vRjK differ Index: kli_ga22.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/kli/kli_ga22.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsRAQAFD and /tmp/cvsCHEzgJ differ Index: kli_ga28.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/kli/kli_ga28.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsnr2KzH and /tmp/cvsuJB4cN differ Index: kli_ga15.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/kli/kli_ga15.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs7PscCG and /tmp/cvseNDOhM differ Index: kli_ga21.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/kli/kli_ga21.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsXUHBiK and /tmp/cvsbaGs0P differ Index: kli_ga12.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/kli/kli_ga12.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsFewu7I and /tmp/cvsG57vRO differ Index: kli_ga23.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/kli/kli_ga23.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsBRSoFK and /tmp/cvs2rMKrQ differ Index: kli_ga19.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/kli/kli_ga19.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsETLGoO and /tmp/cvsnkUkdU differ Index: kli_ga07.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/kli/kli_ga07.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsK5QniN and /tmp/cvsvgxl9S differ Index: kli_ga14.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/kli/kli_ga14.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsfmX5gQ and /tmp/cvsoPlLcW differ Index: kli_ga29.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/kli/kli_ga29.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsx2YyHS and /tmp/cvs97uwHY differ Index: kli_ga30.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/kli/kli_ga30.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsDLhwKX and /tmp/cvsGxAXO3 differ Index: kli_ga06.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/kli/kli_ga06.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsRYypk0 and /tmp/cvsWt77s6 differ From modemhero at users.sourceforge.net Thu May 11 20:54:20 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 01:54:20 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.18, 1.19 build.cmd, 1.13, 1.14 compile.txt, 1.8, 1.9 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24524 Modified Files: NetrekXP to do list.C build.cmd compile.txt Log Message: Conversion from old to new sourceforge directory - changes since May 6 basically, plus whatever else SF decides is different. Index: compile.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/compile.txt,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- compile.txt 7 May 2006 16:59:26 -0000 1.8 +++ compile.txt 12 May 2006 01:54:18 -0000 1.9 @@ -36,11 +36,6 @@ If you were compiling with Visual C++ you will also have a InstCWD\tmp folder containing lots of objects. Just delete it. -Step 4: -------- -Get SDL.dll and SDL_mixer.dll from the SDL website (you will need these to run the client, -they must be in the installer package) - Other Notes: ------------ Additional instructions for compiling with Microsoft Visual C++ 2005 Express Edition, Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- NetrekXP to do list.C 7 May 2006 21:10:51 -0000 1.18 +++ NetrekXP to do list.C 12 May 2006 01:54:18 -0000 1.19 @@ -15,14 +15,13 @@ 4) cloaking/shields at warp 0 doesn't update someone else's tactical on what you did - server not sending right info - short packets! 4a) observer sound messes up when someone flips shields at warp 0, again a server problem -4b) Locking onto iggy caues the observer sound to mess up for shields up/down (this is -server side problem, both for the not being able to lock back onto your team, and -the shield packet not being sent) +4b) Locking onto robot cause the observer sound to mess up for shields up/down (this is +server side problem, for the shield packet not being sent) 5) KWINNER called to all players at genocide, not KGENOCIDE, and observers don't get -any state at all (head to default which is error message). +any state at all (head to default which is error message) - short packets! +6) Can't bomb enemy 3rd space planets in your T-mode opponent's space. Things to do: -0) Eventually add the SDL dll files to the source. 1) Add warning hull. 2) resizeable message windows. Perhaps memory of window positions if you choose to save settings. Text in windows should adjust to new window size. @@ -41,8 +40,9 @@ 6a) Issue with flickering. 6b) Border issue 6c) The new smooth turning only working on self, not obs or others - short packets! -6d) Not working with BCC 7) login not read in before metaserver info (for metablocking purposes) +8) Border issue on galaxy map - not using right border width for draw purposes +10) double buffering not working with new bitmaps Stas's list: - color coded playerlist. Index: build.cmd =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/build.cmd,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- build.cmd 7 May 2006 16:59:26 -0000 1.13 +++ build.cmd 12 May 2006 01:54:18 -0000 1.14 @@ -480,6 +480,7 @@ mkdir %InstCWD%\netrek\sounds copy resources\sounds\*.wav %InstCWD%\netrek\sounds +copy win32\SDL\*.dll %InstCWD%\netrek if /I "%Compiler%" == "BCC" copy src\cursors\curslib.dll %InstCWD%\netrek\bitmaps if /I "%Compiler%" == "BCC" copy src\winkey\winkey.dll %InstCWD%\netrek\bitmaps From modemhero at users.sourceforge.net Thu May 11 20:54:21 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 01:54:21 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt,1.40,1.41 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24524/resources/docs Modified Files: changes.txt Log Message: Conversion from old to new sourceforge directory - changes since May 6 basically, plus whatever else SF decides is different. Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- changes.txt 7 May 2006 16:59:26 -0000 1.40 +++ changes.txt 12 May 2006 01:54:18 -0000 1.41 @@ -1,8 +1,11 @@ Version TBA: +- added link to genocide.netrek.org newbie manual to replace broken link +- fix to background star jumpiness with short packets off +- fixed a bunch of stray pixels in mono color and tinted GA bitmaps - fixed some playerlist bugs, and increased playerlist window from 21 to 32 lines - *.tamu.edu removed from metaserver listing, and direct connect via -h servername - also removed. This is due to the policy of blocking all players with the default - login that comes with the client. + also removed, for those with default logins. This is due to the policy of blocking + all players with the default login that comes with the client. - added new scaling/rotation function that allows us to use higher resolution bitmaps. The new bitmap set (made by Defcom) are stored in 80x80 pixel blocks (rather than 20x20 for all other bitmap sets). In addition, only 1 bitmap per ship is needed rather than From modemhero at users.sourceforge.net Thu May 11 20:54:20 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 01:54:20 +0000 Subject: [netrek-cvs] client/netrekxp/include version.h,1.3,1.4 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24524/include Modified Files: version.h Log Message: Conversion from old to new sourceforge directory - changes since May 6 basically, plus whatever else SF decides is different. Index: version.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/version.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- version.h 21 Apr 2006 12:00:06 -0000 1.3 +++ version.h 12 May 2006 01:54:18 -0000 1.4 @@ -2,5 +2,5 @@ /* store the version info here */ -static char mvers[] = "4.4.0.4"; -static char version[] = "Netrek XP Mod"; \ No newline at end of file +static char mvers[] = "1.0"; +static char version[] = "Netrek XP 2006"; \ No newline at end of file From modemhero at users.sourceforge.net Thu May 11 20:55:30 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 01:55:30 +0000 Subject: [netrek-cvs] client/netrekxp/resources/ships/grayscale/fed fed_ga13.bmp, 1.1, 1.2 fed_ga19.bmp, 1.1, 1.2 fed_ga20.bmp, 1.1, 1.2 fed_ga21.bmp, 1.1, 1.2 fed_ga22.bmp, 1.1, 1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/fed In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24584/resources/ships/grayscale/fed Modified Files: fed_ga13.bmp fed_ga19.bmp fed_ga20.bmp fed_ga21.bmp fed_ga22.bmp Log Message: Conversion from old to new sourceforge directory - changes since May 6 basically, plus whatever else SF decides is different. Index: fed_ga20.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/fed/fed_ga20.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsQ1dkqV and /tmp/cvsyjCWzZ differ Index: fed_ga19.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/fed/fed_ga19.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsX8fEaX and /tmp/cvsTDEVm1 differ Index: fed_ga22.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/fed/fed_ga22.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs4xPxEZ and /tmp/cvsvHXcV3 differ Index: fed_ga21.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/fed/fed_ga21.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs8iwkK3 and /tmp/cvsQnaE37 differ Index: fed_ga13.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/grayscale/fed/fed_ga13.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsezefP2 and /tmp/cvssRbbb7 differ From modemhero at users.sourceforge.net Thu May 11 20:56:32 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 01:56:32 +0000 Subject: [netrek-cvs] client/netrekxp/resources/ships/tinted/kli kli_ga04.bmp, 1.1, 1.2 kli_ga05.bmp, 1.1, 1.2 kli_ga06.bmp, 1.1, 1.2 kli_ga07.bmp, 1.1, 1.2 kli_ga12.bmp, 1.1, 1.2 kli_ga13.bmp, 1.1, 1.2 kli_ga14.bmp, 1.1, 1.2 kli_ga15.bmp, 1.1, 1.2 kli_ga19.bmp, 1.1, 1.2 kli_ga20.bmp, 1.1, 1.2 kli_ga21.bmp, 1.1, 1.2 kli_ga22.bmp, 1.1, 1.2 kli_ga23.bmp, 1.1, 1.2 kli_ga28.bmp, 1.1, 1.2 kli_ga29.bmp, 1.1, 1.2 kli_ga30.bmp, 1.1, 1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/ships/tinted/kli In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24662/resources/ships/tinted/kli Modified Files: kli_ga04.bmp kli_ga05.bmp kli_ga06.bmp kli_ga07.bmp kli_ga12.bmp kli_ga13.bmp kli_ga14.bmp kli_ga15.bmp kli_ga19.bmp kli_ga20.bmp kli_ga21.bmp kli_ga22.bmp kli_ga23.bmp kli_ga28.bmp kli_ga29.bmp kli_ga30.bmp Log Message: Conversion from old to new sourceforge directory - changes since May 6 basically, plus whatever else SF decides is different. Index: kli_ga20.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/kli/kli_ga20.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsEFVCUe and /tmp/cvs9mjp1f differ Index: kli_ga04.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/kli/kli_ga04.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsi9vZCe and /tmp/cvsq8ObNf differ Index: kli_ga13.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/kli/kli_ga13.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsSVgf5i and /tmp/cvs05n5mk differ Index: kli_ga05.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/kli/kli_ga05.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsPzzBzo and /tmp/cvsIuYGWp differ Index: kli_ga22.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/kli/kli_ga22.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsVIg9zq and /tmp/cvs8kVd4r differ Index: kli_ga28.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/kli/kli_ga28.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs2P83Nv and /tmp/cvs0O68mx differ Index: kli_ga15.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/kli/kli_ga15.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsMDcvDv and /tmp/cvsBK0Xfx differ Index: kli_ga21.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/kli/kli_ga21.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsOUML8w and /tmp/cvsP0ZJNy differ Index: kli_ga12.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/kli/kli_ga12.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsgaUg1A and /tmp/cvsCkPMIC differ Index: kli_ga23.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/kli/kli_ga23.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsvNJimA and /tmp/cvsLEMB6B differ Index: kli_ga19.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/kli/kli_ga19.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsGbBBLB and /tmp/cvsd0wuyD differ Index: kli_ga07.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/kli/kli_ga07.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs8RMWCF and /tmp/cvs7FFlsH differ Index: kli_ga14.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/kli/kli_ga14.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsIKO1TE and /tmp/cvs1ei7LG differ Index: kli_ga29.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/kli/kli_ga29.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsapShRI and /tmp/cvsFlJOLK differ Index: kli_ga30.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/kli/kli_ga30.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvszgqu1I and /tmp/cvsajbq0K differ Index: kli_ga06.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/kli/kli_ga06.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvskFABQM and /tmp/cvsf4l1RO differ From modemhero at users.sourceforge.net Thu May 11 20:58:43 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 01:58:43 +0000 Subject: [netrek-cvs] client/netrekxp/resources/htmlhelp netrek.chm, 1.7, NONE Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/htmlhelp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24711/resources/htmlhelp Removed Files: netrek.chm Log Message: Conversion from old to new sourceforge directory - changes since May 6 basically, plus whatever else SF decides is different. --- netrek.chm DELETED --- From modemhero at users.sourceforge.net Thu May 11 20:58:44 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 01:58:44 +0000 Subject: [netrek-cvs] client/netrekxp/resources/weaplibm cloud1.bmp, 1.1.1.1, NONE cloud2.bmp, 1.1.1.1, NONE cloud3.bmp, 1.1.1.1, NONE cloud4.bmp, 1.1.1.1, NONE cloud5.bmp, 1.1.1.1, NONE eplasma.bmp, 1.1.1.1, NONE etorp.bmp, 1.1.1.1, NONE mplasma.bmp, 1.1.1.1, NONE mtorp.bmp, 1.1.1.1, NONE plcloud1.bmp, 1.1.1.1, NONE plcloud2.bmp, 1.1.1.1, NONE plcloud3.bmp, 1.1.1.1, NONE plcloud4.bmp, 1.1.1.1, NONE plcloud5.bmp, 1.1.1.1, NONE Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/weaplibm In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24711/resources/weaplibm Removed Files: cloud1.bmp cloud2.bmp cloud3.bmp cloud4.bmp cloud5.bmp eplasma.bmp etorp.bmp mplasma.bmp mtorp.bmp plcloud1.bmp plcloud2.bmp plcloud3.bmp plcloud4.bmp plcloud5.bmp Log Message: Conversion from old to new sourceforge directory - changes since May 6 basically, plus whatever else SF decides is different. --- cloud2.bmp DELETED --- --- cloud1.bmp DELETED --- --- mtorp.bmp DELETED --- --- eplasma.bmp DELETED --- --- plcloud3.bmp DELETED --- --- cloud4.bmp DELETED --- --- plcloud4.bmp DELETED --- --- cloud3.bmp DELETED --- --- plcloud1.bmp DELETED --- --- plcloud2.bmp DELETED --- --- cloud5.bmp DELETED --- --- plcloud5.bmp DELETED --- --- etorp.bmp DELETED --- --- mplasma.bmp DELETED --- From modemhero at users.sourceforge.net Thu May 11 20:58:39 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 01:58:39 +0000 Subject: [netrek-cvs] client/netrekxp buildexe.cmd,1.4,NONE Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24711 Removed Files: buildexe.cmd Log Message: Conversion from old to new sourceforge directory - changes since May 6 basically, plus whatever else SF decides is different. --- buildexe.cmd DELETED --- From modemhero at users.sourceforge.net Thu May 11 20:58:39 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 01:58:39 +0000 Subject: [netrek-cvs] client/netrekxp/resources/ships/tinted/rom rom_ga19.bmp, 1.1, 1.2 rom_ga20.bmp, 1.1, 1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/ships/tinted/rom In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24711/resources/ships/tinted/rom Modified Files: rom_ga19.bmp rom_ga20.bmp Log Message: Conversion from old to new sourceforge directory - changes since May 6 basically, plus whatever else SF decides is different. Index: rom_ga19.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/rom/rom_ga19.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsV2obNX and /tmp/cvs7nBRoZ differ Index: rom_ga20.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/rom/rom_ga20.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs69CTz2 and /tmp/cvsVSbxj4 differ From modemhero at users.sourceforge.net Thu May 11 20:58:39 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 01:58:39 +0000 Subject: [netrek-cvs] client/netrekxp/resources/ships/tinted/ori ori_ga13.bmp, 1.1, 1.2 ori_ga19.bmp, 1.1, 1.2 ori_ga20.bmp, 1.1, 1.2 ori_ga21.bmp, 1.1, 1.2 ori_ga22.bmp, 1.1, 1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/ships/tinted/ori In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24711/resources/ships/tinted/ori Modified Files: ori_ga13.bmp ori_ga19.bmp ori_ga20.bmp ori_ga21.bmp ori_ga22.bmp Log Message: Conversion from old to new sourceforge directory - changes since May 6 basically, plus whatever else SF decides is different. Index: ori_ga13.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/ori/ori_ga13.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvspqGdkK and /tmp/cvsyBhEvL differ Index: ori_ga21.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/ori/ori_ga21.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsyzNhmJ and /tmp/cvsKX9YzK differ Index: ori_ga20.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/ori/ori_ga20.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsvshPHK and /tmp/cvsFpaLXL differ Index: ori_ga22.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/ori/ori_ga22.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs1WtecO and /tmp/cvsHMPkuP differ Index: ori_ga19.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/ori/ori_ga19.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsjLq3cN and /tmp/cvsoYepxO differ From modemhero at users.sourceforge.net Thu May 11 20:58:41 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 01:58:41 +0000 Subject: [netrek-cvs] client/netrekxp/win32 config.h,1.8,1.9 Message-ID: Update of /cvsroot/netrek/client/netrekxp/win32 In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24711/win32 Modified Files: config.h Log Message: Conversion from old to new sourceforge directory - changes since May 6 basically, plus whatever else SF decides is different. Index: config.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/win32/config.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- config.h 7 May 2006 16:59:28 -0000 1.8 +++ config.h 12 May 2006 01:58:39 -0000 1.9 @@ -20,7 +20,7 @@ ################################################################################ */ -#define CBUGS "Send bugs/suggestion to: keyos at keyos.org" +#define CBUGS "Send bugs/suggestion to: williamb at its.caltech.edu" /* ################################################################################ @@ -126,8 +126,8 @@ /* RACE_COLORS - additional bitplane for race colors */ #define RACE_COLORS -/* DOUBLE_BUFFERING - paint using double buffering to remove flicker (not working) */ -#undef DOUBLE_BUFFERING +/* DOUBLE_BUFFERING - paint using double buffering to remove flicker */ +//#define DOUBLE_BUFFERING #define PLIST1 #define PLIST From modemhero at users.sourceforge.net Thu May 11 20:58:40 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 01:58:40 +0000 Subject: [netrek-cvs] client/netrekxp/src bccnetrek.rc, 1.4, 1.5 getname.c, 1.5, 1.6 local.c, 1.19, 1.20 makefile, 1.9, 1.10 map.c, 1.6, 1.7 mswindow.c, 1.16, 1.17 netrek.rc, 1.2, 1.3 parsemeta.c, 1.6, 1.7 short.c, 1.6, 1.7 vccnetrek.rc, 1.1, 1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24711/src Modified Files: bccnetrek.rc getname.c local.c makefile map.c mswindow.c netrek.rc parsemeta.c short.c vccnetrek.rc Log Message: Conversion from old to new sourceforge directory - changes since May 6 basically, plus whatever else SF decides is different. Index: bccnetrek.rc =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/bccnetrek.rc,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- bccnetrek.rc 21 Apr 2006 12:00:06 -0000 1.4 +++ bccnetrek.rc 12 May 2006 01:58:37 -0000 1.5 @@ -9,12 +9,12 @@ { BLOCK "040904E4" { VALUE "CompanyName", "Netrek\000" - VALUE "FileDescription", "Netrek XP Mod (Colorized) Client\000" + VALUE "FileDescription", "Netrek XP 2006 Client\000" VALUE "FileVersion", "123456789012345678901234567890\000" - VALUE "InternalName", "Netrek XP Mod\000" - VALUE "LegalCopyright", "Copyright ? 1986-2004\000" + VALUE "InternalName", "Netrek XP 2006\000" + VALUE "LegalCopyright", "Copyright ? 1986-2006\000" VALUE "OriginalFilename", "netrek.rc\000" - VALUE "ProductName", "Netrek XP Mod Client\000" + VALUE "ProductName", "Netrek XP 2006 Client\000" VALUE "ProductVersion", "123456789012345678901234567890\000" } } Index: netrek.rc =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/netrek.rc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- netrek.rc 12 Apr 2006 04:20:04 -0000 1.2 +++ netrek.rc 12 May 2006 01:58:38 -0000 1.3 @@ -46,14 +46,14 @@ BEGIN VALUE "Comments", "\0" VALUE "CompanyName", "Netrek\0" - VALUE "FileDescription", "Netrek XP Mod (Colorized) Client\0" + VALUE "FileDescription", "Netrek XP 2006 Client\0" VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "Netrek XP Mod\0" - VALUE "LegalCopyright", "Copyright ? 1986-2004\0" + VALUE "InternalName", "Netrek XP 2006\0" + VALUE "LegalCopyright", "Copyright ? 1986-2006\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "netrek.rc\0" VALUE "PrivateBuild", "\0" - VALUE "ProductName", "Netrek XP Mod Client\0" + VALUE "ProductName", "Netrek XP 2006 Client\0" VALUE "ProductVersion", "1, 0, 0, 1\0" VALUE "SpecialBuild", "\0" END Index: parsemeta.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/parsemeta.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- parsemeta.c 7 May 2006 16:59:27 -0000 1.6 +++ parsemeta.c 12 May 2006 01:58:38 -0000 1.7 @@ -799,7 +799,7 @@ if (x >= 0 && x <= 19) /* Netrek Home Page */ ShellExecute (NULL, "open", "http://www.netrek.org", NULL, NULL, SW_SHOWNORMAL); else if (x >= 21 && x <= 35) /* Newbie Manual */ - ShellExecute (NULL, "open", "http://www.netrek.org/cow/current/newbie.html", NULL, NULL, SW_SHOWNORMAL); + ShellExecute (NULL, "open", "http://genocide.netrek.org/beginner/newbie.php", NULL, NULL, SW_SHOWNORMAL); else if (x >= 37 && x <= 43) /* Forums */ ShellExecute (NULL, "open", "http://groups-beta.google.com/group/rec.games.netrek", NULL, NULL, SW_SHOWNORMAL); else if (x >= 45 && x <= 49) /* FAQ */ Index: vccnetrek.rc =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/vccnetrek.rc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- vccnetrek.rc 30 Apr 2006 15:59:40 -0000 1.1 +++ vccnetrek.rc 12 May 2006 01:58:38 -0000 1.2 @@ -2,39 +2,20 @@ MAIN ICON DISCARDABLE "main.ico" -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x3L -#else - FILEFLAGS 0x2L -#endif - FILEOS 0x10004L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "\0" - VALUE "CompanyName", "Netrek\0" - VALUE "FileDescription", "Netrek XP Mod (Colorized) Client\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "Netrek XP Mod\0" - VALUE "LegalCopyright", "Copyright ? 1986-2004\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "netrek.rc\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "Netrek XP Mod Client\0" - VALUE "ProductVersion", "1, 0, 0, 1\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END \ No newline at end of file +1 VERSIONINFO +FILEVERSION 4, 4, 0, 4 +PRODUCTVERSION 4, 4, 0, 4 +{ BLOCK "StringFileInfo" +{ BLOCK "040904E4" + { + VALUE "CompanyName", "Netrek\000" + VALUE "FileDescription", "Netrek XP 2006 Client\000" + VALUE "FileVersion", "123456789012345678901234567890\000" + VALUE "InternalName", "Netrek XP 2006\000" + VALUE "LegalCopyright", "Copyright ? 1986-2006\000" + VALUE "OriginalFilename", "vccnetrek.rc\000" + VALUE "ProductName", "Netrek XP 2006 Client\000" + VALUE "ProductVersion", "123456789012345678901234567890\000" + } + } +} \ No newline at end of file Index: makefile =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/makefile,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- makefile 7 May 2006 21:10:52 -0000 1.9 +++ makefile 12 May 2006 01:58:37 -0000 1.10 @@ -24,7 +24,7 @@ !ENDIF # Libs -#LIBOPTS = /L..\Win32\lib\BCC /Tpe +LIBOPTS = /L..\Win32\lib\BCC /Tpe LIBS = SDL.LIB SDL_mixer.LIB SDLmain.LIB CW32mt.LIB IMPORT32.LIB user32.lib gdi32.lib wsock32.lib kernel32.lib shell32.lib winmm.lib mpr.lib $(GMPLIB) Index: short.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/short.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- short.c 7 May 2006 16:59:27 -0000 1.6 +++ short.c 12 May 2006 01:58:38 -0000 1.7 @@ -1526,7 +1526,7 @@ } if (why_dead) { - add_whydead (msg.mesg, karg5); + add_whydead (msg.mesg, karg5); karg5 = 0; } #endif Index: getname.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/getname.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- getname.c 7 May 2006 16:59:27 -0000 1.5 +++ getname.c 12 May 2006 01:58:37 -0000 1.6 @@ -71,7 +71,7 @@ static char *README[] = { "", - "Netrek XP Mod - the better netrek eXPerience!", + "Netrek XP 2006 - the better netrek eXPerience!", "", "", "", @@ -79,11 +79,11 @@ " No one takes responsibility for lost INL games etc.", " Use at your own risk! If you don't like it, don't use it.", "", - "Comments, suggestions, bugreports to: keyos at keyos.org", + "Comments, suggestions, bugreports to: williamb at its.caltech.edu", "", "Include version and architecture info in bug reports", "", - "Patches to: keyos at keyos.org", + "Patches to: williamb at its.caltech.edu", "", }; int i, length; Index: map.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/map.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- map.c 7 May 2006 16:59:27 -0000 1.6 +++ map.c 12 May 2006 01:58:37 -0000 1.7 @@ -357,7 +357,7 @@ emph_planet_seq[seq_n], W_White); - W_WriteBitmapDB(localSDB, dx - (BMP_MPLANET_WIDTH / 2), dy - (BMP_MPLANET_HEIGHT / 2), + W_WriteBitmapDB(mapSDB, dx - (BMP_MPLANET_WIDTH / 2), dy - (BMP_MPLANET_HEIGHT / 2), planetmBitmap(l), planetColor(l)); #endif emph_planet_seq_n[l->pl_no] -= 1; @@ -867,7 +867,7 @@ emph_player_seq[seq_n], W_White); #else - W_WriteBitmapDB(localSDB, dx - (emph_player_seq_width / 2 - 1), + W_WriteBitmapDB(mapSDB, dx - (emph_player_seq_width / 2 - 1), dy - (emph_player_seq_height / 2 + 1), emph_player_seq[seq_n], W_White); Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- mswindow.c 7 May 2006 21:10:52 -0000 1.16 +++ mswindow.c 12 May 2006 01:58:38 -0000 1.17 @@ -27,6 +27,7 @@ #include #include #include +#include #include "copyright2.h" #include "config.h" @@ -38,6 +39,7 @@ #include "cursors.h" #include "proto.h" #include "resource.h" +#include "math.h" #undef WHITE #undef BLACK @@ -5255,7 +5257,7 @@ GetClientRect (win->hwnd, &(sdb->wr)); - sdb->win_dc = GetWindowDC (win->hwnd); + sdb->win_dc = GetDC (win->hwnd); if (sdb->win_dc == NULL) return NULL; @@ -5848,6 +5850,7 @@ register struct Icon *bitmap = (struct Icon *) icon; register int borderx, bordery, width, height; register int srcx, srcy; + HDC hdc; HBITMAP newbmp; XFORM xForm; double radians; @@ -5866,10 +5869,14 @@ width = bitmap->width; height = bitmap->height; +// hdc = GetDC (bitmap->hwnd); +// newbmp = CreateCompatibleBitmap ( hdc, width, height ); newbmp = CreateCompatibleBitmap ( sdb->mem_dc, width, height ); if (NetrekPalette) { + // SelectPalette (hdc, NetrekPalette, FALSE); + // RealizePalette (hdc); SelectPalette (sdb->mem_dc, NetrekPalette, FALSE); RealizePalette (sdb->mem_dc); } @@ -5881,6 +5888,8 @@ //Set the color of the bitmap //(oddly enough, 1-bit = bk color, 0-bit = text (fg) color) + // SetBkColor (hdc, colortable[color].rgb); + // SetTextColor (hdc, colortable[BLACK].rgb); SetBkColor (sdb->mem_dc, colortable[color].rgb); SetTextColor (sdb->mem_dc, colortable[BLACK].rgb); @@ -5907,7 +5916,8 @@ eDx = x + xscale - cosine*(xscale) + sine*(yscale); eDy = y + yscale - cosine*(yscale) - sine*(xscale); - SetGraphicsMode(sdb->mem_dc,GM_ADVANCED); + // SetGraphicsMode(hdc,GM_ADVANCED); + // SetGraphicsMode(sdb->mem_dc,GM_ADVANCED); xForm.eM11=cosine/SCALEX; xForm.eM12=sine/SCALEX; @@ -5915,10 +5925,14 @@ xForm.eM22=cosine/SCALEY; xForm.eDx = eDx; xForm.eDy = eDy; - - SetWorldTransform(sdb->mem_dc,&xForm); - BitBlt(sdb->mem_dc, 0, 0, width, height, GlobalMemDC2, 0, 0, SRCPAINT); - + + // SetWorldTransform(hdc,&xForm); + // SetWorldTransform(sdb->mem_dc,&xForm); + // BitBlt(hdc, 0, 0, width, height, GlobalMemDC2, 0, 0, SRCPAINT); + //BitBlt(sdb->mem_dc, 0, 0, width, height, GlobalMemDC2, 0, 0, SRCPAINT); + BitBlt (sdb->mem_dc, x, y, width, height, GlobalMemDC2, 0, 0, SRCPAINT); + // StretchBlt(sdb->mem_dc, x, y, (int)(width/SCALEX), (int)(height/SCALEY), GlobalMemDC2, 0, 0, width, height, SRCCOPY); +// ReleaseDC (bitmap->hwnd, hdc); DeleteObject (newbmp); } Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- local.c 7 May 2006 16:59:27 -0000 1.19 +++ local.c 12 May 2006 01:58:37 -0000 1.20 @@ -65,7 +65,7 @@ static void redrawStarSector(int sectorx, int sectory); -#define scaleLocal(pt) ((pt) / SCALE + (WINSIDE/2)) +#define scaleLocal(pt) ((pt) + (WINSIDE/2)) int fullview = WINSIDE * SCALE; int view = WINSIDE * SCALE / 2; @@ -259,8 +259,8 @@ dyy = (int) (Sin[mydir] * streaklength); for (i = 0, s = star_sector; i < 16; i++, s++) { - dx = (s->s_x + xbase) - me->p_x; - dy = (s->s_y + ybase) - me->p_y; + dx = (s->s_x + xbase)/SCALE - me->p_x/SCALE; + dy = (s->s_y + ybase)/SCALE - me->p_y/SCALE; if (ABS(dx) > (view) || ABS(dy) > (view)) continue; @@ -283,8 +283,11 @@ } for (i = 0, s = star_sector; i < 16; i++, s++) { - dx = (s->s_x + xbase) - me->p_x; - dy = (s->s_y + ybase) - me->p_y; + int px, py; + px = me->p_x % 40; + py = me->p_y % 40; + dx = (s->s_x + xbase)/SCALE - me->p_x/SCALE; + dy = (s->s_y + ybase)/SCALE - me->p_y/SCALE; if (ABS(dx) > (view) || ABS(dy) > (view)) continue; @@ -1829,15 +1832,28 @@ if (j != me && ((k->t_war & me->p_team) || (j->p_team & (me->p_hostile | me->p_swar)))) { +#ifndef DOUBLE_BUFFERING W_WriteBitmap (dx - (BMP_CTORP_WIDTH / 2), dy - (BMP_CTORP_HEIGHT / 2), torpC[torpTeam][k->t_fuse], torpColor (k)); +#else + W_WriteBitmapDB (localSDB, dx - (BMP_CTORP_WIDTH / 2), + dy - (BMP_CTORP_HEIGHT / 2), + torpC[torpTeam][k->t_fuse], torpColor (k)); +#endif + } else { +#ifndef DOUBLE_BUFFERING W_WriteBitmap (dx - (BMP_CTORP_WIDTH / 2), dy - (BMP_CTORP_HEIGHT / 2), mtorpC[torpTeam][k->t_fuse], torpColor (k)); +#else + W_WriteBitmapDB (localSDB, dx - (BMP_CTORP_WIDTH / 2), + dy - (BMP_CTORP_HEIGHT / 2), + mtorpC[torpTeam][k->t_fuse], torpColor (k)); +#endif } clearzone[0][clearcount] = dx - (BMP_CTORP_WIDTH / 2); From modemhero at users.sourceforge.net Thu May 11 20:56:29 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 01:56:29 +0000 Subject: [netrek-cvs] client/netrekxp/resources/ships/tinted/fed fed_ga13.bmp, 1.1, 1.2 fed_ga19.bmp, 1.1, 1.2 fed_ga20.bmp, 1.1, 1.2 fed_ga21.bmp, 1.1, 1.2 fed_ga22.bmp, 1.1, 1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/ships/tinted/fed In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24662/resources/ships/tinted/fed Modified Files: fed_ga13.bmp fed_ga19.bmp fed_ga20.bmp fed_ga21.bmp fed_ga22.bmp Log Message: Conversion from old to new sourceforge directory - changes since May 6 basically, plus whatever else SF decides is different. Index: fed_ga20.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/fed/fed_ga20.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs7bHHUQ and /tmp/cvsps4dsK differ Index: fed_ga19.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/fed/fed_ga19.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs1soR8R and /tmp/cvs17PEIL differ Index: fed_ga22.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/fed/fed_ga22.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsijcUaR and /tmp/cvss1YYMK differ Index: fed_ga21.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/fed/fed_ga21.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvscHwIhV and /tmp/cvsnIHvWO differ Index: fed_ga13.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/tinted/fed/fed_ga13.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsY7k8gU and /tmp/cvsBIn7XN differ From modemhero at users.sourceforge.net Thu May 11 20:58:41 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 01:58:41 +0000 Subject: [netrek-cvs] client/netrekxp/win32/SDL SDL.dll, NONE, 1.1 SDL_mixer.dll, NONE, 1.1 Message-ID: Update of /cvsroot/netrek/client/netrekxp/win32/SDL In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24711/win32/SDL Added Files: SDL.dll SDL_mixer.dll Log Message: Conversion from old to new sourceforge directory - changes since May 6 basically, plus whatever else SF decides is different. --- NEW FILE: SDL.dll --- (This appears to be a binary file; contents omitted.) --- NEW FILE: SDL_mixer.dll --- (This appears to be a binary file; contents omitted.) From netrek at gmail.com Thu May 11 21:13:44 2006 From: netrek at gmail.com (Zach) Date: Thu, 11 May 2006 22:13:44 -0400 Subject: [netrek-cvs] so many messages Message-ID: I just received 20 messages from netrek-cvs regarding updates Bill made. Is it possible to have a digest mode so I won't get spam bombed? Zach From modemhero at users.sourceforge.net Thu May 11 21:27:49 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 02:27:49 +0000 Subject: [netrek-cvs] client/netrekxp/src/cursors curslib.sln, NONE, 1.1 curslib.suo, NONE, 1.1 curslib.vcproj, NONE, 1.1 curslib.vcproj.BB.Bill.user, NONE, 1.1 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src/cursors In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25336/src/cursors Added Files: curslib.sln curslib.suo curslib.vcproj curslib.vcproj.BB.Bill.user Log Message: New ind ship bitmaps. Addition of my Visual studio project files. --- NEW FILE: curslib.vcproj --- --- NEW FILE: curslib.suo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: curslib.vcproj.BB.Bill.user --- --- NEW FILE: curslib.sln --- (This appears to be a binary file; contents omitted.) From modemhero at users.sourceforge.net Thu May 11 21:27:49 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 02:27:49 +0000 Subject: [netrek-cvs] client/netrekxp/src/winkey winkey.sln, NONE, 1.1 winkey.suo, NONE, 1.1 winkey.vcproj, NONE, 1.1 winkey.vcproj.BB.Bill.user, NONE, 1.1 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src/winkey In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25336/src/winkey Added Files: winkey.sln winkey.suo winkey.vcproj winkey.vcproj.BB.Bill.user Log Message: New ind ship bitmaps. Addition of my Visual studio project files. --- NEW FILE: winkey.sln --- (This appears to be a binary file; contents omitted.) --- NEW FILE: winkey.suo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: winkey.vcproj.BB.Bill.user --- --- NEW FILE: winkey.vcproj --- From modemhero at users.sourceforge.net Thu May 11 21:27:48 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 02:27:48 +0000 Subject: [netrek-cvs] client/netrekxp/resources/ships/highres indshipHR.bmp, 1.2, 1.3 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/ships/highres In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25336/resources/ships/highres Modified Files: indshipHR.bmp Log Message: New ind ship bitmaps. Addition of my Visual studio project files. Index: indshipHR.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/highres/indshipHR.bmp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvsAbk16N and /tmp/cvsFzaZWr differ From modemhero at users.sourceforge.net Thu May 11 21:27:49 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 02:27:49 +0000 Subject: [netrek-cvs] client/netrekxp clientr.sln, NONE, 1.1 clientr.suo, NONE, 1.1 clientr.vcproj, NONE, 1.1 clientr.vcproj.BB.Bill.user, NONE, 1.1 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25336 Added Files: clientr.sln clientr.suo clientr.vcproj clientr.vcproj.BB.Bill.user Log Message: New ind ship bitmaps. Addition of my Visual studio project files. --- NEW FILE: clientr.suo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: clientr.vcproj --- --- NEW FILE: clientr.vcproj.BB.Bill.user --- --- NEW FILE: clientr.sln --- (This appears to be a binary file; contents omitted.) From quozl at users.sourceforge.net Thu May 11 22:24:02 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Fri, 12 May 2006 03:24:02 +0000 Subject: [netrek-cvs] server/Vanilla/tools/admin ban,1.1,1.2 Message-ID: Update of /cvsroot/netrek/server/Vanilla/tools/admin In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26289 Modified Files: ban Log Message: test Index: ban =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/tools/admin/ban,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ban 30 Sep 2005 04:36:08 -0000 1.1 +++ ban 12 May 2006 03:24:00 -0000 1.2 @@ -8,4 +8,3 @@ echo "*@$2" >> .banned echo "# banned by admin command, `date`" >> .access echo "$2 n" >> .access - From quozl at users.sourceforge.net Thu May 11 22:44:51 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Fri, 12 May 2006 03:44:51 +0000 Subject: [netrek-cvs] server/Vanilla/robots puckmove.h, NONE, 1.1 roboshar.h, NONE, 1.1 basep.c, 1.2, 1.3 inl.c, 1.4, 1.5 inlcmds.c, 1.1, 1.2 inlcomm.c, 1.3, 1.4 inldefs.h, 1.1, 1.2 mars.c, 1.3, 1.4 marsdefs.h, 1.1, 1.2 marsmove.c, 1.2, 1.3 newbie.c, 1.3, 1.4 pret.c, 1.3, 1.4 puck.c, 1.3, 1.4 puckmove.c, 1.4, 1.5 rmove.c, 1.2, 1.3 roboshar.c, 1.2, 1.3 robotII.c, 1.2, 1.3 Message-ID: Update of /cvsroot/netrek/server/Vanilla/robots In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26631/robots Modified Files: basep.c inl.c inlcmds.c inlcomm.c inldefs.h mars.c marsdefs.h marsmove.c newbie.c pret.c puck.c puckmove.c rmove.c roboshar.c robotII.c Added Files: puckmove.h roboshar.h Log Message: merge from jerub darcs 2006-05-12 Index: mars.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robots/mars.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- mars.c 22 Apr 2006 02:16:46 -0000 1.3 +++ mars.c 12 May 2006 03:44:49 -0000 1.4 @@ -14,15 +14,15 @@ #include "copyright.h" #include #include -#include -#include +#include #include -#include +#include #include "defs.h" #include "struct.h" #include "data.h" -#include "marsdefs.h" #include "proto.h" +#include "roboshar.h" +#include "marsdefs.h" #define DOG_STATS ".dog_players" @@ -54,6 +54,7 @@ int closefast; /* approach speed (soft turn) */ void cleanup(); +void config(); void greeting() { @@ -106,7 +107,7 @@ openmem(1); readsysdefaults(); - sprintf(DogStats,"%s/%s\0",LOCALSTATEDIR,DOG_STATS); + sprintf(DogStats,"%s/%s",LOCALSTATEDIR,DOG_STATS); if ( (pno = pickslot(QU_ROBOT)) < 0) exit(0); me = &players[pno]; @@ -153,7 +154,7 @@ } -config() +void config() { int i; FILE* f; @@ -195,7 +196,7 @@ #define IND 0 - sprintf(TournMap_File,"%s/%s\0",SYSCONFDIR,TOURNMAP); + sprintf(TournMap_File,"%s/%s",SYSCONFDIR,TOURNMAP); f = fopen(TournMap_File,"r"); if (f == NULL) { Index: basep.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robots/basep.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- basep.c 22 Apr 2006 02:16:46 -0000 1.2 +++ basep.c 12 May 2006 03:44:48 -0000 1.3 @@ -27,6 +27,8 @@ #include "defs.h" #include "struct.h" #include "data.h" +#include "proto.h" +#include "roboshar.h" #include "basepdefs.h" int debug=0; @@ -72,8 +74,13 @@ void cleanup(int); void checkmess(int); -int start_internal(); -int obliterate(); +int rprog(char *login, char *monitor); +void start_internal(); +void exitRobot(); +void obliterate(int wflag, char kreason); +void check_robots_only(); +void startrobot(int num, char *s, char *h, char *log, int dg, int base, int def); +void fix_planets(); void reaper(sig) @@ -95,7 +102,6 @@ int team = 4; int pno; int class; /* ship class 8/9/91 TC */ - int i; if (gethostname(hostname, 64) != 0) { perror("gethostname"); @@ -106,6 +112,7 @@ getpath(); (void) SIGNAL(SIGCHLD, reaper); openmem(1); + do_message_post_set(check_command); strcpy(robot_host,REMOTEHOST); readsysdefaults(); SIGNAL(SIGALRM, checkmess); /*the def signal is needed - MK */ @@ -165,7 +172,6 @@ void checkmess(int unused) { int shmemKey = PKEY; - int i; HANDLE_SIG(SIGALRM,checkmess); me->p_ghostbuster = 0; /* keep ghostbuster away */ @@ -208,10 +214,10 @@ /* check to see if all robots in the game. If so tell them to exit */ -check_robots_only() +void check_robots_only() { - register i; - register struct player *j; + int i; + struct player *j; for (i = 0, j = players; i < MAXPLAYER; i++, j++) { if (j->p_status == PFREE) @@ -233,9 +239,7 @@ /* this is by no means foolproof */ -int -rprog(login, monitor) - char *login, *monitor; +int rprog(char *login, char *monitor) { int v; @@ -249,10 +253,10 @@ /* here we want to make sure everything is fuel and repair */ -fix_planets() +void fix_planets() { - register i; - register struct planet *j; + int i; + struct planet *j; oldplanets = (struct planet *) malloc(sizeof(struct planet) * MAXPLANETS); MCOPY(planets, oldplanets, sizeof(struct planet) * MAXPLANETS); @@ -266,8 +270,8 @@ int num_players() { - register i; - register struct player *j; + int i; + struct player *j; int c = 0; for (i = 0, j = players; i < MAXPLAYER; i++, j++) if (j->p_status != PFREE) @@ -280,7 +284,7 @@ char *comm; struct message *mess; { - register i; + int i; int sv; char buf[80], team[10], query[20], host[60], log[4], extra[80], desc[32]; int num; @@ -311,10 +315,10 @@ num = 1; def = 1; } else - return; + return 0; } else { /* Start iggy, hoser, ... */ if (sv == 2) start_internal(team); - return; + return 0; } } if (strncmp(team, "fed", 3) == 0) { @@ -335,17 +339,17 @@ strcpy(team, "-To"); } else { messOne(255,roboname,from,"Unknown team name \"%s\"", team); - return; + return 0; } if (num_players() + num > MAXPLAYER) { messOne(255,roboname,from,"Too many players, sorry."); - return; + return 0; } #ifdef nodef if (teami == players[from].p_team) { messOne(255,roboname,from,"Wrong team, pal."); - return; + return 0; } #endif @@ -382,13 +386,14 @@ messAll(255,roboname,buf); startrobot(num, team, sv >= 4 ? host : NULL, sv > 4 ? log : NULL, dg, base, def); + return 0; } char * namearg() { - register i, k = 0; - register struct player *j; + int i, k = 0; + struct player *j; char *name; int namef = 1; @@ -413,16 +418,12 @@ } } -int -startrobot(num, s, h, log, dg, base, def) - int num; - char *s, *h, *log; - int dg, base, def; +void startrobot(int num, char *s, char *h, char *log, int dg, int base, int def) { char *remotehost; char command[256]; char logc[256]; - register i; + int i; if (h) remotehost = h; @@ -457,16 +458,16 @@ if (fork() == 0) { SIGNAL(SIGALRM, SIG_DFL); - execl("/bin/sh", "sh", "-c", command, 0); + execl("/bin/sh", "sh", "-c", command, (char *) NULL); perror("basep'execl"); _exit(1); } sleep(5); } - return 1; + return; } -start_internal(type) +void start_internal(type) char *type; { char *argv[6]; @@ -530,7 +531,7 @@ exitRobot(); } -exitRobot() +void exitRobot() { SIGNAL(SIGALRM, SIG_IGN); if (me != NULL && me->p_team != ALLTEAM) { @@ -549,13 +550,10 @@ } -obliterate(wflag, kreason) - int wflag; - char kreason; +void obliterate(int wflag, char kreason) { /* 0 = do nothing to war status, 1= make war with all, 2= make peace with all */ struct player *j; - int i, k; /* clear torps and plasmas out */ MZERO(torps, sizeof(struct torp) * MAXPLAYER * (MAXTORP + MAXPLASMA)); Index: rmove.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robots/rmove.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- rmove.c 23 Apr 2006 12:47:45 -0000 1.2 +++ rmove.c 12 May 2006 03:44:49 -0000 1.3 @@ -3,11 +3,14 @@ #include "copyright.h" #include +#include #include #include #include "defs.h" #include "struct.h" #include "data.h" +#include "proto.h" +#include "roboshar.h" #define SIZEOF(s) (sizeof (s) / sizeof (*(s))) @@ -115,6 +118,12 @@ u_char getcourse(); char *robo_message(); char *termie_message(); /* added 8/2/91 TC */ +void exitRobot(); +int phaser_plasmas(); +void go_home(struct Enemy *ebuf); +int do_repair(); +int isTractoringMe(struct Enemy *enemy_buf); +int projectDamage(int eNum, int *dirP); char roboname[15]; @@ -128,7 +137,7 @@ int avDir; extern struct Enemy *get_nearest(); struct Enemy *enemy_buf; - struct player *enemy; + struct player *enemy = NULL; static int roboclock = 0; static int avoid[2] = { -32, 32 }; int no_cloak; @@ -573,8 +582,7 @@ as close to them as it can, while staying in its own space. Otherwise, it will head to the center of its own space. */ -go_home(ebuf) -struct Enemy *ebuf; +void go_home(struct Enemy *ebuf) { int x, y; double dx, dy; @@ -638,7 +646,7 @@ if (! cloaker) cloak_off(); } -phaser_plasmas() +int phaser_plasmas() { struct torp *t; int myphrange; @@ -667,8 +675,7 @@ return 0; } -projectDamage(eNum, dirP) - int *dirP; +int projectDamage(int eNum, int *dirP) { register int i, j, numHits = 0, mx, my, tx, ty, dx, dy; double tdx, tdy, mdx, mdy; @@ -697,11 +704,10 @@ } if (numHits > 0) *dirP /= numHits; - return (numHits); + return numHits; } -isTractoringMe(enemy_buf) -struct Enemy *enemy_buf; +int isTractoringMe(struct Enemy *enemy_buf) { return ((enemy_buf->e_hisflags & PFTRACT) && /* bug fix: was using */ !(enemy_buf->e_hisflags & PFPRESS) && /* e_flags 6/24/92 TC */ @@ -819,9 +825,9 @@ } /* end for */ } /* end else */ if (pcount == 0) { - return (NOENEMY); /* no players in game */ + return NOENEMY; /* no players in game */ } else if (ebuf.e_info == me->p_no) { - return (0); /* no hostile players in the game */ + return 0; /* no hostile players in the game */ } else { j = &players[ebuf.e_info]; @@ -892,7 +898,6 @@ if ((polymorphic) && (j->p_ship.s_type != me->p_ship.s_type) && (j->p_ship.s_type != ATT)) { /* don't polymorph to ATT 4/8/92 TC */ extern int config(); - extern int getship(); int old_shield; int old_damage; old_shield = me->p_ship.s_maxshield; @@ -908,7 +913,7 @@ /(float)old_damage; } - return (&ebuf); + return &ebuf; } } @@ -931,11 +936,11 @@ return nearest; } -do_repair() +int do_repair() { /* Repair if necessary (we are safe) */ - register struct planet* l; + struct planet* l; int dx, dy; int dist; @@ -949,13 +954,13 @@ if ((dx < PFIREDIST) && (dy < PFIREDIST)) { if (debug) ERROR(1,( "%d) on top of hostile planet (%s)\n", me->p_no, l->pl_name)); - return(0); /* can't repair on top of hostile planets */ + return 0; /* can't repair on top of hostile planets */ } if ((int) (hypot((double) dx, (double) dy)) < PFIREDIST) { if (debug) ERROR(1,("%d) on top of hostile planet (%s)\n", me->p_no, l->pl_name)); - return(0); + return 0; } } me->p_desspeed = 0; @@ -984,7 +989,7 @@ me->p_flags &= ~PFPLLOCK; orbit(); } - return(1); + return 1; } else { /* not repair, so ignore it */ me->p_desspeed = 0; @@ -997,10 +1002,10 @@ ERROR(1,( "%d) repairing damage at %d\n", me->p_no, me->p_damage)); - return(1); + return 1; } else { - return (0); + return 0; } } @@ -1075,7 +1080,7 @@ } } *s='\0'; - return(rmessage); + return rmessage; } char* termie_message(enemy) @@ -1153,11 +1158,10 @@ } } *s='\0'; - return(tmessage); - + return tmessage; } -exitRobot() +void exitRobot() { SIGNAL(SIGALRM, SIG_IGN); if (me != NULL && me->p_team != ALLTEAM) { Index: robotII.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robots/robotII.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- robotII.c 22 Apr 2006 02:16:46 -0000 1.2 +++ robotII.c 12 May 2006 03:44:49 -0000 1.3 @@ -4,19 +4,21 @@ #include #include -#include -#include +#include +#include #include -#include #include "defs.h" #include "struct.h" #include "data.h" +#include "proto.h" +#include "roboshar.h" extern int redrawall; /* maint: missing "extern" 6/22/92 TC */ extern int lastm; /* maint: missing "extern" 6/22/92 TC */ extern char roboname[15]; /* So it can be defined dynamically */ +void config(); /* lots of neat flags */ int hostile; @@ -54,7 +56,7 @@ register int i; void rmove(); int team = -1; - int bteam; + int bteam = FED; int pno; int class; /* ship class 8/9/91 TC */ @@ -301,7 +303,7 @@ } -config() +void config() { /* calc class-specific stuff */ Index: marsmove.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robots/marsmove.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- marsmove.c 22 Apr 2006 02:16:46 -0000 1.2 +++ marsmove.c 12 May 2006 03:44:49 -0000 1.3 @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -34,6 +35,8 @@ #include "defs.h" #include "struct.h" #include "data.h" +#include "proto.h" +#include "roboshar.h" #include "marsdefs.h" @@ -185,14 +188,14 @@ void reset_game(void); void reportFinal(void); void reportStanding(void); +int get_num_matches(int a, int b); void cleanup(void); +int nextFreeArena(void); void smileon(struct player* j); void do_msg_check(void); void do_stats(int who); -void do_war(void); void join(int who); void join_game(Track *track); -void mars_rules(void); int lookupshipname(char *shipname); void do_score(void); void player_maint(void); @@ -1418,7 +1421,7 @@ return; } - old_a = &arenas[track->t_arena]; + old_a = &arenas[(int) track->t_arena]; checkBadArenaNo(ano,"in teleport\n"); @@ -1704,7 +1707,7 @@ continue; /*Don't do this for dead and for puck*/ - a = &arenas[track->t_arena]; + a = &arenas[(int) track->t_arena]; /* kill torps that might distract guys in other arenas */ @@ -1938,7 +1941,6 @@ static DogStatEntry player; static int position= -1; int plfd; - int i; int entries; struct stat buf; Index: puck.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robots/puck.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- puck.c 22 Apr 2006 02:16:46 -0000 1.3 +++ puck.c 12 May 2006 03:44:49 -0000 1.4 @@ -10,16 +10,17 @@ #include "copyright.h" #include +#include #include -#include -#include +#include #include -#include #include "defs.h" #include "struct.h" #include "data.h" -#include "puckdefs.h" #include "proto.h" +#include "puckdefs.h" +#include "roboshar.h" +#include "puckmove.h" #ifdef PUCK_FIRST #include Index: pret.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robots/pret.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- pret.c 23 Apr 2006 10:39:10 -0000 1.3 +++ pret.c 12 May 2006 03:44:49 -0000 1.4 @@ -27,18 +27,14 @@ #include "defs.h" #include "struct.h" #include "data.h" +#include "proto.h" +#include "roboshar.h" #include "pretdefs.h" int debug=0; char *roboname = "Kathy"; -#define NUMADJ 12 -static char *adj_s[NUMADJ] = { - "VICIOUS", "RUTHLESS", "IRONFISTED", "RELENTLESS", - "MERCILESS", "UNFLINCHING", "FEARLESS", "BLOODTHIRSTY", - "FURIOUS", "DESPERATE", "FRENZIED", "RABID"}; - #define NUMNAMES 20 static char *names[NUMNAMES] = @@ -62,7 +58,7 @@ int trrange; /* tractor range 8/2/91 TC */ int ticks = 0; int oldmctl; -static realT = 0; +static int realT = 0; int pt_robots = 0; int team1=0; int team2=0; @@ -71,7 +67,6 @@ static void cleanup(int); void checkmess(int); -static void start_internal(char *type); static void obliterate(int wflag, char kreason, int killRobots); static void start_a_robot(char *team); static void stop_a_robot(void); @@ -109,7 +104,6 @@ int team = 4; int pno; int class; /* ship class 8/9/91 TC */ - int i; #ifndef TREKSERVER if (gethostname(hostname, 64) != 0) { @@ -201,7 +195,6 @@ void checkmess(int unused) { int shmemKey = PKEY; - int i; static int no_humans = 0; static int no_bots = 0; static int time_in_T = 0; @@ -257,8 +250,8 @@ /* Stop or start a robot. */ if ((ticks % ROBOCHECK) == 0) { int next_team; - int np = num_players(&next_team); - + num_players(&next_team); + if (!(ticks % ROBOEXITWAIT)) { if(debugTarget != -1) { @@ -442,7 +435,6 @@ static int rprog(char *login, char *robotHost) { - int v; char localHostName[80]; gethostname(localHostName, 80); @@ -533,8 +525,8 @@ static char * namearg(void) { - register i, k = 0; - register struct player *j; + int i, k = 0; + struct player *j; char *name; int namef = 1; @@ -579,7 +571,7 @@ return; if (pid == 0) { SIGNAL(SIGALRM, SIG_DFL); - execl("/bin/sh", "sh", "-c", command, 0); + execl("/bin/sh", "sh", "-c", command, (char *) NULL); perror("pret'execl"); _exit(1); } @@ -587,36 +579,6 @@ status->gameup |= GU_BOT_IN_GAME; } -static void start_internal(char *type) -{ - char *argv[6]; - u_int argc = 0; - - argv[argc++] = "robot"; - if ((strncmp(type, "iggy", 2) == 0) || - (strncmp(type, "hunterkiller", 2) == 0)) { - argv[argc++] = "-Ti"; - argv[argc++] = "-P"; - argv[argc++] = "-f"; /* Allow more than one */ - } else if (strncmp (type, "cloaker", 2) == 0) { - argv[argc++] = "-Ti"; - argv[argc++] = "-C"; /* Never uncloak */ - argv[argc++] = "-F"; /* Needs no fuel */ - argv[argc++] = "-f"; - } else if (strncmp (type, "hoser", 2) == 0) { - argv[argc++] = "-p"; - argv[argc++] = "-f"; - } else return; - - argv[argc] = NULL; - if (fork() == 0) { - SIGNAL(SIGALRM, SIG_DFL); - execv(Robot,argv); - perror(Robot); - _exit(1); - } -} - static void cleanup(int unused) { register struct player *j; @@ -730,7 +692,6 @@ { /* 0 = do nothing to war status, 1= make war with all, 2= make peace with all */ struct player *j; - int i, k; /* clear torps and plasmas out */ MZERO(torps, sizeof(struct torp) * MAXPLAYER * (MAXTORP + MAXPLASMA)); --- NEW FILE: roboshar.h --- /* from roboshar.c */ void robonameset(struct player *myself); void messAll(int mynum, char *name, const char *fmt, ...); u_char getcourse2(int x1, int y1, int x2, int y2); void messOne(int mynum, char *name, int who, const char *fmt, ...); /* from ntserv/commands.c */ int check_command(struct message *mess); Index: newbie.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robots/newbie.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- newbie.c 22 Apr 2006 02:16:46 -0000 1.3 +++ newbie.c 12 May 2006 03:44:49 -0000 1.4 @@ -27,6 +27,8 @@ #include "defs.h" #include "struct.h" #include "data.h" +#include "proto.h" +#include "roboshar.h" #include "newbiedefs.h" int debug=0; @@ -34,14 +36,6 @@ char *roboname = "Merlin"; -static char *team_s[4] = {"federation", "romulan", "klingon", "orion"}; - -#define NUMADJ 12 -static char *adj_s[NUMADJ] = { - "VICIOUS", "RUTHLESS", "IRONFISTED", "RELENTLESS", - "MERCILESS", "UNFLINCHING", "FEARLESS", "BLOODTHIRSTY", - "FURIOUS", "DESPERATE", "FRENZIED", "RABID"}; - #define NUMNAMES 20 static char *names[NUMNAMES] = @@ -70,7 +64,6 @@ static void cleanup(int); void checkmess(int); -static void start_internal(char *type); static void obliterate(int wflag, char kreason); static void start_a_robot(char *team); static void stop_a_robot(void); @@ -103,7 +96,6 @@ int team = 4; int pno; int class; /* ship class 8/9/91 TC */ - int i; #ifndef TREKSERVER if (gethostname(hostname, 64) != 0) { @@ -190,7 +182,6 @@ void checkmess(int unused) { int shmemKey = PKEY; - int i; static int no_humans = 0; HANDLE_SIG(SIGALRM,checkmess); @@ -308,8 +299,6 @@ static int rprog(char *login, char *monitor) { - int v; - if (strcmp(login, "robot!") == 0) /* if (strstr(monitor, "uci")) */ return 1; @@ -378,8 +367,8 @@ static char * namearg(void) { - register i, k = 0; - register struct player *j; + int i, k = 0; + struct player *j; char *name; int namef = 1; @@ -419,43 +408,13 @@ return; if (pid == 0) { SIGNAL(SIGALRM, SIG_DFL); - execl("/bin/sh", "sh", "-c", command, 0); + execl("/bin/sh", "sh", "-c", command, (char *) NULL); perror("newbie'execl"); _exit(1); } nb_robots++; } -static void start_internal(char *type) -{ - char *argv[6]; - u_int argc = 0; - - argv[argc++] = "robot"; - if ((strncmp(type, "iggy", 2) == 0) || - (strncmp(type, "hunterkiller", 2) == 0)) { - argv[argc++] = "-Ti"; - argv[argc++] = "-P"; - argv[argc++] = "-f"; /* Allow more than one */ - } else if (strncmp (type, "cloaker", 2) == 0) { - argv[argc++] = "-Ti"; - argv[argc++] = "-C"; /* Never uncloak */ - argv[argc++] = "-F"; /* Needs no fuel */ - argv[argc++] = "-f"; - } else if (strncmp (type, "hoser", 2) == 0) { - argv[argc++] = "-p"; - argv[argc++] = "-f"; - } else return; - - argv[argc] = NULL; - if (fork() == 0) { - SIGNAL(SIGALRM, SIG_DFL); - execv(Robot,argv); - perror(Robot); - _exit(1); - } -} - static void cleanup(int unused) { register struct player *j; @@ -514,7 +473,6 @@ { /* 0 = do nothing to war status, 1= make war with all, 2= make peace with all */ struct player *j; - int i, k; /* clear torps and plasmas out */ MZERO(torps, sizeof(struct torp) * MAXPLAYER * (MAXTORP + MAXPLASMA)); --- NEW FILE: puckmove.h --- void do_war(void); void puck_rules(void); void do_faceoff(void); Index: marsdefs.h =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robots/marsdefs.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- marsdefs.h 21 Mar 2005 05:23:46 -0000 1.1 +++ marsdefs.h 12 May 2006 03:44:49 -0000 1.2 @@ -8,6 +8,9 @@ #ifndef _h_marsdefs #define _h_marsdefs +void do_war(void); +void mars_rules(void); +void init_mars(void); #include "defs.h" Index: inldefs.h =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robots/inldefs.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- inldefs.h 21 Mar 2005 05:23:46 -0000 1.1 +++ inldefs.h 12 May 2006 03:44:49 -0000 1.2 @@ -128,5 +128,7 @@ char *message; /* Message to print */ } Inl_countdown; -#endif /* _h_inldefs */ +void start_countdown(); +void reset_inl(int); +#endif /* _h_inldefs */ Index: roboshar.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robots/roboshar.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- roboshar.c 22 Apr 2006 11:31:53 -0000 1.2 +++ roboshar.c 12 May 2006 03:44:49 -0000 1.3 @@ -4,11 +4,14 @@ #include "struct.h" #include "data.h" #include "proto.h" +#include "roboshar.h" #ifndef M_PI #include #endif +extern void do_message(int recip, int group, char *address, u_char from, + const char *fmt, va_list args); /* Each robot must declare the following variables as globals */ extern int debug; @@ -102,13 +105,7 @@ va_start(args, fmt); -/* +++ 2.6pl0 cameron at sna.dec.com */ -#if defined(__alpha) - sprintf(addrbuf, "%s->ALL", &name ); -#else sprintf(addrbuf, "%s->ALL", name ); -#endif -/* --- */ do_message(0, MALL, addrbuf, mynum, fmt, args); va_end(args); } Index: inlcmds.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robots/inlcmds.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- inlcmds.c 21 Mar 2005 05:23:46 -0000 1.1 +++ inlcmds.c 12 May 2006 03:44:49 -0000 1.2 @@ -10,15 +10,9 @@ would be a horror to implement in the old scheme.. */ -#include -#include -#include -#include -#include #include "defs.h" #include "struct.h" #include "data.h" - #include "gencmds.h" #include "inldefs.h" @@ -49,6 +43,7 @@ int do_nothing() { + return 0; } /********* COMMANDS LIST ******** Index: inl.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robots/inl.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- inl.c 6 May 2006 12:28:20 -0000 1.4 +++ inl.c 12 May 2006 03:44:49 -0000 1.5 @@ -1,9 +1,5 @@ /* $Id$ */ -#ifndef lint -static char vcid[] = "$Id$"; -#endif /* lint */ - /* * inl.c * @@ -15,26 +11,20 @@ */ #include -#include +#include +#include #include -#include -#include -#include #include -#include -#include -#include +#include #include -#include -#include #include #include "defs.h" #include "struct.h" #include "data.h" #include "planets.h" #include "inldefs.h" -#include INC_STRINGS #include "proto.h" +#include "roboshar.h" #include "ltd_stats.h" /* @@ -160,13 +150,19 @@ }; void cleanup(); -void reset_inl(int); -int checkmess(); +void checkmess(); void inlmove(); int start_tourney(); void reset_stats(); void update_scores(); void announce_scores(int, int, FILE *); +void doResources(int startup); +void countdown(int counter, Inl_countdown *cnt); +void obliterate(int wflag, char kreason); +void player_maint(); +void init_server(); +int all_alert(int stat); +int check_winner(); extern char *addr_mess(int who, int type); @@ -176,12 +172,11 @@ int argc; char *argv[]; { - int i; - srandom(time(NULL)); getpath(); openmem(1); + do_message_post_set(check_command); readsysdefaults(); if ((inl_log = fopen(N_INLLOG,"w+"))==NULL) { @@ -386,7 +381,6 @@ { register int i; register struct planet *l; - struct planet *homep = NULL; struct player *j; int loser, winner; @@ -511,15 +505,14 @@ SIGNAL(SIGALRM, inlmove); } -player_maint() +void player_maint() { #ifdef INLDEBUG ERROR(2,("Enter player_maint\n")); #endif } -int -all_alert(int stat) +int all_alert(int stat) { struct player *j; @@ -530,43 +523,26 @@ return 1; } -logmessage(m) - struct message *m; +void logmessage(struct message *m) { - time_t curtime; - struct tm *tmstruct; - int hour; - int least = MBOMB; /* decide whether or not to log this message */ #ifdef nodef if (m->m_flags & MINDIV) return; /* individual message */ if (!(m->m_flags & MGOD)) return; if ((m->m_flags & MGOD) > least) return; #endif - /* - time(&curtime); - tmstruct = localtime(&curtime); - if (!(hour = tmstruct->tm_hour%12)) hour = 12; - fprintf(inl_log,"%02d:%02d %-73.73s\n", hour, tmstruct->tm_min, - m->m_data); - */ fprintf(inl_log,"%5d: %s\n",inl_stat.ticks,m->m_data); } -checkmess() +void checkmess() { - int shmemKey = PKEY; - int i; - #ifdef INLDEBUG ERROR(2,("Enter checkmess\n")); #endif /* make sure shared memory is still valid */ - if (shmget(shmemKey, SHMFLAG, 0) < 0) { + if (shmget(PKEY, SHMFLAG, 0) < 0) { exit(1); - ERROR(2,("ERROR: Invalid shared memory\n")); - } while (oldmctl!=mctl->mc_current) { @@ -863,11 +839,10 @@ return -1; } - + return 0; } -int -end_tourney() +int end_tourney() { int game_over = 0; int win_cond; @@ -1024,7 +999,7 @@ status->gameup &= ~(GU_PAUSED); gettimeofday(&tv, (struct timezone *) 0); - fprintf(inl_log, "TIME: Game ending at %d seconds\n", tv.tv_sec); + fprintf(inl_log, "TIME: Game ending at %d seconds\n", (int) tv.tv_sec); fclose(inl_log); sleep(2); /* a kluge to allow time for all the ntservs to run */ @@ -1041,7 +1016,7 @@ players[c].p_pos = -1; - sprintf(name, "%s.%d", N_INLLOG, tv.tv_sec); + sprintf(name, "%s.%d", N_INLLOG, (int) tv.tv_sec); rename(N_INLLOG, name); if ((inl_log = fopen(N_INLLOG,"w+"))==NULL) { @@ -1049,13 +1024,13 @@ exit(1); } - sprintf(name, "%s.%d", N_PLAYERFILE, tv.tv_sec); + sprintf(name, "%s.%d", N_PLAYERFILE, (int) tv.tv_sec); rename(N_PLAYERFILE, name); - sprintf(name, "%s.%d", N_PLFILE, tv.tv_sec); + sprintf(name, "%s.%d", N_PLFILE, (int) tv.tv_sec); rename(N_PLFILE, name); - sprintf(name, "%s.%d", N_GLOBAL, tv.tv_sec); + sprintf(name, "%s.%d", N_GLOBAL, (int) tv.tv_sec); rename(N_GLOBAL, name); /* Stop cambot. */ @@ -1063,7 +1038,7 @@ kill(cambot_pid, SIGTERM); waitpid(cambot_pid, NULL, 0); cambot_pid = 0; - sprintf(name, "%s.%d", Cambot_out, tv.tv_sec); + sprintf(name, "%s.%d", Cambot_out, (int) tv.tv_sec); rename(Cambot_out, name); } @@ -1077,9 +1052,9 @@ pmessage(who, MINDIV, addr_mess(who, MINDIV), "Official registration script starting."); } - sprintf(pipe, "./end_tourney.pl -register %d", tv.tv_sec); + sprintf(pipe, "./end_tourney.pl -register %d", (int) tv.tv_sec); } else { - sprintf(pipe, "./end_tourney.pl -practice %d", tv.tv_sec); + sprintf(pipe, "./end_tourney.pl -practice %d", (int) tv.tv_sec); } fp = popen(pipe, "r"); @@ -1108,11 +1083,10 @@ reset_inl(1); } /* if (game_over) */ - + return 0; } -void -reset_inl(int is_end_tourney) +void reset_inl(int is_end_tourney) /* is_end_tourney: boolean, used so that the galaxy isn't reset at the end of a tournament. */ { @@ -1203,10 +1177,9 @@ } -init_server() +void init_server() { - register i; - register struct planet *j; + int i; /* Tell other processes a game robot is running */ status->gameup |= GU_INROBOT; @@ -1371,10 +1344,8 @@ exit(0); } -start_countdown() +void start_countdown() { - int c; - inl_stat.change = 0; inl_teams[HOME].side = sides[inl_teams[HOME].side_index].flag; @@ -1415,14 +1386,11 @@ inl_countdown.end = inl_stat.ticks+INLSTARTFUSE; inl_countdown.action = start_tourney; inl_countdown.message = "Game start in %i %s"; - } -start_tourney() +int start_tourney() { - int c; - struct player* j; struct timeval tv; struct tm *tp; char *ap; @@ -1441,7 +1409,7 @@ gettimeofday (&tv, (struct timezone *) 0); - fprintf(inl_log, "TIME: Game started at %d seconds\n", tv.tv_sec); + fprintf(inl_log, "TIME: Game started at %d seconds\n", (int) tv.tv_sec); tp = localtime (&tv.tv_sec); ap = asctime (tp); @@ -1500,19 +1468,18 @@ if (pid < 0) perror("fork cambot"); else if (pid == 0) { - execl(Cambot, "cambot", 0); + execl(Cambot, "cambot", (char *) NULL); perror("execl cambot"); } else { cambot_pid = pid; } } + return 0; } -obliterate(wflag, kreason) - int wflag; - char kreason; +void obliterate(int wflag, char kreason) { /* 0 = do nothing to war status, 1= make war with all, 2= make peace with all */ struct player *j; @@ -1593,13 +1560,10 @@ } -countdown(counter,cnt) - int counter; - Inl_countdown *cnt; +void countdown(int counter, Inl_countdown *cnt) { int i = 0; int j = 0; - char *ms; if (cnt->end - cnt->counts[cnt->idx]*cnt->unit > counter) return; @@ -1625,8 +1589,7 @@ } -doResources(startup) - int startup; +void doResources(int startup) { int i, j, k, which; Index: inlcomm.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robots/inlcomm.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- inlcomm.c 12 Aug 2005 04:35:08 -0000 1.3 +++ inlcomm.c 12 May 2006 03:44:49 -0000 1.4 @@ -8,23 +8,12 @@ */ #include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include "defs.h" #include "struct.h" #include "data.h" +#include "proto.h" +#include "roboshar.h" #include "inldefs.h" extern Inl_stats inl_stat; @@ -88,15 +77,10 @@ -do_switchside(comm,mess) +int do_switchside(comm,mess) char *comm; struct message *mess; { - int who; - int queue; - int side; - struct player *j; - #ifndef nodef return 0; /* disabled until fixed */ @@ -106,6 +90,10 @@ with a wait queue. cameron at stl.dec.com */ #else + int who; + int queue; + int side; + struct player *j; #ifdef INLDEBUG ERROR(2,(" Enter do_switchside\n")); @@ -180,7 +168,7 @@ /* Allows the captain to agree on starting the game */ -do_start(comm,mess) +int do_start(comm,mess) char *comm; struct message *mess; { @@ -276,9 +264,10 @@ inl_teams[c].flags &= ~T_START; start_countdown(); + return 0; } -do_register(comm,mess) +int do_register(comm,mess) char *comm; struct message *mess; { @@ -305,9 +294,10 @@ pmessage(0, MALL, inl_from, "Game is official.. will be automatically registered."); + return 0; } -do_gametime(comm,mess) +int do_gametime(comm,mess) char *comm; struct message *mess; { @@ -403,10 +393,11 @@ inl_stat.time = time * PERMIN; inl_stat.overtime = overtime * PERMIN; } + return 0; } -do_army(comm,mess) +int do_army(comm,mess) char *comm; struct message *mess; { @@ -467,12 +458,13 @@ army); inl_stat.start_armies = army; } + return 0; } /* Allows the captains of both teams to agree on resetting the galaxy */ -do_resetgalaxy(comm,mess) +int do_resetgalaxy(comm,mess) char *comm; struct message *mess; { @@ -517,18 +509,19 @@ pmessage (0, MALL, inl_from, "Game restarting with new galaxy. Teams should be reselected"); + return 0; } /* Makes the player who sent the message captain if it hasn't been taken yet. */ -do_captain(comm,mess) +int do_captain(comm,mess) char *comm; struct message *mess; { int who; - int c, num=-1; + int num = -1; #ifdef INLDEBUG ERROR(2,(" Enter do_captain\n")); @@ -568,12 +561,12 @@ /* Allows the captain to release captaining duties */ -do_uncaptain(comm,mess) +int do_uncaptain(comm,mess) char *comm; struct message *mess; { int who; - int c, num=-1; + int num = -1; #ifdef INLDEBUG ERROR(2,(" Enter do_uncaptain\n")); @@ -591,16 +584,25 @@ } +static int get_other_side(int num) +{ + int c; + for (c=0; c < INLTEAM; c++) { + if (inl_teams[num].team != inl_teams[c].team) + return inl_teams[c].team; + } + return 0; +} + /* This allows the captain to pick the different races */ -do_pickside(comm,mess) +int do_pickside(comm,mess) char *comm; struct message *mess; { int who; - int c, other_side, num=-1; - int race,diagonal; + int c, other_side, num = -1; #ifdef INLDEBUG ERROR(2,(" Enter pickside\n")); @@ -618,11 +620,7 @@ if ((num = check_player(who, 1)) == NONE) return 0; - for (c=0; c < INLTEAM; c++) - { - if (inl_teams[num].team != inl_teams[c].team) - other_side = inl_teams[c].team; - } + other_side = get_other_side(num); if (inl_teams[num].flags & T_SIDELOCKED) { @@ -688,13 +686,10 @@ return 1; } -do_tname(comm,mess) - char *comm; - struct message *mess; +int do_tname(char *comm, struct message *mess) { int who; - - int c, other_side, num=-1; + int num = -1; #ifdef INLDEBUG ERROR(2,(" Enter do_tname\n")); @@ -717,14 +712,14 @@ return 0; } - if (strlen(comm)+1 < 2) + comm++; + + if (strlen(comm) < 1) { pmessage(who, MINDIV, addr_mess(who, MINDIV), "No team name was given."); return 0; } - comm = ++comm; - /* free (inl_teams[num].t_name); */ inl_teams[num].t_name = strdup (comm); pmessage(who, MINDIV, addr_mess(who, MINDIV), @@ -739,16 +734,14 @@ inl_stat.flags &= ~(S_FREEZE | S_COUNTDOWN); status->gameup &= ~(GU_PRACTICE | GU_PAUSED); pmessage(0,MALL, inl_from, "---- Game continues ----"); + return 0; } -do_pause(comm,mess) +int do_pause(comm,mess) char *comm; struct message *mess; { int who; - int queue; - int side; - struct player *j; int c, begin=0, num=-1; #ifdef INLDEBUG @@ -818,17 +811,14 @@ inl_countdown.action=end_pause; inl_countdown.message="Game continues in %i seconds"; } - + return 0; } -do_restart(comm,mess) +int do_restart(comm,mess) char *comm; struct message *mess; { int who; - int queue; - int side; - struct player *j; int c, restart=0, num=-1; #ifdef INLDEBUG @@ -861,13 +851,14 @@ pmessage(0, MALL, inl_from, "INL SERVER RESTARTED"); reset_inl(0); } + return 0; } -do_timeout(char *comm, struct message *mess) +int do_timeout(char *comm, struct message *mess) { int who; int other_side; - int c, num=-1; + int num = -1; #ifdef INLDEBUG ERROR(2,(" Enter do_pause\n")); @@ -884,11 +875,7 @@ return 0; } - for (c=0; c < INLTEAM; c++) - { - if (inl_teams[num].team != inl_teams[c].team) - other_side = inl_teams[c].team; - } + other_side = get_other_side(num); if (inl_teams[num].flags & T_TIMEOUT) { @@ -925,12 +912,13 @@ pmessage(0, MALL, inl_from, "**********************************************************"); } + return 0; } -do_confine(char *comm, struct message *mess) +int do_confine(char *comm, struct message *mess) { int who; - int c, other_side, num=-1; + int other_side, num = -1; #ifdef INLDEBUG ERROR(2,(" Enter do_confine\n")); @@ -946,11 +934,7 @@ return 0; } - for (c=0; c < INLTEAM; c++) - { - if (inl_teams[num].team != inl_teams[c].team) - other_side = inl_teams[c].team; - } + other_side = get_other_side(num); if (inl_teams[num].flags & T_CONFINE) { @@ -974,9 +958,10 @@ inl_teams[num].t_name, players[who].p_mapchars); } + return 0; } -do_free(char *comm, struct message *mess) +int do_free(char *comm, struct message *mess) { int num=-1; int victim; @@ -986,6 +971,7 @@ if ((num = check_player(who, 1)) == NONE) return 0; /* Captain ? */ + extern int getplayer(int from, char *line); /* gencmds.c */ if ((victim = getplayer(who, comm)) == -1) return 0; @@ -1213,5 +1199,6 @@ pmessage(0, MALL, inl_from, "%s scoring mode approved. See MOTD.", mode); inl_stat.score_mode = inl_teams[HOME].score_mode; } + return 0; } Index: puckmove.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robots/puckmove.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- puckmove.c 26 Apr 2006 09:52:43 -0000 1.4 +++ puckmove.c 12 May 2006 03:44:49 -0000 1.5 @@ -22,7 +22,10 @@ #include "defs.h" #include "struct.h" #include "data.h" +#include "proto.h" #include "puckdefs.h" +#include "roboshar.h" +#include "puckmove.h" #ifdef PUCK_FIRST #include @@ -143,13 +146,10 @@ void do_teleport_home(void); void do_peace(void); void do_msg_check(void); -void do_war(void); void place_anncer(void); void do_offsides(void); -void puck_rules(void); void do_goal(int); void do_score(void); -void do_faceoff(void); void woomp(void); void player_maint(void); void player_bounce(void); @@ -158,6 +158,8 @@ unsigned char getcourse(); char *robo_message(); char *puckie_message(); /* added 8/2/91 TC */ +int isInPossession(struct Enemy *enemy_buf); +int isPressoringMe(struct Enemy *enemy_buf); #ifdef HAVE_GOALIE struct player *ori_goalie = NULL; @@ -1051,7 +1053,7 @@ if ((j != me) && (j->p_status == PALIVE)) { if (((j->p_team == KLI) && (j->p_y > GWIDTH/2)) || ((j->p_team == ORI) && (j->p_y < GWIDTH/2))) { - int startplanet; + int startplanet = 10; messAll(me->p_no,roboname,"%s (%2s) is offsides.", j->p_name, j->p_mapchars); j->p_flags &= ~(PFORBIT|PFPLOCK|PFPLLOCK|PFTRACT|PFPRESS); /* ***BAV*** */ From quozl at users.sourceforge.net Thu May 11 22:44:52 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Fri, 12 May 2006 03:44:52 +0000 Subject: [netrek-cvs] server/Vanilla/tools Makefile.in, 1.7, 1.8 cambot.c, 1.4, 1.5 keyman.c, 1.3, 1.4 mergescores.c, 1.1, 1.2 metaget.c, 1.2, 1.3 newscores.c, 1.2, 1.3 nuke.c, 1.1, 1.2 players.c, 1.6, 1.7 setgalaxy.c, 1.4, 1.5 setplanet.c, 1.2, 1.3 showgalaxy.c, 1.1, 1.2 trimscores.c, 1.2, 1.3 update.c, 1.2, 1.3 xtkill.c, 1.6, 1.7 Message-ID: Update of /cvsroot/netrek/server/Vanilla/tools In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26631/tools Modified Files: Makefile.in cambot.c keyman.c mergescores.c metaget.c newscores.c nuke.c players.c setgalaxy.c setplanet.c showgalaxy.c trimscores.c update.c xtkill.c Log Message: merge from jerub darcs 2006-05-12 Index: metaget.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/tools/metaget.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- metaget.c 22 Apr 2006 02:16:47 -0000 1.2 +++ metaget.c 12 May 2006 03:44:50 -0000 1.3 @@ -20,16 +20,13 @@ */ -#ifndef lint -static char vcid[] = "$Id$"; -#endif /* lint */ - #include #include #include #include #include #include +#include #include int main (int argc, char *argv[]) @@ -47,7 +44,7 @@ if (argc > 2) port = atoi(argv[2]); sock = socket(AF_INET, SOCK_DGRAM, 0); - if (sock < 0) { perror("socket"); exit(1); } + if (sock < 0) { perror("socket"); return 1; } address.sin_family = AF_INET; address.sin_port = htons(port); @@ -56,7 +53,7 @@ struct hostent *hp; if ((hp = gethostbyname(host)) == NULL) { herror("gethostbyname"); - exit(2); + return 2; } else { address.sin_addr.s_addr = *(long *) hp->h_addr; } @@ -65,19 +62,20 @@ /* send query */ stat = sendto(sock, "?", 1, 0, (struct sockaddr *) &address, sizeof(struct sockaddr)); - if (stat < 0) { perror("sendto"); exit(3); } + if (stat < 0) { perror("sendto"); return 3; } /* wait for response */ len = recvfrom(sock, buf, BUFSIZ, 0, NULL, NULL); - if (len < 0) { perror("recvfrom"); exit(4); } + if (len < 0) { perror("recvfrom"); return 4; } if (len == 0) { fprintf(stderr, "%s: zero length response received\n", argv[0]); - exit(5); + return 5; } /* display response */ stat = write(STDOUT_FILENO, buf, len); - if (stat < 0) { perror("write"); exit(6); } + if (stat < 0) { perror("write"); return 6; } close(sock); + return 0; } Index: xtkill.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/tools/xtkill.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- xtkill.c 23 Apr 2006 11:24:53 -0000 1.6 +++ xtkill.c 12 May 2006 03:44:50 -0000 1.7 @@ -9,8 +9,6 @@ static void Usage(void); static void _pmessage(char *str, int recip, int group); -static char *names[] = { "Neutral", "Fed", "Rom", "", "Kli", "", "", "", "Ori"}; - static void Usage(void) { printf("\ @@ -39,8 +37,6 @@ static void refit(struct player *me, int type) { - int i; - getship(&(me->p_ship), type); /* enable docking */ Index: update.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/tools/update.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- update.c 28 Sep 2005 12:14:06 -0000 1.2 +++ update.c 12 May 2006 03:44:50 -0000 1.3 @@ -8,26 +8,13 @@ #include #include #include -#include -#include #include -#include #include #include #include #include "defs.h" -#include INC_SYS_TIME -#include -#include -#include -#include -#include #include -#include -#include -#include INC_STRINGS #include INC_SYS_FCNTL -#include INC_SYS_PTYIO #include "struct.h" #include "data.h" #include "patchlevel.h" @@ -338,11 +325,11 @@ #endif if (exclude) execl(buf,KEYCOMP,"-c","-m",buf1,"-t",classes,"-x", - exclude,buf2,0); + exclude,buf2, (char *) NULL); else execl(buf,KEYCOMP,"-c","-m",buf1,"-t",classes, - buf2,0); + buf2, (char *) NULL); _exit(1); } @@ -378,7 +365,7 @@ #endif } while (num_written < num_read); } - fclose(keyfile); + fclose(featurefile); fprintf(stderr,"Wrote new feature file\n"); } close(sock); Index: Makefile.in =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/tools/Makefile.in,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Makefile.in 23 Apr 2006 11:22:53 -0000 1.7 +++ Makefile.in 12 May 2006 03:44:49 -0000 1.8 @@ -78,7 +78,7 @@ $(INSTALLPROG) $(INSTALLOPTS) updated $(DESTDIR)$(LIBDIR)/updated $(INSTALLPROG) $(INSTALLOPTS) cambot $(DESTDIR)$(LIBDIR)/cambot $(INSTALLPROG) $(INSTALLOPTS) metaget $(DESTDIR)$(LIBDIR)/tools/metaget - $(INSTALLPROG) $(INSTALLOPTS) setplanet $(DESTDIR)$(LIBDIR)/tools/metaget + $(INSTALLPROG) $(INSTALLOPTS) setplanet $(DESTDIR)$(LIBDIR)/tools/setplanet cambot: cambot.o $(OBJS) $(CC) -o $@ $(CFLAGS) ${LDFLAGS} cambot.o $(OBJS) $(RSA_LIB) @@ -159,7 +159,7 @@ $(CC) -o $@ $(CFLAGS) ${LDFLAGS} conq_vert.o metaget: metaget.o - $(CC) -o $@ $(CFLAGS) ${LDFLAGS} metaget.o + $(CC) -o $@ $(CFLAGS) ${LDFLAGS} metaget.o $(EXTRALIBS) setplanet: setplanet.o $(OBJS) $(CC) -o $@ $(CFLAGS) ${LDFLAGS} setplanet.o $(OBJS) Index: cambot.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/tools/cambot.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- cambot.c 27 Apr 2006 00:24:07 -0000 1.4 +++ cambot.c 12 May 2006 03:44:50 -0000 1.5 @@ -41,7 +41,6 @@ int debug; void message_flag(struct message *cur, char *address) {} -int check_command(struct message *mess) {return 0;} void flushSockBuf(void) {} int bounceSBStats(int from) {return 0;} int bouncePingStats(int from) {return 0;} Index: setplanet.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/tools/setplanet.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- setplanet.c 26 Apr 2006 09:52:43 -0000 1.2 +++ setplanet.c 12 May 2006 03:44:50 -0000 1.3 @@ -1,5 +1,8 @@ #include +#include #include +#include +#include #include "defs.h" #include "struct.h" #include "planets.h" @@ -127,6 +130,7 @@ if (verbose) say("%s made %s", pl->pl_name, name); return 1; } + return 0; } /* check for a request to clear a planet flag, and do it */ @@ -138,6 +142,7 @@ if (verbose) say("%s made %s", pl->pl_name, name); return 1; } + return 0; } /* display everything known about a planet in command line format */ Index: mergescores.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/tools/mergescores.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mergescores.c 21 Mar 2005 05:23:47 -0000 1.1 +++ mergescores.c 12 May 2006 03:44:50 -0000 1.2 @@ -25,14 +25,10 @@ */ #include -#include -#include -#include /* for time() */ +#include #include -#include #include #include "defs.h" -#include INC_STRINGS #include INC_FCNTL #include "struct.h" #include "data.h" @@ -100,7 +96,7 @@ lstatus=(struct status *) malloc(sizeof(struct status)); fstatus=(struct status *) malloc(sizeof(struct status)); scanf("%10ld %10d %10d %10d %10d %10lf\n", - &fstatus->time, + (long int *) &fstatus->time, &fstatus->planets, &fstatus->armsbomb, &fstatus->kills, @@ -117,14 +113,14 @@ fprintf(stderr, " Ticks Planets Armsbomb Kills Losses Timeprod\n"); fprintf(stderr, "Loc: %10ld %10d %10d %10d %10d %10lf\n", - lstatus->time, + (long int) lstatus->time, lstatus->planets, lstatus->armsbomb, lstatus->kills, lstatus->losses, lstatus->timeprod); fprintf(stderr, "For: %10ld %10d %10d %10d %10d %10lf\n", - fstatus->time, + (long int) fstatus->time, fstatus->planets, fstatus->armsbomb, fstatus->kills, Index: players.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/tools/players.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- players.c 6 May 2006 12:23:30 -0000 1.6 +++ players.c 12 May 2006 03:44:50 -0000 1.7 @@ -1,10 +1,8 @@ #include #include #include +#include #include -#include -#include -#include #include #include "defs.h" #include "struct.h" Index: newscores.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/tools/newscores.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- newscores.c 30 Sep 2005 05:46:19 -0000 1.2 +++ newscores.c 12 May 2006 03:44:50 -0000 1.3 @@ -9,9 +9,6 @@ #include #include #include -#include -#include -#include #include "defs.h" #include INC_FCNTL #include "struct.h" @@ -60,7 +57,7 @@ } /* ARGSUSED */ -main(argc, argv) +int main(argc, argv) int argc; char **argv; { @@ -72,7 +69,7 @@ printf("Warning: If you do not know how to use this program, break it now!\n"); status=(struct status *) malloc(sizeof(struct status)); scanf("%ld %d %d %d %d %lf\n", - &status->time, + (long int *) &status->time, &status->planets, &status->armsbomb, &status->kills, Index: nuke.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/tools/nuke.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- nuke.c 21 Mar 2005 05:23:47 -0000 1.1 +++ nuke.c 12 May 2006 03:44:50 -0000 1.2 @@ -1,5 +1,7 @@ #include #include "defs.h" +#include "struct.h" +#include "proto.h" int main(int argc, char **argv) { Index: setgalaxy.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/tools/setgalaxy.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- setgalaxy.c 23 Apr 2006 11:21:01 -0000 1.4 +++ setgalaxy.c 12 May 2006 03:44:50 -0000 1.5 @@ -12,6 +12,8 @@ */ #include +#include +#include #include "defs.h" #include "struct.h" #include "planets.h" @@ -288,6 +290,7 @@ } } +#ifdef notused static void CloseUp(int i) { int m, dx, dy, t = 200; dx = (planets[i].pl_x - 50000)/t; @@ -329,6 +332,7 @@ CloseUp(20); CloseUp(30); } +#endif static void CloseUpShop() { int i, m, dx[MAXPLANETS], dy[MAXPLANETS], t = 600; Index: trimscores.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/tools/trimscores.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- trimscores.c 30 Sep 2005 05:46:19 -0000 1.2 +++ trimscores.c 12 May 2006 03:44:50 -0000 1.3 @@ -61,7 +61,7 @@ int fd; struct player j; - int count, kept; + int count, kept = 0; char buf[MAXBUFFER]; int harsh=10; /* How strict we will be with player trimming */ const LONG currenttime = time (NULL); @@ -76,7 +76,7 @@ fprintf(stderr," you're about to lose the player database\n"); status=(struct status *) malloc(sizeof(struct status)); scanf("%10ld %10d %10d %10d %10d %10lf\n", - &status->time, + (long int *) &status->time, &status->planets, &status->armsbomb, &status->kills, Index: showgalaxy.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/tools/showgalaxy.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- showgalaxy.c 21 Mar 2005 05:23:47 -0000 1.1 +++ showgalaxy.c 12 May 2006 03:44:50 -0000 1.2 @@ -364,14 +364,13 @@ int isinput(int delay) { struct timeval timeout; - int reads, writes, excepts; + fd_set reads; - writes=excepts=0; - reads=1; - timeout.tv_sec=delay/10; - timeout.tv_usec=(delay % 10) * 100000; - return (select(1, (fd_set *)&reads, (fd_set *)&writes, (fd_set *)&excepts, - (struct timeval *)&timeout)); + FD_ZERO(&reads); + FD_SET(1, &reads); + timeout.tv_sec = delay/10; + timeout.tv_usec = (delay % 10) * 100000; + return (select(1, &reads, NULL, NULL,&timeout)); } void showPlanets(void) Index: keyman.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/tools/keyman.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- keyman.c 22 Apr 2006 02:16:47 -0000 1.3 +++ keyman.c 12 May 2006 03:44:50 -0000 1.4 @@ -9,7 +9,7 @@ #include #ifdef RSA #include -#include +#include #include #include #include @@ -18,6 +18,7 @@ #include INC_FCNTL #include "struct.h" #include "data.h" +#include "proto.h" #define CATALOG "catalog" From quozl at users.sourceforge.net Thu May 11 22:44:50 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Fri, 12 May 2006 03:44:50 +0000 Subject: [netrek-cvs] server/Vanilla/ntserv commands.c, 1.6, 1.7 daemonII.c, 1.13, 1.14 data.c, 1.7, 1.8 main.c, 1.9, 1.10 ntscmds.c, 1.11, 1.12 openmem.c, 1.4, 1.5 redraw.c, 1.3, 1.4 smessage.c, 1.1, 1.2 Message-ID: Update of /cvsroot/netrek/server/Vanilla/ntserv In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26631/ntserv Modified Files: commands.c daemonII.c data.c main.c ntscmds.c openmem.c redraw.c smessage.c Log Message: merge from jerub darcs 2006-05-12 Index: redraw.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/redraw.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- redraw.c 14 Apr 2006 10:19:17 -0000 1.3 +++ redraw.c 12 May 2006 03:44:48 -0000 1.4 @@ -210,7 +210,7 @@ me->p_wtemp = pl->p_wtemp; me->p_etemp = pl->p_etemp; /* These flags shouldn't be propagated to observers */ -#define NOOBSMASK (PFSELFDEST|PFPLOCK|PFPLLOCK|PFOBSERV) +#define NOOBSMASK (PFWAR|PFREFITTING|PFSELFDEST|PFPLOCK|PFPLLOCK|PFOBSERV) me->p_flags = (pl->p_flags & ~NOOBSMASK) | (me->p_flags & NOOBSMASK); me->p_dir = pl->p_dir; Index: ntscmds.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/ntscmds.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ntscmds.c 6 May 2006 13:12:56 -0000 1.11 +++ ntscmds.c 12 May 2006 03:44:48 -0000 1.12 @@ -226,7 +226,7 @@ { NULL } }; -int check_command(struct message *mess) +int do_check_command(struct message *mess) { return check_2_command(mess, nts_commands, (status->gameup & GU_INROBOT) ? 0 : C_PR_INPICKUP); Index: smessage.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/smessage.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- smessage.c 21 Mar 2005 05:23:44 -0000 1.1 +++ smessage.c 12 May 2006 03:44:48 -0000 1.2 @@ -66,6 +66,13 @@ } +static int (*do_message_post)(struct message *message) = NULL; + +void do_message_post_set(int (*proposed)(struct message *message)) +{ + do_message_post = proposed; +} + void do_message(int recip, int group, char *address, u_char from, const char *fmt, va_list args) { @@ -108,7 +115,10 @@ message_flag(cur,address); cur->m_flags |= MVALID; - if ((cur->m_flags & MINDIV) && (cur->m_recpt == me->p_no) && - (cur->m_from == me->p_no)) - check_command(cur); + if (do_message_post != NULL) { + if ((cur->m_flags & MINDIV) && (cur->m_recpt == me->p_no) && + (cur->m_from == me->p_no)) { + (*do_message_post)(cur); + } + } } Index: openmem.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/openmem.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- openmem.c 6 May 2006 14:02:37 -0000 1.4 +++ openmem.c 12 May 2006 03:44:48 -0000 1.5 @@ -70,6 +70,7 @@ { players = sharedMemory->players; torps = sharedMemory->torps; + context = sharedMemory->context; status = sharedMemory->status; planets = sharedMemory->planets; phasers = sharedMemory->phasers; Index: data.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/data.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- data.c 6 May 2006 12:06:39 -0000 1.7 +++ data.c 12 May 2006 03:44:48 -0000 1.8 @@ -9,6 +9,7 @@ struct player *players; struct player *me; struct torp *torps; +struct context *context; struct status *status; struct ship *myship; struct stats *mystats; Index: commands.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/commands.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- commands.c 6 May 2006 12:05:57 -0000 1.6 +++ commands.c 12 May 2006 03:44:48 -0000 1.7 @@ -507,8 +507,7 @@ return what; } -check_listing(comm) -char *comm; +int check_listing(char *comm) { register int i; @@ -675,9 +674,7 @@ /* ARGSUSED */ -int do_help(comm,mess) -char *comm; -struct message *mess; +int do_help(char *comm, struct message *mess) { int who; int i; @@ -748,63 +745,52 @@ votes[i].type, ch, votes[i].desc); } } - return; + return 0; } #ifndef INL /*** QUERIES ***/ -send_query(which,who,from) -char which; -int who, from; +int send_query(char which, int who, int from) { pmessage2(who, MINDIV, " ", from, "%c", which); + return 0; } /* ARGSUSED */ -do_client_query(comm,mess,who) -char *comm; -struct message *mess; -int who; +int do_client_query(char *comm, struct message *mess, int who) { #ifdef RSA send_query('#', who, mess->m_from); #endif + return 0; } /* ARGSUSED */ -do_ping_query(comm,mess,who) -char *comm; -struct message *mess; -int who; +int do_ping_query(char *comm, struct message *mess, int who) { - send_query('!', who, mess->m_from); + send_query('!', who, mess->m_from); + return 0; } /* ARGSUSED */ -do_stats_query(comm,mess,who) -char *comm; -struct message *mess; -int who; +int do_stats_query(char *comm, struct message *mess, int who) { - send_query('?', who, mess->m_from); + send_query('?', who, mess->m_from); + return 0; } /* ARGSUSED */ -do_whois_query(comm,mess,who) -char *comm; -struct message *mess; -int who; +int do_whois_query(char *comm, struct message *mess, int who) { - send_query('@', who, mess->m_from); + send_query('@', who, mess->m_from); + return 0; } #ifdef RSA -int bounceRSAClientType(from) -int from; +int bounceRSAClientType(int from) { bounce(from,"Client: %s", RSA_client_type); - return 1; } #endif @@ -869,9 +855,7 @@ return 1; } -int -bounceSBStats(from) - int from; +int bounceSBStats(int from) { float sessionRatio, sessionKPH, sessionDPH, overallKPH, overallDPH, overallRatio; @@ -961,8 +945,7 @@ #ifdef PING -int bouncePingStats(from) -int from; +int bouncePingStats(int from) { if(me->p_avrt == -1){ /* client doesn't support it or server not pinging */ @@ -986,34 +969,28 @@ #if !defined (DOG) && !defined (PUCK) /* Server only */ /* ARGSUSED */ -do_sbstats_query(comm,mess,who) -char *comm; -struct message *mess; -int who; +int do_sbstats_query(char *comm, struct message *mess, int who) { - send_query('^', who, mess->m_from); + send_query('^', who, mess->m_from); + return 0; } #ifdef GENO_COUNT -do_genos_query(comm,mess,who) -char *comm; -struct message *mess; -int who; +int do_genos_query(char *comm, struct message *mess, int who) { char *addr; addr = addr_mess(mess->m_from,MINDIV); pmessage(mess->m_from, MINDIV, addr, "%s has won the game %d times.", players[who].p_name,players[who].p_stats.st_genos); + return 0; } #endif /* ARGSUSED */ #if !defined (BASEP) || !defined(BASEPRACTICE) -do_time_msg(comm,mess) -char *comm; -struct message *mess; +int do_time_msg(char *comm, struct message *mess) { int who; int t; @@ -1029,6 +1006,7 @@ } else { pmessage(who, MINDIV, addr, "The %s have %d minutes left before they surrender.", team_name(t), teams[t].s_surrender); } + return 0; } /* @@ -1036,9 +1014,7 @@ */ /* ARGSUSED */ -do_queue_msg(comm,mess) -char *comm; -struct message *mess; +int do_queue_msg(char *comm, struct message *mess) { int who; char *addr; @@ -1059,6 +1035,7 @@ pmessage(who, MINDIV, addr, "There is no one on the %s queue.", queues[i].q_name); } + return 0; } #endif Index: main.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/main.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- main.c 6 May 2006 12:06:39 -0000 1.9 +++ main.c 12 May 2006 03:44:48 -0000 1.10 @@ -123,6 +123,7 @@ /* this finds the shared memory information */ openmem(1); + do_message_post_set(do_check_command); readsysdefaults(); #ifdef FEATURE_PACKETS Index: daemonII.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/daemonII.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- daemonII.c 6 May 2006 12:06:39 -0000 1.13 +++ daemonII.c 12 May 2006 03:44:48 -0000 1.14 @@ -228,6 +228,7 @@ status->kills=10; status->losses=10; } + context->daemon = getpid(); #undef wait @@ -4488,14 +4489,6 @@ } } -/* dummy check_command to fool do_message() */ - -int check_command(struct message *mess) { - /* get rid of annoying compiler warning */ - if (mess) ; - return 1; -} - void message_flag(struct message *cur, char *address) { if(arg[0] != DINVALID){ From quozl at users.sourceforge.net Thu May 11 22:44:51 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Fri, 12 May 2006 03:44:51 +0000 Subject: [netrek-cvs] server/Vanilla/robotd assault.c, 1.2, 1.3 decide.c, 1.3, 1.4 defs.h, 1.4, 1.5 robot.c, 1.3, 1.4 Message-ID: Update of /cvsroot/netrek/server/Vanilla/robotd In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26631/robotd Modified Files: assault.c decide.c defs.h robot.c Log Message: merge from jerub darcs 2006-05-12 Index: defs.h =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robotd/defs.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- defs.h 22 Apr 2006 02:16:46 -0000 1.4 +++ defs.h 12 May 2006 03:44:48 -0000 1.5 @@ -227,7 +227,7 @@ /* client version of UDPDIAG */ #define UDPDIAG(x) { if (udpDebug) { printf("UDP: "); printf x; }} #define V_UDPDIAG(x) /*UDPDIAG(x)*/ -#endif +#endif /* ATM */ #define RANDOM() rand() #define SRANDOM(x) srand(x) Index: decide.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robotd/decide.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- decide.c 22 Apr 2006 02:16:46 -0000 1.3 +++ decide.c 12 May 2006 03:44:48 -0000 1.4 @@ -238,18 +238,21 @@ else if(!unknownpl(_state.assault_planet) && _state.assault_planet->pl_armies < 5){ unassault_c("already bombed."); + check_ogg(NULL,20000); /* test JKH */ check_bomb(NULL); return; } if(myteam_bombing(_state.assault_planet, _state.assault_planet->pl_mydist)){ unassault_c("somebody else bombing"); + check_ogg(NULL,20000); /* test JKH */ check_bomb(NULL); return; } if(_state.assault_planet->pl_mydist < 20000 && pl_defended(_state.assault_planet, 2)){ unassault_c("planet defended"); + check_ogg(NULL,20000); /* test JKH */ check_bomb(NULL); return; } Index: robot.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robotd/robot.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- robot.c 22 Apr 2006 02:16:46 -0000 1.3 +++ robot.c 12 May 2006 03:44:48 -0000 1.4 @@ -626,6 +626,7 @@ && MYFUEL() > 25) req_detonate(""); #endif + #ifdef nodef /* debug */ if(num_hits > 0 && me->p_speed > 6){ Index: assault.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robotd/assault.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- assault.c 22 Apr 2006 02:16:46 -0000 1.2 +++ assault.c 12 May 2006 03:44:48 -0000 1.3 @@ -43,6 +43,30 @@ } } +/* determine if there is risk of death due to res of opponent */ +static int risk_res_death(struct planet *pl) +{ + if (pl == NULL) return 0; + /* One of the home planets identified by server etc/sysdef PLANETS */ + if (pl->pl_flags & PLHOME) return 1; + /* Altair in standard position */ + if (pl->pl_no == 7 && pl->pl_x == 11000 && pl->pl_y == 75000) return 1; + /* Draconis in standard position */ + if (pl->pl_no == 16 && pl->pl_x == 28000 && pl->pl_y == 23000) return 1; + /* Scorpii in standard position */ + if (pl->pl_no == 26 && pl->pl_x == 70720 && pl->pl_y == 26320) return 1; + /* Within rectangular phaser distance of any home planet res point */ + int i; + for (i=0,pl=planets;ipl_flags & PLHOME) { + if(ABS(pl->pl_x - me->p_x) < 12000 && ABS(pl->pl_y - me->p_y) < 12000) { + return 1; + } + } + } + return 0; +} + goto_assault_planet() { Player *e = _state.closest_e; @@ -70,9 +94,18 @@ /* bug -- crashes into people */ /* don't cloak if we're far from planet */ + /* start within assuming you don't need cloak */ + cloak = 0; + if(!inl && pdist > 20000) cloak = 0; + /* cloak bomb near enemy core, so you don't get res-killed */ + + if (pdist < 7000) { + if (risk_res_death(pl)) cloak = 1; + } + if(pdist < 10000 && edist < 18000) cloak = 1; @@ -135,22 +168,32 @@ assault_planet() { - Player *e = _state.closest_e; - struct player *j = e?e->p:NULL; - struct planet *pl = _state.assault_planet; - int armies = pl->pl_armies; + Player *e = _state.closest_e; + struct player *j = e?e->p:NULL; + struct planet *pl = _state.assault_planet; + int cloak; + int armies = pl->pl_armies; #ifdef nodef if(!do_cloak(0)) req_cloak_off(); #endif - if(e && e->p && isAlive(e->p)){ - if(e->dist < 10000) - req_cloak_on(); - else - req_cloak_off("enemy farther than 10000"); + + cloak=0; /* start assuming you don't need to cloak */ + + if (e && e->p && isAlive(e->p)){ /* cloak when enemy is near */ + if(e->dist < 10000) { + cloak=1; + } } - + + /* cloak bomb near enemy core, so you don't get res-killed */ + if (risk_res_death(pl)) cloak = 1; + + if(cloak) + req_cloak_on(); + else + req_cloak_off("no cloak in assault_planet()"); if(armies > 4){ req_bomb(); From quozl at users.sourceforge.net Thu May 11 22:44:50 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Fri, 12 May 2006 03:44:50 +0000 Subject: [netrek-cvs] server/Vanilla/res-rsa configure.in,1.1,1.2 Message-ID: Update of /cvsroot/netrek/server/Vanilla/res-rsa In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26631/res-rsa Modified Files: configure.in Log Message: merge from jerub darcs 2006-05-12 Index: configure.in =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/res-rsa/configure.in,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- configure.in 21 Mar 2005 05:23:44 -0000 1.1 +++ configure.in 12 May 2006 03:44:48 -0000 1.2 @@ -53,65 +53,63 @@ # If GMP directory was specified, do some smart checking if test "$GMP_DIR" != ""; then - # prefix the search path with the provided path GMP_PATH="$GMP_DIR $GMP_PATH" + fi - # search for the header file - AC_MSG_CHECKING(for local gmp.h) + # search for the header file + AC_MSG_CHECKING(for local gmp.h) + + for path in $GMP_PATH; do + if test -r $path/gmp.h; then + GMP_VER=1 + GMP_INC="-I$path" + break + fi + if test -r $path/include/gmp.h; then + GMP_VER=1 + GMP_INC="-I$path/include" + break + fi + done + + if test $GMP_VER = 1; then + AC_MSG_RESULT(found in $GMP_INC) + else + AC_MSG_RESULT(not found) + fi + + # search for the library file only if header was found + if test $GMP_VER = 1; then + + GMP_VER=0 + + AC_MSG_CHECKING(for local libgmp.a) for path in $GMP_PATH; do - if test -r $path/gmp.h; then + if test -r $path/libgmp.a; then GMP_VER=1 - GMP_INC="-I$path" + GMP_LIB="-L$path" break fi - if test -r $path/include/gmp.h; then + if test -r $path/lib/libgmp.a; then GMP_VER=1 - GMP_INC="-I$path/include" + GMP_LIB="-L$path/lib" break fi done - if test $GMP_VER = 1; then - AC_MSG_RESULT(found in $GMP_INC) + AC_MSG_RESULT(found in $GMP_LIB) else AC_MSG_RESULT(not found) fi - # search for the library file only if header was found + # Check for GMP2 if test $GMP_VER = 1; then - - GMP_VER=0 - - AC_MSG_CHECKING(for local libgmp.a) - - for path in $GMP_PATH; do - if test -r $path/libgmp.a; then - GMP_VER=1 - GMP_LIB="-L$path" - break - fi - if test -r $path/lib/libgmp.a; then - GMP_VER=1 - GMP_LIB="-L$path/lib" - break - fi - done - if test $GMP_VER = 1; then - AC_MSG_RESULT(found in $GMP_LIB) - else - AC_MSG_RESULT(not found) - fi - - # Check for GMP2 - if test $GMP_VER = 1; then - LDOLD="$LDFLAGS" - LDFLAGS="$GMP_LIB -lgmp" - AC_CHECK_LIB(gmp, mpz_fdiv_q_ui, AC_DEFINE(HAVE_LIB_GMP2) GMP_VER=2) - LDFLAGS="$LDOLD" - fi - + LDOLD="$LDFLAGS" + LDFLAGS="$GMP_LIB -lgmp" + AC_CHECK_LIB(gmp, mpz_fdiv_q_ui, AC_DEFINE(HAVE_LIB_GMP2) GMP_VER=2) + LDFLAGS="$LDOLD" fi fi From quozl at users.sourceforge.net Thu May 11 22:44:50 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Fri, 12 May 2006 03:44:50 +0000 Subject: [netrek-cvs] server/Vanilla/include data.h, 1.5, 1.6 proto.h, 1.8, 1.9 struct.h, 1.8, 1.9 Message-ID: Update of /cvsroot/netrek/server/Vanilla/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26631/include Modified Files: data.h proto.h struct.h Log Message: merge from jerub darcs 2006-05-12 Index: data.h =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/include/data.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- data.h 26 Apr 2006 09:52:43 -0000 1.5 +++ data.h 12 May 2006 03:44:48 -0000 1.6 @@ -57,6 +57,7 @@ extern struct player *players; extern struct player *me; extern struct torp *torps; +extern struct context *context; extern struct status *status; extern struct ship *myship; extern struct stats *mystats; Index: struct.h =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/include/struct.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- struct.h 26 Apr 2006 09:52:43 -0000 1.8 +++ struct.h 12 May 2006 03:44:48 -0000 1.9 @@ -72,6 +72,10 @@ /* End of waitq related stuff */ +struct context { + int daemon; /* pid_t of daemon */ +}; + struct status { int active; u_char tourn; /* Tournament mode? */ @@ -80,6 +84,7 @@ /* Use long for this, so it never wraps */ double timeprod; int gameup; + /* CAUTION, adding to this struct invalidates var/global */ }; /* The following defines are for gameup field */ @@ -592,6 +597,7 @@ struct memory { struct player players[MAXPLAYER]; struct torp torps[MAXPLAYER * (MAXTORP + MAXPLASMA)]; + struct context context[1]; struct status status[1]; struct planet planets[MAXPLANETS]; struct phaser phasers[MAXPLAYER]; Index: proto.h =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/include/proto.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- proto.h 6 May 2006 14:02:37 -0000 1.8 +++ proto.h 12 May 2006 03:44:48 -0000 1.9 @@ -148,7 +148,7 @@ int bounceRSAClientType(int from); #endif int bounceWhois(int from); -int check_command(struct message *mess); +int do_check_command(struct message *mess); /* openmem.c */ int openmem(int trystart); @@ -203,9 +203,11 @@ /* smessage.c */ void bounce(int bounceto, const char *, ...); +void lmessage(const char *fmt, ...); void pmessage(int recip, int group, char *address, const char *, ...); void pmessage2(int recip, int group, char *address, u_char from, const char *, ...); +void do_message_post_set(int (*proposed)(struct message *message)); /* socket.c */ struct player_spacket; From quozl at users.sourceforge.net Thu May 11 22:44:50 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Fri, 12 May 2006 03:44:50 +0000 Subject: [netrek-cvs] server/Vanilla/newstartd newstartd.c,1.9,1.10 Message-ID: Update of /cvsroot/netrek/server/Vanilla/newstartd In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26631/newstartd Modified Files: newstartd.c Log Message: merge from jerub darcs 2006-05-12 Index: newstartd.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/newstartd/newstartd.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- newstartd.c 8 May 2006 08:50:21 -0000 1.9 +++ newstartd.c 12 May 2006 03:44:48 -0000 1.10 @@ -41,6 +41,7 @@ #include #include #include +#include #include #include "defs.h" From quozl at users.sourceforge.net Thu May 11 22:44:50 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Fri, 12 May 2006 03:44:50 +0000 Subject: [netrek-cvs] server/Vanilla/docs README.newbie,1.1,1.2 Message-ID: Update of /cvsroot/netrek/server/Vanilla/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26631/docs Modified Files: README.newbie Log Message: merge from jerub darcs 2006-05-12 Index: README.newbie =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/docs/README.newbie,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- README.newbie 21 Mar 2005 05:23:34 -0000 1.1 +++ README.newbie 12 May 2006 03:44:47 -0000 1.2 @@ -39,7 +39,16 @@ o Compile and install the server according to the instructions in the INSTALL file. -o Edit .sysdef and set NEWBIE=1. +o Edit sysdef in the /etc directory and set NEWBIE=1. + +o Edit ports in the same directory as sysdef. + + Uncomment these lines: + 3592 ntserv "ntserv" -q 10 + 2592 ntserv "ntserv" -q 9 + + and comment this line: + 2592 ntserv "ntserv" TODO: Automate the following: From quozl at users.sourceforge.net Thu May 11 22:44:49 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Fri, 12 May 2006 03:44:49 +0000 Subject: [netrek-cvs] server/Vanilla ChangeLog, 1.42, 1.43 NEWS, 1.21, 1.22 PROJECTS, 1.10, 1.11 configure.in, 1.5, 1.6 Message-ID: Update of /cvsroot/netrek/server/Vanilla In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26631 Modified Files: ChangeLog NEWS PROJECTS configure.in Log Message: merge from jerub darcs 2006-05-12 Index: NEWS =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/NEWS,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- NEWS 6 May 2006 12:28:20 -0000 1.21 +++ NEWS 12 May 2006 03:44:47 -0000 1.22 @@ -1,3 +1,4 @@ +- fix practice robots to cloak when bombing near home planet [Huang] - fix INL confine to knock ships out of orbit [Cameron] - describe a local unnamed server as "server on this computer" [Cameron] - fix cambot regression [Cameron] Index: ChangeLog =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ChangeLog,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- ChangeLog 8 May 2006 08:22:41 -0000 1.42 +++ ChangeLog 12 May 2006 03:44:47 -0000 1.43 @@ -1,3 +1,9 @@ + +Mon May 8 18:35:57 2006 Bill Balcerski + + * PROJECTS, ntserv/redraw.c: fix to bug where observer locks + onto robot and cannot input any other commands + Mon May 8 18:18:38 2006 James Cameron * pledit: fix compilation warnings under GCC 4.0.3 with -Wall. Index: PROJECTS =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/PROJECTS,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- PROJECTS 6 May 2006 12:17:29 -0000 1.10 +++ PROJECTS 12 May 2006 03:44:47 -0000 1.11 @@ -3,6 +3,11 @@ List of things to do in the future + - factorise message insertion, and maintenance of mc_current, + as it is distributed all over the code. + + - add a "who am i t-mode against?" + - list connection failure scenarios and response by server, so that we can reduce jammed slots. @@ -79,11 +84,6 @@ their viewpoint. Only when twarping is over, you can swap again [Shadow.Hunter at netrek.org] - - You can always lock onto an independent ship (Iggy) - (->planets too?) but after doing that you cannot revert to - observing your own team anymore. Bummer ;-( - [Shadow.Hunter at netrek.org] - - tools/update.c sa_sigaction not present on NetBSD. [Hietbrink] - 'transwarp 0 off' to prevent slot 0 from transwarping. [Swasey] @@ -142,11 +142,10 @@ - need generic shared memory dump tool to assist diagnosis. - - revisit syntax of .metaservers file to aid understanding, + - revisit syntax of metaservers file to aid understanding, - compile with -Wall and fix the problems. - [done ntserv, quozl at us.netrek.org] - [big set of prototypes missing in tools/cambot.c, quozl] + [yet to do: crypt(3), sigsetmask(2), keyman, keycomp, & xsg] - observers, allow them to have a ship of their own that is ineffective and invisible to others. Index: configure.in =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/configure.in,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- configure.in 22 Feb 2006 09:18:30 -0000 1.5 +++ configure.in 12 May 2006 03:44:47 -0000 1.6 @@ -241,7 +241,7 @@ #-------------------------------------------------------------------- AC_MSG_CHECKING(for mp.h) -AC_ARG_WITH(gmp-incdir,[ --with-gmp-incdir GMP Include Dir], MPINC="-I$withval" search=false, MPINC=nope) +AC_ARG_WITH(gmp,[ --with-gmp GMP Dir], MPINC="-I$withval/include" MPLIB="-L$withval/lib -lgmp" search=false, MPINC=nope MPLIB=nope) if test "$MPINC" = nope; then AC_EGREP_CPP( GNU_MP,[ #include @@ -296,7 +296,6 @@ ],AC_DEFINE(HAVE_GMP2_H)) INCS="$SAVEINCS" -AC_ARG_WITH(gmp-libdir,[ --with-gmp-libdir GMP Library Dir], MPLIB="-L$withval -lgmp" search=false, MPLIB=nope) if test "$MPLIB" = nope; then if test "$search" = true; then MPLIB=nope @@ -378,6 +377,7 @@ # AC _CHECK_LIB(V3, main, [LIBS="$LIBS -lV3"]) # AC _CHECK_LIB(PW, main, [LIBS="$LIBS -lPW"]) AC_CHECK_LIB(socket, main, [LIBS="$LIBS -lsocket"]) +AC_CHECK_LIB(resolv, main, [LIBS="$LIBS -lresolv"]) AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"]) AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"]) AC_CHECK_LIB(seq, main, [LIBS="$LIBS -lseq"]) @@ -512,6 +512,7 @@ docs/sample_geno_timer_crontab docs/sample_sysdef) if test "x$GUM" = xdo_gum; then +ifdef([AC_OUTPUT_SUBDIRS],[], [AC_DEFUN([AC_OUTPUT_SUBDIRS],[subdirs=$1; _AC_OUTPUT_SUBDIRS])]) AC_OUTPUT_SUBDIRS(gum) fi From modemhero at users.sourceforge.net Fri May 12 15:49:10 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 20:49:10 +0000 Subject: [netrek-cvs] client/netrekxp/resources/planlibm/color - New directory Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/planlibm/color In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv31456/color Log Message: Directory /cvsroot/netrek/client/netrekxp/resources/planlibm/color added to the repository From modemhero at users.sourceforge.net Fri May 12 15:51:33 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 20:51:33 +0000 Subject: [netrek-cvs] client/netrekxp/src local.c, 1.20, 1.21 mswindow.c, 1.17, 1.18 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv32180/src Modified Files: local.c mswindow.c Log Message: Double buffering. Fix to background stars and short packets. New IND bitmaps Addition of some new color planets to plant library, Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- mswindow.c 12 May 2006 01:58:38 -0000 1.17 +++ mswindow.c 12 May 2006 20:51:31 -0000 1.18 @@ -1436,7 +1436,7 @@ r.left = max (x, border); r.right = min (x + width, win->ClipRect.right); if (r.right < r.left) - return; //Horizantal extents do not overlap + return; //Horizontal extents do not overlap r.top = max (y, border); r.bottom = min (y + height, win->ClipRect.bottom); if (r.bottom < r.top) @@ -1479,7 +1479,7 @@ r.left = max (x, border); r.right = min (x + width, win->ClipRect.right); if (r.right < r.left) - return; //Horizantal extents do not overlap + return; //Horizontal extents do not overlap r.top = max (y, border); r.bottom = min (y + height, win->ClipRect.bottom); if (r.bottom < r.top) @@ -1554,7 +1554,7 @@ r.left = max (x, border); r.right = min (x + width, win->ClipRect.right); if (r.right < r.left) - continue; //Horizantal extents do not overlap + continue; //Horizontal extents do not overlap r.top = max (y, border); r.bottom = min (y + height, win->ClipRect.bottom); if (r.bottom < r.top) @@ -3303,7 +3303,7 @@ r.left = max (x, border); r.right = min (x + ext.cx, win->ClipRect.right); if (r.right < r.left) - return; //Horizantal extents do not overlap + return; //Horizontal extents do not overlap r.top = max (y, border); r.bottom = min (y + ext.cy, win->ClipRect.bottom); if (r.bottom < r.top) @@ -5318,7 +5318,7 @@ r.left = max (x, border); r.right = min (x + width, win->ClipRect.right); if (r.right < r.left) - return; //Horizantal extents do not overlap + return; //Horizontal extents do not overlap r.top = max (y, border); r.bottom = min (y + height, win->ClipRect.bottom); if (r.bottom < r.top) @@ -5355,7 +5355,7 @@ r.left = max (x, border); r.right = min (x + width, win->ClipRect.right); if (r.right < r.left) - return; //Horizantal extents do not overlap + return; //Horizontal extents do not overlap r.top = max (y, border); r.bottom = min (y + height, win->ClipRect.bottom); if (r.bottom < r.top) @@ -5418,7 +5418,7 @@ r.left = max (x, border); r.right = min (x + width, win->ClipRect.right); if (r.right < r.left) - continue; //Horizantal extents do not overlap + continue; //Horizontal extents do not overlap r.top = max (y, border); r.bottom = min (y + height, win->ClipRect.bottom); if (r.bottom < r.top) @@ -5750,7 +5750,7 @@ r.left = max (x, border); r.right = min (x + ext.cx, win->ClipRect.right); if (r.right < r.left) - return; //Horizantal extents do not overlap + return; //Horizontal extents do not overlap r.top = max (y, border); r.bottom = min (y + ext.cy, win->ClipRect.bottom); if (r.bottom < r.top) @@ -5850,14 +5850,13 @@ register struct Icon *bitmap = (struct Icon *) icon; register int borderx, bordery, width, height; register int srcx, srcy; - HDC hdc; HBITMAP newbmp; XFORM xForm; double radians; float cosine, sine, Point1x, Point1y, Point2x, Point2y, Point3x, Point3y; float xscale, yscale; float eDx, eDy; - + //Fast (I hope) rectangle intersection, don't overwrite our borders srcx = bitmap->x; srcy = bitmap->y; @@ -5868,15 +5867,12 @@ width = bitmap->width; height = bitmap->height; - -// hdc = GetDC (bitmap->hwnd); -// newbmp = CreateCompatibleBitmap ( hdc, width, height ); + newbmp = CreateCompatibleBitmap ( sdb->mem_dc, width, height ); if (NetrekPalette) { - // SelectPalette (hdc, NetrekPalette, FALSE); - // RealizePalette (hdc); + SelectPalette (sdb->mem_dc, NetrekPalette, FALSE); RealizePalette (sdb->mem_dc); } @@ -5888,8 +5884,6 @@ //Set the color of the bitmap //(oddly enough, 1-bit = bk color, 0-bit = text (fg) color) - // SetBkColor (hdc, colortable[color].rgb); - // SetTextColor (hdc, colortable[BLACK].rgb); SetBkColor (sdb->mem_dc, colortable[color].rgb); SetTextColor (sdb->mem_dc, colortable[BLACK].rgb); @@ -5916,9 +5910,9 @@ eDx = x + xscale - cosine*(xscale) + sine*(yscale); eDy = y + yscale - cosine*(yscale) - sine*(xscale); - // SetGraphicsMode(hdc,GM_ADVANCED); - // SetGraphicsMode(sdb->mem_dc,GM_ADVANCED); + // SetGraphicsMode(sdb->mem_dc,GM_ADVANCED); + xForm.eM11=cosine/SCALEX; xForm.eM12=sine/SCALEX; xForm.eM21=-sine/SCALEY; @@ -5926,13 +5920,11 @@ xForm.eDx = eDx; xForm.eDy = eDy; - // SetWorldTransform(hdc,&xForm); + SetStretchBltMode(sdb->mem_dc, COLORONCOLOR); // SetWorldTransform(sdb->mem_dc,&xForm); - // BitBlt(hdc, 0, 0, width, height, GlobalMemDC2, 0, 0, SRCPAINT); - //BitBlt(sdb->mem_dc, 0, 0, width, height, GlobalMemDC2, 0, 0, SRCPAINT); - BitBlt (sdb->mem_dc, x, y, width, height, GlobalMemDC2, 0, 0, SRCPAINT); - // StretchBlt(sdb->mem_dc, x, y, (int)(width/SCALEX), (int)(height/SCALEY), GlobalMemDC2, 0, 0, width, height, SRCCOPY); -// ReleaseDC (bitmap->hwnd, hdc); + // BitBlt(hdc, 0, 0, width, height, GlobalMemDC2, 0, 0, SRCPAINT); + // BitBlt(sdb->mem_dc, 0, 0, width, height, GlobalMemDC2, 0, 0, SRCPAINT); + StretchBlt(sdb->mem_dc, x, y, (int)(width/SCALEX), (int)(height/SCALEY), GlobalMemDC2, 0, 0, width, height, SRCPAINT); DeleteObject (newbmp); } Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- local.c 12 May 2006 01:58:37 -0000 1.20 +++ local.c 12 May 2006 20:51:31 -0000 1.21 @@ -65,7 +65,7 @@ static void redrawStarSector(int sectorx, int sectory); -#define scaleLocal(pt) ((pt) + (WINSIDE/2)) +#define scaleLocal(pt) ((pt)/SCALE + (WINSIDE/2)) int fullview = WINSIDE * SCALE; int view = WINSIDE * SCALE / 2; @@ -259,8 +259,8 @@ dyy = (int) (Sin[mydir] * streaklength); for (i = 0, s = star_sector; i < 16; i++, s++) { - dx = (s->s_x + xbase)/SCALE - me->p_x/SCALE; - dy = (s->s_y + ybase)/SCALE - me->p_y/SCALE; + dx = (s->s_x + xbase) - (me->p_x - (me->p_x % 40)); + dy = (s->s_y + ybase) - (me->p_y - (me->p_y % 40)); if (ABS(dx) > (view) || ABS(dy) > (view)) continue; @@ -283,11 +283,8 @@ } for (i = 0, s = star_sector; i < 16; i++, s++) { - int px, py; - px = me->p_x % 40; - py = me->p_y % 40; - dx = (s->s_x + xbase)/SCALE - me->p_x/SCALE; - dy = (s->s_y + ybase)/SCALE - me->p_y/SCALE; + dx = (s->s_x + xbase) - (me->p_x - (me->p_x % 40)); + dy = (s->s_y + ybase) - (me->p_y - (me->p_y % 40)); if (ABS(dx) > (view) || ABS(dy) > (view)) continue; From modemhero at users.sourceforge.net Fri May 12 15:51:33 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 20:51:33 +0000 Subject: [netrek-cvs] client/netrekxp/win32 config.h,1.9,1.10 Message-ID: Update of /cvsroot/netrek/client/netrekxp/win32 In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv32180/win32 Modified Files: config.h Log Message: Double buffering. Fix to background stars and short packets. New IND bitmaps Addition of some new color planets to plant library, Index: config.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/win32/config.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- config.h 12 May 2006 01:58:39 -0000 1.9 +++ config.h 12 May 2006 20:51:31 -0000 1.10 @@ -127,7 +127,7 @@ #define RACE_COLORS /* DOUBLE_BUFFERING - paint using double buffering to remove flicker */ -//#define DOUBLE_BUFFERING +#define DOUBLE_BUFFERING #define PLIST1 #define PLIST From modemhero at users.sourceforge.net Fri May 12 15:51:33 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 20:51:33 +0000 Subject: [netrek-cvs] client/netrekxp/resources/planlibm/color agri1.bmp, NONE, 1.1 agri2.bmp, NONE, 1.1 earth.bmp, NONE, 1.1 klingus.bmp, NONE, 1.1 orion.bmp, NONE, 1.1 rock1.bmp, NONE, 1.1 romulus.bmp, NONE, 1.1 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/planlibm/color In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv32180/resources/planlibm/color Added Files: agri1.bmp agri2.bmp earth.bmp klingus.bmp orion.bmp rock1.bmp romulus.bmp Log Message: Double buffering. Fix to background stars and short packets. New IND bitmaps Addition of some new color planets to plant library, --- NEW FILE: earth.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: orion.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: agri1.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: romulus.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: agri2.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: rock1.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: klingus.bmp --- (This appears to be a binary file; contents omitted.) From modemhero at users.sourceforge.net Fri May 12 15:51:32 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 20:51:32 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.19, 1.20 clientr.suo, 1.1, 1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv32180 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Double buffering. Fix to background stars and short packets. New IND bitmaps Addition of some new color planets to plant library, Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- NetrekXP to do list.C 12 May 2006 01:54:18 -0000 1.19 +++ NetrekXP to do list.C 12 May 2006 20:51:30 -0000 1.20 @@ -17,8 +17,7 @@ 4a) observer sound messes up when someone flips shields at warp 0, again a server problem 4b) Locking onto robot cause the observer sound to mess up for shields up/down (this is server side problem, for the shield packet not being sent) -5) KWINNER called to all players at genocide, not KGENOCIDE, and observers don't get -any state at all (head to default which is error message) - short packets! +5) Observers don't get any geno message at all (head to default which is error message) - short packets! 6) Can't bomb enemy 3rd space planets in your T-mode opponent's space. Things to do: @@ -37,11 +36,11 @@ 5) A lot of annoying pop up windows (like macro window, default controls) should be closeable by shift right click. 6) With new scaling function, implement Defcom's new bitmaps -6a) Issue with flickering. 6b) Border issue 6c) The new smooth turning only working on self, not obs or others - short packets! 7) login not read in before metaserver info (for metablocking purposes) -8) Border issue on galaxy map - not using right border width for draw purposes +8) Border issue on galaxy map - not using right border width for draw purposes, top and right +borders get overwritten by 1 space. It's an issue in COW too. 10) double buffering not working with new bitmaps Stas's list: Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsImoOZ7 and /tmp/cvshpdiV1 differ From modemhero at users.sourceforge.net Fri May 12 15:51:33 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 20:51:33 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt,1.41,1.42 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv32180/resources/docs Modified Files: changes.txt Log Message: Double buffering. Fix to background stars and short packets. New IND bitmaps Addition of some new color planets to plant library, Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- changes.txt 12 May 2006 01:54:18 -0000 1.41 +++ changes.txt 12 May 2006 20:51:30 -0000 1.42 @@ -1,4 +1,5 @@ Version TBA: +- double buffering now in (to reduce flicker) - added link to genocide.netrek.org newbie manual to replace broken link - fix to background star jumpiness with short packets off - fixed a bunch of stray pixels in mono color and tinted GA bitmaps From modemhero at users.sourceforge.net Fri May 12 15:51:33 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 12 May 2006 20:51:33 +0000 Subject: [netrek-cvs] client/netrekxp/resources/ships/highres indshipHR.bmp, 1.3, 1.4 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/ships/highres In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv32180/resources/ships/highres Modified Files: indshipHR.bmp Log Message: Double buffering. Fix to background stars and short packets. New IND bitmaps Addition of some new color planets to plant library, Index: indshipHR.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/highres/indshipHR.bmp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 Binary files /tmp/cvsV3guDk and /tmp/cvssHP0Te differ From modemhero at users.sourceforge.net Fri May 12 22:37:38 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 13 May 2006 03:37:38 +0000 Subject: [netrek-cvs] client/netrekxp/resources/weaplibm/color mtorpC.bmp, 1.2, 1.3 torpC.bmp, 1.1, 1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/weaplibm/color In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv4789/resources/weaplibm/color Modified Files: mtorpC.bmp torpC.bmp Log Message: New ori GA color1 bitmaps Index: mtorpC.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/weaplibm/color/mtorpC.bmp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvs1csEkR and /tmp/cvsfJZRqL differ Index: torpC.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/weaplibm/color/torpC.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsvUl0gQ and /tmp/cvsV1hxpK differ From modemhero at users.sourceforge.net Fri May 12 22:37:38 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 13 May 2006 03:37:38 +0000 Subject: [netrek-cvs] client/netrekxp/src/cursors curslib.vcproj.BB.Bill.user, 1.1, NONE Message-ID: Update of /cvsroot/netrek/client/netrekxp/src/cursors In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv4789/src/cursors Removed Files: curslib.vcproj.BB.Bill.user Log Message: New ori GA color1 bitmaps --- curslib.vcproj.BB.Bill.user DELETED --- From modemhero at users.sourceforge.net Fri May 12 22:37:38 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 13 May 2006 03:37:38 +0000 Subject: [netrek-cvs] client/netrekxp/resources/ships/color1/ori ori_ga01.bmp, 1.1, 1.2 ori_ga02.bmp, 1.1, 1.2 ori_ga03.bmp, 1.1, 1.2 ori_ga04.bmp, 1.1, 1.2 ori_ga05.bmp, 1.1, 1.2 ori_ga06.bmp, 1.1, 1.2 ori_ga07.bmp, 1.1, 1.2 ori_ga08.bmp, 1.1, 1.2 ori_ga09.bmp, 1.1, 1.2 ori_ga10.bmp, 1.1, 1.2 ori_ga11.bmp, 1.1, 1.2 ori_ga12.bmp, 1.1, 1.2 ori_ga13.bmp, 1.1, 1.2 ori_ga14.bmp, 1.1, 1.2 ori_ga15.bmp, 1.1, 1.2 ori_ga16.bmp, 1.1, 1.2 ori_ga17.bmp, 1.1, 1.2 ori_ga18.bmp, 1.1, 1.2 ori_ga19.bmp, 1.1, 1.2 ori_ga20.bmp, 1.1, 1.2 ori_ga21.bmp, 1.1, 1.2 ori_ga22.bmp, 1.1, 1.2 ori_ga23.bmp, 1.1, 1.2 ori_ga24.bmp, 1.1, 1.2 ori_ga25.bmp, 1.1, 1.2 ori_ga26.bmp, 1.1, 1.2 ori_ga27.bmp, 1.1, 1.2 ori_ga28.bmp, 1.1, 1.2 ori_ga29.bmp, 1.1, 1.2 ori_ga30.bmp, 1.1, 1.2 ori_ga31.bmp, 1.1, 1.2 ori_ga32.bmp, 1.1, 1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv4789/resources/ships/color1/ori Modified Files: ori_ga01.bmp ori_ga02.bmp ori_ga03.bmp ori_ga04.bmp ori_ga05.bmp ori_ga06.bmp ori_ga07.bmp ori_ga08.bmp ori_ga09.bmp ori_ga10.bmp ori_ga11.bmp ori_ga12.bmp ori_ga13.bmp ori_ga14.bmp ori_ga15.bmp ori_ga16.bmp ori_ga17.bmp ori_ga18.bmp ori_ga19.bmp ori_ga20.bmp ori_ga21.bmp ori_ga22.bmp ori_ga23.bmp ori_ga24.bmp ori_ga25.bmp ori_ga26.bmp ori_ga27.bmp ori_ga28.bmp ori_ga29.bmp ori_ga30.bmp ori_ga31.bmp ori_ga32.bmp Log Message: New ori GA color1 bitmaps Index: ori_ga04.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga04.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsYmvo0H and /tmp/cvsDLGlVB differ Index: ori_ga17.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga17.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvstoXl6L and /tmp/cvs9SU13F differ Index: ori_ga10.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga10.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs9A4ptO and /tmp/cvsi1vNuI differ Index: ori_ga13.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga13.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsmFDjyP and /tmp/cvsHSpoFJ differ Index: ori_ga23.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga23.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsPQ5vsT and /tmp/cvsTDlpCN differ Index: ori_ga03.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga03.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsHlcwBW and /tmp/cvs4k8hUQ differ Index: ori_ga12.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga12.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs5kCTU2 and /tmp/cvs6pngkX differ Index: ori_ga32.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga32.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsYGRuk4 and /tmp/cvsZI65PY differ Index: ori_ga07.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga07.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvstnZgT7 and /tmp/cvsxJUUq2 differ Index: ori_ga30.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga30.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsYtX5x6 and /tmp/cvsSkjo70 differ Index: ori_ga24.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga24.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsVXsQ2b and /tmp/cvsHblnH6 differ Index: ori_ga16.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga16.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs20Ttdb and /tmp/cvsXj6wU5 differ Index: ori_ga19.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga19.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs6RdJ3e and /tmp/cvsXv4hN9 differ Index: ori_ga15.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga15.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvswLrVd7 and /tmp/cvs8dUi01 differ Index: ori_ga26.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga26.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvse87uo8 and /tmp/cvsSz7Gg3 differ Index: ori_ga11.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga11.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs3YH0Cb and /tmp/cvs2hhHw6 differ Index: ori_ga21.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga21.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsO5MMwa and /tmp/cvsmqYMs5 differ Index: ori_ga22.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga22.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsQfg9Md and /tmp/cvssYOEK8 differ Index: ori_ga31.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga31.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsvNlMlc and /tmp/cvsWtTMk7 differ Index: ori_ga29.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga29.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsmKNjvg and /tmp/cvsxBbmxb differ Index: ori_ga27.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga27.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs16RNef and /tmp/cvsrVLBia differ Index: ori_ga09.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga09.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsUzl3Ki and /tmp/cvsU4mOQd differ Index: ori_ga01.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga01.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsHQPkvh and /tmp/cvsF2EUCc differ Index: ori_ga02.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga02.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsuneG5k and /tmp/cvs3aO5eg differ Index: ori_ga14.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga14.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsmKDwIj and /tmp/cvsaqULTe differ Index: ori_ga08.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga08.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsqgVg9m and /tmp/cvsqT3kmi differ Index: ori_ga05.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga05.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsro2mxp and /tmp/cvszCdpOk differ Index: ori_ga20.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga20.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsqaCJrq and /tmp/cvsqgwgKl differ Index: ori_ga06.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga06.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsfeLtZo and /tmp/cvsQSfvjk differ Index: ori_ga25.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga25.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs3CF4lu and /tmp/cvsynZ6Kp differ Index: ori_ga28.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga28.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsEV8Lgt and /tmp/cvsvqGEHo differ Index: ori_ga18.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/color1/ori/ori_ga18.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsSHu9Iw and /tmp/cvsmihSbs differ From modemhero at users.sourceforge.net Fri May 12 22:37:38 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 13 May 2006 03:37:38 +0000 Subject: [netrek-cvs] client/netrekxp clientr.vcproj.BB.Bill.user,1.1,NONE Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv4789 Removed Files: clientr.vcproj.BB.Bill.user Log Message: New ori GA color1 bitmaps --- clientr.vcproj.BB.Bill.user DELETED --- From modemhero at users.sourceforge.net Fri May 12 22:37:38 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 13 May 2006 03:37:38 +0000 Subject: [netrek-cvs] client/netrekxp/src mswindow.c,1.18,1.19 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv4789/src Modified Files: mswindow.c Log Message: New ori GA color1 bitmaps Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- mswindow.c 12 May 2006 20:51:31 -0000 1.18 +++ mswindow.c 13 May 2006 03:37:36 -0000 1.19 @@ -1375,7 +1375,7 @@ win->BorderColor = color; - hdc = GetDC (win->hwnd); //Turn off boder clipping + hdc = GetDC (win->hwnd); //Turn off border clipping if (NetrekPalette) { SelectPalette (hdc, NetrekPalette, FALSE); @@ -5755,10 +5755,11 @@ r.bottom = min (y + ext.cy, win->ClipRect.bottom); if (r.bottom < r.top) return; //Vertical extents do not overlap - + ExtTextOut (sdb->mem_dc, x, y, ETO_CLIPPED | ETO_OPAQUE, &r, str, len, NULL); break; + default: LineToConsole ("Unknown window type in W_WriteText"); } From modemhero at users.sourceforge.net Fri May 12 22:37:38 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 13 May 2006 03:37:38 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt,1.42,1.43 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv4789/resources/docs Modified Files: changes.txt Log Message: New ori GA color1 bitmaps Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- changes.txt 12 May 2006 20:51:30 -0000 1.42 +++ changes.txt 13 May 2006 03:37:36 -0000 1.43 @@ -1,4 +1,5 @@ Version TBA: +- redesigned color1 ori GA so it's not the same pic as base - double buffering now in (to reduce flicker) - added link to genocide.netrek.org newbie manual to replace broken link - fix to background star jumpiness with short packets off From modemhero at users.sourceforge.net Fri May 12 22:37:38 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 13 May 2006 03:37:38 +0000 Subject: [netrek-cvs] client/netrekxp/src/winkey winkey.vcproj.BB.Bill.user, 1.1, NONE Message-ID: Update of /cvsroot/netrek/client/netrekxp/src/winkey In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv4789/src/winkey Removed Files: winkey.vcproj.BB.Bill.user Log Message: New ori GA color1 bitmaps --- winkey.vcproj.BB.Bill.user DELETED --- From modemhero at users.sourceforge.net Sat May 13 21:14:56 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 14 May 2006 02:14:56 +0000 Subject: [netrek-cvs] client/netrekxp/resources/planlibm/color rock2.bmp, NONE, 1.1 unknown.bmp, NONE, 1.1 agri1.bmp, 1.1, 1.2 agri2.bmp, 1.1, 1.2 earth.bmp, 1.1, 1.2 klingus.bmp, 1.1, 1.2 orion.bmp, 1.1, 1.2 rock1.bmp, 1.1, 1.2 romulus.bmp, 1.1, 1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/planlibm/color In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv22379/resources/planlibm/color Modified Files: agri1.bmp agri2.bmp earth.bmp klingus.bmp orion.bmp rock1.bmp romulus.bmp Added Files: rock2.bmp unknown.bmp Log Message: New planet bitmaps! Using Defcom's art. Changeable via planets menu. New netrekrc option, "planetBitmapGalaxy: (0-3)", same options as planetBitmap, but now you have the choice to change map display planets too! And have map and local planets use different bitmap sets Fixed bug where map window border wasn't being redrawn on death Shortpackets is now off by default. In the current state of internet connectivity, most people don't need the reduced packets, which don't send complete information and break certain features such as which direction other players are moving, robot shields, observer geno messages, shield/cloak status for warp 0 players, etc. Fix to problem with bottom and right borders in certain windows (like map) getting overwritten - thanks Stas! Client now recognizes planets that are flagged as "core", waiting on server patch to actually get this information and do something with it Index: earth.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/planlibm/color/earth.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs1QgMkW and /tmp/cvs3RywWO differ Index: orion.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/planlibm/color/orion.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsECDQd3 and /tmp/cvsC1ti4V differ Index: agri1.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/planlibm/color/agri1.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsW7PBQ7 and /tmp/cvsfc4L10 differ --- NEW FILE: unknown.bmp --- (This appears to be a binary file; contents omitted.) Index: romulus.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/planlibm/color/romulus.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsDb0q8b and /tmp/cvsvMoDr5 differ Index: agri2.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/planlibm/color/agri2.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvswvvZKg and /tmp/cvs8L0saa differ --- NEW FILE: rock2.bmp --- (This appears to be a binary file; contents omitted.) Index: rock1.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/planlibm/color/rock1.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsb1PzKl and /tmp/cvsXOwnif differ Index: klingus.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/planlibm/color/klingus.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsmZfALn and /tmp/cvs3gavmh differ From modemhero at users.sourceforge.net Sat May 13 21:14:56 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 14 May 2006 02:14:56 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.20, 1.21 build.cmd, 1.14, 1.15 clientr.suo, 1.2, 1.3 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv22379 Modified Files: NetrekXP to do list.C build.cmd clientr.suo Log Message: New planet bitmaps! Using Defcom's art. Changeable via planets menu. New netrekrc option, "planetBitmapGalaxy: (0-3)", same options as planetBitmap, but now you have the choice to change map display planets too! And have map and local planets use different bitmap sets Fixed bug where map window border wasn't being redrawn on death Shortpackets is now off by default. In the current state of internet connectivity, most people don't need the reduced packets, which don't send complete information and break certain features such as which direction other players are moving, robot shields, observer geno messages, shield/cloak status for warp 0 players, etc. Fix to problem with bottom and right borders in certain windows (like map) getting overwritten - thanks Stas! Client now recognizes planets that are flagged as "core", waiting on server patch to actually get this information and do something with it Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- NetrekXP to do list.C 12 May 2006 20:51:30 -0000 1.20 +++ NetrekXP to do list.C 14 May 2006 02:14:54 -0000 1.21 @@ -35,13 +35,11 @@ - option server/servernick/servertype needs to be saved 5) A lot of annoying pop up windows (like macro window, default controls) should be closeable by shift right click. -6) With new scaling function, implement Defcom's new bitmaps -6b) Border issue -6c) The new smooth turning only working on self, not obs or others - short packets! +6) Implement Defcom's new planet and ship bitmaps +6a) Border issue - quite complex problem, how to know the borders to obey after the bitmap + is rotated, and where to center bitmap +6b) The new smooth turning only working on self, not obs or others - short packets! 7) login not read in before metaserver info (for metablocking purposes) -8) Border issue on galaxy map - not using right border width for draw purposes, top and right -borders get overwritten by 1 space. It's an issue in COW too. -10) double buffering not working with new bitmaps Stas's list: - color coded playerlist. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvswGA3oR and /tmp/cvsRibnVJ differ Index: build.cmd =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/build.cmd,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- build.cmd 12 May 2006 01:54:18 -0000 1.14 +++ build.cmd 14 May 2006 02:14:54 -0000 1.15 @@ -459,6 +459,9 @@ copy resources\planlibm\rabbit\mplanR.bmp %InstCWD%\netrek\bitmaps\planlibm copy resources\planlibm\moo\mplanM.bmp %InstCWD%\netrek\bitmaps\planlibm +mkdir %InstCWD%\netrek\bitmaps\planlibm\color +copy resources\planlibm\color\*.bmp %InstCWD%\netrek\bitmaps\planlibm\color + mkdir %InstCWD%\netrek\bitmaps\misclib copy resources\misclib\mono\sbexplM.bmp %InstCWD%\netrek\bitmaps\misclib copy resources\misclib\mono\shexplM.bmp %InstCWD%\netrek\bitmaps\misclib From modemhero at users.sourceforge.net Sat May 13 21:14:56 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 14 May 2006 02:14:56 +0000 Subject: [netrek-cvs] client/netrekxp/resources/htmlhelp/html generalconfig.html, 1.7, 1.8 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv22379/resources/htmlhelp/html Modified Files: generalconfig.html Log Message: New planet bitmaps! Using Defcom's art. Changeable via planets menu. New netrekrc option, "planetBitmapGalaxy: (0-3)", same options as planetBitmap, but now you have the choice to change map display planets too! And have map and local planets use different bitmap sets Fixed bug where map window border wasn't being redrawn on death Shortpackets is now off by default. In the current state of internet connectivity, most people don't need the reduced packets, which don't send complete information and break certain features such as which direction other players are moving, robot shields, observer geno messages, shield/cloak status for warp 0 players, etc. Fix to problem with bottom and right borders in certain windows (like map) getting overwritten - thanks Stas! Client now recognizes planets that are flagged as "core", waiting on server patch to actually get this information and do something with it Index: generalconfig.html =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html/generalconfig.html,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- generalconfig.html 2 May 2006 00:55:52 -0000 1.7 +++ generalconfig.html 14 May 2006 02:14:54 -0000 1.8 @@ -644,12 +644,26 @@ planetBitmap -Style of planet bitmaps on tactical +Style of planet bitmaps on local map + +
        +
      • 0 (default) - Bronco bitmaps
      • +
      • 1 - Moo bitmaps
      • +
      • 2 - Rabbitear bitmaps
      • +
      • 3 - New color bitmaps
      • +
      + + + + +planetBitmapGalaxy +Style of planet bitmaps on galaxy map
      • 0 (default) - Bronco bitmaps
      • 1 - Moo bitmaps
      • 2 - Rabbitear bitmaps
      • +
      • 3 - New color bitmaps
      From modemhero at users.sourceforge.net Sat May 13 21:14:56 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 14 May 2006 02:14:56 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.43, 1.44 netrekrc_options.txt, 1.5, 1.6 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv22379/resources/docs Modified Files: changes.txt netrekrc_options.txt Log Message: New planet bitmaps! Using Defcom's art. Changeable via planets menu. New netrekrc option, "planetBitmapGalaxy: (0-3)", same options as planetBitmap, but now you have the choice to change map display planets too! And have map and local planets use different bitmap sets Fixed bug where map window border wasn't being redrawn on death Shortpackets is now off by default. In the current state of internet connectivity, most people don't need the reduced packets, which don't send complete information and break certain features such as which direction other players are moving, robot shields, observer geno messages, shield/cloak status for warp 0 players, etc. Fix to problem with bottom and right borders in certain windows (like map) getting overwritten - thanks Stas! Client now recognizes planets that are flagged as "core", waiting on server patch to actually get this information and do something with it Index: netrekrc_options.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc_options.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- netrekrc_options.txt 2 May 2006 00:55:52 -0000 1.5 +++ netrekrc_options.txt 14 May 2006 02:14:54 -0000 1.6 @@ -129,10 +129,17 @@ phaserStats: (on/off) show phaser statistics phaserWindow: (on/off) whether to show phaser window -planetBitmap: (0-2) what bitmaps to use for planets +planetBitmap: (0-3) what bitmaps to use for local planets # 0 - Bronco (default) # 1 - Moo # 2 - Rabbitear +# 3 - New color + +planetBitmapGalaxy: (0-3) what bitmaps to use for galaxy planets +# 0 - Bronco (default) +# 1 - Moo +# 2 - Rabbitear +# 3 - New color playerList: (string) custom style of player list # ' ' - White Space Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- changes.txt 13 May 2006 03:37:36 -0000 1.43 +++ changes.txt 14 May 2006 02:14:54 -0000 1.44 @@ -1,4 +1,16 @@ Version TBA: +- new netrekrc option, "planetBitmapGalaxy: (0-3)", same options as planetBitmap, but now you have + the choice to change map display planets too! And have map and local planets use different + bitmap sets +- fixed bug where map window border wasn't being redrawn on death +- shortpackets is now off by default. In the current state of internet connectivity, most people + don't need the reduced packets, which don't send complete information and break certain features + such as which direction other players are moving, robot shields, observer geno messages, + shield/cloak status for warp 0 players, etc. +- fix to problem with bottom and right borders in certain windows (like map) getting overwritten +- new planet bitmaps! Using Defcom's art. Changeable via planets menu. +- client now recognizes planets that are flagged as "core", waiting on server patch to + actually get this information - redesigned color1 ori GA so it's not the same pic as base - double buffering now in (to reduce flicker) - added link to genocide.netrek.org newbie manual to replace broken link From modemhero at users.sourceforge.net Sat May 13 21:14:56 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 14 May 2006 02:14:56 +0000 Subject: [netrek-cvs] client/netrekxp/include bitmaps.h, 1.7, 1.8 data.h, 1.13, 1.14 defs.h, 1.6, 1.7 proto.h, 1.13, 1.14 struct.h, 1.6, 1.7 wlib.h, 1.4, 1.5 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv22379/include Modified Files: bitmaps.h data.h defs.h proto.h struct.h wlib.h Log Message: New planet bitmaps! Using Defcom's art. Changeable via planets menu. New netrekrc option, "planetBitmapGalaxy: (0-3)", same options as planetBitmap, but now you have the choice to change map display planets too! And have map and local planets use different bitmap sets Fixed bug where map window border wasn't being redrawn on death Shortpackets is now off by default. In the current state of internet connectivity, most people don't need the reduced packets, which don't send complete information and break certain features such as which direction other players are moving, robot shields, observer geno messages, shield/cloak status for warp 0 players, etc. Fix to problem with bottom and right borders in certain windows (like map) getting overwritten - thanks Stas! Client now recognizes planets that are flagged as "core", waiting on server patch to actually get this information and do something with it Index: bitmaps.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/bitmaps.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- bitmaps.h 2 May 2006 00:55:52 -0000 1.7 +++ bitmaps.h 14 May 2006 02:14:54 -0000 1.8 @@ -129,3 +129,27 @@ #define PLANET_VIEWS 9 #define MPLANET_VIEWS 9 + +// Color planets + +// Homeworlds +#define BMP_EARTH 1 +#define BMP_ROMULUS 2 +#define BMP_ORION 3 +#define BMP_KLINGUS 4 + +// Agris +#define BMP_AGRI1 5 +#define BMP_AGRI2 6 + +// Regular planets +#define BMP_ROCK1 7 +#define BMP_ROCK2 8 + +// Untouched planet +#define BMP_PLANET_UNKNOWN 9 + +#define BMP_CPLANET_WIDTH 120 +#define BMP_CPLANET_HEIGHT 120 + + Index: defs.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/defs.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- defs.h 29 Apr 2006 19:22:38 -0000 1.6 +++ defs.h 14 May 2006 02:14:54 -0000 1.7 @@ -124,10 +124,10 @@ #define ROM 0x2 #define KLI 0x4 #define ORI 0x8 -#define IND 0x16 -#define ALLTEAM (FED|ROM|KLI|ORI|IND) -#define MAXTEAM (IND) -#define NUMTEAM 5 +#define ALLTEAM (FED|ROM|KLI|ORI) +#define MAXTEAM (ORI) +#define NUMTEAM 4 /* Used for player list */ +#define NUMTEAMS 5 /* Used for planet bitmap storage */ /* * These are random configuration variables */ #define VICTORY 3 /* Number of systems needed * to conquer the galaxy */ Index: struct.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/struct.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- struct.h 7 May 2006 16:59:26 -0000 1.6 +++ struct.h 14 May 2006 02:14:54 -0000 1.7 @@ -379,9 +379,10 @@ #define PLCOUP 0x200 /* Coup has occured */ #define PLCHEAP 0x400 /* Planet was taken from * undefended team */ +#define PLCORE 0x800 /* A core world planet */ #ifdef BRMH -#define PLCLEAR 0x800 +#define PLCLEAR 0x1000 #endif struct planet Index: proto.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- proto.h 7 May 2006 16:59:26 -0000 1.13 +++ proto.h 14 May 2006 02:14:54 -0000 1.14 @@ -443,7 +443,7 @@ /******************************************************************************/ void initPlanets (void); //inline static void checkRedraw(int x, int y); -//inline static W_Icon planetmBitmap(register struct planet * p); +extern inline W_Icon planetBitmapC(register struct planet * p); //static void DrawPlanets(); void map (void); @@ -627,11 +627,14 @@ W_Color color); void W_WriteScaleBitmap (int x, int y, - float SCALEX, - float SCALEY, + int destwidth, + int destheight, + int srcwidth, + int srcheight, unsigned char p_dir, W_Icon icon, - W_Color color); + W_Color color, + W_Window window); void W_WriteBitmapGrey (int x, int y, W_Icon icon, @@ -710,6 +713,15 @@ int y, W_Icon icon, W_Color color); +void W_OverlayScaleBitmap (int x, + int y, + int destwidth, + int destheight, + int srcwidth, + int srcheight, + W_Icon icon, + W_Color color, + W_Window window); void W_EraseTTSText (W_Window window, int last_tts_xpos, int tts_ypos, @@ -758,10 +770,13 @@ void W_WriteTextDB (SDBUFFER * sdb, int x, int y, W_Color color, char *str, int len, W_Font font); void W_MaskTextDB (SDBUFFER * sdb, int x, int y, W_Color color, char *str, int len, W_Font font); void W_WriteBitmapDB (SDBUFFER * sdb, int x, int y, W_Icon icon, W_Color color); -void W_WriteScaleBitmapDB (SDBUFFER * sdb, int x, int y, float SCALEX, float SCALEY, - unsigned char p_dir, W_Icon icon, W_Color color); +void W_WriteScaleBitmapDB (SDBUFFER * sdb, int x, int y, int destwidth, int destheight, + int srcwidth, int srcheight, unsigned char p_dir, W_Icon icon, + W_Color color, W_Window window); void W_WriteBitmapGreyDB (SDBUFFER * sdb, int x, int y, W_Icon icon, W_Color color); void W_OverlayBitmapDB (SDBUFFER * sdb, int x, int y, W_Icon icon, W_Color color); +void W_OverlayScaleBitmapDB (SDBUFFER * sdb, int x, int y, int destwidth, int destheight, + int srcwidth, int srcheight, W_Icon icon, W_Color color, W_Window window); #endif /******************************************************************************/ Index: wlib.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/wlib.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- wlib.h 6 May 2006 05:40:00 -0000 1.4 +++ wlib.h 14 May 2006 02:14:54 -0000 1.5 @@ -129,11 +129,14 @@ W_Color color); extern void W_WriteScaleBitmap (int x, int y, - float SCALEX, - float SCALEY, + int destwidth, + int destheight, + int srcwidth, + int srcheight, unsigned char p_dir, W_Icon icon, - W_Color color); + W_Color color, + W_Window window); extern void W_ClearArea (W_Window window, int x, int y, @@ -203,6 +206,15 @@ int, W_Icon, W_Color); +extern void W_OverlayScaleBitmap (int, + int, + int, + int, + int, + int, + W_Icon, + W_Color, + W_Window); extern void W_WriteTriangle (W_Window, int, int, Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- data.h 7 May 2006 16:59:26 -0000 1.13 +++ data.h 14 May 2006 02:14:54 -0000 1.14 @@ -219,6 +219,7 @@ extern int showAllTractorPressor; extern int showLock; extern int planetBitmap; +extern int planetBitmapGalaxy; extern int logging; extern int continueTractor; extern int tcounter; @@ -300,7 +301,13 @@ extern W_Icon fed_bitmapsHR[NUM_TYPES], kli_bitmapsHR[NUM_TYPES], rom_bitmapsHR[NUM_TYPES], ori_bitmapsHR[NUM_TYPES], ind_bitmapsHR[NUM_TYPES]; - + +// Planets +extern W_Icon planet_unknown; +extern W_Icon planet_bitmaps[8]; +extern W_Icon planet_earth[NUMTEAMS], planet_klingus[NUMTEAMS], planet_orion[NUMTEAMS], + planet_romulus[NUMTEAMS], planet_agri1[NUMTEAMS], planet_agri2[NUMTEAMS], + planet_rock1[NUMTEAMS], planet_rock2[NUMTEAMS]; extern W_Icon base_planets; extern W_Icon base_mplanets; extern W_Icon bplanets[PLANET_VIEWS]; From modemhero at users.sourceforge.net Sat May 13 21:14:56 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 14 May 2006 02:14:56 +0000 Subject: [netrek-cvs] client/netrekxp/src data.c, 1.17, 1.18 death.c, 1.5, 1.6 defaults.c, 1.15, 1.16 defwin.c, 1.4, 1.5 local.c, 1.21, 1.22 map.c, 1.7, 1.8 mswindow.c, 1.19, 1.20 newwin.c, 1.20, 1.21 option.c, 1.13, 1.14 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv22379/src Modified Files: data.c death.c defaults.c defwin.c local.c map.c mswindow.c newwin.c option.c Log Message: New planet bitmaps! Using Defcom's art. Changeable via planets menu. New netrekrc option, "planetBitmapGalaxy: (0-3)", same options as planetBitmap, but now you have the choice to change map display planets too! And have map and local planets use different bitmap sets Fixed bug where map window border wasn't being redrawn on death Shortpackets is now off by default. In the current state of internet connectivity, most people don't need the reduced packets, which don't send complete information and break certain features such as which direction other players are moving, robot shields, observer geno messages, shield/cloak status for warp 0 players, etc. Fix to problem with bottom and right borders in certain windows (like map) getting overwritten - thanks Stas! Client now recognizes planets that are flagged as "core", waiting on server patch to actually get this information and do something with it Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- mswindow.c 13 May 2006 03:37:36 -0000 1.19 +++ mswindow.c 14 May 2006 02:14:54 -0000 1.20 @@ -485,7 +485,27 @@ free (eplasmatorp); free (mplasmatorp); - + for (i = 0; i < NUMTEAMS; i++) + { + free (planet_earth[i]); + free (planet_klingus[i]); + free (planet_orion[i]); + free (planet_romulus[i]); + free (planet_agri1[i]); + free (planet_agri2[i]); + free (planet_rock1[i]); + free (planet_rock2[i]); + } + free (planet_bitmaps[0]); + free (planet_bitmaps[1]); + free (planet_bitmaps[2]); + free (planet_bitmaps[3]); + free (planet_bitmaps[4]); + free (planet_bitmaps[5]); + free (planet_bitmaps[6]); + free (planet_bitmaps[7]); + free (planet_unknown); + for (i = 0; i < PLANET_VIEWS; i++) free (bplanets[i]); for (i = 0; i < MPLANET_VIEWS; i++) @@ -1491,9 +1511,6 @@ SelectPalette (hdc, NetrekPalette, FALSE); RealizePalette (hdc); } - // FillRect doesn't do the edges (right and bottom) -SAC - r.right++; - r.bottom++; FillRect (hdc, &r, colortable[W_Black].brush); ReleaseDC (win->hwnd, hdc); } @@ -3838,48 +3855,74 @@ void W_WriteScaleBitmap (int x, int y, - float SCALEX, - float SCALEY, + int destwidth, + int destheight, + int srcwidth, + int srcheight, unsigned char p_dir, W_Icon icon, - W_Color color) + W_Color color, + W_Window window) { register struct Icon *bitmap = (struct Icon *) icon; - register int borderx, bordery, width, height; + register int border; register int srcx, srcy; HDC hdc; HBITMAP newbmp; XFORM xForm; + int newwidth, newheight; double radians; - float cosine, sine, Point1x, Point1y, Point2x, Point2y, Point3x, Point3y; - float xscale, yscale; - float eDx, eDy; + float cosine, sine, xscale, yscale, eDx, eDy; + FNHEADER_VOID; - //Fast (I hope) rectangle intersection, don't overwrite our borders + // First copy bitmap into new bitmap, and scale it. This makes life + // easier for doing border intersection srcx = bitmap->x; srcy = bitmap->y; - borderx = bitmap->ClipRectAddr->left; - x += borderx; - bordery = bitmap->ClipRectAddr->top; - y += bordery; - - width = bitmap->width; - height = bitmap->height; - hdc = GetDC (bitmap->hwnd); - newbmp = CreateCompatibleBitmap ( hdc, width, height ); + hdc = GetDC (win->hwnd); + newbmp = CreateCompatibleBitmap ( hdc, destwidth, destheight ); + + SelectObject (GlobalMemDC, bitmap->bm); + SelectObject (GlobalMemDC2, newbmp); + + // Copy selected section of main bitmap into newbmp before rotation + SetStretchBltMode(GlobalMemDC2, COLORONCOLOR); + StretchBlt(GlobalMemDC2, 0, 0, destwidth, destheight, GlobalMemDC, + srcx, srcy, srcwidth, srcheight, SRCPAINT); + + //Fast (I hope) rectangle intersection, don't overwrite our borders + border = win->ClipRect.top; + + // Reset srcx and srcy as our new source bitmap starts at 0,0 + srcx = 0; + srcy = 0; + x += border; + y += border; + + if (x < border) + { + newwidth = destwidth - (border - x); + srcx += border - x; + x = border; + } + else if ((newwidth = win->ClipRect.right - x) > destwidth) + newwidth = destwidth; + if (y < border) + { + newheight = destheight - (border - y); + srcy += (border - y); + y = border; + } + else if ((newheight = win->ClipRect.bottom - y) > destheight) + newheight = destheight; if (NetrekPalette) { SelectPalette (hdc, NetrekPalette, FALSE); RealizePalette (hdc); } - SelectObject (GlobalMemDC, bitmap->bm); - SelectObject (GlobalMemDC2, newbmp); - - // Copy selected section of main bitmap into newbmp before rotation - BitBlt (GlobalMemDC2, 0, 0, width, height, GlobalMemDC, srcx, srcy, SRCPAINT); - + //Set the color of the bitmap //(oddly enough, 1-bit = bk color, 0-bit = text (fg) color) SetBkColor (hdc, colortable[color].rgb); @@ -3887,40 +3930,39 @@ //Convert p_dir to radians radians=(2*3.14159*p_dir*360/255)/360; - //Setworldtransform screws up at angle = 0, slight hack to fix - if (radians == 0.0) - radians = 0.0000001; + cosine=(float)cos(radians); sine=(float)sin(radians); // Scale used to find bitmap center - xscale = (float)(width/SCALEX/2); - yscale = (float)(height/SCALEY/2); - - // Compute dimensions of the resulting bitmap - // First get the coordinates of the 3 corners other than origin - Point1x=(height*sine); - Point1y=(height*cosine); - Point2x=(width*cosine+height*sine); - Point2y=(height*cosine-width*sine); - Point3x=(width*cosine); - Point3y=-(width*sine); + xscale = (float)(newwidth/2); + yscale = (float)(newheight/2); eDx = x + xscale - cosine*(xscale) + sine*(yscale); eDy = y + yscale - cosine*(yscale) - sine*(xscale); SetGraphicsMode(hdc,GM_ADVANCED); - xForm.eM11=cosine/SCALEX; - xForm.eM12=sine/SCALEX; - xForm.eM21=-sine/SCALEY; - xForm.eM22=cosine/SCALEY; + xForm.eM11=cosine; + xForm.eM12=sine; + xForm.eM21=-sine; + xForm.eM22=cosine; xForm.eDx = eDx; xForm.eDy = eDy; SetWorldTransform(hdc,&xForm); - BitBlt(hdc, 0, 0, width, height, GlobalMemDC2, 0, 0, SRCPAINT); - - ReleaseDC (bitmap->hwnd, hdc); + BitBlt(hdc, 0, 0, newwidth, newheight, GlobalMemDC2, srcx, srcy, SRCPAINT); + + // Reset xForm + xForm.eM11 = (FLOAT) 1.0; + xForm.eM12 = (FLOAT) 0.0; + xForm.eM21 = (FLOAT) 0.0; + xForm.eM22 = (FLOAT) 1.0; + xForm.eDx = (FLOAT) 0.0; + xForm.eDy = (FLOAT) 0.0; + + SetWorldTransform(hdc,&xForm); + + ReleaseDC (win->hwnd, hdc); DeleteObject (newbmp); /* Alternative method using PlgBlt, left in for reference purposes @@ -4918,6 +4960,100 @@ ReleaseDC (bitmap->hwnd, hdc); } +void +W_OverlayScaleBitmap (int x, + int y, + int destwidth, + int destheight, + int srcwidth, + int srcheight, + W_Icon icon, + W_Color color, + W_Window window) +{ + register struct Icon *bitmap = (struct Icon *) icon; + register int border; + register int srcx, srcy; + HDC hdc; + HBITMAP newbmp; + XFORM xForm; + int newwidth, newheight; + FNHEADER_VOID; + + // First copy bitmap into new bitmap, and scale it. This makes life + // easier for doing border intersection + srcx = bitmap->x; + srcy = bitmap->y; + + hdc = GetDC (win->hwnd); + newbmp = CreateCompatibleBitmap ( hdc, destwidth, destheight ); + + SelectObject (GlobalMemDC, bitmap->bm); + SelectObject (GlobalMemDC2, newbmp); + + // Copy selected section of main bitmap into newbmp before rotation + SetStretchBltMode(GlobalMemDC2, COLORONCOLOR); + StretchBlt(GlobalMemDC2, 0, 0, destwidth, destheight, GlobalMemDC, + srcx, srcy, srcwidth, srcheight, SRCPAINT); + + // Copy selected section of main bitmap into newbmp before rotation + SetStretchBltMode(GlobalMemDC2, COLORONCOLOR); + StretchBlt(GlobalMemDC2, 0, 0, destwidth, destheight, GlobalMemDC, + srcx, srcy, srcwidth, srcheight, SRCPAINT); + + //Fast (I hope) rectangle intersection, don't overwrite our borders + border = win->ClipRect.top; + + // Reset srcx and srcy as our new source bitmap starts at 0,0 + srcx = 0; + srcy = 0; + x += border; + y += border; + + if (x < border) + { + newwidth = destwidth - (border - x); + srcx += border - x; + x = border; + } + else if ((newwidth = win->ClipRect.right - x) > destwidth) + newwidth = destwidth; + if (y < border) + { + newheight = destheight - (border - y); + srcy += (border - y); + y = border; + } + else if ((newheight = win->ClipRect.bottom - y) > destheight) + newheight = destheight; + + if (NetrekPalette) + { + SelectPalette (hdc, NetrekPalette, FALSE); + RealizePalette (hdc); + } + + //Set the color of the bitmap + //(oddly enough, 1-bit = bk color, 0-bit = text (fg) color) + SetBkColor (hdc, colortable[color].rgb); + SetTextColor (hdc, colortable[BLACK].rgb); + + SetGraphicsMode(hdc,GM_ADVANCED); + + xForm.eM11 = (FLOAT) 1.0; + xForm.eM12 = (FLOAT) 0.0; + xForm.eM21 = (FLOAT) 0.0; + xForm.eM22 = (FLOAT) 1.0; + xForm.eDx = (float)x; + xForm.eDy = (float)y; + + SetWorldTransform(hdc,&xForm); + BitBlt(hdc, 0, 0, newwidth, newheight, GlobalMemDC2, 0, 0, SRCPAINT); + + ReleaseDC (win->hwnd, hdc); + DeleteObject (newbmp); +} + #ifdef BEEPLITE void W_EraseTTSText(W_Window window, int last_tts_xpos, int tts_ypos, int last_tts_width) { @@ -5366,9 +5502,6 @@ SelectPalette (sdb->mem_dc, NetrekPalette, FALSE); RealizePalette (sdb->mem_dc); } - // FillRect doesn't do the edges (right and bottom) -SAC - r.right++; - r.bottom++; FillRect (sdb->mem_dc, &r, colortable[W_Black].brush); } @@ -5845,87 +5978,127 @@ void -W_WriteScaleBitmapDB (SDBUFFER * sdb, int x, int y, float SCALEX, float SCALEY, - unsigned char p_dir, W_Icon icon, W_Color color) +W_WriteScaleBitmapDB (SDBUFFER * sdb, int x, int y, int destwidth, int destheight, + int srcwidth, int srcheight, unsigned char p_dir, W_Icon icon, + W_Color color, W_Window window) { register struct Icon *bitmap = (struct Icon *) icon; - register int borderx, bordery, width, height; + register int border; register int srcx, srcy; HBITMAP newbmp; XFORM xForm; + int newwidth, newheight; double radians; - float cosine, sine, Point1x, Point1y, Point2x, Point2y, Point3x, Point3y; - float xscale, yscale; - float eDx, eDy; - - //Fast (I hope) rectangle intersection, don't overwrite our borders + float Point1x, Point1y, Point2x, Point2y, Point3x, Point3y; + float minx, maxx, miny, maxy; + float cosine, sine, xscale, yscale, eDx, eDy; + FNHEADER_VOID; + + // First copy bitmap into new bitmap, and scale it. This makes life + // easier for doing border intersection srcx = bitmap->x; srcy = bitmap->y; - borderx = bitmap->ClipRectAddr->left; - x += borderx; - bordery = bitmap->ClipRectAddr->top; - y += bordery; - - width = bitmap->width; - height = bitmap->height; - - newbmp = CreateCompatibleBitmap ( sdb->mem_dc, width, height ); - - if (NetrekPalette) - { - - SelectPalette (sdb->mem_dc, NetrekPalette, FALSE); - RealizePalette (sdb->mem_dc); - } + + newbmp = CreateCompatibleBitmap ( sdb->mem_dc, destwidth, destheight ); + SelectObject (GlobalMemDC, bitmap->bm); SelectObject (GlobalMemDC2, newbmp); // Copy selected section of main bitmap into newbmp before rotation - BitBlt (GlobalMemDC2, 0, 0, width, height, GlobalMemDC, srcx, srcy, SRCPAINT); - - //Set the color of the bitmap - //(oddly enough, 1-bit = bk color, 0-bit = text (fg) color) - SetBkColor (sdb->mem_dc, colortable[color].rgb); - SetTextColor (sdb->mem_dc, colortable[BLACK].rgb); + SetStretchBltMode(GlobalMemDC2, COLORONCOLOR); + StretchBlt(GlobalMemDC2, 0, 0, destwidth, destheight, GlobalMemDC, + srcx, srcy, srcwidth, srcheight, SRCPAINT); + //Fast (I hope) rectangle intersection, don't overwrite our borders + border = win->ClipRect.top; + //Convert p_dir to radians radians=(2*3.14159*p_dir*360/255)/360; - //Setworldtransform screws up at angle = 0, slight hack to fix - if (radians == 0.0) - radians = 0.0000001; + + // Calculate angle of rotation cosine=(float)cos(radians); sine=(float)sin(radians); - // Scale used to find bitmap center - xscale = (float)(width/SCALEX/2); - yscale = (float)(height/SCALEY/2); - + // Reset srcx and srcy as our new source bitmap starts at 0,0 + srcx = 0; + srcy = 0; + x += border; + y += border; + // Compute dimensions of the resulting bitmap // First get the coordinates of the 3 corners other than origin - Point1x=(height*sine); - Point1y=(height*cosine); - Point2x=(width*cosine+height*sine); - Point2y=(height*cosine-width*sine); - Point3x=(width*cosine); - Point3y=-(width*sine); + Point1x=(destheight*sine); + Point1y=(destheight*cosine); + Point2x=(destwidth*cosine+destheight*sine); + Point2y=(destheight*cosine-destwidth*sine); + Point3x=(destwidth*cosine); + Point3y=-(destwidth*sine); + + minx=min(0,min(Point1x,min(Point2x,Point3x))); + miny=min(0,min(Point1y,min(Point2y,Point3y))); + maxx=max(0,max(Point1x,max(Point2x,Point3x))); + maxy=max(0,max(Point1y,max(Point2y,Point3y))); + + // Set the new destination height and width - needs work + // destwidth =(int)ceil(maxx-minx); + // destheight =(int)ceil(maxy-miny); + + if (x < border) + { + newwidth = destwidth - (border - x); + srcx += border - x; + x = border; + } + else if ((newwidth = win->ClipRect.right - x) > destwidth) + newwidth = destwidth; + if (y < border) + { + newheight = destheight - (border - y); + srcy += (border - y); + y = border; + } + else if ((newheight = win->ClipRect.bottom - y) > destheight) + newheight = destheight; + if (NetrekPalette) + { + SelectPalette (sdb->mem_dc, NetrekPalette, FALSE); + RealizePalette (sdb->mem_dc); + } + + //Set the color of the bitmap + //(oddly enough, 1-bit = bk color, 0-bit = text (fg) color) + SetBkColor (sdb->mem_dc, colortable[color].rgb); + SetTextColor (sdb->mem_dc, colortable[BLACK].rgb); + + // Find bitmap center + xscale = (float)(newwidth/2); + yscale = (float)(newheight/2); + eDx = x + xscale - cosine*(xscale) + sine*(yscale); eDy = y + yscale - cosine*(yscale) - sine*(xscale); + SetGraphicsMode(sdb->mem_dc,GM_ADVANCED); - // SetGraphicsMode(sdb->mem_dc,GM_ADVANCED); - - xForm.eM11=cosine/SCALEX; - xForm.eM12=sine/SCALEX; - xForm.eM21=-sine/SCALEY; - xForm.eM22=cosine/SCALEY; + xForm.eM11=cosine; + xForm.eM12=sine; + xForm.eM21=-sine; + xForm.eM22=cosine; xForm.eDx = eDx; xForm.eDy = eDy; + + SetWorldTransform(sdb->mem_dc,&xForm); + BitBlt(sdb->mem_dc, 0, 0, newwidth, newheight, GlobalMemDC2, srcx, srcy, SRCPAINT); + + // Reset xForm + xForm.eM11 = (FLOAT) 1.0; + xForm.eM12 = (FLOAT) 0.0; + xForm.eM21 = (FLOAT) 0.0; + xForm.eM22 = (FLOAT) 1.0; + xForm.eDx = (FLOAT) 0.0; + xForm.eDy = (FLOAT) 0.0; + + SetWorldTransform(sdb->mem_dc,&xForm); - SetStretchBltMode(sdb->mem_dc, COLORONCOLOR); - // SetWorldTransform(sdb->mem_dc,&xForm); - // BitBlt(hdc, 0, 0, width, height, GlobalMemDC2, 0, 0, SRCPAINT); - // BitBlt(sdb->mem_dc, 0, 0, width, height, GlobalMemDC2, 0, 0, SRCPAINT); - StretchBlt(sdb->mem_dc, x, y, (int)(width/SCALEX), (int)(height/SCALEY), GlobalMemDC2, 0, 0, width, height, SRCPAINT); DeleteObject (newbmp); } @@ -6037,6 +6210,100 @@ BitBlt (sdb->mem_dc, x, y, //Copy the bitmap width, height, GlobalMemDC, srcx, srcy, SRCPAINT); // <-- using OR mode } + +void +W_OverlayScaleBitmapDB (SDBUFFER * sdb, int x, int y, int destwidth, int destheight, + int srcwidth, int srcheight, W_Icon icon, W_Color color, W_Window window) +{ + register struct Icon *bitmap = (struct Icon *) icon; + register int border; + register int srcx, srcy; + HBITMAP newbmp; + XFORM xForm; + int newwidth, newheight; + FNHEADER_VOID; + + // First copy bitmap into new bitmap, and scale it. This makes life + // easier for doing border intersection + srcx = bitmap->x; + srcy = bitmap->y; + + newbmp = CreateCompatibleBitmap ( sdb->mem_dc, destwidth, destheight ); + + SelectObject (GlobalMemDC, bitmap->bm); + SelectObject (GlobalMemDC2, newbmp); + + // Copy selected section of main bitmap into newbmp before rotation + SetStretchBltMode(GlobalMemDC2, COLORONCOLOR); + StretchBlt(GlobalMemDC2, 0, 0, destwidth, destheight, GlobalMemDC, + srcx, srcy, srcwidth, srcheight, SRCPAINT); + + // Copy selected section of main bitmap into newbmp before rotation + SetStretchBltMode(GlobalMemDC2, COLORONCOLOR); + StretchBlt(GlobalMemDC2, 0, 0, destwidth, destheight, GlobalMemDC, + srcx, srcy, srcwidth, srcheight, SRCPAINT); + + //Fast (I hope) rectangle intersection, don't overwrite our borders + border = win->ClipRect.top; + + // Reset srcx and srcy as our new source bitmap starts at 0,0 + srcx = 0; + srcy = 0; + x += border; + y += border; + + if (x < border) + { + newwidth = destwidth - (border - x); + srcx += border - x; + x = border; + } + else if ((newwidth = win->ClipRect.right - x) > destwidth) + newwidth = destwidth; + if (y < border) + { + newheight = destheight - (border - y); + srcy += (border - y); + y = border; + } + else if ((newheight = win->ClipRect.bottom - y) > destheight) + newheight = destheight; + + if (NetrekPalette) + { + SelectPalette (sdb->mem_dc, NetrekPalette, FALSE); + RealizePalette (sdb->mem_dc); + } + + //Set the color of the bitmap + //(oddly enough, 1-bit = bk color, 0-bit = text (fg) color) + SetBkColor (sdb->mem_dc, colortable[color].rgb); + SetTextColor (sdb->mem_dc, colortable[BLACK].rgb); + + SetGraphicsMode(sdb->mem_dc,GM_ADVANCED); + + xForm.eM11 = (FLOAT) 1.0; + xForm.eM12 = (FLOAT) 0.0; + xForm.eM21 = (FLOAT) 0.0; + xForm.eM22 = (FLOAT) 1.0; + xForm.eDx = (float)x; + xForm.eDy = (float)y; + + SetWorldTransform(sdb->mem_dc,&xForm); + BitBlt(sdb->mem_dc, 0, 0, newwidth, newheight, GlobalMemDC2, 0, 0, SRCPAINT); + + // Reset xForm + xForm.eM11 = (FLOAT) 1.0; + xForm.eM12 = (FLOAT) 0.0; + xForm.eM21 = (FLOAT) 0.0; + xForm.eM22 = (FLOAT) 1.0; + xForm.eDx = (FLOAT) 0.0; + xForm.eDy = (FLOAT) 0.0; + + SetWorldTransform(sdb->mem_dc,&xForm); + + DeleteObject (newbmp); +} #endif /* DOUBLE_BUFFERING */ // Make a WIN_SCROLL type window. Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- newwin.c 7 May 2006 16:59:27 -0000 1.20 +++ newwin.c 14 May 2006 02:14:54 -0000 1.21 @@ -56,6 +56,7 @@ void loadbitmapsG (void); void loadbitmapsHR (void); void loadweaponsC (void); +void loadplanetsC (void); /******************************************************************************/ /*** loadbitmaps(), loadbitmaps1(), loadbitmapsT(), loadbitmapsG(), @@ -567,6 +568,83 @@ } /******************************************************************************/ +/*** loadplanetsC() - colorized planets +/******************************************************************************/ +void loadplanetsC() +{ + int j; + + /* Load the eight 5x1 planet bitmaps */ + planet_bitmaps[0] = + W_StoreBitmap3 ("bitmaps/planlibm/color/earth.bmp", + BMP_CPLANET_WIDTH * NUMTEAMS, BMP_CPLANET_HEIGHT, BMP_EARTH, w, + LR_DEFAULTCOLOR); + planet_bitmaps[1] = + W_StoreBitmap3 ("bitmaps/planlibm/color/klingus.bmp", + BMP_CPLANET_WIDTH * NUMTEAMS, BMP_CPLANET_HEIGHT, BMP_KLINGUS, w, + LR_DEFAULTCOLOR); + planet_bitmaps[2] = + W_StoreBitmap3 ("bitmaps/planlibm/color/orion.bmp", + BMP_CPLANET_WIDTH * NUMTEAMS, BMP_CPLANET_HEIGHT, BMP_ORION, w, + LR_DEFAULTCOLOR); + planet_bitmaps[3] = + W_StoreBitmap3 ("bitmaps/planlibm/color/romulus.bmp", + BMP_CPLANET_WIDTH * NUMTEAMS, BMP_CPLANET_HEIGHT, BMP_ROMULUS, w, + LR_DEFAULTCOLOR); + planet_bitmaps[4] = + W_StoreBitmap3 ("bitmaps/planlibm/color/agri1.bmp", + BMP_CPLANET_WIDTH * NUMTEAMS, BMP_CPLANET_HEIGHT, BMP_AGRI1, w, + LR_DEFAULTCOLOR); + planet_bitmaps[5] = + W_StoreBitmap3 ("bitmaps/planlibm/color/agri2.bmp", + BMP_CPLANET_WIDTH * NUMTEAMS, BMP_CPLANET_HEIGHT, BMP_AGRI2, w, + LR_DEFAULTCOLOR); + planet_bitmaps[6] = + W_StoreBitmap3 ("bitmaps/planlibm/color/rock1.bmp", + BMP_CPLANET_WIDTH * NUMTEAMS, BMP_CPLANET_HEIGHT, BMP_ROCK1, w, + LR_DEFAULTCOLOR); + planet_bitmaps[7] = + W_StoreBitmap3 ("bitmaps/planlibm/color/rock2.bmp", + BMP_CPLANET_WIDTH * NUMTEAMS, BMP_CPLANET_HEIGHT, BMP_ROCK2, w, + LR_DEFAULTCOLOR); + + /* Make pointers to the bitmaps */ + for (j = 0; j < NUMTEAMS; j++) + { + planet_earth[j] = + W_PointBitmap2 (planet_bitmaps[0], j, 0, BMP_CPLANET_WIDTH, + BMP_CPLANET_HEIGHT); + planet_klingus[j]= + W_PointBitmap2 (planet_bitmaps[1], j, 0, BMP_CPLANET_WIDTH, + BMP_CPLANET_HEIGHT); + planet_orion[j]= + W_PointBitmap2 (planet_bitmaps[2], j, 0, BMP_CPLANET_WIDTH, + BMP_CPLANET_HEIGHT); + planet_romulus[j]= + W_PointBitmap2 (planet_bitmaps[3], j, 0, BMP_CPLANET_WIDTH, + BMP_CPLANET_HEIGHT); + planet_agri1[j]= + W_PointBitmap2 (planet_bitmaps[4], j, 0, BMP_CPLANET_WIDTH, + BMP_CPLANET_HEIGHT); + planet_agri2[j]= + W_PointBitmap2 (planet_bitmaps[5], j, 0, BMP_CPLANET_WIDTH, + BMP_CPLANET_HEIGHT); + planet_rock1[j]= + W_PointBitmap2 (planet_bitmaps[6], j, 0, BMP_CPLANET_WIDTH, + BMP_CPLANET_HEIGHT); + planet_rock2[j]= + W_PointBitmap2 (planet_bitmaps[7], j, 0, BMP_CPLANET_WIDTH, + BMP_CPLANET_HEIGHT); + } + + /* Load the unknown planet bitmap */ + planet_unknown = + W_StoreBitmap3 ("bitmaps/planlibm/color/unknown.bmp", + BMP_CPLANET_WIDTH, BMP_CPLANET_HEIGHT, BMP_PLANET_UNKNOWN, w, + LR_DEFAULTCOLOR); +} + +/******************************************************************************/ /*** handleMessageWindowKeyDown() /******************************************************************************/ static void @@ -907,19 +985,30 @@ char *MPlanlib; planetBitmap = intDefault ("planetBitmap", planetBitmap); - - switch (planetBitmap) + planetBitmapGalaxy = intDefault ("planetBitmapGalaxy", planetBitmapGalaxy); + loadplanetsC(); // Always load new color planet bitmaps..for now + + switch (planetBitmap) // Case 3 = new color, but we never use Planlib { case 1: Planlib = "bitmaps/planlibm/planM.bmp"; - MPlanlib = "bitmaps/planlibm/mplanM.bmp"; break; case 2: Planlib = "bitmaps/planlibm/planR.bmp"; - MPlanlib = "bitmaps/planlibm/mplanR.bmp"; break; default: Planlib = "bitmaps/planlibm/plan.bmp"; + break; + } + switch (planetBitmapGalaxy) // Case 3 = new color, but we never use MPlanlib + { + case 1: + MPlanlib = "bitmaps/planlibm/mplanM.bmp"; + break; + case 2: + MPlanlib = "bitmaps/planlibm/mplanR.bmp"; + break; + default: MPlanlib = "bitmaps/planlibm/mplan.bmp"; break; } Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- local.c 12 May 2006 20:51:31 -0000 1.21 +++ local.c 14 May 2006 02:14:54 -0000 1.22 @@ -259,8 +259,8 @@ dyy = (int) (Sin[mydir] * streaklength); for (i = 0, s = star_sector; i < 16; i++, s++) { - dx = (s->s_x + xbase) - (me->p_x - (me->p_x % 40)); - dy = (s->s_y + ybase) - (me->p_y - (me->p_y % 40)); + dx = (s->s_x + xbase) - (me->p_x - (me->p_x % SCALE)); + dy = (s->s_y + ybase) - (me->p_y - (me->p_y % SCALE)); if (ABS(dx) > (view) || ABS(dy) > (view)) continue; @@ -283,8 +283,8 @@ } for (i = 0, s = star_sector; i < 16; i++, s++) { - dx = (s->s_x + xbase) - (me->p_x - (me->p_x % 40)); - dy = (s->s_y + ybase) - (me->p_y - (me->p_y % 40)); + dx = (s->s_x + xbase) - (me->p_x - (me->p_x % SCALE)); + dy = (s->s_y + ybase) - (me->p_y - (me->p_y % SCALE)); if (ABS(dx) > (view) || ABS(dy) > (view)) continue; @@ -354,17 +354,45 @@ dx = dx / SCALE + WINSIDE / 2; dy = dy / SCALE + WINSIDE / 2; - + + if (planetBitmap == 3) + { #ifndef DOUBLE_BUFFERING - W_WriteBitmap (dx - (BMP_PLANET_WIDTH / 2), - dy - (BMP_PLANET_HEIGHT / 2), getPlanetBitmap (l), - planetColor (l)); + W_WriteScaleBitmap (dx - (BMP_PLANET_WIDTH / 2), + dy - (BMP_PLANET_HEIGHT / 2), + BMP_PLANET_WIDTH, + BMP_PLANET_HEIGHT, + BMP_CPLANET_WIDTH, + BMP_CPLANET_HEIGHT, + 0, + planetBitmapC (l), + planetColor (l), + w); #else - W_WriteBitmapDB (localSDB, dx - (BMP_PLANET_WIDTH / 2), - dy - (BMP_PLANET_HEIGHT / 2), getPlanetBitmap (l), - planetColor (l)); + W_WriteScaleBitmapDB (localSDB, dx - (BMP_PLANET_WIDTH / 2), + dy - (BMP_PLANET_HEIGHT / 2), + BMP_PLANET_WIDTH, + BMP_PLANET_HEIGHT, + BMP_CPLANET_WIDTH, + BMP_CPLANET_HEIGHT, + 0, + planetBitmapC (l), + planetColor (l), + w); #endif - + } + else + { +#ifndef DOUBLE_BUFFERING + W_WriteBitmap (dx - (BMP_PLANET_WIDTH / 2), + dy - (BMP_PLANET_HEIGHT / 2), getPlanetBitmap (l), + planetColor (l)); +#else + W_WriteBitmapDB (localSDB, dx - (BMP_PLANET_WIDTH / 2), + dy - (BMP_PLANET_HEIGHT / 2), getPlanetBitmap (l), + planetColor (l)); +#endif + } if (showIND && ((l->pl_info & me->p_team) #ifdef RECORDGAME || playback @@ -836,19 +864,25 @@ #ifndef DOUBLE_BUFFERING W_WriteScaleBitmap (dx - (j->p_ship.s_width / 2), dy - (j->p_ship.s_height / 2), - (float)(BMP_SHIP_WIDTH_HR/j->p_ship.s_width), - (float)(BMP_SHIP_HEIGHT_HR/j->p_ship.s_height), + j->p_ship.s_width, + j->p_ship.s_height, + BMP_SHIP_WIDTH_HR, + BMP_SHIP_HEIGHT_HR, j->p_dir, ship_bitsHR[j->p_ship.s_type], - playerColor (j)); + playerColor (j), + w); #else W_WriteScaleBitmapDB (localSDB, dx - (j->p_ship.s_width / 2), dy - (j->p_ship.s_height / 2), - (float)(BMP_SHIP_WIDTH_HR/j->p_ship.s_width), - (float)(BMP_SHIP_HEIGHT_HR/j->p_ship.s_height), + j->p_ship.s_width, + j->p_ship.s_height, + BMP_SHIP_WIDTH_HR, + BMP_SHIP_HEIGHT_HR, j->p_dir, ship_bitsHR[j->p_ship.s_type], - playerColor (j)); + playerColor (j), + w); #endif } @@ -1744,9 +1778,6 @@ case FED: torpTeam = 1; break; - case IND: - torpTeam = 2; - break; case KLI: torpTeam = 3; break; @@ -1756,8 +1787,8 @@ case ROM: torpTeam = 5; break; - default: - torpTeam = 0; + default: // IND + torpTeam = 2; } } #ifndef DOUBLE_BUFFERING @@ -1809,9 +1840,6 @@ case FED: torpTeam = 1; break; - case IND: - torpTeam = 2; - break; case KLI: torpTeam = 3; break; @@ -1821,8 +1849,8 @@ case ROM: torpTeam = 5; break; - default: - torpTeam = 0; + default: // IND + torpTeam = 2; } } @@ -2036,9 +2064,6 @@ case FED: ptorpTeam = 1; break; - case IND: - ptorpTeam = 2; - break; case KLI: ptorpTeam = 3; break; @@ -2048,8 +2073,8 @@ case ROM: ptorpTeam = 5; break; - default: - ptorpTeam = 0; + default: // IND + ptorpTeam = 2; } } #ifndef DOUBLE_BUFFERING @@ -2103,9 +2128,6 @@ case FED: ptorpTeam = 1; break; - case IND: - ptorpTeam = 2; - break; case KLI: ptorpTeam = 3; break; @@ -2115,8 +2137,8 @@ case ROM: ptorpTeam = 5; break; - default: - ptorpTeam = 0; + default: // IND + ptorpTeam = 2; } } if (pt->pt_owner != me->p_no && ((pt->pt_war & me->p_team) || Index: death.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/death.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- death.c 7 May 2006 16:59:27 -0000 1.5 +++ death.c 14 May 2006 02:14:54 -0000 1.6 @@ -37,11 +37,8 @@ void death (void) { - W_Window oldw; W_Event event; - oldw = w; - #ifdef AUTOKEY if (autoKey) autoKeyAllOff (); @@ -53,7 +50,15 @@ if (oldalert != PFGREEN) { if (extraAlertBorder) - W_ChangeBorder (oldw, gColor); + { +#ifndef DOUBLE_BUFFERING + W_ChangeBorder (w, gColor); + W_ChangeBorder (mapw, gColor); +#else + W_ChangeBorderDB (localSDB, gColor); + W_ChangeBorderDB (mapSDB, gColor); +#endif + } W_ChangeBorder (baseWin, gColor); oldalert = PFGREEN; } @@ -193,7 +198,6 @@ W_WriteText (w, 50, 80, W_Cyan, deathmessage, strlen (deathmessage), deathFont); - w = oldw; /* This is a good time to expire all the torps and phasors that we have missed the TFREE and PFREE packes for. */ Index: option.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/option.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- option.c 7 May 2006 16:59:27 -0000 1.13 +++ option.c 14 May 2006 02:14:54 -0000 1.14 @@ -144,12 +144,12 @@ static char *plistmessagingmess[] = { "Disable player list messaging", "Enable player list messaging", - "" + "" }; static char *savebigmess[] = { "Save options without comments", "Save options with comments", - "" + "" }; static char *timermess[] = { "Timer shows nothing (off)", @@ -160,12 +160,19 @@ "" }; -static char *planetbitmapmess[] = { "Show Bronco bitmaps on local", - "Show Moo bitmaps on local", - "Show Rabbitear bitmaps on local", +static char *planetbitmapmess[] = { "Show Bronco bitmaps on local map", + "Show Moo bitmaps on local map", + "Show Rabbitear bitmaps on local map", + "Show New color bitmaps on local map", "" }; +static char *planetbitmapgalaxymess[] = { "Show Bronco bitmaps on galactic map", + "Show Moo bitmaps on galactic map", + "Show Rabbitear bitmaps on galactic map", + "Show New color bitmaps on galactic map", + "" +}; /* Only one of op_option, op_targetwin, and op_string should be defined. If * op_string is defined, op_size should be too and op_text is used without a * "Don't" prefix. if op_range is defined, there should be a %d in op_text @@ -231,7 +238,9 @@ struct int_range playerlistobserver_range = { 0, 4, 1 }; -struct int_range planetbitmaprange = { 0, 2, 1 }; +struct int_range planetbitmaprange = { 0, 3, 1 }; + +struct int_range planetbitmapgalaxyrange = { 0, 3, 1 }; int saveOpts = 1; /* Temp flag to use for save options action */ @@ -268,6 +277,7 @@ {0, "Planet Menu", &MenuPage, 0, 0, 0, NULL, &Menus_Range}, {1, "Page %d (click to change)", &MenuPage, 0, 0, 0, NULL, &Menus_Range}, {1, "", &planetBitmap, 0, 0, 0, planetbitmapmess, &planetbitmaprange}, + {1, "", &planetBitmapGalaxy, 0, 0, 0, planetbitmapgalaxymess, &planetbitmapgalaxyrange}, {1, "show planet names on local", &showPlanetNames, 0, 0, 0, NULL, NULL}, {1, "show owner on galactic", &showPlanetOwner, 0, 0, 0, NULL, NULL}, {1, "show IND planets", &showIND, 0, 0, 0, NULL, NULL}, @@ -698,45 +708,70 @@ /* Let's see if this is our option changed */ else if (op->op_option == &planetBitmap) { - char *Planlib; - char *MPlanlib; - - for (i = 0; i < PLANET_VIEWS; i++) - free (bplanets[i]); - for (i = 0; i < MPLANET_VIEWS; i++) - free (bmplanets[i]); - - switch (planetBitmap) + if (planetBitmap != 3) // Color planet bitmaps stay loaded at all times { - case 1: - Planlib = "bitmaps/planlibm/planM.bmp"; - MPlanlib = "bitmaps/planlibm/mplanM.bmp"; - break; - case 2: - Planlib = "bitmaps/planlibm/planR.bmp"; - MPlanlib = "bitmaps/planlibm/mplanR.bmp"; - break; - default: - Planlib = "bitmaps/planlibm/plan.bmp"; - MPlanlib = "bitmaps/planlibm/mplan.bmp"; - break; + char *Planlib; + + for (i = 0; i < PLANET_VIEWS; i++) + free (bplanets[i]); + + switch (planetBitmap) + { + case 1: + Planlib = "bitmaps/planlibm/planM.bmp"; + break; + case 2: + Planlib = "bitmaps/planlibm/planR.bmp"; + break; + default: + Planlib = "bitmaps/planlibm/plan.bmp"; + break; + } + base_planets = W_StoreBitmap3 (Planlib, BMP_PLANET_WIDTH, BMP_PLANET_HEIGHT * 9, + BMP_PLANET000, w, LR_MONOCHROME); + + for (i = 0; i < PLANET_VIEWS; i++) + { + bplanets[i] = W_PointBitmap2 (base_planets, 0, i, BMP_PLANET_WIDTH, + BMP_PLANET_HEIGHT); + } } - base_planets = W_StoreBitmap3 (Planlib, BMP_PLANET_WIDTH, BMP_PLANET_HEIGHT * 9, - BMP_PLANET000, w, LR_MONOCHROME); - base_mplanets = W_StoreBitmap3 (MPlanlib, BMP_MPLANET_WIDTH, BMP_MPLANET_HEIGHT * 9, - BMP_MPLANET000, mapw, LR_MONOCHROME); - for (i = 0; i < PLANET_VIEWS; i++) + redrawall = 1; + } + else if (op->op_option == &planetBitmapGalaxy) + { + if (planetBitmapGalaxy != 3) // Color planet bitmaps stay loaded at all times { - bplanets[i] = W_PointBitmap2 (base_planets, 0, i, BMP_PLANET_WIDTH, - BMP_PLANET_HEIGHT); - bmplanets[i] = W_PointBitmap2 (base_mplanets, 0, i, BMP_MPLANET_WIDTH, - BMP_MPLANET_HEIGHT); + char *MPlanlib; + + for (i = 0; i < MPLANET_VIEWS; i++) + free (bmplanets[i]); + + switch (planetBitmapGalaxy) + { + case 1: + MPlanlib = "bitmaps/planlibm/mplanM.bmp"; + break; + case 2: + MPlanlib = "bitmaps/planlibm/mplanR.bmp"; + break; + default: + MPlanlib = "bitmaps/planlibm/mplan.bmp"; + break; + } + base_mplanets = W_StoreBitmap3 (MPlanlib, BMP_MPLANET_WIDTH, BMP_MPLANET_HEIGHT * 9, + BMP_MPLANET000, mapw, LR_MONOCHROME); + + for (i = 0; i < PLANET_VIEWS; i++) + { + bmplanets[i] = W_PointBitmap2 (base_mplanets, 0, i, BMP_MPLANET_WIDTH, + BMP_MPLANET_HEIGHT); + } } redrawall = 1; } - #ifdef ROTATERACE else if (rotate != old_rotate) { Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- data.c 7 May 2006 16:59:27 -0000 1.17 +++ data.c 14 May 2006 02:14:54 -0000 1.18 @@ -57,8 +57,7 @@ * system support */ int niftyNewMessages = 1; unsigned int oldalert = 0; -int remap[32] = { 0, 1, 2, 0, 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, - 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +int remap[16] = { 0, 1, 2, 0, 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0 }; int messpend = 0; #ifdef XTRA_MESSAGE_UI int messageHUD = 0; /* Show message being typed on the local display */ @@ -102,6 +101,7 @@ int msgBeep = 1; /* ATM - msg beep */ int planetBitmap = 0; +int planetBitmapGalaxy = 0; int logging = 0; int continueTractor = 1; @@ -203,8 +203,8 @@ #ifdef SHORT_PACKETS int why_dead = 0; -int tryShort = 1; /* for .xtrekrc option */ -int tryShort1 = 1; +int tryShort = 0; /* for .xtrekrc option */ +int tryShort1 = 0; int recv_short = 0; int recv_mesg = 1; int recv_kmesg = 1; @@ -306,6 +306,12 @@ ori_bitmapsHR[NUM_TYPES], ind_bitmapsHR[NUM_TYPES]; // Planets +W_Icon planet_unknown; +W_Icon planet_bitmaps[8]; +W_Icon planet_earth[NUMTEAMS], planet_klingus[NUMTEAMS], planet_orion[NUMTEAMS], + planet_romulus[NUMTEAMS], planet_agri1[NUMTEAMS], planet_agri2[NUMTEAMS], + planet_rock1[NUMTEAMS], planet_rock2[NUMTEAMS]; + W_Icon base_planets; W_Icon base_mplanets; W_Icon bplanets[PLANET_VIEWS]; Index: defwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defwin.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- defwin.c 7 May 2006 16:59:27 -0000 1.4 +++ defwin.c 14 May 2006 02:14:54 -0000 1.5 @@ -18,6 +18,20 @@ * the use of it.) * * $Log$ + * Revision 1.5 2006/05/14 02:14:54 modemhero + * New planet bitmaps! Using Defcom's art. Changeable via planets menu. + * New netrekrc option, "planetBitmapGalaxy: (0-3)", same options as planetBitmap, but now you have + * the choice to change map display planets too! And have map and local planets use different + * bitmap sets + * Fixed bug where map window border wasn't being redrawn on death + * Shortpackets is now off by default. In the current state of internet connectivity, most people + * don't need the reduced packets, which don't send complete information and break certain features + * such as which direction other players are moving, robot shields, observer geno messages, + * shield/cloak status for warp 0 players, etc. + * Fix to problem with bottom and right borders in certain windows (like map) getting overwritten - thanks Stas! + * Client now recognizes planets that are flagged as "core", waiting on server patch to + * actually get this information and do something with it + * * Revision 1.4 2006/05/07 16:59:27 modemhero * Major features in this patch are: * Merge of Stas' latest source into client. @@ -325,7 +339,7 @@ , #ifdef SHORT_PACKETS { - "tryShort", BOOL_DEF, "Try short packets at startup", &tryShort1, + "tryShort", BOOL_DEF, "Use short packets for communications", &tryShort1, { {0, NULL, ""}, {0, NULL, NULL} @@ -334,7 +348,7 @@ , #endif { - "tryUdp", BOOL_DEF, "Try UDP automatically", &tryUdp1, + "tryUdp", BOOL_DEF, "Use UDP for communications", &tryUdp1, { {0, NULL, ""}, {0, NULL, NULL} Index: map.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/map.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- map.c 12 May 2006 01:58:37 -0000 1.7 +++ map.c 14 May 2006 02:14:54 -0000 1.8 @@ -253,6 +253,83 @@ } /******************************************************************************/ +/*** planetmBitmapC() +/******************************************************************************/ +extern inline W_Icon +planetBitmapC (register struct planet *p) +/* + * Choose the color bitmap for a planet. + */ +{ + int i; + W_Icon (*planet_bits); + + if ((p->pl_info & me->p_team) +#ifdef RECORDGAME + || playback +#endif + ) + { + /* Logic for planet assignment: + 1) Check if it's a homeworld. If so, find which homeworld it is + 2) Check if it's a core planet + 2a) Check if it's agri + 3) Check if it's agri + 4) Default planet bitmap + 5) Switch statement by owner to determine color + */ + if (p->pl_flags & PLHOME) + { + if (!strcmp(p->pl_name, "Earth")) + planet_bits = planet_earth; + else if (!strcmp(p->pl_name, "Klingus")) + planet_bits = planet_klingus; + else if (!strcmp(p->pl_name, "Romulus")) + planet_bits = planet_romulus; + else if (!strcmp(p->pl_name, "Orion")) + planet_bits = planet_orion; + else // This should never be called + planet_bits = planet_rock1; + } + else if (p->pl_flags & PLCORE) // Not functional yet due to server + { + if (p->pl_flags & PLAGRI) + planet_bits = planet_agri1; + else + planet_bits = planet_rock1; + } + else if (p->pl_flags & PLAGRI) + planet_bits = planet_agri2; + else + planet_bits = planet_rock2; + + switch (p->pl_owner) + { + case FED: + i = 0; + break; + case KLI: + i = 2; + break; + case ORI: + i = 3; + break; + case ROM: + i = 4; + break; + default: // IND + i = 1; + break; + } + return planet_bits[i]; + } + else + { + return planet_unknown; + } +} + +/******************************************************************************/ /*** agriColor() /******************************************************************************/ W_Color getAgriColor (struct planet *l) @@ -342,24 +419,61 @@ if (useLite && emph_planet_seq_n[l->pl_no] > 0) { int seq_n = emph_planet_seq_n[l->pl_no] % emph_planet_seq_frames; + + if (planetBitmapGalaxy == 3) + { +#ifndef DOUBLE_BUFFERING + W_OverlayBitmap(dx - (emph_planet_seq_width / 2 + 1), + dy - (emph_planet_seq_height / 2), + emph_planet_seq[seq_n], + W_White); + W_WriteScaleBitmap(dx - (BMP_MPLANET_WIDTH / 2), + dy - (BMP_MPLANET_HEIGHT / 2), + BMP_MPLANET_WIDTH, + BMP_MPLANET_HEIGHT, + BMP_CPLANET_WIDTH, + BMP_CPLANET_HEIGHT, + 0, + planetBitmapC(l), planetColor(l), + mapw); +#else + W_OverlayBitmapDB(mapSDB, dx - (emph_planet_seq_width / 2 + 1), + dy - (emph_planet_seq_height / 2), + emph_planet_seq[seq_n], + W_White); + + W_WriteScaleBitmapDB(mapSDB, dx - (BMP_MPLANET_WIDTH / 2), + dy - (BMP_MPLANET_HEIGHT / 2), + BMP_MPLANET_WIDTH, + BMP_MPLANET_HEIGHT, + BMP_CPLANET_WIDTH, + BMP_CPLANET_HEIGHT, + 0, + planetBitmapC(l), planetColor(l), + mapw); +#endif + } + else + { #ifndef DOUBLE_BUFFERING - W_OverlayBitmap(dx - (emph_planet_seq_width / 2 + 1), - dy - (emph_planet_seq_height / 2), - emph_planet_seq[seq_n], - W_White); + W_OverlayBitmap(dx - (emph_planet_seq_width / 2 + 1), + dy - (emph_planet_seq_height / 2), + emph_planet_seq[seq_n], + W_White); - W_WriteBitmap(dx - (BMP_MPLANET_WIDTH / 2), dy - (BMP_MPLANET_HEIGHT / 2), - planetmBitmap(l), planetColor(l)); + W_WriteBitmap(dx - (BMP_MPLANET_WIDTH / 2), dy - (BMP_MPLANET_HEIGHT / 2), + planetmBitmap(l), planetColor(l)); #else - W_OverlayBitmapDB(mapSDB, dx - (emph_planet_seq_width / 2 + 1), - dy - (emph_planet_seq_height / 2), - emph_planet_seq[seq_n], - W_White); + W_OverlayBitmapDB(mapSDB, dx - (emph_planet_seq_width / 2 + 1), + dy - (emph_planet_seq_height / 2), + emph_planet_seq[seq_n], + W_White); - W_WriteBitmapDB(mapSDB, dx - (BMP_MPLANET_WIDTH / 2), dy - (BMP_MPLANET_HEIGHT / 2), - planetmBitmap(l), planetColor(l)); + W_WriteBitmapDB(mapSDB, dx - (BMP_MPLANET_WIDTH / 2), dy - (BMP_MPLANET_HEIGHT / 2), + planetmBitmap(l), planetColor(l)); #endif + } emph_planet_seq_n[l->pl_no] -= 1; l->pl_flags |= PLREDRAW; /* Leave redraw on until * * * done highlighting */ @@ -368,16 +482,43 @@ } else { +#endif + if (planetBitmapGalaxy == 3) + { +#ifndef DOUBLE_BUFFERING + W_OverlayScaleBitmap (dx - (BMP_MPLANET_WIDTH / 2), + dy - (BMP_MPLANET_HEIGHT / 2), + BMP_MPLANET_WIDTH, + BMP_MPLANET_HEIGHT, + BMP_CPLANET_WIDTH, + BMP_CPLANET_HEIGHT, + planetBitmapC (l), + planetColor (l), + mapw); +#else + W_OverlayScaleBitmapDB (mapSDB, dx - (BMP_MPLANET_WIDTH / 2), + dy - (BMP_MPLANET_HEIGHT / 2), + BMP_MPLANET_WIDTH, + BMP_MPLANET_HEIGHT, + BMP_CPLANET_WIDTH, + BMP_CPLANET_HEIGHT, + planetBitmapC (l), + planetColor (l), + mapw); #endif + } + else + { #ifndef DOUBLE_BUFFERING - W_OverlayBitmap (dx - (BMP_MPLANET_WIDTH / 2), - dy - (BMP_MPLANET_HEIGHT / 2), planetmBitmap (l), - planetColor (l)); + W_OverlayBitmap (dx - (BMP_MPLANET_WIDTH / 2), + dy - (BMP_MPLANET_HEIGHT / 2), planetmBitmap (l), + planetColor (l)); #else - W_OverlayBitmapDB (mapSDB, dx - (BMP_MPLANET_WIDTH / 2), - dy - (BMP_MPLANET_HEIGHT / 2), planetmBitmap (l), - planetColor (l)); + W_OverlayBitmapDB (mapSDB, dx - (BMP_MPLANET_WIDTH / 2), + dy - (BMP_MPLANET_HEIGHT / 2), planetmBitmap (l), + planetColor (l)); #endif + } #ifdef BEEPLITE } #endif Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- defaults.c 7 May 2006 16:59:27 -0000 1.15 +++ defaults.c 14 May 2006 02:14:54 -0000 1.16 @@ -344,10 +344,21 @@ }, {"planetBitmap", &planetBitmap, RC_INT, { - "Type of planet bitmaps", + "Type of planet bitmaps on local map", "0 - Bronco (default)", "1 - Moo", "2 - Rabbitear", + "3 - New color", + NULL + } + }, + {"planetBitmapGalaxy", &planetBitmapGalaxy, RC_INT, + { + "Type of planet bitmaps on galactic map", + "0 - Bronco (default)", + "1 - Moo", + "2 - Rabbitear", + "3 - New color", NULL } }, From quozl at users.sourceforge.net Mon May 15 04:13:20 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Mon, 15 May 2006 09:13:20 +0000 Subject: [netrek-cvs] server/Vanilla/include patchlevel.h, 1.6, 1.7 version.h, 1.2, 1.3 Message-ID: Update of /cvsroot/netrek/server/Vanilla/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv411/include Modified Files: patchlevel.h version.h Log Message: release 2.11.0 preparation Index: patchlevel.h =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/include/patchlevel.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- patchlevel.h 22 Apr 2006 02:16:45 -0000 1.6 +++ patchlevel.h 15 May 2006 09:13:18 -0000 1.7 @@ -12,7 +12,7 @@ * (a) reset this to zero before each major release, and; * (b) increment this number before each patch release. */ -#define PATCHLEVEL 3 +#define PATCHLEVEL 0 #if !defined(NULL) #define NULL 0 #endif Index: version.h =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/include/version.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- version.h 28 Sep 2005 12:14:05 -0000 1.2 +++ version.h 15 May 2006 09:13:18 -0000 1.3 @@ -1,9 +1,9 @@ /* store the version info here */ #ifdef SVERS -static char serv_version[]="Vanilla server version 2.10"; +static char serv_version[]="Vanilla server version 2.11"; #endif #ifdef MVERS -static char mvers[]="2.10"; +static char mvers[]="2.11"; #endif From quozl at users.sourceforge.net Mon May 15 04:13:20 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Mon, 15 May 2006 09:13:20 +0000 Subject: [netrek-cvs] server/Vanilla/rpm netrek.spec,1.4,1.5 Message-ID: Update of /cvsroot/netrek/server/Vanilla/rpm In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv411/rpm Modified Files: netrek.spec Log Message: release 2.11.0 preparation Index: netrek.spec =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/rpm/netrek.spec,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- netrek.spec 22 Apr 2006 02:16:47 -0000 1.4 +++ netrek.spec 15 May 2006 09:13:18 -0000 1.5 @@ -1,6 +1,6 @@ Summary: Netrek Software Suite Name: netrek -Version: 2.10.3 +Version: 2.11.0 Release: 0 Copyright: Undetermined Packager: Vanilla Server Development Team From quozl at users.sourceforge.net Mon May 15 04:13:20 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Mon, 15 May 2006 09:13:20 +0000 Subject: [netrek-cvs] server/Vanilla ChangeLog, 1.43, 1.44 Makefile.in, 1.11, 1.12 README.releasing, 1.13, 1.14 Message-ID: Update of /cvsroot/netrek/server/Vanilla In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv411 Modified Files: ChangeLog Makefile.in README.releasing Log Message: release 2.11.0 preparation Index: Makefile.in =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/Makefile.in,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Makefile.in 6 May 2006 12:02:49 -0000 1.11 +++ Makefile.in 15 May 2006 09:13:17 -0000 1.12 @@ -5,7 +5,7 @@ # PACKAGE=netrek-server-vanilla -VERSION=2.10.3 +VERSION=2.11.0 VPATH = @srcdir@ srcdir = @srcdir@ Index: README.releasing =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/README.releasing,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- README.releasing 22 Apr 2006 02:16:45 -0000 1.13 +++ README.releasing 15 May 2006 09:13:17 -0000 1.14 @@ -7,8 +7,8 @@ cd Vanilla # set variables -VS=2.10.3 -VL=v_2_10_3 +VS=2.11.0 +VL=v_2_11_0 PN=netrek-server-vanilla # check version numbers in files @@ -18,6 +18,7 @@ # debian/changelog # rpm/netrek.spec # README.releasing +# ChangeLog (add release date) # crosscheck updates in CVS against ChangeLog # crosscheck updates in ChangeLog against NEWS Index: ChangeLog =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ChangeLog,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- ChangeLog 12 May 2006 03:44:47 -0000 1.43 +++ ChangeLog 15 May 2006 09:13:17 -0000 1.44 @@ -1,8 +1,11 @@ +Mon May 15 19:01:27 2006 James Cameron + + * netrek-server-vanilla-2.11.0 released Mon May 8 18:35:57 2006 Bill Balcerski - * PROJECTS, ntserv/redraw.c: fix to bug where observer locks - onto robot and cannot input any other commands + * PROJECTS, ntserv/redraw.c: fix to bug where observer locks onto + robot and cannot input any other commands. Mon May 8 18:18:38 2006 James Cameron From quozl at users.sourceforge.net Mon May 15 04:13:20 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Mon, 15 May 2006 09:13:20 +0000 Subject: [netrek-cvs] server/Vanilla/debian changelog,1.4,1.5 Message-ID: Update of /cvsroot/netrek/server/Vanilla/debian In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv411/debian Modified Files: changelog Log Message: release 2.11.0 preparation Index: changelog =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/debian/changelog,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- changelog 22 Apr 2006 02:16:45 -0000 1.4 +++ changelog 15 May 2006 09:13:18 -0000 1.5 @@ -1,3 +1,9 @@ +netrek-server-vanilla (2.11.0-0) unstable; urgency=low + + * release planned + + -- James Cameron Mon, 15 May 2006 18:59:44 +1000 + netrek-server-vanilla (2.10.3-0) unstable; urgency=low * release planned From quozl at users.sourceforge.net Mon May 15 04:14:18 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Mon, 15 May 2006 09:14:18 +0000 Subject: [netrek-cvs] server/Vanilla NEWS,1.22,1.23 Message-ID: Update of /cvsroot/netrek/server/Vanilla In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv877 Modified Files: NEWS Log Message: release 2.11.0 commit Index: NEWS =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/NEWS,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- NEWS 12 May 2006 03:44:47 -0000 1.22 +++ NEWS 15 May 2006 09:14:16 -0000 1.23 @@ -1,3 +1,5 @@ +2.11.0: released 2006-05-15 + - fix practice robots to cloak when bombing near home planet [Huang] - fix INL confine to knock ships out of orbit [Cameron] - describe a local unnamed server as "server on this computer" [Cameron] From modemhero at users.sourceforge.net Tue May 16 00:10:15 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 16 May 2006 05:10:15 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.44, 1.45 hints.dat, 1.5, 1.6 netrekrc_options.txt, 1.6, 1.7 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv18138/resources/docs Modified Files: changes.txt hints.dat netrekrc_options.txt Log Message: Addition of core flag to planet info and planet menu. New quit window stuff. More work on planet bitmaps and draw functions. Index: hints.dat =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/hints.dat,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- hints.dat 21 Apr 2006 11:35:02 -0000 1.5 +++ hints.dat 16 May 2006 05:10:13 -0000 1.6 @@ -7,6 +7,7 @@ an observer can lock onto a cloaked teammate from the player list. macros can be sent using players from the player list as the target. Some default distresses can be sent this way too. you can change the dashboard clock to a timer through the Visuals Menu. The \ key is default for reseting the timer. +short packets reduce the amount of information your client receives. Unless you are playing on a terrible net connection, leave short packets off! when you are low on planets, you should let the more experienced players pick the armies. Those should not be wasted. when you are in doubt, you should ask a Commodore, Rear Adm. or Admiral for advice. when your team has lots of armies, you should not be afraid to pick them. They'll get bombed anyway. Index: netrekrc_options.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc_options.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- netrekrc_options.txt 14 May 2006 02:14:54 -0000 1.6 +++ netrekrc_options.txt 16 May 2006 05:10:13 -0000 1.7 @@ -109,6 +109,7 @@ # on - COW style # off - old style +newQuit: (on/off) use new quit window newSound: (on/off) use layered, stereo sound newSoundAngles: (on/off) use 3D sound effects (only works if newSound is on) omitTeamLetter: (on/off) omit team letter on galaxy Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- changes.txt 14 May 2006 02:14:54 -0000 1.44 +++ changes.txt 16 May 2006 05:10:13 -0000 1.45 @@ -1,7 +1,8 @@ Version TBA: +- new netrekrc option, "newQuit (on/off)", to use new quit window - new netrekrc option, "planetBitmapGalaxy: (0-3)", same options as planetBitmap, but now you have the choice to change map display planets too! And have map and local planets use different - bitmap sets + bitmap sets. - fixed bug where map window border wasn't being redrawn on death - shortpackets is now off by default. In the current state of internet connectivity, most people don't need the reduced packets, which don't send complete information and break certain features @@ -9,8 +10,8 @@ shield/cloak status for warp 0 players, etc. - fix to problem with bottom and right borders in certain windows (like map) getting overwritten - new planet bitmaps! Using Defcom's art. Changeable via planets menu. -- client now recognizes planets that are flagged as "core", waiting on server patch to - actually get this information +- client now recognizes planets that are flagged as "core": this shows up in planet list menu, + planet info, and core planets also use different bitmaps in the "New Color" bitmap set - redesigned color1 ori GA so it's not the same pic as base - double buffering now in (to reduce flicker) - added link to genocide.netrek.org newbie manual to replace broken link From modemhero at users.sourceforge.net Tue May 16 00:10:15 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 16 May 2006 05:10:15 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.21, 1.22 build.cmd, 1.15, 1.16 clientr.suo, 1.3, 1.4 clientr.vcproj, 1.1, 1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv18138 Modified Files: NetrekXP to do list.C build.cmd clientr.suo clientr.vcproj Log Message: Addition of core flag to planet info and planet menu. New quit window stuff. More work on planet bitmaps and draw functions. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 Binary files /tmp/cvs4aehI5 and /tmp/cvstIBaej differ Index: clientr.vcproj =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.vcproj,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- clientr.vcproj 12 May 2006 02:27:47 -0000 1.1 +++ clientr.vcproj 16 May 2006 05:10:13 -0000 1.2 @@ -172,7 +172,7 @@ Update of /cvsroot/netrek/client/netrekxp/resources/planlibm/color In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv18138/resources/planlibm/color Modified Files: unknown.bmp Log Message: Addition of core flag to planet info and planet menu. New quit window stuff. More work on planet bitmaps and draw functions. Index: unknown.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/planlibm/color/unknown.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsxPziH5 and /tmp/cvsHXY0cj differ From modemhero at users.sourceforge.net Tue May 16 00:10:15 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 16 May 2006 05:10:15 +0000 Subject: [netrek-cvs] client/netrekxp/resources/htmlhelp/html generalconfig.html, 1.8, 1.9 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv18138/resources/htmlhelp/html Modified Files: generalconfig.html Log Message: Addition of core flag to planet info and planet menu. New quit window stuff. More work on planet bitmaps and draw functions. Index: generalconfig.html =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html/generalconfig.html,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- generalconfig.html 14 May 2006 02:14:54 -0000 1.8 +++ generalconfig.html 16 May 2006 05:10:13 -0000 1.9 @@ -532,6 +532,16 @@ +newQuit +Use new quit window + +
        +
      • on(default)
      • +
      • off
      • +
      + + + newSound Use new layered, stereo sound effects From modemhero at users.sourceforge.net Tue May 16 00:10:15 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 16 May 2006 05:10:15 +0000 Subject: [netrek-cvs] client/netrekxp/src data.c, 1.18, 1.19 defaults.c, 1.16, 1.17 inform.c, 1.2, 1.3 map.c, 1.8, 1.9 mswindow.c, 1.20, 1.21 newwin.c, 1.21, 1.22 planetlist.c, 1.1.1.1, 1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv18138/src Modified Files: data.c defaults.c inform.c map.c mswindow.c newwin.c planetlist.c Log Message: Addition of core flag to planet info and planet menu. New quit window stuff. More work on planet bitmaps and draw functions. Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- mswindow.c 14 May 2006 02:14:54 -0000 1.20 +++ mswindow.c 16 May 2006 05:10:13 -0000 1.21 @@ -451,7 +451,8 @@ // Free other bitmaps free (clockpic); - + free (clockhandpic); + for (j = 0; j < NUM_CTORP_TYPES; j++) { for (i = 0; i < BMP_TORPDET_FRAMES; i++) @@ -4967,6 +4968,7 @@ int destheight, int srcwidth, int srcheight, + int angle, W_Icon icon, W_Color color, W_Window window) @@ -4978,6 +4980,8 @@ HBITMAP newbmp; XFORM xForm; int newwidth, newheight; + double radians; + float cosine, sine, xscale, yscale, eDx, eDy; FNHEADER_VOID; // First copy bitmap into new bitmap, and scale it. This makes life @@ -5038,17 +5042,40 @@ SetBkColor (hdc, colortable[color].rgb); SetTextColor (hdc, colortable[BLACK].rgb); + //Convert angle to radians + radians=(2*3.14159*angle/360); + + cosine=(float)cos(radians); + sine=(float)sin(radians); + + // Scale used to find bitmap center + xscale = (float)(newwidth/2); + yscale = (float)(newheight/2); + + eDx = x + xscale - cosine*(xscale) + sine*(yscale); + eDy = y + yscale - cosine*(yscale) - sine*(xscale); SetGraphicsMode(hdc,GM_ADVANCED); + xForm.eM11=cosine; + xForm.eM12=sine; + xForm.eM21=-sine; + xForm.eM22=cosine; + xForm.eDx = eDx; + xForm.eDy = eDy; + + SetWorldTransform(hdc,&xForm); + + BitBlt(hdc, 0, 0, newwidth, newheight, GlobalMemDC2, srcx, srcy, SRCPAINT); + + // Reset xForm xForm.eM11 = (FLOAT) 1.0; xForm.eM12 = (FLOAT) 0.0; xForm.eM21 = (FLOAT) 0.0; xForm.eM22 = (FLOAT) 1.0; - xForm.eDx = (float)x; - xForm.eDy = (float)y; + xForm.eDx = (FLOAT) 0.0; + xForm.eDy = (FLOAT) 0.0; - SetWorldTransform(hdc,&xForm); - BitBlt(hdc, 0, 0, newwidth, newheight, GlobalMemDC2, 0, 0, SRCPAINT); + SetWorldTransform(hdc,&xForm); ReleaseDC (win->hwnd, hdc); DeleteObject (newbmp); @@ -6213,7 +6240,8 @@ void W_OverlayScaleBitmapDB (SDBUFFER * sdb, int x, int y, int destwidth, int destheight, - int srcwidth, int srcheight, W_Icon icon, W_Color color, W_Window window) + int srcwidth, int srcheight, int angle, + W_Icon icon, W_Color color, W_Window window) { register struct Icon *bitmap = (struct Icon *) icon; register int border; @@ -6221,6 +6249,8 @@ HBITMAP newbmp; XFORM xForm; int newwidth, newheight; + double radians; + float cosine, sine, xscale, yscale, eDx, eDy; FNHEADER_VOID; // First copy bitmap into new bitmap, and scale it. This makes life @@ -6280,17 +6310,29 @@ SetBkColor (sdb->mem_dc, colortable[color].rgb); SetTextColor (sdb->mem_dc, colortable[BLACK].rgb); + //Convert angle to radians + radians=(2*3.14159*angle/360); + + cosine=(float)cos(radians); + sine=(float)sin(radians); + + // Scale used to find bitmap center + xscale = (float)(newwidth/2); + yscale = (float)(newheight/2); + + eDx = x + xscale - cosine*(xscale) + sine*(yscale); + eDy = y + yscale - cosine*(yscale) - sine*(xscale); SetGraphicsMode(sdb->mem_dc,GM_ADVANCED); - xForm.eM11 = (FLOAT) 1.0; - xForm.eM12 = (FLOAT) 0.0; - xForm.eM21 = (FLOAT) 0.0; - xForm.eM22 = (FLOAT) 1.0; - xForm.eDx = (float)x; - xForm.eDy = (float)y; + xForm.eM11=cosine; + xForm.eM12=sine; + xForm.eM21=-sine; + xForm.eM22=cosine; + xForm.eDx = eDx; + xForm.eDy = eDy; SetWorldTransform(sdb->mem_dc,&xForm); - BitBlt(sdb->mem_dc, 0, 0, newwidth, newheight, GlobalMemDC2, 0, 0, SRCPAINT); + BitBlt(sdb->mem_dc, 0, 0, newwidth, newheight, GlobalMemDC2, srcx, srcy, SRCPAINT); // Reset xForm xForm.eM11 = (FLOAT) 1.0; @@ -6301,7 +6343,7 @@ xForm.eDy = (FLOAT) 0.0; SetWorldTransform(sdb->mem_dc,&xForm); - + DeleteObject (newbmp); } #endif /* DOUBLE_BUFFERING */ Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- newwin.c 14 May 2006 02:14:54 -0000 1.21 +++ newwin.c 16 May 2006 05:10:13 -0000 1.22 @@ -704,7 +704,7 @@ W_SetWindowButtonHandler (messagew, handleMessageWindowButton); W_SetWindowExposeHandler (messagew, DisplayMessage); - planetw = W_MakeTextWindow ("planet", 10, 10, 53, MAXPLANETS + 3, w, 2); + planetw = W_MakeTextWindow ("planet", 10, 10, 57, MAXPLANETS + 3, w, 2); W_SetWindowExposeHandler (planetw, planetlist); rankw = W_MakeTextWindow ("rank", 50, 300, 65, NUMRANKS + 9, w, 2); @@ -1196,11 +1196,23 @@ stipple = W_StoreBitmap3 ("bitmaps/misclib/stipple.bmp", BMP_STIPPLE_WIDTH, BMP_STIPPLE_HEIGHT, BMP_STIPPLE, w, LR_MONOCHROME); - clockpic = - W_StoreBitmap3 ("bitmaps/misclib/clock.bmp", BMP_CLOCK_WIDTH, - BMP_CLOCK_HEIGHT, BMP_CLOCK, qwin, LR_MONOCHROME); + if (newQuit) + { + clockpic = + W_StoreBitmap3 ("bitmaps/misclib/color/clock.bmp", BMP_CCLOCK_WIDTH, + BMP_CCLOCK_HEIGHT, BMP_CLOCK, qwin, LR_DEFAULTCOLOR); + clockhandpic = + W_StoreBitmap3 ("bitmaps/misclib/color/clockhand.bmp", BMP_CHAND_WIDTH, + BMP_CHAND_HEIGHT, BMP_CLOCKHAND, qwin, LR_DEFAULTCOLOR); + } + else + { + clockpic = + W_StoreBitmap3 ("bitmaps/misclib/clock.bmp", BMP_CLOCK_WIDTH, + BMP_CLOCK_HEIGHT, BMP_CLOCK, qwin, LR_MONOCHROME); + } genopic = - W_StoreBitmap3 ("bitmaps/misclib/genocide.bmp", WINSIDE, + W_StoreBitmap3 ("bitmaps/misclib/color/genocide.bmp", WINSIDE, WINSIDE, BMP_GENO, w, LR_DEFAULTCOLOR); } @@ -1503,7 +1515,7 @@ redrawTeam (teamWin[i], i, &lastplayercount[i]); break; } - if (event.Window == qwin) + if (event.Window == qwin && !newQuit) { redrawQuit (); } @@ -1924,9 +1936,6 @@ W_WriteText (qwin, 5, 5, textColor, "Quit NetrekXP", 13, W_RegularFont); } - -#define CLOCK_WID (BOXSIDE * 9 / 10) -#define CLOCK_HEI (BOXSIDE * 2 / 3) #define CLOCK_BDR 0 #define CLOCK_X (BOXSIDE / 2 - CLOCK_WID / 2) #define CLOCK_Y (BOXSIDE / 2 - CLOCK_HEI / 2) @@ -1939,9 +1948,23 @@ void showTimeLeft (time_t time, time_t max) { + register struct player *j = me; char buf[BUFSIZ], *cp; - int cx, cy, ex, ey, tx, ty; + int cx, cy, tx, ty; + int ex = 0, ey = 0; + int CLOCK_WID, CLOCK_HEI; + int angle; + if (newQuit) + { + CLOCK_WID = BOXSIDE; + CLOCK_HEI = BOXSIDE; + } + else + { + CLOCK_WID = (BOXSIDE * 9 / 10); + CLOCK_HEI = (BOXSIDE * 2 / 3); + } if ((max - time) < 10 && time & 1) { W_Beep (); @@ -1950,21 +1973,40 @@ W_ClearArea (qwin, CLOCK_X, CLOCK_Y, CLOCK_WID, CLOCK_HEI); cx = CLOCK_X + CLOCK_WID / 2; - cy = CLOCK_Y + (CLOCK_HEI - W_Textheight) / 2; - ex = cx - BMP_CLOCK_WIDTH / 2; - ey = cy - BMP_CLOCK_HEIGHT / 2; - W_WriteBitmap (ex, ey, clockpic, foreColor); + if (newQuit) + { + cy = CLOCK_Y + CLOCK_HEI / 2; + + angle = (int)(-360 * time / max); + W_WriteBitmap ( CLOCK_BDR, CLOCK_BDR, clockpic, foreColor); + W_OverlayScaleBitmap (CLOCK_BDR, CLOCK_BDR, BMP_CHAND_WIDTH, BMP_CHAND_HEIGHT, + BMP_CHAND_WIDTH, BMP_CHAND_HEIGHT, + angle, clockhandpic, foreColor, qwin); + sprintf (buf, "%d", max - time); + tx = cx - W_Textwidth * strlen (buf) / 2; + ty = 2*(cy - W_Textheight / 2)/3; + W_WriteText (qwin, tx, ty, textColor, buf, strlen (buf), W_RegularFont); - ex = (int) (cx - BMP_CLOCK_WIDTH * sin (2 * XPI * time / max) / 2); - ey = (int) (cy - BMP_CLOCK_HEIGHT * cos (2 * XPI * time / max) / 2); - W_MakeLine (qwin, cx, cy, ex, ey, foreColor); + cp = "Quit NetrekXP"; + } + else + { + cy = CLOCK_Y + (CLOCK_HEI - W_Textheight) / 2; + ex = cx - BMP_CLOCK_WIDTH / 2; + ey = cy - BMP_CLOCK_HEIGHT / 2; + W_WriteBitmap (ex, ey, clockpic, foreColor); + + ex = (int) (cx - BMP_CLOCK_WIDTH * sin (2 * XPI * time / max) / 2); + ey = (int) (cy - BMP_CLOCK_HEIGHT * cos (2 * XPI * time / max) / 2); + W_MakeLine (qwin, cx, cy, ex, ey, foreColor); - sprintf (buf, "%d", max - time); - tx = cx - W_Textwidth * strlen (buf) / 2; - ty = cy - W_Textheight / 2; - W_WriteText (qwin, tx, ty, textColor, buf, strlen (buf), W_RegularFont); + sprintf (buf, "%d", max - time); + tx = cx - W_Textwidth * strlen (buf) / 2; + ty = cy - W_Textheight / 2; + W_WriteText (qwin, tx, ty, textColor, buf, strlen (buf), W_RegularFont); - cp = "Auto Quit"; + cp = "Auto Quit"; + } tx = CLOCK_X + cx - W_Textwidth * strlen (cp) / 2; ty = CLOCK_Y + CLOCK_HEI - W_Textheight; W_WriteText (qwin, tx, ty, textColor, cp, strlen (cp), W_RegularFont); Index: inform.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/inform.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- inform.c 12 Apr 2006 04:20:03 -0000 1.2 +++ inform.c 16 May 2006 05:10:13 -0000 1.3 @@ -225,13 +225,13 @@ else { /* Planet */ /* Too close to the edge? */ - if (mx + 20 * W_Textwidth + 2 > windowWidth) - mx = windowWidth - 25 * W_Textwidth - 2; + if (mx + 23 * W_Textwidth + 2 > windowWidth) + mx = windowWidth - 28 * W_Textwidth - 2; if (my + 3 * W_Textheight + 2 > windowHeight) my = windowHeight - 3 * W_Textheight - 2; infow = - W_MakeWindow ("info", mx, my, W_Textwidth * 25, W_Textheight * 3, + W_MakeWindow ("info", mx, my, W_Textwidth * 28, W_Textheight * 3, ww, 2, foreColor); W_MapWindow (infow); k = &planets[target->o_num]; @@ -249,10 +249,11 @@ (void) sprintf (buf, "Armies %d", k->pl_armies); W_WriteText (infow, W_Textwidth, W_Textheight * line++, planetColor (k), buf, strlen (buf), W_RegularFont); - (void) sprintf (buf, "%s %s %s %c%c%c%c", + (void) sprintf (buf, "%s %s %s %s %c%c%c%c", (k->pl_flags & PLREPAIR ? "REPAIR" : " "), (k->pl_flags & PLFUEL ? "FUEL" : " "), (k->pl_flags & PLAGRI ? "AGRI" : " "), + (k->pl_flags & PLCORE ? "CORE" : " "), (k->pl_info & FED ? 'F' : ' '), (k->pl_info & ROM ? 'R' : ' '), (k->pl_info & KLI ? 'K' : ' '), Index: planetlist.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/planetlist.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- planetlist.c 21 Jan 2003 21:28:42 -0000 1.1.1.1 +++ planetlist.c 16 May 2006 05:10:13 -0000 1.2 @@ -43,20 +43,21 @@ register struct planet *j; /* W_ClearWindow(planetw); */ - (void) sprintf (buf, "Planet Name own armies REPAIR FUEL AGRI info"); + (void) sprintf (buf, "Planet Name own armies REPAIR FUEL AGRI CORE info"); W_WriteText (planetw, 2, 1, textColor, buf, strlen (buf), W_RegularFont); k = 2; for (i = 0, j = &planets[i]; i < MAXPLANETS; i++, j++) { if (j->pl_info & me->p_team) { - (void) sprintf (buf, "%-16s %3s %3d %6s %4s %4s %c%c%c%c", + (void) sprintf (buf, "%-16s %3s %3d %6s %4s %4s %4s %c%c%c%c", j->pl_name, teamname[j->pl_owner], j->pl_armies, (j->pl_flags & PLREPAIR ? "REPAIR" : " "), (j->pl_flags & PLFUEL ? "FUEL" : " "), (j->pl_flags & PLAGRI ? "AGRI" : " "), + (j->pl_flags & PLCORE ? "CORE" : " "), (j->pl_info & FED ? 'F' : ' '), (j->pl_info & ROM ? 'R' : ' '), (j->pl_info & KLI ? 'K' : ' '), Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- defaults.c 14 May 2006 02:14:54 -0000 1.16 +++ defaults.c 16 May 2006 05:10:13 -0000 1.17 @@ -288,6 +288,12 @@ NULL } }, + {"newQuit", &newQuit, RC_BOOL, + { + "Use new quit window", + NULL + } + }, {"newSound", &newSound, RC_BOOL, { "Use new layered, stereo sound", @@ -1385,6 +1391,7 @@ timerType = T_SHIP; allowWheelActions = booleanDefault ("allowWheelActions", allowWheelActions); + newQuit = booleanDefault ("newQuit", newQuit); newSound = booleanDefault ("newSound", newSound); newSoundAngles = booleanDefault ("newSoundAngles", newSoundAngles); tpDotDist = intDefault ("tpDotDist", tpDotDist); Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- data.c 14 May 2006 02:14:54 -0000 1.18 +++ data.c 16 May 2006 05:10:13 -0000 1.19 @@ -236,7 +236,7 @@ extern double Sin[], Cos[]; -W_Icon stipple, clockpic, genopic, icon; +W_Icon stipple, clockpic, clockhandpic, genopic, icon; W_Color borderColor, backColor, textColor, myColor, warningColor, shipCol[5], rColor, yColor, gColor, unColor, foreColor; @@ -747,6 +747,6 @@ WNDPROC lpfnDefRichEditWndProc; /* default window proc */ int richText = 0; /* temporary variable to select rich text message windows */ - +int newQuit = 1; int newSound = 1; /* use new SDL sound */ int newSoundAngles = 1; /* use new SDL sound with angular 3d component */ \ No newline at end of file Index: map.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/map.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- map.c 14 May 2006 02:14:54 -0000 1.8 +++ map.c 16 May 2006 05:10:13 -0000 1.9 @@ -482,7 +482,7 @@ } else { -#endif +#endif // Beeplite end if (planetBitmapGalaxy == 3) { #ifndef DOUBLE_BUFFERING @@ -492,6 +492,7 @@ BMP_MPLANET_HEIGHT, BMP_CPLANET_WIDTH, BMP_CPLANET_HEIGHT, + 0, planetBitmapC (l), planetColor (l), mapw); @@ -502,6 +503,7 @@ BMP_MPLANET_HEIGHT, BMP_CPLANET_WIDTH, BMP_CPLANET_HEIGHT, + 0, planetBitmapC (l), planetColor (l), mapw); From modemhero at users.sourceforge.net Tue May 16 00:10:15 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 16 May 2006 05:10:15 +0000 Subject: [netrek-cvs] client/netrekxp/include bitmaps.h, 1.8, 1.9 data.h, 1.14, 1.15 proto.h, 1.14, 1.15 wlib.h, 1.5, 1.6 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv18138/include Modified Files: bitmaps.h data.h proto.h wlib.h Log Message: Addition of core flag to planet info and planet menu. New quit window stuff. More work on planet bitmaps and draw functions. Index: wlib.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/wlib.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- wlib.h 14 May 2006 02:14:54 -0000 1.5 +++ wlib.h 16 May 2006 05:10:13 -0000 1.6 @@ -212,6 +212,7 @@ int, int, int, + int, W_Icon, W_Color, W_Window); Index: bitmaps.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/bitmaps.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- bitmaps.h 14 May 2006 02:14:54 -0000 1.8 +++ bitmaps.h 16 May 2006 05:10:13 -0000 1.9 @@ -77,7 +77,8 @@ #define BMP_SHIP_EXPLOSION 8 #define BMP_SB_EXPLOSION 1 #define BMP_CLOCK 13 -#define BMP_CLOAK 14 +#define BMP_CLOCKHAND 14 +#define BMP_CLOAK 15 #define BMP_SHIELD 16 #define BMP_VSHIELD 17 #define BMP_STIPPLE 22 @@ -93,6 +94,10 @@ #define BMP_CLOCK_WIDTH 48 #define BMP_CLOCK_HEIGHT 48 +#define BMP_CHAND_WIDTH 100 +#define BMP_CHAND_HEIGHT 100 +#define BMP_CCLOCK_WIDTH 100 +#define BMP_CCLOCK_HEIGHT 100 #define BMP_CLOAK_WIDTH 20 #define BMP_CLOAK_HEIGHT 20 #define BMP_SHIELD_WIDTH 20 Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- data.h 14 May 2006 02:14:54 -0000 1.14 +++ data.h 16 May 2006 05:10:13 -0000 1.15 @@ -233,7 +233,7 @@ extern double Sin[], Cos[]; -extern W_Icon stipple, clockpic, genopic; +extern W_Icon stipple, clockpic, clockhandpic, genopic; extern W_Icon base_expview; extern W_Icon expview[BMP_SHIPEXPL_FRAMES]; @@ -644,7 +644,7 @@ extern WNDPROC lpfnDefRichEditWndProc; /* default window procedure for our richedit controls */ extern int richText; /* temporary variable to enable/disable rich text windows */ - +extern int newQuit; extern int newSound; /* Use new SDL sound interface */ extern int newSoundAngles; /* Use SDL with angular 3D sound */ #endif /* _h_data */ Index: proto.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- proto.h 14 May 2006 02:14:54 -0000 1.14 +++ proto.h 16 May 2006 05:10:13 -0000 1.15 @@ -719,6 +719,7 @@ int destheight, int srcwidth, int srcheight, + int angle, W_Icon icon, W_Color color, W_Window window); @@ -776,7 +777,8 @@ void W_WriteBitmapGreyDB (SDBUFFER * sdb, int x, int y, W_Icon icon, W_Color color); void W_OverlayBitmapDB (SDBUFFER * sdb, int x, int y, W_Icon icon, W_Color color); void W_OverlayScaleBitmapDB (SDBUFFER * sdb, int x, int y, int destwidth, int destheight, - int srcwidth, int srcheight, W_Icon icon, W_Color color, W_Window window); + int srcwidth, int srcheight, int angle, + W_Icon icon, W_Color color, W_Window window); #endif /******************************************************************************/ From modemhero at users.sourceforge.net Tue May 16 00:11:54 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 16 May 2006 05:11:54 +0000 Subject: [netrek-cvs] client/netrekxp/resources/misclib/color clock.bmp, NONE, 1.1 clockhand.bmp, NONE, 1.1 nebula.jpg, NONE, 1.1 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/misclib/color In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv18579/resources/misclib/color Added Files: clock.bmp clockhand.bmp nebula.jpg Log Message: New clock art. And pretty nebula (not used yet). --- NEW FILE: clock.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: clockhand.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: nebula.jpg --- (This appears to be a binary file; contents omitted.) From quozl at users.sourceforge.net Tue May 16 01:16:37 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Tue, 16 May 2006 06:16:37 +0000 Subject: [netrek-cvs] client/cow ChangeLog, 1.27, 1.28 newwin.c, 1.4, 1.5 inform.c, 1.1.1.1, 1.2 planetlist.c, 1.1.1.1, 1.2 Message-ID: Update of /cvsroot/netrek/client/cow In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv8087 Modified Files: ChangeLog newwin.c inform.c planetlist.c Log Message: add PLCORE Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/cow/newwin.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- newwin.c 22 Jun 2002 04:43:24 -0000 1.4 +++ newwin.c 16 May 2006 06:16:35 -0000 1.5 @@ -2,6 +2,9 @@ /* newwin.c * * $Log$ + * Revision 1.5 2006/05/16 06:16:35 quozl + * add PLCORE + * * Revision 1.4 2002/06/22 04:43:24 tanner * Clean up of SDL code. #ifdef'd out functions not needed in SDL. * @@ -171,7 +174,7 @@ W_SetWindowKeyDownHandler(messagew, handleMessageWindowKeyDown); W_SetWindowButtonHandler(messagew, handleMessageWindowButton); - planetw = W_MakeTextWindow("planet", 10, 10, 53, MAXPLANETS + 3, w, 2); + planetw = W_MakeTextWindow("planet", 10, 10, 57, MAXPLANETS + 3, w, 2); W_SetWindowExposeHandler(planetw, planetlist); rankw = W_MakeTextWindow("rank", 50, 300, 65, NUMRANKS + 9, w, 2); Index: inform.c =================================================================== RCS file: /cvsroot/netrek/client/cow/inform.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- inform.c 1 Nov 1998 17:24:10 -0000 1.1.1.1 +++ inform.c 16 May 2006 06:16:35 -0000 1.2 @@ -2,6 +2,9 @@ /* inform.c * * $Log$ + * Revision 1.2 2006/05/16 06:16:35 quozl + * add PLCORE + * * Revision 1.1.1.1 1998/11/01 17:24:10 siegl * COW 3.0 initial revision * */ @@ -204,12 +207,12 @@ else { /* Planet */ /* Too close to the edge? */ - if (mx + 20 * W_Textwidth + 2 > windowWidth) - mx = windowWidth - 25 * W_Textwidth - 2; + if (mx + 23 * W_Textwidth + 2 > windowWidth) + mx = windowWidth - 28 * W_Textwidth - 2; if (my + 3 * W_Textheight + 2 > windowHeight) my = windowHeight - 3 * W_Textheight - 2; - infow = W_MakeWindow("info", mx, my, W_Textwidth * 25, W_Textheight * 3, ww, + infow = W_MakeWindow("info", mx, my, W_Textwidth * 28, W_Textheight * 3, ww, 2, foreColor); W_MapWindow(infow); k = &planets[target->o_num]; @@ -229,10 +232,11 @@ (void) sprintf(buf, "Armies %d", k->pl_armies); W_WriteText(infow, W_Textwidth, W_Textheight * line++, planetColor(k), buf, strlen(buf), W_RegularFont); - (void) sprintf(buf, "%s %s %s %c%c%c%c", + (void) sprintf(buf, "%s %s %s %s %c%c%c%c", (k->pl_flags & PLREPAIR ? "REPAIR" : " "), (k->pl_flags & PLFUEL ? "FUEL" : " "), (k->pl_flags & PLAGRI ? "AGRI" : " "), + (k->pl_flags & PLCORE ? "CORE" : " "), (k->pl_info & FED ? 'F' : ' '), (k->pl_info & ROM ? 'R' : ' '), (k->pl_info & KLI ? 'K' : ' '), Index: ChangeLog =================================================================== RCS file: /cvsroot/netrek/client/cow/ChangeLog,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- ChangeLog 14 Apr 2006 10:35:37 -0000 1.27 +++ ChangeLog 16 May 2006 06:16:35 -0000 1.28 @@ -1,3 +1,9 @@ +Tue May 16 15:51:12 2006 Bill Balcerski + + * newwin.c (newwin): enlarge planet list window. + * inform.c (inform): add PLCORE. + * planetlist.c (planetlist): add PLCORE. + Fri Apr 14 20:33:28 2006 James Cameron * parsemeta.c (parseInput): fix format string for sscanf, more Index: planetlist.c =================================================================== RCS file: /cvsroot/netrek/client/cow/planetlist.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- planetlist.c 1 Nov 1998 17:24:11 -0000 1.1.1.1 +++ planetlist.c 16 May 2006 06:16:35 -0000 1.2 @@ -2,6 +2,9 @@ /* planetlist.c * * $Log$ + * Revision 1.2 2006/05/16 06:16:35 quozl + * add PLCORE + * * Revision 1.1.1.1 1998/11/01 17:24:11 siegl * COW 3.0 initial revision * */ @@ -38,20 +41,21 @@ register struct planet *j; /* W_ClearWindow(planetw); */ - (void) sprintf(buf, "Planet Name own armies REPAIR FUEL AGRI info"); + (void) sprintf(buf, "Planet Name own armies REPAIR FUEL AGRI CORE info"); W_WriteText(planetw, 2, 1, textColor, buf, strlen(buf), W_RegularFont); k = 2; for (i = 0, j = &planets[i]; i < MAXPLANETS; i++, j++) { if (j->pl_info & me->p_team) { - (void) sprintf(buf, "%-16s %3s %3d %6s %4s %4s %c%c%c%c", + (void) sprintf(buf, "%-16s %3s %3d %6s %4s %4s %4s %c%c%c%c", j->pl_name, teamname[j->pl_owner], j->pl_armies, (j->pl_flags & PLREPAIR ? "REPAIR" : " "), (j->pl_flags & PLFUEL ? "FUEL" : " "), (j->pl_flags & PLAGRI ? "AGRI" : " "), + (j->pl_flags & PLCORE ? "CORE" : " "), (j->pl_info & FED ? 'F' : ' '), (j->pl_info & ROM ? 'R' : ' '), (j->pl_info & KLI ? 'K' : ' '), From quozl at users.sourceforge.net Tue May 16 01:20:20 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Tue, 16 May 2006 06:20:20 +0000 Subject: [netrek-cvs] client/cow struct.h,1.3,1.4 Message-ID: Update of /cvsroot/netrek/client/cow In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv9489 Modified Files: struct.h Log Message: add PLCORE Index: struct.h =================================================================== RCS file: /cvsroot/netrek/client/cow/struct.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- struct.h 21 Jun 2002 00:26:03 -0000 1.3 +++ struct.h 16 May 2006 06:20:18 -0000 1.4 @@ -6,6 +6,9 @@ * Most of the unneeded stuff in the structures has been thrown away. * * $Log$ + * Revision 1.4 2006/05/16 06:20:18 quozl + * add PLCORE + * * Revision 1.3 2002/06/21 00:26:03 quozl * fix description of PFOBSERV * @@ -390,7 +393,8 @@ #define PLCOUP 0x200 /* Coup has occured */ #define PLCHEAP 0x400 /* Planet was taken from * undefended team */ -#define PLCLEAR 0x800 +#define PLCORE 0x800 +#define PLCLEAR 0x1000 struct planet { From quozl at users.sourceforge.net Tue May 16 01:25:27 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Tue, 16 May 2006 06:25:27 +0000 Subject: [netrek-cvs] client/cow ChangeLog, 1.28, 1.29 defaults.c, 1.4, 1.5 input.c, 1.11, 1.12 mkcflags.c, 1.3, 1.4 reserved.c, 1.2, 1.3 socket.c, 1.8, 1.9 x11window.c, 1.6, 1.7 Message-ID: Update of /cvsroot/netrek/client/cow In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv10864 Modified Files: ChangeLog defaults.c input.c mkcflags.c reserved.c socket.c x11window.c Log Message: some compilation fixes Index: ChangeLog =================================================================== RCS file: /cvsroot/netrek/client/cow/ChangeLog,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- ChangeLog 16 May 2006 06:16:35 -0000 1.28 +++ ChangeLog 16 May 2006 06:25:25 -0000 1.29 @@ -1,3 +1,8 @@ +Tue May 16 16:21:29 2006 James Cameron + + * x11window.c, socket.c, reserved.c, mkcflags.c, input.c, defaults.c: + compilation fixes. + Tue May 16 15:51:12 2006 Bill Balcerski * newwin.c (newwin): enlarge planet list window. Index: input.c =================================================================== RCS file: /cvsroot/netrek/client/cow/input.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- input.c 22 Jun 2002 04:43:24 -0000 1.11 +++ input.c 16 May 2006 06:25:25 -0000 1.12 @@ -2,6 +2,9 @@ /* input.c * * $Log$ + * Revision 1.12 2006/05/16 06:25:25 quozl + * some compilation fixes + * * Revision 1.11 2002/06/22 04:43:24 tanner * Clean up of SDL code. #ifdef'd out functions not needed in SDL. * @@ -476,7 +479,7 @@ { unsigned char *p; - if (strlen(str) == 1) + if (strlen((char *)str) == 1) { /* This is a little pointless, but it'll preform as per * the * * documentation */ @@ -484,12 +487,12 @@ } else if (!strcmpi(str, "TAB")) { - p = "^i"; + p = (unsigned char *) "^i"; mystats->st_keymap[getctrlkey(&p) - 32] = 'X'; } else if (!strcmpi(str, "ESC")) { - p = "^["; + p = (unsigned char *) "^["; mystats->st_keymap[getctrlkey(&p) - 32] = 'X'; } } Index: mkcflags.c =================================================================== RCS file: /cvsroot/netrek/client/cow/mkcflags.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- mkcflags.c 28 Feb 2006 01:45:56 -0000 1.3 +++ mkcflags.c 16 May 2006 06:25:25 -0000 1.4 @@ -1,5 +1,6 @@ #include "config.h" +#include #include #include @@ -21,6 +22,9 @@ /*****************************************************************************/ /* * $Log$ + * Revision 1.4 2006/05/16 06:25:25 quozl + * some compilation fixes + * * Revision 1.3 2006/02/28 01:45:56 quozl * prerelease * Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/cow/defaults.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- defaults.c 28 Apr 2001 04:03:56 -0000 1.4 +++ defaults.c 16 May 2006 06:25:25 -0000 1.5 @@ -8,6 +8,9 @@ /****************************************************************************/ /* * $Log$ + * Revision 1.5 2006/05/16 06:25:25 quozl + * some compilation fixes + * * Revision 1.4 2001/04/28 04:03:56 quozl * change -U to also adopt a local port number for TCP mode. * -- Benjamin `Quisar' Lerman @@ -25,6 +28,7 @@ #include "config.h" #include "copyright2.h" #include +#include #include "Wlib.h" #include "defs.h" #include "struct.h" @@ -366,7 +370,7 @@ { int keycnt; - if ((keycnt = strlen(keys)) == MAX_KEY - 1) + if ((keycnt = strlen((char *) keys)) == MAX_KEY - 1) { fprintf(stderr, "Maximum number of keys is %d\n", MAX_KEY - 1); } Index: reserved.c =================================================================== RCS file: /cvsroot/netrek/client/cow/reserved.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- reserved.c 25 Mar 1999 20:56:26 -0000 1.2 +++ reserved.c 16 May 2006 06:25:25 -0000 1.3 @@ -4,6 +4,9 @@ * Kevin P. Smith 7/3/89 * * $Log$ + * Revision 1.3 2006/05/16 06:25:25 quozl + * some compilation fixes + * * Revision 1.2 1999/03/25 20:56:26 siegl * CygWin32 autoconfig fixes * @@ -86,7 +89,7 @@ if (netaddr == 0) { len = sizeof(saddr); - if (getpeername(sock, (struct sockaddr *) &saddr, &len) < 0) + if (getpeername(sock, (struct sockaddr *) &saddr, (socklen_t *) &len) < 0) { perror("getpeername(sock)"); terminate(1); Index: x11window.c =================================================================== RCS file: /cvsroot/netrek/client/cow/x11window.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- x11window.c 22 Jun 2002 04:43:24 -0000 1.6 +++ x11window.c 16 May 2006 06:25:25 -0000 1.7 @@ -4,6 +4,9 @@ * Kevin P. Smith 6/11/89 Much modified by Jerry Frain and Joe Young * * $Log$ + * Revision 1.7 2006/05/16 06:25:25 quozl + * some compilation fixes + * * Revision 1.6 2002/06/22 04:43:24 tanner * Clean up of SDL code. #ifdef'd out functions not needed in SDL. * @@ -30,6 +33,7 @@ #include "config.h" #include +#include #include INC_SYS_SELECT #include INC_STRINGS #include @@ -1364,9 +1368,9 @@ if ( #ifdef FUNCTION_KEYS - ((XLookupString(key, &ch, 1, &sym, NULL) > 0) || sym == XK_Tab) + ((XLookupString(key, (char *) &ch, 1, &sym, NULL) > 0) || sym == XK_Tab) #else - (XLookupString(key, &ch, 1, NULL, NULL) > 0) + (XLookupString(key, (char *) &ch, 1, NULL, NULL) > 0) #endif ) Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/cow/socket.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- socket.c 27 Jan 2006 09:57:27 -0000 1.8 +++ socket.c 16 May 2006 06:25:25 -0000 1.9 @@ -8,6 +8,9 @@ * Routines to allow connection to the xtrek server. * * $Log$ + * Revision 1.9 2006/05/16 06:25:25 quozl + * some compilation fixes + * * Revision 1.8 2006/01/27 09:57:27 quozl * *** empty log message *** * @@ -751,7 +754,7 @@ terminate(0); } - sock = accept(s, (struct sockaddr *) &naddr, &len); + sock = accept(s, (struct sockaddr *) &naddr, (socklen_t *) &len); if (sock == -1) { @@ -771,7 +774,7 @@ * "serverName" and "serveraddr" appropriately. */ len = sizeof(struct sockaddr_in); - if (getpeername(sock, (struct sockaddr *) &addr, &len) < 0) + if (getpeername(sock, (struct sockaddr *) &addr, (socklen_t *) &len) < 0) { perror("unable to get peername"); serverName = "nowhere"; @@ -1511,6 +1514,9 @@ if (!F_many_self) { me = (ghoststart ? &players[ghost_pno] : pl); + if (log_packets) { + fprintf(stderr, "handleSelf: my player number is %d\n", packet->pnum); + } myship = &(me->p_ship); mystats = &(me->p_stats); } From quozl at users.sourceforge.net Tue May 16 07:59:40 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Tue, 16 May 2006 12:59:40 +0000 Subject: [netrek-cvs] client/cow camera.c, NONE, 1.1 system.mk.in, 1.7, 1.8 x11window.c, 1.7, 1.8 Message-ID: Update of /cvsroot/netrek/client/cow In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv20304 Modified Files: system.mk.in x11window.c Added Files: camera.c Log Message: tactical camera, based on Imlib2 --- NEW FILE: camera.c --- /* prototype camera support */ #include #include #include #include "defs.h" /* internal context */ static Display *disp = NULL; static Visual *vis = NULL; static Screen *scr = NULL; static Colormap cm; static Window rw, tw; static int rx, ry; static unsigned int rdx, rdy; /* set the display used by the camera */ void camera_set_display(Display *arg_disp) { int depth; disp = arg_disp; scr = ScreenOfDisplay(disp, DefaultScreen(disp)); vis = DefaultVisual(disp, XScreenNumberOfScreen(scr)); depth = DefaultDepth(disp, XScreenNumberOfScreen(scr)); cm = DefaultColormap(disp, XScreenNumberOfScreen(scr)); rw = RootWindow(disp, XScreenNumberOfScreen(scr)); imlib_context_set_display(disp); imlib_context_set_visual(vis); imlib_context_set_colormap(cm); imlib_context_set_color_modifier(NULL); imlib_context_set_operation(IMLIB_OP_COPY); } /* set the window used by the camera */ void camera_set_window(Window arg_window, int arg_width, int arg_height) { tw = arg_window; rx = 0; ry = 0; rdx = TWINSIDE; /* restrict to tactical */ rdy = TWINSIDE; imlib_context_set_drawable(tw); } void camera_snap() { Imlib_Image image; image = imlib_create_image_from_drawable(rw, rx, ry, rdx, rdy, 0); imlib_context_set_image(image); imlib_image_attach_data_value("quality", NULL, 15, NULL); imlib_save_image("cow-camera-frame.png"); imlib_free_image_and_decache(); } Index: x11window.c =================================================================== RCS file: /cvsroot/netrek/client/cow/x11window.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- x11window.c 16 May 2006 06:25:25 -0000 1.7 +++ x11window.c 16 May 2006 12:59:38 -0000 1.8 @@ -4,6 +4,9 @@ * Kevin P. Smith 6/11/89 Much modified by Jerry Frain and Joe Young * * $Log$ + * Revision 1.8 2006/05/16 12:59:38 quozl + * tactical camera, based on Imlib2 + * * Revision 1.7 2006/05/16 06:25:25 quozl * some compilation fixes * @@ -456,6 +459,7 @@ /* tmp */ /* XSynchronize(W_Display, True); */ /* XSetErrorHandler(_myerror); */ + camera_set_display(W_Display); W_Root = DefaultRootWindow(W_Display); @@ -1006,6 +1010,9 @@ CWBorderPixel, &attrs), WIN_GRAPH); + if (strcmp(name, "netrek") == 0) { + camera_set_window(newwin->window, width, height); + } /* top window */ sz_hints = XAllocSizeHints(); if (strcmp(name, "netrek") == 0 || strcmp(name, "wait") == 0 || Index: system.mk.in =================================================================== RCS file: /cvsroot/netrek/client/cow/system.mk.in,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- system.mk.in 31 Jan 2006 18:34:06 -0000 1.7 +++ system.mk.in 16 May 2006 12:59:38 -0000 1.8 @@ -72,7 +72,7 @@ netstat.o netstatopt.o spopt.o dashboard.o dashboard3.o \ short.o distress.o senddist.o defwin.o tools.o sound.o\ docwin.o cflags.o beeplite.o feature.o\ - string_util.o local.o censor.o cowmain.o + string_util.o local.o censor.o cowmain.o camera.o RSRC = check.c colors.c data.c death.c defaults.c dmessage.c\ enter.c findslot.c getname.c getship.c helpwin.c inform.c\ @@ -83,7 +83,7 @@ lagmeter.c netstat.c netstatopt.c spopt.c dashboard.c dashboard3.c \ short.c distress.c senddist.c defwin.c tools.c sound.c\ docwin.c cflags.c beeplite.c feature.c reserved.c\ - string_util.c local.c censor.c cowmain.c + string_util.c local.c censor.c cowmain.c camera.c INCLUDES = struct.h packets.h defs.h copyright.h bitmaps.h data.h\ @@ -113,7 +113,7 @@ netrek: $(RSAOBJ) $(PMAKE) null $(ROBJ) $(MAINOBJ) $(INPUTOBJ) $(X11OBJ) $(WIN32OBJ) $(RANDOMOBJ) cflags.c randomize $(CC) $(LFLAGS) -o netrek `./randomize $(ROBJ) $(RSAOBJ) $(INPUTOBJ) \ - $(MAINOBJ) $(X11OBJ) $(WIN32OBJ) $(RANDOMOBJ)` $(LIBRARIES) + $(MAINOBJ) $(X11OBJ) $(WIN32OBJ) $(RANDOMOBJ)` $(LIBRARIES) -lImlib2 netrek.shared: done.libcow $(MAINOBJ) $(COWAPI) $(CC) $(LFLAGS) $(MAINOBJ) -L. -lcow $(LIBS) -o netrek.shared From modemhero at users.sourceforge.net Thu May 18 02:15:37 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 18 May 2006 07:15:37 +0000 Subject: [netrek-cvs] client/netrekxp/resources/ships/highres indshipHR.bmp, 1.4, 1.5 klishipHR.bmp, 1.1, 1.2 orishipHR.bmp, 1.2, 1.3 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/ships/highres In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv13111/resources/ships/highres Modified Files: indshipHR.bmp klishipHR.bmp orishipHR.bmp Log Message: Some bitmap modifications (with new art) Added timer/clock back to text dashboard Added torp count to LAB dashboard -Added new status line to KRP, COW and LAB dashboard. In order of priority, it shows the following: 1) time left in declare war delay 2) time left in refit delay 3) time left to fully repair (if you are at warp 0 in repair mode) 4) time left in grace period after T mode drops to still take planets (15 second timer) 5) whether you are in transwarp 6) whether you are under impulse power (default) Index: orishipHR.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/highres/orishipHR.bmp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvsbgLVif and /tmp/cvsCp5moB differ Index: klishipHR.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/highres/klishipHR.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsYVZKXk and /tmp/cvsEaLu8G differ Index: indshipHR.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/highres/indshipHR.bmp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 Binary files /tmp/cvsVEATOp and /tmp/cvsGrUs7L differ From modemhero at users.sourceforge.net Thu May 18 02:15:37 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 18 May 2006 07:15:37 +0000 Subject: [netrek-cvs] client/netrekxp/src dashboard.c, 1.3, 1.4 dashboard3.c, 1.4, 1.5 data.c, 1.19, 1.20 getship.c, 1.1.1.1, 1.2 redraw.c, 1.6, 1.7 warning.c, 1.5, 1.6 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv13111/src Modified Files: dashboard.c dashboard3.c data.c getship.c redraw.c warning.c Log Message: Some bitmap modifications (with new art) Added timer/clock back to text dashboard Added torp count to LAB dashboard -Added new status line to KRP, COW and LAB dashboard. In order of priority, it shows the following: 1) time left in declare war delay 2) time left in refit delay 3) time left to fully repair (if you are at warp 0 in repair mode) 4) time left in grace period after T mode drops to still take planets (15 second timer) 5) whether you are in transwarp 6) whether you are under impulse power (default) Index: redraw.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/redraw.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- redraw.c 7 May 2006 16:59:27 -0000 1.6 +++ redraw.c 18 May 2006 07:15:35 -0000 1.7 @@ -185,6 +185,9 @@ buf = buf2; oldbuf = buf1; } + /* TIMER */ + db_timer (flag, WINSIDE - 12 * W_Textwidth, 27); + buf[0] = (char) (me->p_flags & PFSHIELD ? 'S' : ' '); if (me->p_flags & PFGREEN) buf[1] = 'G'; Index: getship.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/getship.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- getship.c 21 Jan 2003 21:28:30 -0000 1.1.1.1 +++ getship.c 18 May 2006 07:15:35 -0000 1.2 @@ -39,6 +39,7 @@ shipvals[SCOUT].s_width = 20; /* scout: */ shipvals[SCOUT].s_height = 20; /* scout: */ shipvals[SCOUT].s_phaserfuse = 10; /* scout: */ + shipvals[SCOUT].s_repair = 80; /* scout: */ shipvals[DESTROYER].s_phaserdamage = 85; /* destroyer: */ shipvals[DESTROYER].s_torpspeed = 14; /* destroyer: */ @@ -53,6 +54,7 @@ shipvals[DESTROYER].s_height = 20; /* destroyer: */ shipvals[DESTROYER].s_type = DESTROYER; /* destroyer: */ shipvals[DESTROYER].s_phaserfuse = 10; /* destroyer: */ + shipvals[DESTROYER].s_repair = 100; /* destroyer: */ shipvals[BATTLESHIP].s_phaserdamage = 105; /* battleship: */ shipvals[BATTLESHIP].s_torpspeed = 12; /* battleship: */ @@ -67,6 +69,7 @@ shipvals[BATTLESHIP].s_height = 20; /* battleship: */ shipvals[BATTLESHIP].s_type = BATTLESHIP; /* battleship: */ shipvals[BATTLESHIP].s_phaserfuse = 10; /* battleship: */ + shipvals[BATTLESHIP].s_repair = 125; /* battleship: */ shipvals[ASSAULT].s_phaserdamage = 80; /* assault */ shipvals[ASSAULT].s_torpspeed = 16; /* assault */ @@ -81,6 +84,7 @@ shipvals[ASSAULT].s_height = 20; /* assault */ shipvals[ASSAULT].s_type = ASSAULT; /* assault */ shipvals[ASSAULT].s_phaserfuse = 10; /* assault */ + shipvals[ASSAULT].s_repair = 120; /* assault */ shipvals[STARBASE].s_phaserdamage = 120; /* starbase */ shipvals[STARBASE].s_torpspeed = 14; /* starbase */ @@ -95,7 +99,8 @@ shipvals[STARBASE].s_height = 20; /* starbase */ shipvals[STARBASE].s_type = STARBASE; /* starbase */ shipvals[STARBASE].s_phaserfuse = 4; /* starbase */ - + shipvals[STARBASE].s_repair = 140; /* starbase */ + shipvals[ATT].s_phaserdamage = 10000; /* att: */ shipvals[ATT].s_torpspeed = 30; /* att: */ shipvals[ATT].s_maxspeed = 60; /* att: */ @@ -109,6 +114,7 @@ shipvals[ATT].s_height = 20; /* att: */ shipvals[ATT].s_type = ATT; /* att: */ shipvals[ATT].s_phaserfuse = 1; /* att: */ + shipvals[ATT].s_repair = 30000; /* att: */ shipvals[SGALAXY].s_phaserdamage = 100; /* galaxy: */ shipvals[SGALAXY].s_torpspeed = 13; /* galaxy: */ @@ -123,6 +129,7 @@ shipvals[SGALAXY].s_height = 20; /* galaxy: */ shipvals[SGALAXY].s_type = SGALAXY; /* galaxy: */ shipvals[SGALAXY].s_phaserfuse = 10; /* galaxy: */ + shipvals[SGALAXY].s_repair = 112; /* galaxy: */ shipvals[CRUISER].s_phaserdamage = 100; /* cruiser: */ shipvals[CRUISER].s_torpspeed = 12; /* cruiser: */ @@ -137,6 +144,7 @@ shipvals[CRUISER].s_height = 20; /* cruiser: */ shipvals[CRUISER].s_type = CRUISER; /* cruiser: */ shipvals[CRUISER].s_phaserfuse = 10; /* cruiser: */ + shipvals[CRUISER].s_repair = 110; /* cruiser: */ } /******************************************************************************/ Index: dashboard.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/dashboard.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- dashboard.c 7 May 2006 16:59:27 -0000 1.3 +++ dashboard.c 18 May 2006 07:15:35 -0000 1.4 @@ -38,6 +38,7 @@ #define BAR_LENGTH 56 #define SPACING 4 + /******************************************************************************/ /*** timerString() ***/ /******************************************************************************/ @@ -90,7 +91,10 @@ switch (timerType) { case T_NONE: - W_ClearArea(tstatw, xloc, yloc, 12 * W_Textwidth, W_Textheight); + if (newDashboard) + W_ClearArea(tstatw, xloc, yloc, 12 * W_Textwidth, W_Textheight); + else + W_ClearArea(tstatw, xloc + 4 * W_Textwidth, yloc - W_Textheight, 8 * W_Textwidth, 2 * W_Textheight); strcpy(lasttimer, " "); oldtime = now; break; @@ -109,7 +113,10 @@ } if(s) { - W_WriteText(tstatw, xloc, yloc, textColor, s, 3, W_RegularFont); + if (newDashboard) + W_WriteText(tstatw, xloc, yloc, textColor, s, 3, W_RegularFont); + else + W_WriteText(tstatw, xloc + 4 * W_Textwidth, yloc - W_Textheight, textColor, s, 3, W_RegularFont); } } if (!timerType) @@ -266,6 +273,88 @@ } /******************************************************************************/ +/*** db_special() - for showing prioritized timer info in dashboard ***/ +/******************************************************************************/ +static void +db_special (void) +{ + char buf[16]; + struct player *plr; + int repairtime; + + if ((me->p_flags & (PFPLOCK | PFOBSERV)) == (PFPLOCK | PFOBSERV)) + plr = players + me->p_playerl; + else + plr = me; + + /* Start with low priority messages, clear as necessary for higher + priority ones */ + + /* Default impulse text */ + W_ClearArea (tstatw, 38, 3, W_Textwidth * 8, W_Textheight); + W_WriteText (tstatw, 38, 3, W_Yellow, "Impulse", 7, W_BoldFont); + + /* Transwarp text */ + if (me->p_flags & PFTWARP) + { + W_ClearArea (tstatw, 38, 3, W_Textwidth * 8, W_Textheight); + W_WriteText (tstatw, 38, 3, W_White, "Twarp", 5, W_BoldFont); + } + /* Tournament extension text */ + if (tdelay) + { + if (time (0) > tdelay) + tdelay = 0; + else + { + W_ClearArea (tstatw, 38, 3, W_Textwidth * 8, W_Textheight); + W_WriteText (tstatw, 38, 3, W_Grey, "Tmod", 4, W_BoldFont); + sprintf(buf, "%d", tdelay - time (0)); + W_WriteText (tstatw, 68, 3, textColor, buf, strlen (buf), W_RegularFont); + } + } + + /* Repair text */ + if ((me->p_flags & PFREPAIR) && plr->p_speed == 0) + { + repairtime = repair_time(); + W_ClearArea (tstatw, 38, 3, W_Textwidth * 8, W_Textheight); + W_WriteText (tstatw, 38, 3, W_Cyan, "Fix", 3, W_BoldFont); + sprintf(buf, "%d", repairtime); + W_WriteText (tstatw, 62, 3, textColor, buf, strlen (buf), W_RegularFont); + } + + /* Refit text */ + if (rdelay) + { + if (time (0) > rdelay) + rdelay = 0; + else + { + W_ClearArea (tstatw, 38, 3, W_Textwidth * 8, W_Textheight); + W_WriteText (tstatw, 38, 3, W_Green, "Refit", 5, W_BoldFont); + sprintf(buf, "%d", rdelay - time (0)); + W_WriteText (tstatw, 74, 3, textColor, buf, strlen (buf), W_RegularFont); + } + } + + /* Declare War text */ + if (delay) + { + if (time (0) > delay) + delay = 0; + else + { + W_ClearArea (tstatw, 38, 3, W_Textwidth * 8, W_Textheight); + W_WriteText (tstatw, 38, 3, W_Red, "War", 3, W_BoldFont); + sprintf(buf, "%d", delay - time (0)); + W_WriteText (tstatw, 62, 3, textColor, buf, strlen (buf), W_RegularFont); + } + } +} + + +/******************************************************************************/ /*** db_flags() ***/ /******************************************************************************/ static void @@ -274,7 +363,7 @@ static float old_kills = -1.0; static int old_torp = -1; static unsigned int old_flags = (unsigned int) -1; - static int old_tourn = -1; + static int old_tourn = 0; char buf[16]; struct player *plr; @@ -315,19 +404,25 @@ buf[11] = 'd'; else buf[11] = ' '; - + W_WriteText (tstatw, 2, 3, textColor, "Flags", 5, W_RegularFont); W_WriteText (tstatw, 2, 17, textColor, buf, 12, W_RegularFont); old_flags = me->p_flags; } - + if (fr || status->tourn != old_tourn) { if (status->tourn) + { W_WriteText (tstatw, 74, 17, textColor, "T", 1, W_BoldFont); + tdelay = 0; + } else + { + if (status->tourn != old_tourn && !tdelay) + tdelay = time (0) + TOURNEXTENDTIME; W_WriteText (tstatw, 74, 17, textColor, " ", 1, W_BoldFont); - + } old_tourn = status->tourn; } @@ -391,6 +486,7 @@ W_ClearWindow (tstatw); db_flags (fr); + db_special (); /* TIMER */ db_timer (fr, 2, 3 + 2 * (W_Textheight + SPACING)); @@ -550,6 +646,7 @@ W_ClearWindow (tstatw); db_flags (fr); + db_special (); db_timer (fr, 2, 3 + 2 * (W_Textheight + SPACING)); @@ -700,3 +797,59 @@ db_redraw_COW (fr); } } + +/******************************************************************************/ +/*** repair_time() - calculate time left till ship is fully repaired + using server defined repair rates. Only called when + ship is at warp 0 and under repair ***/ +/******************************************************************************/ +int +repair_time (void) +{ + int shieldtime = 0; + int hulltime = 0; + int shieldneeded, hullneeded; + float shieldrate = 0.0, hullrate = 0.0; + + /* 100 subshield or subdamage = 1 shield or hull repaired + This routine is used by server every update (and 10 updates/sec) */ + /* calculate shield repair rate */ + if ((shieldneeded = (me->p_ship.s_maxshield - me->p_shield)) > 0) + { + me->p_subshield = me->p_ship.s_repair * 4; + if ((me->p_flags & PFORBIT) + && (planets[me->p_planet].pl_flags & PLREPAIR) + &&(!(planets[me->p_planet].pl_owner & (me->p_swar | me->p_hostile)))) + { + me->p_subshield += me->p_ship.s_repair * 4; + } + if (me->p_flags & PFDOCK) + { + me->p_subshield += me->p_ship.s_repair * 6; + } + /* Calculate time needed to repair shields */ + shieldrate = (float)(me->p_subshield)/(float)100.0; + shieldtime = (int)(shieldneeded/shieldrate); + } + + /* calculate hull repair rate */ + if (((hullneeded = me->p_damage) > 0) && !(me->p_flags & PFSHIELD)) + { + me->p_subdamage = me->p_ship.s_repair * 2; + if ((me->p_flags & PFORBIT) + && (planets[me->p_planet].pl_flags & PLREPAIR) + && (!(planets[me->p_planet].pl_owner & (me->p_swar | me->p_hostile)))) + { + me->p_subdamage += me->p_ship.s_repair * 2; + } + if (me->p_flags & PFDOCK) + { + me->p_subdamage += me->p_ship.s_repair * 3; + } + /* Calculate time needed to repair hull */ + hullrate = (float)(me->p_subdamage)/(float)100.0; + hulltime = (int)(hullneeded/hullrate); + } + + return MAX(shieldtime, hulltime); +}; \ No newline at end of file Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- data.c 16 May 2006 05:10:13 -0000 1.19 +++ data.c 18 May 2006 07:15:35 -0000 1.20 @@ -79,8 +79,9 @@ struct plupdate pl_update[MAXPLANETS]; char buttonmap[23] = { '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0' }; int lastm = 0; -int delay = 0; /* delay for decaring war */ -int rdelay = 0; /* delay for refitting */ +time_t delay = 0; /* time stamp for decaring war */ +time_t rdelay = 0; /* time stamp for refitting */ +time_t tdelay = 0; /* time stamp for T mode extension */ int showPlanetNames = 1; int autoQuit = 60; int showStats = 0; Index: warning.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/warning.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- warning.c 7 May 2006 16:59:27 -0000 1.5 +++ warning.c 18 May 2006 07:15:35 -0000 1.6 @@ -27,7 +27,7 @@ void warning (char *text) { - int doPhaser; + int doPhaser, doRefit, doDeclare; time_t curtime; struct tm *tm; char newtext[128]; @@ -40,8 +40,14 @@ } doPhaser = (strncmp (text, "Phaser burst", 12) == 0); - + doRefit = (strncmp (text, "You are being transported", 25) == 0); + doDeclare = (strncmp (text, "Pausing ten seconds to re-program", 33) == 0); warncount = strlen (text); + + if (doRefit) + rdelay = time (0) + REFITTIME; + if (doDeclare) + delay = time (0) + DECLARETIME; #ifdef PHASER_STATS if (doPhaser && phaserStats) { Index: dashboard3.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/dashboard3.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- dashboard3.c 7 May 2006 16:59:27 -0000 1.4 +++ dashboard3.c 18 May 2006 07:15:35 -0000 1.5 @@ -241,13 +241,95 @@ /******************************************************************************/ +/*** db_special() - for showing prioritized timer info in dashboard ***/ +/******************************************************************************/ +static void +db_special (void) +{ + char buf[16]; + struct player *plr; + int repairtime; + + if ((me->p_flags & (PFPLOCK | PFOBSERV)) == (PFPLOCK | PFOBSERV)) + plr = players + me->p_playerl; + else + plr = me; + + /* Start with low priority messages, clear as necessary for higher + priority ones */ + + /* Default impulse text */ + W_ClearArea (tstatw, 160, 32, W_Textwidth * 8, W_Textheight); + W_WriteText (tstatw, 160, 32, W_Yellow, "Impulse", 7, W_BoldFont); + + /* Transwarp text */ + if (me->p_flags & PFTWARP) + { + W_ClearArea (tstatw, 160, 32, W_Textwidth * 8, W_Textheight); + W_WriteText (tstatw, 160, 32, W_White, "Twarp", 5, W_BoldFont); + } + /* Tournament extension text */ + if (tdelay) + { + if (time (0) > tdelay) + tdelay = 0; + else + { + W_ClearArea (tstatw, 160, 32, W_Textwidth * 8, W_Textheight); + W_WriteText (tstatw, 160, 32, W_Grey, "Tmod", 4, W_BoldFont); + sprintf(buf, "%d", tdelay - time (0)); + W_WriteText (tstatw, 190, 32, textColor, buf, strlen (buf), W_RegularFont); + } + } + + /* Repair text */ + if ((me->p_flags & PFREPAIR) && plr->p_speed == 0) + { + repairtime = repair_time(); + W_ClearArea (tstatw, 160, 32, W_Textwidth * 8, W_Textheight); + W_WriteText (tstatw, 160, 32, W_Cyan, "Fix", 3, W_BoldFont); + sprintf(buf, "%d", repairtime); + W_WriteText (tstatw, 184, 32, textColor, buf, strlen (buf), W_RegularFont); + } + + /* Refit text */ + if (rdelay) + { + if (time (0) > rdelay) + rdelay = 0; + else + { + W_ClearArea (tstatw, 160, 32, W_Textwidth * 8, W_Textheight); + W_WriteText (tstatw, 160, 32, W_Green, "Refit", 5, W_BoldFont); + sprintf(buf, "%d", rdelay - time (0)); + W_WriteText (tstatw, 196, 32, textColor, buf, strlen (buf), W_RegularFont); + } + } + + /* Declare War text */ + if (delay) + { + if (time (0) > delay) + delay = 0; + else + { + W_ClearArea (tstatw, 160, 32, W_Textwidth * 8, W_Textheight); + W_WriteText (tstatw, 160, 32, W_Red, "War", 3, W_BoldFont); + sprintf(buf, "%d", delay - time (0)); + W_WriteText (tstatw, 184, 32, textColor, buf, strlen (buf), W_RegularFont); + } + } +} + + +/******************************************************************************/ /*** db_flags() ***/ /******************************************************************************/ static void db_flags (int fr) { static unsigned int old_flags = (unsigned int) -1; - static unsigned char old_tourn = (unsigned char) -1; + static unsigned char old_tourn = (unsigned char) 0; char buf[13]; @@ -315,10 +397,13 @@ if (status->tourn) { buf[12] = 't'; + tdelay = 0; } else { buf[12] = ' '; + if (status->tourn != old_tourn && !tdelay) + tdelay = time (0) + TOURNEXTENDTIME; } W_WriteText (tstatw, 2, 32, W_White, buf, 13, W_RegularFont); @@ -340,19 +425,28 @@ static int old_wpn = -1, old_egn = -1; static int old_ful = -1; static float old_kills = -1; + static int old_torp = -1; int cur_max, cur_arm, label_len; char label[32]; float kills; + int torp; if ((me->p_flags & (PFPLOCK | PFOBSERV)) == (PFPLOCK | PFOBSERV)) + { kills = players[me->p_playerl].p_kills; + torp = players[me->p_playerl].p_ntorp; + } else + { kills = me->p_kills; + torp = me->p_ntorp; + } if (fr) W_ClearWindow (tstatw); db_flags (fr); + db_special (); /* TIMER */ db_timer (fr, WINSIDE - 12 * W_Textwidth, 32); @@ -551,7 +645,30 @@ old_kills = kills; } - + + if (fr || (old_torp != torp)) + { + W_ClearArea (tstatw, 242, 32, 72, W_Textheight); + + if (torp > 0) + { + label[0] = ' '; + label[1] = 'T'; + label[2] = 'o'; + label[3] = 'r'; + label[4] = 'p'; + label[5] = 's'; + label[6] = ':'; + label[7] = ' '; + label_len = 8 + db_itoa (&label[8], torp); + + W_WriteText (tstatw, + 242, 32, + W_White, label, label_len, W_RegularFont); + } + old_torp = torp; + } + old_spd = me->p_speed; old_cur_max = cur_max; old_shl = me->p_shield; From modemhero at users.sourceforge.net Thu May 18 02:15:37 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 18 May 2006 07:15:37 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt,1.45,1.46 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv13111/resources/docs Modified Files: changes.txt Log Message: Some bitmap modifications (with new art) Added timer/clock back to text dashboard Added torp count to LAB dashboard -Added new status line to KRP, COW and LAB dashboard. In order of priority, it shows the following: 1) time left in declare war delay 2) time left in refit delay 3) time left to fully repair (if you are at warp 0 in repair mode) 4) time left in grace period after T mode drops to still take planets (15 second timer) 5) whether you are in transwarp 6) whether you are under impulse power (default) Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- changes.txt 16 May 2006 05:10:13 -0000 1.45 +++ changes.txt 18 May 2006 07:15:35 -0000 1.46 @@ -1,4 +1,13 @@ Version TBA: +- added timer/clock back to text dashboard +- added torp count to LAB dashboard +- added new status line to KRP, COW and LAB dashboard. In order of priority, it shows the following: + 1) time left in declare war delay + 2) time left in refit delay + 3) time left to fully repair (if you are at warp 0 in repair mode) + 4) time left in grace period after T mode drops to still take planets (15 second timer) + 5) whether you are in transwarp + 6) whether you are under impulse power (default) - new netrekrc option, "newQuit (on/off)", to use new quit window - new netrekrc option, "planetBitmapGalaxy: (0-3)", same options as planetBitmap, but now you have the choice to change map display planets too! And have map and local planets use different From modemhero at users.sourceforge.net Thu May 18 02:15:37 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 18 May 2006 07:15:37 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h, 1.15, 1.16 defs.h, 1.7, 1.8 proto.h, 1.15, 1.16 struct.h, 1.7, 1.8 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv13111/include Modified Files: data.h defs.h proto.h struct.h Log Message: Some bitmap modifications (with new art) Added timer/clock back to text dashboard Added torp count to LAB dashboard -Added new status line to KRP, COW and LAB dashboard. In order of priority, it shows the following: 1) time left in declare war delay 2) time left in refit delay 3) time left to fully repair (if you are at warp 0 in repair mode) 4) time left in grace period after T mode drops to still take planets (15 second timer) 5) whether you are in transwarp 6) whether you are under impulse power (default) Index: defs.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/defs.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- defs.h 14 May 2006 02:14:54 -0000 1.7 +++ defs.h 18 May 2006 07:15:35 -0000 1.8 @@ -135,7 +135,15 @@ * a warning on the screen */ #define MESSTIME 30 /* Number of updates to have * a message on the screen */ - + +/* These are server defined times */ +#define REFITTIME 5 /* Number of seconds it takes + * to refit */ +#define DECLARETIME 10 /* Number of seconds it takes + * to declare war */ +#define TOURNEXTENDTIME 15 /* Number of seconds after T-mode ends + in which it's still considered T-mode for + planet taking purposes */ #define TARG_PLAYER 0x1 /* Flags for gettarget */ #define TARG_PLANET 0x2 #define TARG_CLOAK 0x4 /* Include cloaked ships in Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- data.h 16 May 2006 05:10:13 -0000 1.15 +++ data.h 18 May 2006 07:15:35 -0000 1.16 @@ -60,8 +60,9 @@ extern int lastcount; extern int mdisplayed; extern int lastm; -extern int delay; -extern int rdelay; +extern time_t delay; +extern time_t rdelay; +extern time_t tdelay; extern int showPlanetNames; extern int warnShields; extern int showStats; Index: struct.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/struct.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- struct.h 14 May 2006 02:14:54 -0000 1.7 +++ struct.h 18 May 2006 07:15:35 -0000 1.8 @@ -174,6 +174,7 @@ short s_type; int s_torpspeed; int s_phaserfuse; + int s_repair; }; struct stats Index: proto.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- proto.h 16 May 2006 05:10:13 -0000 1.15 +++ proto.h 18 May 2006 07:15:35 -0000 1.16 @@ -67,6 +67,7 @@ void db_redraw_krp (int fr); void db_redraw_COW (int fr); void db_redraw (int fr); +int repair_time (void); /******************************************************************************/ /*** dashboard3.c ***/ From modemhero at users.sourceforge.net Thu May 18 02:15:37 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 18 May 2006 07:15:37 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.22, 1.23 clientr.suo, 1.4, 1.5 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv13111 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Some bitmap modifications (with new art) Added timer/clock back to text dashboard Added torp count to LAB dashboard -Added new status line to KRP, COW and LAB dashboard. In order of priority, it shows the following: 1) time left in declare war delay 2) time left in refit delay 3) time left to fully repair (if you are at warp 0 in repair mode) 4) time left in grace period after T mode drops to still take planets (15 second timer) 5) whether you are in transwarp 6) whether you are under impulse power (default) Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- NetrekXP to do list.C 16 May 2006 05:10:12 -0000 1.22 +++ NetrekXP to do list.C 18 May 2006 07:15:35 -0000 1.23 @@ -13,6 +13,8 @@ away, etc). Don't think this is fixable. 2) torp_other and plasma_other not working right due to lack of torp fuse info 3) Can't bomb enemy 3rd space planets in your T-mode opponent's space. +4) Refit disallows ATT before it even gets to the shipallow check, should remove the +first disallow. Things that go wrong when short packets are on: 1) cloaking/shields at warp 0 doesn't update someone else's tactical on what you did @@ -47,6 +49,7 @@ 10) fix clock 10a) add msimg32.lib to borland compile -assuming can get clock to work and i use transparentblt 11) need resources drawn somehow +12) BUG: phaser stats don't work with short packets off Stas's list: - color coded playerlist. @@ -74,7 +77,6 @@ - check geno/shift-q wrong behavior - resize documentation window - pasting multiline prints \r\n instead of splitting lines -- add sortPlayersFirst - fix makedistress bug that creates 0 instead of empty string when macro starts with conditional Simple in-game, realtime variable checking: Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 Binary files /tmp/cvspGeVud and /tmp/cvsfOaotz differ From modemhero at users.sourceforge.net Fri May 19 13:08:09 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 19 May 2006 18:08:09 +0000 Subject: [netrek-cvs] client/netrekxp/src dashboard.c, 1.4, 1.5 dashboard3.c, 1.5, 1.6 data.c, 1.20, 1.21 mswindow.c, 1.21, 1.22 newwin.c, 1.22, 1.23 war.c, 1.1.1.1, 1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv14632/src Modified Files: dashboard.c dashboard3.c data.c mswindow.c newwin.c war.c Log Message: Fixed up clock hand display using mask. Rewrote dashboard special info function to be smarter and only redraw when something changes. Some more bitmap changes to make ships more distinct. Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- mswindow.c 16 May 2006 05:10:13 -0000 1.21 +++ mswindow.c 19 May 2006 18:08:07 -0000 1.22 @@ -452,6 +452,7 @@ // Free other bitmaps free (clockpic); free (clockhandpic); + free (clockhandmask); for (j = 0; j < NUM_CTORP_TYPES; j++) { @@ -5065,7 +5066,7 @@ SetWorldTransform(hdc,&xForm); - BitBlt(hdc, 0, 0, newwidth, newheight, GlobalMemDC2, srcx, srcy, SRCPAINT); + BitBlt(hdc, 0, 0, newwidth, newheight, GlobalMemDC2, srcx, srcy, SRCAND); // Reset xForm xForm.eM11 = (FLOAT) 1.0; Index: dashboard.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/dashboard.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- dashboard.c 18 May 2006 07:15:35 -0000 1.4 +++ dashboard.c 19 May 2006 18:08:07 -0000 1.5 @@ -275,82 +275,124 @@ /******************************************************************************/ /*** db_special() - for showing prioritized timer info in dashboard ***/ /******************************************************************************/ -static void -db_special (void) +void +db_special (int fr, int x, int y) { - char buf[16]; + char buf[8]; + char buf2[4]; + char tmp[8]; struct player *plr; - int repairtime; - + int msgtype; + static char oldmsg[8]; + static int oldmsgtype; + W_Color color; + int left, right, pos; + if ((me->p_flags & (PFPLOCK | PFOBSERV)) == (PFPLOCK | PFOBSERV)) plr = players + me->p_playerl; else plr = me; - /* Start with low priority messages, clear as necessary for higher - priority ones */ + /* Check if any delays expired */ + if (delay && time (0) > delay) + delay = 0; + if (rdelay && time (0) > rdelay) + rdelay = 0; + if (tdelay && time (0) > tdelay) + tdelay = 0; + + /* Start with highest priority message, then go down in descending order + of importance */ - /* Default impulse text */ - W_ClearArea (tstatw, 38, 3, W_Textwidth * 8, W_Textheight); - W_WriteText (tstatw, 38, 3, W_Yellow, "Impulse", 7, W_BoldFont); - - /* Transwarp text */ - if (me->p_flags & PFTWARP) + /* Declare War text */ + if (delay) { - W_ClearArea (tstatw, 38, 3, W_Textwidth * 8, W_Textheight); - W_WriteText (tstatw, 38, 3, W_White, "Twarp", 5, W_BoldFont); + sprintf (buf, "War "); + sprintf(buf2, "%d", delay - time (0)); + strcat (buf, buf2); + msgtype = 0; + color = W_Red; } - /* Tournament extension text */ - if (tdelay) + /* Refit text */ + else if (rdelay) { - if (time (0) > tdelay) - tdelay = 0; - else - { - W_ClearArea (tstatw, 38, 3, W_Textwidth * 8, W_Textheight); - W_WriteText (tstatw, 38, 3, W_Grey, "Tmod", 4, W_BoldFont); - sprintf(buf, "%d", tdelay - time (0)); - W_WriteText (tstatw, 68, 3, textColor, buf, strlen (buf), W_RegularFont); - } + sprintf (buf, "Refit "); + sprintf(buf2, "%d", rdelay - time (0)); + strcat (buf, buf2); + msgtype = 1; + color = W_Green; } - /* Repair text */ - if ((me->p_flags & PFREPAIR) && plr->p_speed == 0) + else if ((me->p_flags & PFREPAIR) && plr->p_speed == 0) { - repairtime = repair_time(); - W_ClearArea (tstatw, 38, 3, W_Textwidth * 8, W_Textheight); - W_WriteText (tstatw, 38, 3, W_Cyan, "Fix", 3, W_BoldFont); - sprintf(buf, "%d", repairtime); - W_WriteText (tstatw, 62, 3, textColor, buf, strlen (buf), W_RegularFont); + sprintf (buf, "Fix "); + sprintf(buf2, "%d", repair_time()); + strcat (buf, buf2); + msgtype = 2; + color = W_Cyan; } - - /* Refit text */ - if (rdelay) + /* Tournament extension text */ + else if (tdelay) { - if (time (0) > rdelay) - rdelay = 0; - else - { - W_ClearArea (tstatw, 38, 3, W_Textwidth * 8, W_Textheight); - W_WriteText (tstatw, 38, 3, W_Green, "Refit", 5, W_BoldFont); - sprintf(buf, "%d", rdelay - time (0)); - W_WriteText (tstatw, 74, 3, textColor, buf, strlen (buf), W_RegularFont); - } + sprintf (buf, "Tmod "); + sprintf(buf2, "%d", tdelay - time (0)); + strcat (buf, buf2); + msgtype = 3; + color = W_Grey; + } + /* Transwarp text */ + else if (me->p_flags & PFTWARP) + { + sprintf (buf, "Twarp"); + msgtype = 4; + color = W_White; } - - /* Declare War text */ - if (delay) + /* Default impulse text */ + else { - if (time (0) > delay) - delay = 0; - else + sprintf (buf, "Impulse"); + msgtype = 5; + color = W_Yellow; + } + + if (fr || msgtype != oldmsgtype) + { + W_ClearArea (tstatw, x, y, W_Textwidth * 8, W_Textheight); + W_WriteText (tstatw, x, y, color, buf, strlen (buf), W_BoldFont); + } + else + { + /* + Run through the string to find any differences. Print any + continuous differences with one W_WriteText call. + */ + left = 0; + right = -1; + pos = 0; + strcpy (tmp, buf); + while (pos < 7) { - W_ClearArea (tstatw, 38, 3, W_Textwidth * 8, W_Textheight); - W_WriteText (tstatw, 38, 3, W_Red, "War", 3, W_BoldFont); - sprintf(buf, "%d", delay - time (0)); - W_WriteText (tstatw, 62, 3, textColor, buf, strlen (buf), W_RegularFont); + if (tmp[pos] == oldmsg[pos]) + { + if (left <= right) + W_WriteText(tstatw, x + left * W_Textwidth, y, color, + tmp + left, right - left + 1, W_BoldFont); + left = pos + 1; + right = pos; + } + else + right++; + pos++; } + if (left <= right) + W_WriteText(tstatw, x + left * W_Textwidth, y, color, + tmp + left, right - left + 1, W_BoldFont); } + + oldmsgtype = msgtype; + strcpy(oldmsg, buf); + + return; } @@ -486,7 +528,7 @@ W_ClearWindow (tstatw); db_flags (fr); - db_special (); + db_special (fr, 38, 3); /* TIMER */ db_timer (fr, 2, 3 + 2 * (W_Textheight + SPACING)); @@ -646,7 +688,7 @@ W_ClearWindow (tstatw); db_flags (fr); - db_special (); + db_special (fr, 38, 3); db_timer (fr, 2, 3 + 2 * (W_Textheight + SPACING)); Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- newwin.c 16 May 2006 05:10:13 -0000 1.22 +++ newwin.c 19 May 2006 18:08:07 -0000 1.23 @@ -1203,7 +1203,10 @@ BMP_CCLOCK_HEIGHT, BMP_CLOCK, qwin, LR_DEFAULTCOLOR); clockhandpic = W_StoreBitmap3 ("bitmaps/misclib/color/clockhand.bmp", BMP_CHAND_WIDTH, - BMP_CHAND_HEIGHT, BMP_CLOCKHAND, qwin, LR_DEFAULTCOLOR); + BMP_CHAND_HEIGHT, BMP_CLOCKHAND, qwin, LR_DEFAULTCOLOR); + clockhandmask = + W_StoreBitmap3 ("bitmaps/misclib/color/clockhandmask.bmp", BMP_CHAND_WIDTH, + BMP_CHAND_HEIGHT, BMP_CLOCKHAND, qwin, LR_MONOCHROME); } else { @@ -1981,11 +1984,15 @@ W_WriteBitmap ( CLOCK_BDR, CLOCK_BDR, clockpic, foreColor); W_OverlayScaleBitmap (CLOCK_BDR, CLOCK_BDR, BMP_CHAND_WIDTH, BMP_CHAND_HEIGHT, BMP_CHAND_WIDTH, BMP_CHAND_HEIGHT, - angle, clockhandpic, foreColor, qwin); + angle, clockhandmask, foreColor, qwin); + angle = (int)(255-time*255/max); + W_WriteScaleBitmap (CLOCK_BDR, CLOCK_BDR, BMP_CHAND_WIDTH, BMP_CHAND_HEIGHT, + BMP_CHAND_WIDTH, BMP_CHAND_HEIGHT, + (unsigned char)(angle), clockhandpic, foreColor, qwin); sprintf (buf, "%d", max - time); tx = cx - W_Textwidth * strlen (buf) / 2; ty = 2*(cy - W_Textheight / 2)/3; - W_WriteText (qwin, tx, ty, textColor, buf, strlen (buf), W_RegularFont); + W_MaskText (qwin, tx, ty, W_Black, buf, strlen (buf), W_RegularFont); cp = "Quit NetrekXP"; } Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- data.c 18 May 2006 07:15:35 -0000 1.20 +++ data.c 19 May 2006 18:08:07 -0000 1.21 @@ -237,7 +237,7 @@ extern double Sin[], Cos[]; -W_Icon stipple, clockpic, clockhandpic, genopic, icon; +W_Icon stipple, clockpic, clockhandpic, clockhandmask, genopic, icon; W_Color borderColor, backColor, textColor, myColor, warningColor, shipCol[5], rColor, yColor, gColor, unColor, foreColor; Index: war.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/war.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- war.c 21 Jan 2003 21:28:34 -0000 1.1.1.1 +++ war.c 19 May 2006 18:08:07 -0000 1.2 @@ -130,6 +130,9 @@ W_UnmapWindow (war); return; break; + default: + return; + break; } if (me->p_swar & enemyteam) Index: dashboard3.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/dashboard3.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- dashboard3.c 18 May 2006 07:15:35 -0000 1.5 +++ dashboard3.c 19 May 2006 18:08:07 -0000 1.6 @@ -241,88 +241,6 @@ /******************************************************************************/ -/*** db_special() - for showing prioritized timer info in dashboard ***/ -/******************************************************************************/ -static void -db_special (void) -{ - char buf[16]; - struct player *plr; - int repairtime; - - if ((me->p_flags & (PFPLOCK | PFOBSERV)) == (PFPLOCK | PFOBSERV)) - plr = players + me->p_playerl; - else - plr = me; - - /* Start with low priority messages, clear as necessary for higher - priority ones */ - - /* Default impulse text */ - W_ClearArea (tstatw, 160, 32, W_Textwidth * 8, W_Textheight); - W_WriteText (tstatw, 160, 32, W_Yellow, "Impulse", 7, W_BoldFont); - - /* Transwarp text */ - if (me->p_flags & PFTWARP) - { - W_ClearArea (tstatw, 160, 32, W_Textwidth * 8, W_Textheight); - W_WriteText (tstatw, 160, 32, W_White, "Twarp", 5, W_BoldFont); - } - /* Tournament extension text */ - if (tdelay) - { - if (time (0) > tdelay) - tdelay = 0; - else - { - W_ClearArea (tstatw, 160, 32, W_Textwidth * 8, W_Textheight); - W_WriteText (tstatw, 160, 32, W_Grey, "Tmod", 4, W_BoldFont); - sprintf(buf, "%d", tdelay - time (0)); - W_WriteText (tstatw, 190, 32, textColor, buf, strlen (buf), W_RegularFont); - } - } - - /* Repair text */ - if ((me->p_flags & PFREPAIR) && plr->p_speed == 0) - { - repairtime = repair_time(); - W_ClearArea (tstatw, 160, 32, W_Textwidth * 8, W_Textheight); - W_WriteText (tstatw, 160, 32, W_Cyan, "Fix", 3, W_BoldFont); - sprintf(buf, "%d", repairtime); - W_WriteText (tstatw, 184, 32, textColor, buf, strlen (buf), W_RegularFont); - } - - /* Refit text */ - if (rdelay) - { - if (time (0) > rdelay) - rdelay = 0; - else - { - W_ClearArea (tstatw, 160, 32, W_Textwidth * 8, W_Textheight); - W_WriteText (tstatw, 160, 32, W_Green, "Refit", 5, W_BoldFont); - sprintf(buf, "%d", rdelay - time (0)); - W_WriteText (tstatw, 196, 32, textColor, buf, strlen (buf), W_RegularFont); - } - } - - /* Declare War text */ - if (delay) - { - if (time (0) > delay) - delay = 0; - else - { - W_ClearArea (tstatw, 160, 32, W_Textwidth * 8, W_Textheight); - W_WriteText (tstatw, 160, 32, W_Red, "War", 3, W_BoldFont); - sprintf(buf, "%d", delay - time (0)); - W_WriteText (tstatw, 184, 32, textColor, buf, strlen (buf), W_RegularFont); - } - } -} - - -/******************************************************************************/ /*** db_flags() ***/ /******************************************************************************/ static void @@ -446,7 +364,7 @@ W_ClearWindow (tstatw); db_flags (fr); - db_special (); + db_special (fr, 160, 32); /* TIMER */ db_timer (fr, WINSIDE - 12 * W_Textwidth, 32); From modemhero at users.sourceforge.net Fri May 19 13:08:09 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 19 May 2006 18:08:09 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.23, 1.24 clientr.vcproj, 1.2, 1.3 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv14632 Modified Files: NetrekXP to do list.C clientr.vcproj Log Message: Fixed up clock hand display using mask. Rewrote dashboard special info function to be smarter and only redraw when something changes. Some more bitmap changes to make ships more distinct. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- NetrekXP to do list.C 18 May 2006 07:15:35 -0000 1.23 +++ NetrekXP to do list.C 19 May 2006 18:08:07 -0000 1.24 @@ -13,8 +13,8 @@ away, etc). Don't think this is fixable. 2) torp_other and plasma_other not working right due to lack of torp fuse info 3) Can't bomb enemy 3rd space planets in your T-mode opponent's space. -4) Refit disallows ATT before it even gets to the shipallow check, should remove the -first disallow. +4) ATT not listed as valid ship even if it's in sysdef. +5) in orbit.c, pftranswarp strangeness. Things that go wrong when short packets are on: 1) cloaking/shields at warp 0 doesn't update someone else's tactical on what you did @@ -46,10 +46,16 @@ 8) BUG : Lock on someone as obs, then delock (or whey they die), screen doesn't go blank it stays in same drawn state. Only when short packets off and doublebuffering on. 9) Use nebula pic -10) fix clock -10a) add msimg32.lib to borland compile -assuming can get clock to work and i use transparentblt +10) fix clock - rewrite overlaybitmap calls to use SRCAND +10a) rewrite all scalebitmap functions to use angle not p_dir 11) need resources drawn somehow -12) BUG: phaser stats don't work with short packets off +12) BUG: phaser stats don't work with short packets off (server fix pending) + "Phaser missed!!!", /* 37 */ + "You destroyed the plasma torpedo!", /* 38 */ +13) changing teams doesn't set delay to 0 for declare war , as it should (server fix pending) +13a) intermittent problem with repair count and orbitting planet +14) Bug with waraction..was being called even when clicking on border (broke function) +..I added a default return to switch statement, but the underlying bug still remains. Stas's list: - color coded playerlist. Index: clientr.vcproj =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- clientr.vcproj 16 May 2006 05:10:13 -0000 1.2 +++ clientr.vcproj 19 May 2006 18:08:07 -0000 1.3 @@ -172,7 +172,7 @@ Update of /cvsroot/netrek/client/netrekxp/resources/misclib/color In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv14632/resources/misclib/color Modified Files: clockhand.bmp Added Files: clockhandmask.bmp Log Message: Fixed up clock hand display using mask. Rewrote dashboard special info function to be smarter and only redraw when something changes. Some more bitmap changes to make ships more distinct. Index: clockhand.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/misclib/color/clockhand.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsbhCPSD and /tmp/cvsP9XiPm differ --- NEW FILE: clockhandmask.bmp --- (This appears to be a binary file; contents omitted.) From modemhero at users.sourceforge.net Fri May 19 13:08:09 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 19 May 2006 18:08:09 +0000 Subject: [netrek-cvs] client/netrekxp/resources/ships/highres klishipHR.bmp, 1.2, 1.3 romshipHR.bmp, 1.1, 1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/ships/highres In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv14632/resources/ships/highres Modified Files: klishipHR.bmp romshipHR.bmp Log Message: Fixed up clock hand display using mask. Rewrote dashboard special info function to be smarter and only redraw when something changes. Some more bitmap changes to make ships more distinct. Index: klishipHR.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/highres/klishipHR.bmp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvsVmfbID and /tmp/cvsdT2CEm differ Index: romshipHR.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/ships/highres/romshipHR.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsixPhzR and /tmp/cvsR4QySA differ From modemhero at users.sourceforge.net Fri May 19 13:08:09 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 19 May 2006 18:08:09 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h, 1.16, 1.17 proto.h, 1.16, 1.17 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv14632/include Modified Files: data.h proto.h Log Message: Fixed up clock hand display using mask. Rewrote dashboard special info function to be smarter and only redraw when something changes. Some more bitmap changes to make ships more distinct. Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- data.h 18 May 2006 07:15:35 -0000 1.16 +++ data.h 19 May 2006 18:08:07 -0000 1.17 @@ -234,7 +234,7 @@ extern double Sin[], Cos[]; -extern W_Icon stipple, clockpic, clockhandpic, genopic; +extern W_Icon stipple, clockpic, clockhandpic, clockhandmask, genopic; extern W_Icon base_expview; extern W_Icon expview[BMP_SHIPEXPL_FRAMES]; Index: proto.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- proto.h 18 May 2006 07:15:35 -0000 1.16 +++ proto.h 19 May 2006 18:08:07 -0000 1.17 @@ -67,6 +67,7 @@ void db_redraw_krp (int fr); void db_redraw_COW (int fr); void db_redraw (int fr); +void db_special (int fr, int x, int y); int repair_time (void); /******************************************************************************/ From modemhero at users.sourceforge.net Fri May 19 22:55:25 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 20 May 2006 03:55:25 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.24, 1.25 clientr.suo, 1.5, 1.6 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv32689 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Fix to bug where client sometimes has wrong value for what planet you are orbitting. Addition of phaser stats to long packets. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 Binary files /tmp/cvsSw9eoU and /tmp/cvsTitnRS differ Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- NetrekXP to do list.C 19 May 2006 18:08:07 -0000 1.24 +++ NetrekXP to do list.C 20 May 2006 03:55:23 -0000 1.25 @@ -49,13 +49,11 @@ 10) fix clock - rewrite overlaybitmap calls to use SRCAND 10a) rewrite all scalebitmap functions to use angle not p_dir 11) need resources drawn somehow -12) BUG: phaser stats don't work with short packets off (server fix pending) - "Phaser missed!!!", /* 37 */ - "You destroyed the plasma torpedo!", /* 38 */ 13) changing teams doesn't set delay to 0 for declare war , as it should (server fix pending) -13a) intermittent problem with repair count and orbitting planet 14) Bug with waraction..was being called even when clicking on border (broke function) ..I added a default return to switch statement, but the underlying bug still remains. +15a) look into swar/war in repair time, with obs and plr - doesn't seem to be any way +for an obs to know what the war decs are of the person he is observing Stas's list: - color coded playerlist. From modemhero at users.sourceforge.net Fri May 19 22:55:25 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 20 May 2006 03:55:25 +0000 Subject: [netrek-cvs] client/netrekxp/include proto.h,1.17,1.18 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv32689/include Modified Files: proto.h Log Message: Fix to bug where client sometimes has wrong value for what planet you are orbitting. Addition of phaser stats to long packets. Index: proto.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- proto.h 19 May 2006 18:08:07 -0000 1.17 +++ proto.h 20 May 2006 03:55:23 -0000 1.18 @@ -69,6 +69,7 @@ void db_redraw (int fr); void db_special (int fr, int x, int y); int repair_time (void); +int get_closest_planet(int x, int y); /******************************************************************************/ /*** dashboard3.c ***/ From modemhero at users.sourceforge.net Fri May 19 22:55:25 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 20 May 2006 03:55:25 +0000 Subject: [netrek-cvs] client/netrekxp/src dashboard.c, 1.5, 1.6 warning.c, 1.6, 1.7 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv32689/src Modified Files: dashboard.c warning.c Log Message: Fix to bug where client sometimes has wrong value for what planet you are orbitting. Addition of phaser stats to long packets. Index: warning.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/warning.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- warning.c 18 May 2006 07:15:35 -0000 1.6 +++ warning.c 20 May 2006 03:55:23 -0000 1.7 @@ -48,7 +48,50 @@ rdelay = time (0) + REFITTIME; if (doDeclare) delay = time (0) + DECLARETIME; + #ifdef PHASER_STATS + if (!recv_short) /* Gotta parse phaser info for long packets here */ + { + if (strncmp(text, "You destroyed the plasma", 24) == 0) /* Plasma hit */ + { + phaserStatTry++; + phaserStatHit++; + /* Record as an average damage hit so as not to skew overall average */ + phaserStatDamage += phaserStatDamage / phaserStatTry; + } + if (strncmp(text, "Phaser missed", 13) == 0) /* Miss */ + { + phaserStatTry++; + if (phaserStats) + { + /* Mung the message */ + char phstatmsg[30]; + + sprintf (phstatmsg, "%s [%d%%]", text, + phaserStatTry ? (phaserStatHit * 100) / + phaserStatTry : 0); + strcpy (text, phstatmsg); + /* Update string length */ + warncount = strlen (text); + } + } + if (doPhaser) /* Parse out damage and record to average */ + { + char *d; + register int damage; + d = &text[warncount]; + /* find the last number in the string, should be damage */ + while (!isdigit(*d) && d > text) + d--; + while (d > text && isdigit(*d)) + d--; + if (d > text) + damage = atoi(d); + phaserStatTry++; + phaserStatHit++; + phaserStatDamage += damage; + } + } if (doPhaser && phaserStats) { sprintf (newtext, "%s [%3d%%] [%2u]", text, Index: dashboard.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/dashboard.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- dashboard.c 19 May 2006 18:08:07 -0000 1.5 +++ dashboard.c 20 May 2006 03:55:23 -0000 1.6 @@ -18,6 +18,7 @@ /******************************************************************************/ #include +#include #include "config.h" #include "copyright.h" @@ -287,12 +288,12 @@ static int oldmsgtype; W_Color color; int left, right, pos; - + if ((me->p_flags & (PFPLOCK | PFOBSERV)) == (PFPLOCK | PFOBSERV)) plr = players + me->p_playerl; else plr = me; - + /* Check if any delays expired */ if (delay && time (0) > delay) delay = 0; @@ -300,10 +301,10 @@ rdelay = 0; if (tdelay && time (0) > tdelay) tdelay = 0; - + /* Start with highest priority message, then go down in descending order of importance */ - + /* Declare War text */ if (delay) { @@ -852,23 +853,29 @@ int hulltime = 0; int shieldneeded, hullneeded; float shieldrate = 0.0, hullrate = 0.0; - + struct player *plr; + + if ((me->p_flags & (PFPLOCK | PFOBSERV)) == (PFPLOCK | PFOBSERV)) + plr = players + me->p_playerl; + else + plr = me; + /* 100 subshield or subdamage = 1 shield or hull repaired This routine is used by server every update (and 10 updates/sec) */ /* calculate shield repair rate */ if ((shieldneeded = (me->p_ship.s_maxshield - me->p_shield)) > 0) { me->p_subshield = me->p_ship.s_repair * 4; - if ((me->p_flags & PFORBIT) - && (planets[me->p_planet].pl_flags & PLREPAIR) - &&(!(planets[me->p_planet].pl_owner & (me->p_swar | me->p_hostile)))) - { - me->p_subshield += me->p_ship.s_repair * 4; - } - if (me->p_flags & PFDOCK) + if (me->p_flags & PFORBIT) { - me->p_subshield += me->p_ship.s_repair * 6; - } + /* Damn server doesn't send us p_planet info, have to calculate it ourselves! */ + me->p_planet = get_closest_planet(me->p_x, me->p_y); + if ((planets[me->p_planet].pl_flags & PLREPAIR) + &&(!(planets[me->p_planet].pl_owner & (plr->p_swar | plr->p_hostile)))) + me->p_subshield += me->p_ship.s_repair * 4; + if (me->p_flags & PFDOCK) + me->p_subshield += me->p_ship.s_repair * 6; + } /* Calculate time needed to repair shields */ shieldrate = (float)(me->p_subshield)/(float)100.0; shieldtime = (int)(shieldneeded/shieldrate); @@ -878,20 +885,44 @@ if (((hullneeded = me->p_damage) > 0) && !(me->p_flags & PFSHIELD)) { me->p_subdamage = me->p_ship.s_repair * 2; - if ((me->p_flags & PFORBIT) - && (planets[me->p_planet].pl_flags & PLREPAIR) - && (!(planets[me->p_planet].pl_owner & (me->p_swar | me->p_hostile)))) - { - me->p_subdamage += me->p_ship.s_repair * 2; - } - if (me->p_flags & PFDOCK) + if (me->p_flags & PFORBIT) { - me->p_subdamage += me->p_ship.s_repair * 3; + /* Damn server doesn't send us p_planet info, have to calculate it ourselves! */ + me->p_planet = get_closest_planet(me->p_x, me->p_y); + if ((planets[me->p_planet].pl_flags & PLREPAIR) + && (!(planets[me->p_planet].pl_owner & (plr->p_swar | plr->p_hostile)))) + me->p_subdamage += me->p_ship.s_repair * 2; + if (me->p_flags & PFDOCK) + me->p_subdamage += me->p_ship.s_repair * 3; } - /* Calculate time needed to repair hull */ + /* Calculate time needed to repair hull */ hullrate = (float)(me->p_subdamage)/(float)100.0; hulltime = (int)(hullneeded/hullrate); } return MAX(shieldtime, hulltime); -}; \ No newline at end of file +} + +/******************************************************************************/ +/*** get_closest_planet() - find closest planet to given location + Useful for determining which planet you are orbitting ***/ +/******************************************************************************/ +int get_closest_planet(int x, int y) +{ + register int i; + register struct planet *k; + double dist, closedist; + int target; + + closedist = GWIDTH; + for (i = 0, k = &planets[i]; i < MAXPLANETS; i++, k++) + { + dist = hypot ((double) (x - k->pl_x), (double) (y - k->pl_y)); + if (dist < closedist) + { + target = i; + closedist = dist; + } + } + return (short)(target); +} From quozl at users.sourceforge.net Sat May 20 03:12:57 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Sat, 20 May 2006 08:12:57 +0000 Subject: [netrek-cvs] client/cow ChangeLog, 1.29, 1.30 mkcflags.c, 1.4, 1.5 system.mk.in, 1.8, 1.9 Message-ID: Update of /cvsroot/netrek/client/cow In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25878 Modified Files: ChangeLog mkcflags.c system.mk.in Log Message: mkcflags compilation fixes Index: ChangeLog =================================================================== RCS file: /cvsroot/netrek/client/cow/ChangeLog,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- ChangeLog 16 May 2006 06:25:25 -0000 1.29 +++ ChangeLog 20 May 2006 08:12:54 -0000 1.30 @@ -1,3 +1,7 @@ +Sat May 20 18:10:01 2006 James Cameron + + * mkcflags.c (main): compilation fixes for -Wall. + Tue May 16 16:21:29 2006 James Cameron * x11window.c, socket.c, reserved.c, mkcflags.c, input.c, defaults.c: Index: system.mk.in =================================================================== RCS file: /cvsroot/netrek/client/cow/system.mk.in,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- system.mk.in 16 May 2006 12:59:38 -0000 1.8 +++ system.mk.in 20 May 2006 08:12:54 -0000 1.9 @@ -37,7 +37,7 @@ # Flags for optimizing # (-O, -g, -O2) -OPT = -O2 +OPT = -g -Wall # Flags for shared libraries Index: mkcflags.c =================================================================== RCS file: /cvsroot/netrek/client/cow/mkcflags.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- mkcflags.c 16 May 2006 06:25:25 -0000 1.4 +++ mkcflags.c 20 May 2006 08:12:54 -0000 1.5 @@ -22,6 +22,9 @@ /*****************************************************************************/ /* * $Log$ + * Revision 1.5 2006/05/20 08:12:54 quozl + * mkcflags compilation fixes + * * Revision 1.4 2006/05/16 06:25:25 quozl * some compilation fixes * @@ -41,7 +44,6 @@ { time_t seconds; struct tm *tm_date; - struct passwd *pw; char tbuff1[100], tbuff2[100]; char pigcall[120]; char *pigcallresp (); @@ -64,7 +66,7 @@ printf ("char cflags[]=\"%s\";\n", argv[1]); printf ("char arch[]=\"%s\";\n", argv[2]); printf ("char cdate[]=\"%s\";\n", tbuff2); - printf ("struct timeval tv_ctime={%u,0};\n", seconds); + printf ("struct timeval tv_ctime={%u,0};\n", (int) seconds); printf ("char cbugs[]=\"Send bugs/suggestion to: cow at netrek.org\";\n"); printf ("char cowid[]=\"%s\";\n", pigcallresp (pigcall, tbuff2, argv[2])); exit (0); @@ -77,8 +79,6 @@ char *cdate; char *arch; { - char buf[20]; - sprintf (pigcall, "%s.%d, %s, %s, ", version, PATCHLEVEL, arch, cdate); /* ack .... gross short hand fomulas for compile options!!! */ From quozl at users.sourceforge.net Sat May 20 03:48:18 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Sat, 20 May 2006 08:48:18 +0000 Subject: [netrek-cvs] client/cow cowmain.c, 1.13, 1.14 feature.c, 1.3, 1.4 socket.c, 1.9, 1.10 ChangeLog, 1.30, 1.31 Message-ID: Update of /cvsroot/netrek/client/cow In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv16466 Modified Files: cowmain.c feature.c socket.c ChangeLog Log Message: fix some valgrind use of uninitialised data reports Index: feature.c =================================================================== RCS file: /cvsroot/netrek/client/cow/feature.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- feature.c 11 Jun 1999 16:14:17 -0000 1.3 +++ feature.c 20 May 2006 08:48:16 -0000 1.4 @@ -14,6 +14,9 @@ * feature packets look like: * * $Log$ + * Revision 1.4 2006/05/20 08:48:16 quozl + * fix some valgrind use of uninitialised data reports + * * Revision 1.3 1999/06/11 16:14:17 siegl * cambot replay patches * @@ -273,6 +276,7 @@ { struct feature_cpacket packet; + bzero(&packet, sizeof(packet)); STRNCPY(packet.name, name, sizeof(packet.name)); packet.type = CP_FEATURE; packet.name[sizeof(packet.name) - 1] = 0; Index: cowmain.c =================================================================== RCS file: /cvsroot/netrek/client/cow/cowmain.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- cowmain.c 22 Jun 2002 10:37:20 -0000 1.13 +++ cowmain.c 20 May 2006 08:48:16 -0000 1.14 @@ -2,6 +2,9 @@ /* main.c * * $Log$ + * Revision 1.14 2006/05/20 08:48:16 quozl + * fix some valgrind use of uninitialised data reports + * * Revision 1.13 2002/06/22 10:37:20 siegl * Release 3.01 * @@ -119,6 +122,7 @@ #include #include INC_STRINGS +#include #include #include #include Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/cow/socket.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- socket.c 16 May 2006 06:25:25 -0000 1.9 +++ socket.c 20 May 2006 08:48:16 -0000 1.10 @@ -8,6 +8,9 @@ * Routines to allow connection to the xtrek server. * * $Log$ + * Revision 1.10 2006/05/20 08:48:16 quozl + * fix some valgrind use of uninitialised data reports + * * Revision 1.9 2006/05/16 06:25:25 quozl * some compilation fixes * @@ -1959,6 +1962,7 @@ { struct login_cpacket packet; + bzero(&packet, sizeof(packet)); strcpy(packet.name, name); strcpy(packet.password, pass); if (strlen(login) > 15) @@ -2251,6 +2255,7 @@ { struct options_cpacket optPacket; + bzero(&optPacket, sizeof(optPacket)); optPacket.type = CP_OPTIONS; optPacket.flags = htonl(ST_MAPMODE + /* always on */ @@ -2280,6 +2285,7 @@ else newsocket = (newsocket + 10687) & 32767; } + bzero(&sockPack,sizeof(sockPack)); sockPack.type = CP_SOCKET; sockPack.socket = htonl(newsocket); sockPack.version = (char) SOCKVERSION; Index: ChangeLog =================================================================== RCS file: /cvsroot/netrek/client/cow/ChangeLog,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- ChangeLog 20 May 2006 08:12:54 -0000 1.30 +++ ChangeLog 20 May 2006 08:48:16 -0000 1.31 @@ -1,3 +1,10 @@ +Sat May 20 18:48:13 2006 James Cameron + + * cowmain.c, feature.c, socket.c: fix some valgrind reports of use + of uninitialised data, possible sources of random information + leakage in packets sent to server in situations where auto (stack) + variables for packets may not be initialised. + Sat May 20 18:10:01 2006 James Cameron * mkcflags.c (main): compilation fixes for -Wall. From modemhero at users.sourceforge.net Sat May 20 12:09:41 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 20 May 2006 17:09:41 +0000 Subject: [netrek-cvs] client/netrekxp/include bitmaps.h, 1.9, 1.10 data.h, 1.17, 1.18 proto.h, 1.18, 1.19 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29983/include Modified Files: bitmaps.h data.h proto.h Log Message: First attempt at some resource display for new planets. Gonna have to rewrite doublebuffering code to make it an rc option, all these duplicate function calls is getting crazy (or quadruple function calls when beeplite and doublebuffering come into play at once). Index: bitmaps.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/bitmaps.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- bitmaps.h 16 May 2006 05:10:13 -0000 1.9 +++ bitmaps.h 20 May 2006 17:09:39 -0000 1.10 @@ -154,6 +154,16 @@ // Untouched planet #define BMP_PLANET_UNKNOWN 9 +// Resources +#define BMP_ARMYBMP 10 +#define BMP_ARMY_WIDTH 10 +#define BMP_ARMY_HEIGHT 30 +#define BMP_WRENCHBMP 11 +#define BMP_WRENCH_WIDTH 30 +#define BMP_WRENCH_HEIGHT 10 +#define BMP_FUELBMP 12 +#define BMP_FUEL_WIDTH 10 +#define BMP_FUEL_HEIGHT 30 #define BMP_CPLANET_WIDTH 120 #define BMP_CPLANET_HEIGHT 120 Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- data.h 19 May 2006 18:08:07 -0000 1.17 +++ data.h 20 May 2006 17:09:39 -0000 1.18 @@ -309,6 +309,9 @@ extern W_Icon planet_earth[NUMTEAMS], planet_klingus[NUMTEAMS], planet_orion[NUMTEAMS], planet_romulus[NUMTEAMS], planet_agri1[NUMTEAMS], planet_agri2[NUMTEAMS], planet_rock1[NUMTEAMS], planet_rock2[NUMTEAMS]; +extern W_Icon army_bitmap; +extern W_Icon wrench_bitmap; +extern W_Icon fuel_bitmap; extern W_Icon base_planets; extern W_Icon base_mplanets; extern W_Icon bplanets[PLANET_VIEWS]; Index: proto.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- proto.h 20 May 2006 03:55:23 -0000 1.18 +++ proto.h 20 May 2006 17:09:39 -0000 1.19 @@ -447,6 +447,8 @@ void initPlanets (void); //inline static void checkRedraw(int x, int y); extern inline W_Icon planetBitmapC(register struct planet * p); +extern inline void planetResourcesC (SDBUFFER * sdb, register struct planet *p, + int destwidth, int destheight, int dx, int dy, W_Window window); //static void DrawPlanets(); void map (void); From modemhero at users.sourceforge.net Sat May 20 12:09:41 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 20 May 2006 17:09:41 +0000 Subject: [netrek-cvs] client/netrekxp/resources/planlibm/color army.bmp, NONE, 1.1 fuel.bmp, NONE, 1.1 wrench.bmp, NONE, 1.1 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/planlibm/color In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29983/resources/planlibm/color Added Files: army.bmp fuel.bmp wrench.bmp Log Message: First attempt at some resource display for new planets. Gonna have to rewrite doublebuffering code to make it an rc option, all these duplicate function calls is getting crazy (or quadruple function calls when beeplite and doublebuffering come into play at once). --- NEW FILE: army.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: wrench.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: fuel.bmp --- (This appears to be a binary file; contents omitted.) From modemhero at users.sourceforge.net Sat May 20 12:09:41 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 20 May 2006 17:09:41 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C,1.25,1.26 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29983 Modified Files: NetrekXP to do list.C Log Message: First attempt at some resource display for new planets. Gonna have to rewrite doublebuffering code to make it an rc option, all these duplicate function calls is getting crazy (or quadruple function calls when beeplite and doublebuffering come into play at once). Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- NetrekXP to do list.C 20 May 2006 03:55:23 -0000 1.25 +++ NetrekXP to do list.C 20 May 2006 17:09:39 -0000 1.26 @@ -48,7 +48,10 @@ 9) Use nebula pic 10) fix clock - rewrite overlaybitmap calls to use SRCAND 10a) rewrite all scalebitmap functions to use angle not p_dir -11) need resources drawn somehow +10b) rewrite all doublebuffering so it's rc option - eliminate all these double +functions!!$!%^ +11) clean up code with resource drawing for overlay and refresh purposes +11a) get new bitmaps for resources 13) changing teams doesn't set delay to 0 for declare war , as it should (server fix pending) 14) Bug with waraction..was being called even when clicking on border (broke function) ..I added a default return to switch statement, but the underlying bug still remains. From modemhero at users.sourceforge.net Sat May 20 12:09:41 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 20 May 2006 17:09:41 +0000 Subject: [netrek-cvs] client/netrekxp/src dashboard.c, 1.6, 1.7 data.c, 1.21, 1.22 local.c, 1.22, 1.23 map.c, 1.9, 1.10 mswindow.c, 1.22, 1.23 newwin.c, 1.23, 1.24 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29983/src Modified Files: dashboard.c data.c local.c map.c mswindow.c newwin.c Log Message: First attempt at some resource display for new planets. Gonna have to rewrite doublebuffering code to make it an rc option, all these duplicate function calls is getting crazy (or quadruple function calls when beeplite and doublebuffering come into play at once). Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- mswindow.c 19 May 2006 18:08:07 -0000 1.22 +++ mswindow.c 20 May 2006 17:09:39 -0000 1.23 @@ -507,7 +507,11 @@ free (planet_bitmaps[6]); free (planet_bitmaps[7]); free (planet_unknown); - + + free (army_bitmap); + free (wrench_bitmap); + free (fuel_bitmap); + for (i = 0; i < PLANET_VIEWS; i++) free (bplanets[i]); for (i = 0; i < MPLANET_VIEWS; i++) @@ -6263,11 +6267,6 @@ SelectObject (GlobalMemDC, bitmap->bm); SelectObject (GlobalMemDC2, newbmp); - - // Copy selected section of main bitmap into newbmp before rotation - SetStretchBltMode(GlobalMemDC2, COLORONCOLOR); - StretchBlt(GlobalMemDC2, 0, 0, destwidth, destheight, GlobalMemDC, - srcx, srcy, srcwidth, srcheight, SRCPAINT); // Copy selected section of main bitmap into newbmp before rotation SetStretchBltMode(GlobalMemDC2, COLORONCOLOR); @@ -6333,7 +6332,7 @@ xForm.eDy = eDy; SetWorldTransform(sdb->mem_dc,&xForm); - BitBlt(sdb->mem_dc, 0, 0, newwidth, newheight, GlobalMemDC2, srcx, srcy, SRCPAINT); + BitBlt(sdb->mem_dc, 0, 0, newwidth, newheight, GlobalMemDC2, srcx, srcy, SRCCOPY); // Reset xForm xForm.eM11 = (FLOAT) 1.0; Index: dashboard.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/dashboard.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- dashboard.c 20 May 2006 03:55:23 -0000 1.6 +++ dashboard.c 20 May 2006 17:09:39 -0000 1.7 @@ -370,7 +370,7 @@ left = 0; right = -1; pos = 0; - strcpy (tmp, buf); + strncpy (tmp, buf, 7); while (pos < 7) { if (tmp[pos] == oldmsg[pos]) Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- newwin.c 19 May 2006 18:08:07 -0000 1.23 +++ newwin.c 20 May 2006 17:09:39 -0000 1.24 @@ -642,6 +642,20 @@ W_StoreBitmap3 ("bitmaps/planlibm/color/unknown.bmp", BMP_CPLANET_WIDTH, BMP_CPLANET_HEIGHT, BMP_PLANET_UNKNOWN, w, LR_DEFAULTCOLOR); + + /* Load the resource bitmaps */ + army_bitmap = + W_StoreBitmap3 ("bitmaps/planlibm/color/army.bmp", + BMP_ARMY_WIDTH, BMP_ARMY_HEIGHT, BMP_ARMYBMP, w, + LR_DEFAULTCOLOR); + wrench_bitmap = + W_StoreBitmap3 ("bitmaps/planlibm/color/wrench.bmp", + BMP_WRENCH_WIDTH, BMP_WRENCH_HEIGHT, BMP_WRENCHBMP, w, + LR_DEFAULTCOLOR); + fuel_bitmap = + W_StoreBitmap3 ("bitmaps/planlibm/color/fuel.bmp", + BMP_FUEL_WIDTH, BMP_FUEL_HEIGHT, BMP_FUELBMP, w, + LR_DEFAULTCOLOR); } /******************************************************************************/ Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- local.c 14 May 2006 02:14:54 -0000 1.22 +++ local.c 20 May 2006 17:09:39 -0000 1.23 @@ -379,6 +379,8 @@ planetBitmapC (l), planetColor (l), w); + /* Draw planet resources */ + planetResourcesC(localSDB, l, BMP_PLANET_WIDTH, BMP_PLANET_HEIGHT, dx, dy, w); #endif } else @@ -438,10 +440,10 @@ clearcount++; } - clearzone[0][clearcount] = dx - (BMP_PLANET_WIDTH / 2); - clearzone[1][clearcount] = dy - (BMP_PLANET_HEIGHT / 2); - clearzone[2][clearcount] = BMP_PLANET_WIDTH; - clearzone[3][clearcount] = BMP_PLANET_HEIGHT; + clearzone[0][clearcount] = dx - (7 * BMP_PLANET_WIDTH / 8); + clearzone[1][clearcount] = dy - (5 * BMP_PLANET_HEIGHT / 6); + clearzone[2][clearcount] = 7 * BMP_PLANET_WIDTH / 4 + 1; + clearzone[3][clearcount] = 4 * BMP_PLANET_HEIGHT / 3 + 1; clearcount++; } } Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- data.c 19 May 2006 18:08:07 -0000 1.21 +++ data.c 20 May 2006 17:09:39 -0000 1.22 @@ -312,7 +312,9 @@ W_Icon planet_earth[NUMTEAMS], planet_klingus[NUMTEAMS], planet_orion[NUMTEAMS], planet_romulus[NUMTEAMS], planet_agri1[NUMTEAMS], planet_agri2[NUMTEAMS], planet_rock1[NUMTEAMS], planet_rock2[NUMTEAMS]; - +W_Icon army_bitmap; +W_Icon wrench_bitmap; +W_Icon fuel_bitmap; W_Icon base_planets; W_Icon base_mplanets; W_Icon bplanets[PLANET_VIEWS]; Index: map.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/map.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- map.c 16 May 2006 05:10:13 -0000 1.9 +++ map.c 20 May 2006 17:09:39 -0000 1.10 @@ -253,7 +253,7 @@ } /******************************************************************************/ -/*** planetmBitmapC() +/*** planetBitmapC() /******************************************************************************/ extern inline W_Icon planetBitmapC (register struct planet *p) @@ -330,6 +330,57 @@ } /******************************************************************************/ +/*** planetResourcesC() +/******************************************************************************/ +extern inline void +planetResourcesC (SDBUFFER * sdb, register struct planet *p, int destwidth, int destheight, + int dx, int dy, W_Window window) +/* + * Draw the resources for a colorized planet. + */ +{ + if ((p->pl_info & me->p_team) +#ifdef RECORDGAME + || playback +#endif + ) + { + /* Select resources */ + if (p->pl_armies > 4) + W_OverlayScaleBitmapDB(sdb, dx - 7 * destwidth / 8, + dy - (destheight / 2), + destwidth/3, + destheight, + BMP_ARMY_WIDTH, + BMP_ARMY_HEIGHT, + 0, + army_bitmap, planetColor(p), + window); + if (p->pl_flags & PLREPAIR) + W_OverlayScaleBitmapDB(sdb, dx - (destwidth / 2), + dy - (5 * destheight / 6), + destwidth, + destheight/3, + BMP_WRENCH_WIDTH, + BMP_WRENCH_HEIGHT, + 0, + wrench_bitmap, planetColor(p), + window); + if (p->pl_flags & PLFUEL) + W_OverlayScaleBitmapDB(sdb, dx + 3 * destwidth / 5, + dy - (destheight / 2), + destwidth/3, + destheight, + BMP_FUEL_WIDTH, + BMP_FUEL_HEIGHT, + 0, + fuel_bitmap, planetColor(p), + window); + } + return; +} + +/******************************************************************************/ /*** agriColor() /******************************************************************************/ W_Color getAgriColor (struct planet *l) @@ -401,13 +452,13 @@ /* XFIX */ #ifndef DOUBLE_BUFFERING - W_ClearArea (mapw, dx - (BMP_MPLANET_WIDTH / 2 + 4), + W_ClearArea (mapw, dx - (BMP_MPLANET_WIDTH / 2 + 8), dy - (BMP_MPLANET_HEIGHT / 2 + 4), BMP_MPLANET_WIDTH + 8, BMP_MPLANET_HEIGHT + 8); #else - W_ClearAreaDB (mapSDB, dx - (BMP_MPLANET_WIDTH / 2 + 4), - dy - (BMP_MPLANET_HEIGHT / 2 + 4), - BMP_MPLANET_WIDTH + 8, BMP_MPLANET_HEIGHT + 8); + W_ClearAreaDB (mapSDB, dx - 7 * BMP_MPLANET_WIDTH / 8, + dy - (5 * BMP_MPLANET_HEIGHT / 6), + 7 * BMP_MPLANET_WIDTH / 4, 4 * BMP_MPLANET_HEIGHT / 3); #endif l->pl_flags &= ~PLCLEAR; } @@ -437,6 +488,9 @@ 0, planetBitmapC(l), planetColor(l), mapw); + + /* Draw planet resources */ + planetResourcesC(mapSDB, l, BMP_MPLANET_WIDTH, BMP_MPLANET_HEIGHT, dx, dy, mapw); #else W_OverlayBitmapDB(mapSDB, dx - (emph_planet_seq_width / 2 + 1), dy - (emph_planet_seq_height / 2), @@ -451,7 +505,9 @@ BMP_CPLANET_HEIGHT, 0, planetBitmapC(l), planetColor(l), - mapw); + mapw); + /* Draw planet resources */ + planetResourcesC(mapSDB, l, BMP_MPLANET_WIDTH, BMP_MPLANET_HEIGHT, dx, dy, mapw); #endif } else @@ -486,7 +542,20 @@ if (planetBitmapGalaxy == 3) { #ifndef DOUBLE_BUFFERING - W_OverlayScaleBitmap (dx - (BMP_MPLANET_WIDTH / 2), + W_WriteScaleBitmap (dx - (BMP_MPLANET_WIDTH / 2), + dy - (BMP_MPLANET_HEIGHT / 2), + BMP_MPLANET_WIDTH, + BMP_MPLANET_HEIGHT, + BMP_CPLANET_WIDTH, + BMP_CPLANET_HEIGHT, + 0, + planetBitmapC (l), + planetColor (l), + mapw); + /* Draw planet resources */ + planetResourcesC(mapSDB, l, BMP_MPLANET_WIDTH, BMP_MPLANET_HEIGHT, dx, dy, mapw); +#else + W_WriteScaleBitmapDB (mapSDB, dx - (BMP_MPLANET_WIDTH / 2), dy - (BMP_MPLANET_HEIGHT / 2), BMP_MPLANET_WIDTH, BMP_MPLANET_HEIGHT, @@ -496,17 +565,8 @@ planetBitmapC (l), planetColor (l), mapw); -#else - W_OverlayScaleBitmapDB (mapSDB, dx - (BMP_MPLANET_WIDTH / 2), - dy - (BMP_MPLANET_HEIGHT / 2), - BMP_MPLANET_WIDTH, - BMP_MPLANET_HEIGHT, - BMP_CPLANET_WIDTH, - BMP_CPLANET_HEIGHT, - 0, - planetBitmapC (l), - planetColor (l), - mapw); + /* Draw planet resources */ + planetResourcesC(mapSDB, l, BMP_MPLANET_WIDTH, BMP_MPLANET_HEIGHT, dx, dy, mapw); #endif } else From modemhero at users.sourceforge.net Sun May 21 04:56:41 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 21 May 2006 09:56:41 +0000 Subject: [netrek-cvs] client/netrekxp/src check.c, 1.3, 1.4 cowmain.c, 1.12, 1.13 dashboard.c, 1.7, 1.8 data.c, 1.22, 1.23 death.c, 1.6, 1.7 defaults.c, 1.17, 1.18 input.c, 1.10, 1.11 local.c, 1.23, 1.24 main.c, 1.5, 1.6 map.c, 1.10, 1.11 mswindow.c, 1.23, 1.24 newwin.c, 1.24, 1.25 option.c, 1.14, 1.15 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv20941/src Modified Files: check.c cowmain.c dashboard.c data.c death.c defaults.c input.c local.c main.c map.c mswindow.c newwin.c option.c Log Message: Rewrote doublebuffering to make it an rc option and not a #define - removes a lot of extra work in terms of needing twice as many write bitmap functions (client had one for regular draw, and one for DB) Added observer support to show repair/declare war flags on dashboard. Observers can also now change lock if they are observing a transwarper (server side fix, but good to know). Changed alert borders so they always redraw instead of on an alert change - was causing lots of problems with bitmaps at edge of screen, as well as with double buffering Readded the ability to see tractor/pressors if they go off screen (such as in the case of ATT tractors). Added "doubleBuffering: (on)/off" to control whether to draw with double buffering (it's recommended you do so if using the new planet and ship bitmaps). Can be changed in game through the options menu. Fixed the -c (report players on server) option so it doesn't crash the client Readded the ability to autologin by using -C name -A password. No more extra typing :). Fixed a whole bunch of startup options (-C, -A, -h, -g, etc) that were crashing client if not entered properly. Also made it so it prints out option list on a misused option. Bunch of other write bitmap function optimizations Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- mswindow.c 20 May 2006 17:09:39 -0000 1.23 +++ mswindow.c 21 May 2006 09:56:38 -0000 1.24 @@ -155,6 +155,56 @@ return;\ win = (Window *)window +#define DBHEADER_VOID\ + HDC hdc;\ + SDBUFFER * sdb;\ + register Window *win;\ + if (!window)\ + return;\ + sdb = SDB_lookup (window);\ + if (doubleBuffering && sdb && ingame)\ [...1764 lines suppressed...] - SetWorldTransform(sdb->mem_dc,&xForm); - BitBlt(sdb->mem_dc, 0, 0, newwidth, newheight, GlobalMemDC2, srcx, srcy, SRCCOPY); - - // Reset xForm - xForm.eM11 = (FLOAT) 1.0; - xForm.eM12 = (FLOAT) 0.0; - xForm.eM21 = (FLOAT) 0.0; - xForm.eM22 = (FLOAT) 1.0; - xForm.eDx = (FLOAT) 0.0; - xForm.eDy = (FLOAT) 0.0; - - SetWorldTransform(sdb->mem_dc,&xForm); - - DeleteObject (newbmp); + BitBlt (sdb->win_dc, 0, 0, sdb->wr.right, sdb->wr.bottom, sdb->mem_dc, 0, 0, SRCCOPY); } -#endif /* DOUBLE_BUFFERING */ // Make a WIN_SCROLL type window. // We use a scrollbar so we can look through the text, something the X version Index: dashboard.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/dashboard.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- dashboard.c 20 May 2006 17:09:39 -0000 1.7 +++ dashboard.c 21 May 2006 09:56:38 -0000 1.8 @@ -306,20 +306,26 @@ of importance */ /* Declare War text */ - if (delay) + if (me->p_flags & PFWAR) { sprintf (buf, "War "); - sprintf(buf2, "%d", delay - time (0)); - strcat (buf, buf2); + if (delay) + { + sprintf(buf2, "%d", delay - time (0)); + strcat (buf, buf2); + } msgtype = 0; color = W_Red; } /* Refit text */ - else if (rdelay) + else if (me->p_flags & PFREFITTING) { sprintf (buf, "Refit "); - sprintf(buf2, "%d", rdelay - time (0)); - strcat (buf, buf2); + if (rdelay) + { + sprintf(buf2, "%d", rdelay - time (0)); + strcat (buf, buf2); + } msgtype = 1; color = W_Green; } Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- newwin.c 20 May 2006 17:09:39 -0000 1.24 +++ newwin.c 21 May 2006 09:56:39 -0000 1.25 @@ -690,16 +690,12 @@ w = W_MakeWindow ("local", 0, 0, WINSIDE, WINSIDE, baseWin, THICKBORDER, foreColor); -#ifdef DOUBLE_BUFFERING localSDB = W_InitSDB (w); -#endif mapw = W_MakeWindow ("map", WINSIDE + 6, 0, WINSIDE, WINSIDE, baseWin, THICKBORDER, foreColor); -#ifdef DOUBLE_BUFFERING mapSDB = W_InitSDB (mapw); -#endif tstatw = W_MakeWindow ("tstat", 0, WINSIDE + 6, WINSIDE + 3, STATSIZE + 2, baseWin, BORDER, foreColor); @@ -1995,14 +1991,13 @@ cy = CLOCK_Y + CLOCK_HEI / 2; angle = (int)(-360 * time / max); - W_WriteBitmap ( CLOCK_BDR, CLOCK_BDR, clockpic, foreColor); + W_WriteBitmap ( CLOCK_BDR, CLOCK_BDR, clockpic, foreColor, qwin); W_OverlayScaleBitmap (CLOCK_BDR, CLOCK_BDR, BMP_CHAND_WIDTH, BMP_CHAND_HEIGHT, BMP_CHAND_WIDTH, BMP_CHAND_HEIGHT, angle, clockhandmask, foreColor, qwin); - angle = (int)(255-time*255/max); W_WriteScaleBitmap (CLOCK_BDR, CLOCK_BDR, BMP_CHAND_WIDTH, BMP_CHAND_HEIGHT, BMP_CHAND_WIDTH, BMP_CHAND_HEIGHT, - (unsigned char)(angle), clockhandpic, foreColor, qwin); + angle, clockhandpic, foreColor, qwin); sprintf (buf, "%d", max - time); tx = cx - W_Textwidth * strlen (buf) / 2; ty = 2*(cy - W_Textheight / 2)/3; @@ -2015,7 +2010,7 @@ cy = CLOCK_Y + (CLOCK_HEI - W_Textheight) / 2; ex = cx - BMP_CLOCK_WIDTH / 2; ey = cy - BMP_CLOCK_HEIGHT / 2; - W_WriteBitmap (ex, ey, clockpic, foreColor); + W_WriteBitmap (ex, ey, clockpic, foreColor, qwin); ex = (int) (cx - BMP_CLOCK_WIDTH * sin (2 * XPI * time / max) / 2); ey = (int) (cy - BMP_CLOCK_HEIGHT * cos (2 * XPI * time / max) / 2); Index: input.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/input.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- input.c 7 May 2006 21:10:51 -0000 1.10 +++ input.c 21 May 2006 09:56:38 -0000 1.11 @@ -692,7 +692,8 @@ while (W_EventsPending ()) W_NextEvent (&event); - + + ingame = 0; longjmp (env, 0); } Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- local.c 20 May 2006 17:09:39 -0000 1.23 +++ local.c 21 May 2006 09:56:38 -0000 1.24 @@ -26,6 +26,7 @@ /* Local Variables */ #define XPI 3.1415926 +static int playalert = 0; static int clearcount = 0; static int clearzone[4][(MAXTORP + 1) * MAXPLAYER + (MAXPLASMA + 1) * MAXPLAYER + MAXPLANETS]; @@ -266,11 +267,7 @@ dx = scaleLocal (dx); dy = scaleLocal (dy); -#ifndef DOUBLE_BUFFERING W_CacheLine (w, dx, dy, dx - dxx, dy - dyy, s->s_color); -#else - W_CacheLineDB (localSDB, dx, dy, dx - dxx, dy - dyy, s->s_color); -#endif clearline[0][clearlcount] = dx; clearline[1][clearlcount] = dy; @@ -290,11 +287,7 @@ dx = scaleLocal (dx); dy = scaleLocal (dy); -#ifndef DOUBLE_BUFFERING W_CachePoint (w, dx, dy, s->s_color); -#else - W_CachePointDB (localSDB, dx, dy, s->s_color); -#endif clearline[0][clearlcount] = dx; clearline[1][clearlcount] = dy; @@ -357,7 +350,6 @@ if (planetBitmap == 3) { -#ifndef DOUBLE_BUFFERING W_WriteScaleBitmap (dx - (BMP_PLANET_WIDTH / 2), dy - (BMP_PLANET_HEIGHT / 2), BMP_PLANET_WIDTH, @@ -368,32 +360,14 @@ planetBitmapC (l), planetColor (l), w); -#else - W_WriteScaleBitmapDB (localSDB, dx - (BMP_PLANET_WIDTH / 2), - dy - (BMP_PLANET_HEIGHT / 2), - BMP_PLANET_WIDTH, - BMP_PLANET_HEIGHT, - BMP_CPLANET_WIDTH, - BMP_CPLANET_HEIGHT, - 0, - planetBitmapC (l), - planetColor (l), - w); /* Draw planet resources */ - planetResourcesC(localSDB, l, BMP_PLANET_WIDTH, BMP_PLANET_HEIGHT, dx, dy, w); -#endif + planetResourcesC(l, BMP_PLANET_WIDTH, BMP_PLANET_HEIGHT, dx, dy, w); } else { -#ifndef DOUBLE_BUFFERING W_WriteBitmap (dx - (BMP_PLANET_WIDTH / 2), dy - (BMP_PLANET_HEIGHT / 2), getPlanetBitmap (l), - planetColor (l)); -#else - W_WriteBitmapDB (localSDB, dx - (BMP_PLANET_WIDTH / 2), - dy - (BMP_PLANET_HEIGHT / 2), getPlanetBitmap (l), - planetColor (l)); -#endif + planetColor (l), w); } if (showIND && ((l->pl_info & me->p_team) #ifdef RECORDGAME @@ -401,7 +375,6 @@ #endif ) && (l->pl_owner == NOBODY)) { -#ifndef DOUBLE_BUFFERING W_CacheLine (w, dx - (BMP_PLANET_WIDTH / 2), dy - (BMP_PLANET_HEIGHT / 2), dx + (BMP_PLANET_WIDTH / 2 - 1), @@ -410,40 +383,33 @@ dy - (BMP_PLANET_HEIGHT / 2), dx - (BMP_PLANET_WIDTH / 2), dy + (BMP_PLANET_HEIGHT / 2 - 1), W_White); -#else - W_CacheLineDB (localSDB, dx - (BMP_PLANET_WIDTH / 2), - dy - (BMP_PLANET_HEIGHT / 2), - dx + (BMP_PLANET_WIDTH / 2 - 1), - dy + (BMP_PLANET_HEIGHT / 2 - 1), W_White); - W_CacheLineDB (localSDB, dx + (BMP_PLANET_WIDTH / 2 - 1), - dy - (BMP_PLANET_HEIGHT / 2), - dx - (BMP_PLANET_WIDTH / 2), - dy + (BMP_PLANET_HEIGHT / 2 - 1), W_White); -#endif } if (showPlanetNames) { -#ifndef DOUBLE_BUFFERING W_MaskText (w, dx - (BMP_PLANET_WIDTH / 2), dy + (BMP_PLANET_HEIGHT / 2), planetColor (l), l->pl_name, l->pl_namelen, planetFont (l)); -#else - W_MaskTextDB (localSDB, dx - (BMP_PLANET_WIDTH / 2), - dy + (BMP_PLANET_HEIGHT / 2), planetColor (l), - l->pl_name, l->pl_namelen, planetFont (l)); -#endif clearzone[0][clearcount] = dx - (BMP_PLANET_WIDTH / 2); clearzone[1][clearcount] = dy + (BMP_PLANET_HEIGHT / 2); clearzone[2][clearcount] = W_Textwidth * l->pl_namelen; clearzone[3][clearcount] = W_Textheight; clearcount++; } - - clearzone[0][clearcount] = dx - (7 * BMP_PLANET_WIDTH / 8); - clearzone[1][clearcount] = dy - (5 * BMP_PLANET_HEIGHT / 6); - clearzone[2][clearcount] = 7 * BMP_PLANET_WIDTH / 4 + 1; - clearzone[3][clearcount] = 4 * BMP_PLANET_HEIGHT / 3 + 1; + if (planetBitmap == 3) // Needs adjusting + { + clearzone[0][clearcount] = dx - (7 * BMP_PLANET_WIDTH / 8); + clearzone[1][clearcount] = dy - (5 * BMP_PLANET_HEIGHT / 6); + clearzone[2][clearcount] = 7 * BMP_PLANET_WIDTH / 4 + 1; + clearzone[3][clearcount] = 4 * BMP_PLANET_HEIGHT / 3 + 1; + } + else + { + clearzone[0][clearcount] = dx - (BMP_PLANET_WIDTH / 2); + clearzone[1][clearcount] = dy - (BMP_PLANET_HEIGHT / 2); + clearzone[2][clearcount] = BMP_PLANET_WIDTH; + clearzone[3][clearcount] = BMP_PLANET_HEIGHT; + } clearcount++; } } @@ -676,14 +642,8 @@ #endif ) { -#ifndef DOUBLE_BUFFERING W_WriteBitmap (dx - (cloak_width / 2), - dy - (cloak_height / 2), cloakicon, myColor); -#else - W_WriteBitmapDB (localSDB, dx - (cloak_width / 2), - dy - (cloak_height / 2), cloakicon, myColor); -#endif - + dy - (cloak_height / 2), cloakicon, myColor, w); clearzone[0][clearcount] = dx - (shield_width / 2); clearzone[1][clearcount] = dy - (shield_height / 2); clearzone[2][clearcount] = shield_width; @@ -849,56 +809,30 @@ if (colorClient != 4) { -#ifndef DOUBLE_BUFFERING W_WriteBitmap (dx - (j->p_ship.s_width / 2), dy - (j->p_ship.s_height / 2), ship_bits[j->p_ship.s_type][rosette (j->p_dir)], - playerColor (j)); -#else - W_WriteBitmapDB (localSDB, dx - (j->p_ship.s_width / 2), - dy - (j->p_ship.s_height / 2), - ship_bits[j->p_ship.s_type][rosette (j->p_dir)], - playerColor (j)); -#endif + playerColor (j), w); } else { -#ifndef DOUBLE_BUFFERING W_WriteScaleBitmap (dx - (j->p_ship.s_width / 2), dy - (j->p_ship.s_height / 2), j->p_ship.s_width, j->p_ship.s_height, BMP_SHIP_WIDTH_HR, BMP_SHIP_HEIGHT_HR, - j->p_dir, + (360 * j->p_dir/255), // Converted to angle ship_bitsHR[j->p_ship.s_type], playerColor (j), w); -#else - W_WriteScaleBitmapDB (localSDB, dx - (j->p_ship.s_width / 2), - dy - (j->p_ship.s_height / 2), - j->p_ship.s_width, - j->p_ship.s_height, - BMP_SHIP_WIDTH_HR, - BMP_SHIP_HEIGHT_HR, - j->p_dir, - ship_bitsHR[j->p_ship.s_type], - playerColor (j), - w); -#endif } if (j->p_cloakphase > 0) { -#ifndef DOUBLE_BUFFERING W_WriteBitmap (dx - (cloak_width / 2), dy - (cloak_height / 2), cloakicon, - playerColor (j)); -#else - W_WriteBitmapDB (localSDB, dx - (cloak_width / 2), - dy - (cloak_height / 2), cloakicon, - playerColor (j)); -#endif + playerColor (j), w); if (!myPlayer (j)) /* if myplayer draw the * shield */ continue; @@ -911,18 +845,10 @@ && (liteflag & LITE_PLAYERS_LOCAL)) { int seq_n = emph_player_seq_n[j->p_no] % emph_player_seql_frames; - -#ifndef DOUBLE_BUFFERING W_WriteBitmap (dx - (emph_player_seql_width / 2), dy - (emph_player_seql_height / 2), emph_player_seql[seq_n], - W_White); -#else - W_WriteBitmapDB (localSDB, dx - (emph_player_seql_width / 2), - dy - (emph_player_seql_height / 2), - emph_player_seql[seq_n], - W_White); -#endif + W_White, w); } #endif @@ -1006,23 +932,12 @@ } #ifdef VSHIELD_BITMAPS -#ifndef DOUBLE_BUFFERING W_WriteBitmap (dx - (shield_width / 2), dy - (shield_height / 2), shield[shieldnum], - color); -#else - W_WriteBitmapDB (localSDB, dx - (shield_width / 2), - dy - (shield_height / 2), shield[shieldnum], - color); -#endif /* DOUBLE_BUFFERING */ + color, w); #else -#ifndef DOUBLE_BUFFERING W_WriteBitmap (dx - (shield_width / 2), - dy - (shield_height / 2), shield, color); -#else - W_WriteBitmapDB (localSDB, dx - (shield_width / 2), - dy - (shield_height / 2), shield, color); -#endif /* DOUBLE_BUFFERING */ + dy - (shield_height / 2), shield, color, w); #endif } if (j->p_flags & PFCLOAK) /* when cloaked stop here */ @@ -1083,16 +998,9 @@ } } } -#ifndef DOUBLE_BUFFERING W_MaskText (w, dx + (j->p_ship.s_width / 2), dy - (j->p_ship.s_height / 2), color, idbuf, buflen, shipFont (j)); -#else - W_MaskTextDB (localSDB, dx + (j->p_ship.s_width / 2), - dy - (j->p_ship.s_height / 2), color, - idbuf, buflen, shipFont (j)); -#endif - clearzone[0][clearcount] = dx + (j->p_ship.s_width / 2); clearzone[1][clearcount] = dy - (j->p_ship.s_height / 2); clearzone[2][clearcount] = buflen * W_Textwidth; @@ -1169,15 +1077,9 @@ if (j->p_ship.s_type == STARBASE) { -#ifndef DOUBLE_BUFFERING W_WriteBitmap (dx - (BMP_SBEXPL_WIDTH / 2), dy - (BMP_SBEXPL_HEIGHT / 2), sbexpview[i], - playerColor (j)); -#else - W_WriteBitmapDB (localSDB, dx - (BMP_SBEXPL_WIDTH / 2), - dy - (BMP_SBEXPL_HEIGHT / 2), sbexpview[i], - playerColor (j)); -#endif + playerColor (j), w); clearzone[0][clearcount] = dx - (BMP_SBEXPL_WIDTH / 2); clearzone[1][clearcount] = dy - (BMP_SBEXPL_HEIGHT / 2); clearzone[2][clearcount] = BMP_SBEXPL_WIDTH; @@ -1185,15 +1087,9 @@ } else { -#ifndef DOUBLE_BUFFERING W_WriteBitmap (dx - (BMP_SHIPEXPL_WIDTH / 2), dy - (BMP_SHIPEXPL_HEIGHT / 2), expview[i], - playerColor (j)); -#else - W_WriteBitmapDB (localSDB, dx - (BMP_SHIPEXPL_WIDTH / 2), - dy - (BMP_SHIPEXPL_HEIGHT / 2), expview[i], - playerColor (j)); -#endif + playerColor (j), w); clearzone[0][clearcount] = dx - (BMP_SHIPEXPL_WIDTH / 2); clearzone[1][clearcount] = dy - (BMP_SHIPEXPL_HEIGHT / 2); clearzone[2][clearcount] = BMP_SHIPEXPL_WIDTH; @@ -1360,11 +1256,7 @@ px = new_dx; py = new_dy; } -#ifndef DOUBLE_BUFFERING W_CacheLine (w, px, py, tx, ty, col); -#else - W_CacheLineDB (localSDB, px, py, tx, ty, col); -#endif } else { @@ -1379,55 +1271,27 @@ py = new_dy; } if (highlightFriendlyPhasers) -#ifndef DOUBLE_BUFFERING W_CacheLine (w, px, py, tx, ty, foreColor); -#else - W_CacheLineDB (localSDB, px, py, tx, ty, foreColor); -#endif else { if ((php->ph_fuse % 2) == 1) -#ifndef DOUBLE_BUFFERING W_CacheLine (w, px, py, tx, ty, foreColor); -#else - W_CacheLineDB (localSDB, px, py, tx, ty, foreColor); -#endif else -#ifndef DOUBLE_BUFFERING W_CacheLine (w, px, py, tx, ty, shipCol[remap[j->p_team]]); -#else - W_CacheLineDB (localSDB, px, py, tx, ty, shipCol[remap[j->p_team]]); -#endif } } else -#ifndef DOUBLE_BUFFERING W_CacheLine (w, px, py, tx, ty, shipCol[remap[j->p_team]]); -#else - W_CacheLineDB (localSDB, px, py, tx, ty, shipCol[remap[j->p_team]]); -#endif } #else if (highlightFriendlyPhasers && (php->ph_status == PHHIT)) -#ifndef DOUBLE_BUFFERING W_CacheLine (w, px, py, tx, ty, foreColor); -#else - W_CacheLineDB (localSDB, px, py, tx, ty, foreColor); -#endif else { if ((php->ph_fuse % 2) == 1) -#ifndef DOUBLE_BUFFERING W_CacheLine (w, px, py, tx, ty, foreColor); -#else - W_CacheLineDB (localSDB, px, py, tx, ty, foreColor); -#endif else -#ifndef DOUBLE_BUFFERING W_CacheLine (w, px, py, tx, ty, shipCol[remap[j->p_team]]); -#else - W_CacheLineDB (localSDB, px, py, tx, ty, shipCol[remap[j->p_team]]); -#endif } #endif php->ph_fuse++; @@ -1464,13 +1328,8 @@ lx = (int) (px - enemyPhasers * Cos[dir]); ly = (int) (py - enemyPhasers * Sin[dir]); -#ifndef DOUBLE_BUFFERING W_MakePhaserLine (w, wx, wy, tx, ty, shipCol[remap[j->p_team]]); W_MakePhaserLine (w, lx, ly, tx, ty, shipCol[remap[j->p_team]]); -#else - W_MakePhaserLineDB (localSDB, wx, wy, tx, ty, shipCol[remap[j->p_team]]); - W_MakePhaserLineDB (localSDB, lx, ly, tx, ty, shipCol[remap[j->p_team]]); -#endif php->ph_fuse++; @@ -1488,11 +1347,7 @@ } else { -#ifndef DOUBLE_BUFFERING W_MakePhaserLine (w, px, py, tx, ty, shipCol[remap[j->p_team]]); -#else - W_MakePhaserLineDB (localSDB, px, py, tx, ty, shipCol[remap[j->p_team]]); -#endif php->ph_fuse++; @@ -1543,8 +1398,6 @@ px = (tractee->p_x - me->p_x); py = (tractee->p_y - me->p_y); - if(px > view || px < -view || py > view || py < -view) - continue; px = px / SCALE + WINSIDE / 2; py = py / SCALE + WINSIDE / 2; @@ -1567,23 +1420,13 @@ ly[1] = (int) (py - (Sin[dir] * (target_width / 2))); if (j->p_flags & PFPRESS) { -#ifndef DOUBLE_BUFFERING W_MakeTractLine (w, dx, dy, lx[0], ly[0], W_Yellow); W_MakeTractLine (w, dx, dy, lx[1], ly[1], W_Yellow); -#else - W_MakeTractLineDB (localSDB, dx, dy, lx[0], ly[0], W_Yellow); - W_MakeTractLineDB (localSDB, dx, dy, lx[1], ly[1], W_Yellow); -#endif } else { -#ifndef DOUBLE_BUFFERING W_MakeTractLine (w, dx, dy, lx[0], ly[0], W_Green); W_MakeTractLine (w, dx, dy, lx[1], ly[1], W_Green); -#else - W_MakeTractLineDB (localSDB, dx, dy, lx[0], ly[0], W_Green); - W_MakeTractLineDB (localSDB, dx, dy, lx[1], ly[1], W_Green); -#endif } /* @@ -1793,15 +1636,9 @@ torpTeam = 2; } } -#ifndef DOUBLE_BUFFERING W_WriteBitmap (dx - (BMP_CTORPDET_WIDTH / 2), dy - (BMP_CTORPDET_HEIGHT / 2), - cloudC[torpTeam][k->t_fuse], torpColor (k)); -#else - W_WriteBitmapDB (localSDB, dx - (BMP_CTORPDET_WIDTH / 2), - dy - (BMP_CTORPDET_HEIGHT / 2), - cloudC[torpTeam][k->t_fuse], torpColor (k)); -#endif + cloudC[torpTeam][k->t_fuse], torpColor (k), w); clearzone[0][clearcount] = dx - (BMP_CTORPDET_WIDTH / 2); clearzone[1][clearcount] = dy - (BMP_CTORPDET_HEIGHT / 2); clearzone[2][clearcount] = BMP_CTORPDET_WIDTH; @@ -1810,15 +1647,9 @@ } else { -#ifndef DOUBLE_BUFFERING W_WriteBitmap (dx - (BMP_TORPDET_WIDTH / 2), dy - (BMP_TORPDET_HEIGHT / 2), - cloud[k->t_fuse], torpColor (k)); -#else - W_WriteBitmapDB (localSDB, dx - (BMP_TORPDET_WIDTH / 2), - dy - (BMP_TORPDET_HEIGHT / 2), - cloud[k->t_fuse], torpColor (k)); -#endif + cloud[k->t_fuse], torpColor (k), w); clearzone[0][clearcount] = dx - (BMP_TORPDET_WIDTH / 2); clearzone[1][clearcount] = dy - (BMP_TORPDET_HEIGHT / 2); clearzone[2][clearcount] = BMP_TORPDET_WIDTH; @@ -1859,28 +1690,15 @@ if (j != me && ((k->t_war & me->p_team) || (j->p_team & (me->p_hostile | me->p_swar)))) { -#ifndef DOUBLE_BUFFERING W_WriteBitmap (dx - (BMP_CTORP_WIDTH / 2), dy - (BMP_CTORP_HEIGHT / 2), - torpC[torpTeam][k->t_fuse], torpColor (k)); -#else - W_WriteBitmapDB (localSDB, dx - (BMP_CTORP_WIDTH / 2), - dy - (BMP_CTORP_HEIGHT / 2), - torpC[torpTeam][k->t_fuse], torpColor (k)); -#endif - + torpC[torpTeam][k->t_fuse], torpColor (k), w); } else { -#ifndef DOUBLE_BUFFERING W_WriteBitmap (dx - (BMP_CTORP_WIDTH / 2), dy - (BMP_CTORP_HEIGHT / 2), - mtorpC[torpTeam][k->t_fuse], torpColor (k)); -#else - W_WriteBitmapDB (localSDB, dx - (BMP_CTORP_WIDTH / 2), - dy - (BMP_CTORP_HEIGHT / 2), - mtorpC[torpTeam][k->t_fuse], torpColor (k)); -#endif + mtorpC[torpTeam][k->t_fuse], torpColor (k), w); } clearzone[0][clearcount] = dx - (BMP_CTORP_WIDTH / 2); @@ -1899,13 +1717,8 @@ * torpColor(k)); */ /* XFIX */ -#ifndef DOUBLE_BUFFERING W_WriteBitmap (dx - (etorp_width / 2), - dy - (etorp_height / 2), etorp, torpColor (k)); -#else - W_WriteBitmapDB (localSDB, dx - (etorp_width / 2), - dy - (etorp_height / 2), etorp, torpColor (k)); -#endif + dy - (etorp_height / 2), etorp, torpColor (k), w); clearzone[0][clearcount] = dx - (etorp_width / 2); clearzone[1][clearcount] = dy - (etorp_height / 2); clearzone[2][clearcount] = etorp_width; @@ -1914,13 +1727,8 @@ } else { -#ifndef DOUBLE_BUFFERING W_WriteBitmap (dx - (mtorp_width / 2), - dy - (mtorp_height / 2), mtorp, torpColor (k)); -#else - W_WriteBitmapDB (localSDB, dx - (mtorp_width / 2), - dy - (mtorp_height / 2), mtorp, torpColor (k)); -#endif + dy - (mtorp_height / 2), mtorp, torpColor (k), w); clearzone[0][clearcount] = dx - (mtorp_width / 2); clearzone[1][clearcount] = dy - (mtorp_height / 2); clearzone[2][clearcount] = mtorp_width; @@ -2079,17 +1887,10 @@ ptorpTeam = 2; } } -#ifndef DOUBLE_BUFFERING W_WriteBitmap (dx - (BMP_CPLASMATORPDET_WIDTH / 2), dy - (BMP_CPLASMATORPDET_HEIGHT / 2), plcloudC[ptorpTeam][pt->pt_fuse], - plasmatorpColor (pt)); -#else - W_WriteBitmapDB (localSDB, dx - (BMP_CPLASMATORPDET_WIDTH / 2), - dy - (BMP_CPLASMATORPDET_HEIGHT / 2), - plcloudC[ptorpTeam][pt->pt_fuse], - plasmatorpColor (pt)); -#endif + plasmatorpColor (pt), w); clearzone[0][clearcount] = dx - (BMP_CPLASMATORPDET_WIDTH / 2); clearzone[1][clearcount] = dy - (BMP_CPLASMATORPDET_HEIGHT / 2); clearzone[2][clearcount] = BMP_CPLASMATORPDET_WIDTH; @@ -2098,15 +1899,9 @@ } else { -#ifndef DOUBLE_BUFFERING W_WriteBitmap (dx - (BMP_PLASMATORPDET_WIDTH / 2), dy - (BMP_PLASMATORPDET_HEIGHT / 2), - plasmacloud[pt->pt_fuse], plasmatorpColor (pt)); -#else - W_WriteBitmapDB (localSDB, dx - (BMP_PLASMATORPDET_WIDTH / 2), - dy - (BMP_PLASMATORPDET_HEIGHT / 2), - plasmacloud[pt->pt_fuse], plasmatorpColor (pt)); -#endif + plasmacloud[pt->pt_fuse], plasmatorpColor (pt), w); clearzone[0][clearcount] = dx - (BMP_PLASMATORPDET_WIDTH / 2); clearzone[1][clearcount] = dy - (BMP_PLASMATORPDET_HEIGHT / 2); clearzone[2][clearcount] = BMP_PLASMATORPDET_WIDTH; @@ -2148,31 +1943,17 @@ p_team & (me->p_hostile | me-> p_swar)))) { -#ifndef DOUBLE_BUFFERING W_WriteBitmap (dx - (BMP_CPLASMATORP_WIDTH / 2), dy - (BMP_CPLASMATORP_HEIGHT / 2), plasmaC[ptorpTeam][pt->pt_fuse], - plasmatorpColor (pt)); -#else - W_WriteBitmapDB (localSDB, dx - (BMP_CPLASMATORP_WIDTH / 2), - dy - (BMP_CPLASMATORP_HEIGHT / 2), - plasmaC[ptorpTeam][pt->pt_fuse], - plasmatorpColor (pt)); -#endif + plasmatorpColor (pt), w); } else { -#ifndef DOUBLE_BUFFERING W_WriteBitmap (dx - (BMP_CPLASMATORP_WIDTH / 2), dy - (BMP_CPLASMATORP_HEIGHT / 2), mplasmaC[ptorpTeam][pt->pt_fuse], - plasmatorpColor (pt)); -#else - W_WriteBitmapDB (localSDB, dx - (BMP_CPLASMATORP_WIDTH / 2), - dy - (BMP_CPLASMATORP_HEIGHT / 2), - mplasmaC[ptorpTeam][pt->pt_fuse], - plasmatorpColor (pt)); -#endif + plasmatorpColor (pt), w); } clearzone[0][clearcount] = dx - (BMP_CPLASMATORP_WIDTH / 2); clearzone[1][clearcount] = dy - (BMP_CPLASMATORP_HEIGHT / 2); @@ -2188,15 +1969,9 @@ p_team & (me->p_hostile | me-> p_swar)))) { -#ifndef DOUBLE_BUFFERING W_WriteBitmap (dx - (eplasmatorp_width / 2), dy - (eplasmatorp_height / 2), - eplasmatorp, plasmatorpColor (pt)); -#else - W_WriteBitmapDB (localSDB, dx - (eplasmatorp_width / 2), - dy - (eplasmatorp_height / 2), - eplasmatorp, plasmatorpColor (pt)); -#endif + eplasmatorp, plasmatorpColor (pt), w); clearzone[0][clearcount] = dx - (eplasmatorp_width / 2); clearzone[1][clearcount] = dy - (eplasmatorp_height / 2); clearzone[2][clearcount] = eplasmatorp_width; @@ -2205,15 +1980,9 @@ } else { -#ifndef DOUBLE_BUFFERING W_WriteBitmap (dx - (mplasmatorp_width / 2), dy - (mplasmatorp_height / 2), - mplasmatorp, plasmatorpColor (pt)); -#else - W_WriteBitmapDB (localSDB, dx - (mplasmatorp_width / 2), - dy - (mplasmatorp_height / 2), - mplasmatorp, plasmatorpColor (pt)); -#endif + mplasmatorp, plasmatorpColor (pt), w); clearzone[0][clearcount] = dx - (mplasmatorp_width / 2); clearzone[1][clearcount] = dy - (mplasmatorp_height / 2); clearzone[2][clearcount] = mplasmatorp_width; @@ -2296,11 +2065,7 @@ else continue; -#ifndef DOUBLE_BUFFERING W_CacheLine (w, sx, sy, ex, ey, sl->color); -#else - W_CacheLineDB (localSDB, sx, sy, ex, ey, sl->color); -#endif clearline[0][clearlcount] = sx; clearline[1][clearlcount] = sy; clearline[2][clearlcount] = ex; @@ -2321,11 +2086,7 @@ if (ey > WINSIDE - 1) ey = WINSIDE - 1; /* XFIX */ -#ifndef DOUBLE_BUFFERING W_CacheLine (w, dx, sy, dx, ey, warningColor); -#else - W_CacheLineDB (localSDB, dx, sy, dx, ey, warningColor); -#endif clearline[0][clearlcount] = dx; clearline[1][clearlcount] = sy; clearline[2][clearlcount] = dx; @@ -2343,11 +2104,7 @@ if (ey > WINSIDE - 1) ey = WINSIDE - 1; /* XFIX */ -#ifndef DOUBLE_BUFFERING W_CacheLine (w, dx, sy, dx, ey, warningColor); -#else - W_CacheLineDB (localSDB, dx, sy, dx, ey, warningColor); -#endif clearline[0][clearlcount] = dx; clearline[1][clearlcount] = sy; clearline[2][clearlcount] = dx; @@ -2365,11 +2122,7 @@ if (ex > WINSIDE - 1) ex = WINSIDE - 1; /* XFIX */ -#ifndef DOUBLE_BUFFERING W_CacheLine (w, sx, dy, ex, dy, warningColor); -#else - W_CacheLineDB (localSDB, sx, dy, ex, dy, warningColor); -#endif clearline[0][clearlcount] = sx; clearline[1][clearlcount] = dy; clearline[2][clearlcount] = ex; @@ -2387,11 +2140,7 @@ if (ex > WINSIDE - 1) ex = WINSIDE - 1; /* XFIX */ -#ifndef DOUBLE_BUFFERING W_CacheLine (w, sx, dy, ex, dy, warningColor); -#else - W_CacheLineDB (localSDB, sx, dy, ex, dy, warningColor); -#endif clearline[0][clearlcount] = sx; clearline[1][clearlcount] = dy; clearline[2][clearlcount] = ex; @@ -2400,27 +2149,24 @@ } - /* Change border color to signify alert status */ - + /* Decided to always redraw alert borders, was causing too many problems with + the infrequent draw rate - BB */ if (oldalert != (me->p_flags & (PFGREEN | PFYELLOW | PFRED))) + playalert = 1; + oldalert = (me->p_flags & (PFGREEN | PFYELLOW | PFRED)); + switch (oldalert) { - oldalert = (me->p_flags & (PFGREEN | PFYELLOW | PFRED)); - switch (oldalert) + case PFGREEN: + if (extraAlertBorder) { - case PFGREEN: - if (extraAlertBorder) - { -#ifndef DOUBLE_BUFFERING - W_ChangeBorder (w, gColor); - W_ChangeBorder (mapw, gColor); -#else - W_ChangeBorderDB (localSDB, gColor); - W_ChangeBorderDB (mapSDB, gColor); -#endif - } - W_ChangeBorder (baseWin, gColor); + W_ChangeBorder (w, gColor); + W_ChangeBorder (mapw, gColor); + } + W_ChangeBorder (baseWin, gColor); #if defined(SOUND) + if (playalert) + { if (newSound) // Kill any channels with WARNING_WAV or RED_ALERT_WAV (group 2) Mix_HaltGroup(2); else @@ -2428,25 +2174,20 @@ Abort_Sound(WARNING_SOUND); Abort_Sound(RED_ALERT_SOUND); } - -#endif - - break; - case PFYELLOW: - if (extraAlertBorder) - { -#ifndef DOUBLE_BUFFERING - W_ChangeBorder (w, yColor); - W_ChangeBorder (mapw, yColor); -#else - W_ChangeBorderDB (localSDB, yColor); - W_ChangeBorderDB (mapSDB, yColor); + } #endif - } - W_ChangeBorder (baseWin, yColor); + break; + case PFYELLOW: + if (extraAlertBorder) + { + W_ChangeBorder (w, yColor); + W_ChangeBorder (mapw, yColor); + } + W_ChangeBorder (baseWin, yColor); #if defined(SOUND) - + if (playalert) + { if (newSound) // Kill any channels with RED_ALERT_WAV (group 2) { Mix_HaltGroup(2); @@ -2457,33 +2198,29 @@ Abort_Sound(RED_ALERT_SOUND); Play_Sound(WARNING_SOUND); } - -#endif - - break; - case PFRED: - if (extraAlertBorder) - { -#ifndef DOUBLE_BUFFERING - W_ChangeBorder (w, rColor); - W_ChangeBorder (mapw, rColor); -#else - W_ChangeBorderDB (localSDB, rColor); - W_ChangeBorderDB (mapSDB, rColor); + } #endif - } - W_ChangeBorder (baseWin, rColor); - + break; + case PFRED: + if (extraAlertBorder) + { + W_ChangeBorder (w, rColor); + W_ChangeBorder (mapw, rColor); + } + W_ChangeBorder (baseWin, rColor); + #if defined(SOUND) + if (playalert) + { if (newSound) Play_Sound(RED_ALERT_WAV); else Play_Sound(RED_ALERT_SOUND); -#endif - - break; } +#endif + break; } + playalert = 0; #if defined(SOUND) if (newSound) @@ -2577,11 +2314,7 @@ } if (tri_x != -1) { -#ifndef DOUBLE_BUFFERING W_WriteTriangle (w, tri_x, tri_y, 4, facing, foreColor); -#else - W_WriteTriangleDB (localSDB, tri_x, tri_y, 4, facing, foreColor); -#endif clearzone[0][clearcount] = tri_x - tri_size - 1; clearzone[1][clearcount] = tri_y - 1 + (facing ? 0 : -tri_size); clearzone[2][clearcount] = tri_size * 2 + 2; @@ -2598,9 +2331,8 @@ Draw out the 'tactical' map */ { -#ifdef DOUBLE_BUFFERING - W_Win2Mem (localSDB); -#endif + if (doubleBuffering) + W_Win2Mem (localSDB); clearLocal (); @@ -2619,9 +2351,8 @@ weaponUpdate = 0; DrawMisc (); -#ifdef DOUBLE_BUFFERING - W_Mem2Win (localSDB); -#endif + if (doubleBuffering) + W_Mem2Win (localSDB); } @@ -2635,11 +2366,7 @@ { if (W_FastClear) { -#ifndef DOUBLE_BUFFERING W_ClearWindow (w); -#else - W_ClearWindowDB (localSDB); -#endif clearcount = 0; clearlcount = 0; tractcurrent = tracthead; @@ -2647,44 +2374,25 @@ else { // Much more efficient way of clearing -- X programmers take note! -#ifndef DOUBLE_BUFFERING W_ClearAreas (w, clearzone[0], clearzone[1], clearzone[2], clearzone[3], clearcount); -#else - W_ClearAreasDB (localSDB, clearzone[0], clearzone[1], clearzone[2], - clearzone[3], clearcount); -#endif clearcount = 0; /* erase the tractor lines [BDyess] */ for (tractrunner = tracthead; tractrunner != tractcurrent; tractrunner = tractrunner->next) { -#ifndef DOUBLE_BUFFERING W_MakeTractLine (w, tractrunner->sx, tractrunner->sy, tractrunner->d1x, tractrunner->d1y, backColor); W_MakeTractLine (w, tractrunner->sx, tractrunner->sy, tractrunner->d2x, tractrunner->d2y, backColor); -#else - W_MakeTractLineDB (localSDB, tractrunner->sx, tractrunner->sy, - tractrunner->d1x, tractrunner->d1y, - backColor); - W_MakeTractLineDB (localSDB, tractrunner->sx, tractrunner->sy, - tractrunner->d2x, tractrunner->d2y, - backColor); -#endif } tractcurrent = tracthead; -#ifndef DOUBLE_BUFFERING W_MakeLines (w, clearline[0], clearline[1], clearline[2], clearline[3], clearlcount, backColor); -#else - W_MakeLinesDB (localSDB, clearline[0], clearline[1], clearline[2], - clearline[3], clearlcount, backColor); -#endif clearlcount = 0; } } Index: death.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/death.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- death.c 14 May 2006 02:14:54 -0000 1.6 +++ death.c 21 May 2006 09:56:38 -0000 1.7 @@ -39,6 +39,7 @@ { W_Event event; + ingame = 0; #ifdef AUTOKEY if (autoKey) autoKeyAllOff (); @@ -51,13 +52,8 @@ { if (extraAlertBorder) { -#ifndef DOUBLE_BUFFERING W_ChangeBorder (w, gColor); W_ChangeBorder (mapw, gColor); -#else - W_ChangeBorderDB (localSDB, gColor); - W_ChangeBorderDB (mapSDB, gColor); -#endif } W_ChangeBorder (baseWin, gColor); oldalert = PFGREEN; @@ -223,7 +219,8 @@ { /* Otherwise we aren't within a thread, so... */ while (W_EventsPending ()) W_NextEvent (&event); - + + ingame = 0; longjmp (env, 0); } #endif /* Threaded */ Index: option.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/option.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- option.c 14 May 2006 02:14:54 -0000 1.14 +++ option.c 21 May 2006 09:56:39 -0000 1.15 @@ -387,6 +387,7 @@ #ifdef XTRA_MESSAGE_UI {1, "", &messageHUD, 0, 0, 0, messagehudmess, &messagehud_range}, #endif + {1, "use double buffering", &doubleBuffering, 0, 0, 0, NULL, NULL}, {1, "done", ¬done, 0, 0, 0, NULL, NULL}, {-1, NULL, 0, 0, 0, 0, NULL, NULL} }; @@ -890,6 +891,13 @@ showHockeyScore = 0; } #endif + /* Let's see if this is our double buffering changed */ + else if (op->op_option == &doubleBuffering) + { + W_ClearWindow (w); + W_ClearWindow (mapw); + redrawall = 1; + } else if (op->op_option == &partitionPlist) RedrawPlayerList (); else if (op->op_option == &sortPlayers) Index: check.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/check.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- check.c 21 Apr 2006 12:00:06 -0000 1.3 +++ check.c 21 May 2006 09:56:38 -0000 1.4 @@ -77,7 +77,6 @@ if (connect (sock, (struct sockaddr *) &addr, sizeof (addr)) < 0) { perror ("connect"); - close (sock); terminate (0); } @@ -89,6 +88,5 @@ { perror ("read"); } - close (sock); terminate (0); } Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- data.c 20 May 2006 17:09:39 -0000 1.22 +++ data.c 21 May 2006 09:56:38 -0000 1.23 @@ -32,6 +32,8 @@ struct mctl *mctl; struct memory universe; +int ingame = 0; /* If player is in game - to distinguish between whether + to use double buffering on the local and map window */ int ghoststart = 0; /* is this a ghostbust * restart? */ int ghost_pno = 0; /* is this a ghostbust @@ -733,10 +735,10 @@ struct stringlist *defaults = NULL; -#ifdef DOUBLE_BUFFERING SDBUFFER * localSDB = NULL; SDBUFFER * mapSDB = NULL; -#endif + +int doubleBuffering = 1; /* Use double buffering to draw map/local */ int disableWinkey = 1; /* disable WinKey + ContextKey by default */ Index: main.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/main.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- main.c 7 May 2006 16:59:27 -0000 1.5 +++ main.c 21 May 2006 09:56:38 -0000 1.6 @@ -121,9 +121,9 @@ { case 'C': /* character name */ - if (i < argc) + if (i < argc && argv[i + 1]) { - (void) STRNCPY (pseudo, argv[i], sizeof (pseudo)); + (void) STRNCPY (pseudo, argv[i + 1], sizeof (argv[i + 1])); i++; } else @@ -131,9 +131,9 @@ break; case 'A': /* authorization password */ - if (i < argc) + if (i < argc && argv[i + 1]) { - (void) STRNCPY (defpasswd, argv[i], sizeof (defpasswd)); + (void) STRNCPY (defpasswd, argv[i + 1], sizeof (argv[i + 1])); i++; } else @@ -151,7 +151,7 @@ break; case 's': /* listen socket number */ - if (i < argc) + if (i < argc && argv[i + 1]) { xtrekPort = atoi (argv[i + 1]); passive = 1; @@ -166,7 +166,7 @@ /* No break */ case 'f': /* record to cambot file */ - if (i < argc) + if (i < argc && argv[i + 1]) { recordFileName = argv[i + 1]; i++; @@ -176,7 +176,7 @@ break; #endif case 'l': /* log to file */ - if (i < argc) + if (i < argc && argv[i + 1]) { logFileName = argv[i + 1]; i++; @@ -186,7 +186,7 @@ break; case 'p': /* port to connect to */ - if (i < argc) + if (i < argc && argv[i + 1]) { xtrekPort = atoi (argv[i + 1]); i++; @@ -196,7 +196,7 @@ break; case 'd': - if (i < argc) + if (i < argc && argv[i + 1]) { display_host = argv[i + 1]; i++; @@ -253,7 +253,7 @@ #endif case 'h': /* server to connect to */ - if (i < argc) + if (i < argc && argv[i + 1]) { servertmp = argv[i + 1]; if (metablock(servertmp)) @@ -276,7 +276,7 @@ #ifdef GATEWAY case 'H': /* gateway to connect through */ hset++; - if (i < argc) + if (i < argc && argv[i + 1]) { netaddr = strToNetaddr (argv[i + 1]; i++; @@ -286,7 +286,7 @@ break; #endif case 'U': /* local UDP port */ - if (i < argc) + if (i < argc && argv[i + 1]) { if ((baseUdpLocalPort = atoi (argv[i + 1])) == 0) { @@ -305,7 +305,7 @@ break; #endif case 'G': /* try restarting previous session */ - if (i < argc) + if (i < argc && argv[i + 1]) { ghoststart++; ghost_pno = atoi (argv[i + 1]); @@ -317,7 +317,7 @@ break; case 't': /* window title */ - if (i < argc) + if (i < argc && argv[i + 1]) { title = argv[i + 1]; i++; @@ -327,7 +327,7 @@ break; case 'r': /* defaults file */ - if (i < argc) + if (i < argc && argv[i + 1]) { deffile = argv[i + 1]; i++; @@ -371,15 +371,16 @@ if (!usemeta && !servertmp) /* no meta type was selected, pick metaserver */ usemeta = 1; - - if (hideConsole) - FreeConsole (); if (usage || err) { printUsage (name); + if (hideConsole) + FreeConsole (); exit (err); } + if (hideConsole) + FreeConsole (); #ifdef GATEWAY if (!hset) use_trekhopd = 0; /* allow use via normal connections */ Index: cowmain.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/cowmain.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- cowmain.c 7 May 2006 16:59:27 -0000 1.12 +++ cowmain.c 21 May 2006 09:56:38 -0000 1.13 @@ -555,7 +555,7 @@ serverName = gateway; #endif - pseudo[0] = defpasswd[0] = '\0'; +// pseudo[0] = defpasswd[0] = '\0'; /* Why was this ever put in? */ #ifdef RECORDGAME if (recordFileName != NULL) @@ -1082,7 +1082,7 @@ Play_Sound(ENGINE_SOUND); } #endif - + ingame = 1; /* Get input until the player quits or dies */ input (); Index: map.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/map.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- map.c 20 May 2006 17:09:39 -0000 1.10 +++ map.c 21 May 2006 09:56:38 -0000 1.11 @@ -333,7 +333,7 @@ /*** planetResourcesC() /******************************************************************************/ extern inline void -planetResourcesC (SDBUFFER * sdb, register struct planet *p, int destwidth, int destheight, +planetResourcesC (register struct planet *p, int destwidth, int destheight, int dx, int dy, W_Window window) /* * Draw the resources for a colorized planet. @@ -347,35 +347,35 @@ { /* Select resources */ if (p->pl_armies > 4) - W_OverlayScaleBitmapDB(sdb, dx - 7 * destwidth / 8, - dy - (destheight / 2), - destwidth/3, - destheight, - BMP_ARMY_WIDTH, - BMP_ARMY_HEIGHT, - 0, - army_bitmap, planetColor(p), - window); + W_WriteScaleBitmap(dx - 7 * destwidth / 8, + dy - (destheight / 2), + destwidth/3, + destheight, + BMP_ARMY_WIDTH, + BMP_ARMY_HEIGHT, + 0, + army_bitmap, planetColor(p), + window); if (p->pl_flags & PLREPAIR) - W_OverlayScaleBitmapDB(sdb, dx - (destwidth / 2), - dy - (5 * destheight / 6), - destwidth, - destheight/3, - BMP_WRENCH_WIDTH, - BMP_WRENCH_HEIGHT, - 0, - wrench_bitmap, planetColor(p), - window); + W_WriteScaleBitmap(dx - (destwidth / 2), + dy - (5 * destheight / 6), + destwidth, + destheight/3, + BMP_WRENCH_WIDTH, + BMP_WRENCH_HEIGHT, + 0, + wrench_bitmap, planetColor(p), + window); if (p->pl_flags & PLFUEL) - W_OverlayScaleBitmapDB(sdb, dx + 3 * destwidth / 5, - dy - (destheight / 2), - destwidth/3, - destheight, - BMP_FUEL_WIDTH, - BMP_FUEL_HEIGHT, - 0, - fuel_bitmap, planetColor(p), - window); + W_WriteScaleBitmap(dx + 3 * destwidth / 5, + dy - (destheight / 2), + destwidth/3, + destheight, + BMP_FUEL_WIDTH, + BMP_FUEL_HEIGHT, + 0, + fuel_bitmap, planetColor(p), + window); } return; } @@ -429,21 +429,17 @@ ody = pl_update[l->pl_no].plu_y * WINSIDE / GWIDTH; /* XFIX */ -#ifndef DOUBLE_BUFFERING - W_ClearArea (mapw, odx - (BMP_MPLANET_WIDTH / 2), - ody - (BMP_MPLANET_HEIGHT / 2), - BMP_MPLANET_WIDTH, BMP_MPLANET_HEIGHT); + if (planetBitmapGalaxy == 3) // Needs adjusting + W_ClearArea (mapw, odx - 7 * BMP_MPLANET_WIDTH / 8, + ody - (5 * BMP_MPLANET_HEIGHT / 6), + 7 * BMP_MPLANET_WIDTH / 4, 4 * BMP_MPLANET_HEIGHT / 3); + else + W_ClearArea (mapw, odx - (BMP_MPLANET_WIDTH / 2), + ody - (BMP_MPLANET_HEIGHT / 2), + BMP_MPLANET_WIDTH, BMP_MPLANET_HEIGHT); W_WriteText (mapw, odx - (BMP_MPLANET_WIDTH / 2), ody + (BMP_MPLANET_HEIGHT / 2), backColor, l->pl_name, 3, planetFont (l)); -#else - W_ClearAreaDB (mapSDB, odx - (BMP_MPLANET_WIDTH / 2), - ody - (BMP_MPLANET_HEIGHT / 2), - BMP_MPLANET_WIDTH, BMP_MPLANET_HEIGHT); - W_WriteTextDB (mapSDB, odx - (BMP_MPLANET_WIDTH / 2), - ody + (BMP_MPLANET_HEIGHT / 2), - backColor, l->pl_name, 3, planetFont (l)); -#endif pl_update[l->pl_no].plu_update = 0; } else @@ -451,15 +447,15 @@ /* Clear the planet normally */ /* XFIX */ -#ifndef DOUBLE_BUFFERING - W_ClearArea (mapw, dx - (BMP_MPLANET_WIDTH / 2 + 8), - dy - (BMP_MPLANET_HEIGHT / 2 + 4), - BMP_MPLANET_WIDTH + 8, BMP_MPLANET_HEIGHT + 8); -#else - W_ClearAreaDB (mapSDB, dx - 7 * BMP_MPLANET_WIDTH / 8, - dy - (5 * BMP_MPLANET_HEIGHT / 6), - 7 * BMP_MPLANET_WIDTH / 4, 4 * BMP_MPLANET_HEIGHT / 3); -#endif + if (planetBitmapGalaxy == 3) // Needs adjusting + W_ClearArea (mapw, dx - 7 * BMP_MPLANET_WIDTH / 8, + dy - (5 * BMP_MPLANET_HEIGHT / 6), + 7 * BMP_MPLANET_WIDTH / 4, 4 * BMP_MPLANET_HEIGHT / 3); + + else + W_ClearArea (mapw, dx - (BMP_MPLANET_WIDTH / 2 + 4), + dy - (BMP_MPLANET_HEIGHT / 2 + 4), + BMP_MPLANET_WIDTH + 8, BMP_MPLANET_HEIGHT + 8); l->pl_flags &= ~PLCLEAR; } @@ -473,11 +469,10 @@ if (planetBitmapGalaxy == 3) { -#ifndef DOUBLE_BUFFERING - W_OverlayBitmap(dx - (emph_planet_seq_width / 2 + 1), + W_WriteBitmap(dx - (emph_planet_seq_width / 2 + 1), dy - (emph_planet_seq_height / 2), emph_planet_seq[seq_n], - W_White); + W_White, mapw); W_WriteScaleBitmap(dx - (BMP_MPLANET_WIDTH / 2), dy - (BMP_MPLANET_HEIGHT / 2), @@ -490,45 +485,17 @@ mapw); /* Draw planet resources */ - planetResourcesC(mapSDB, l, BMP_MPLANET_WIDTH, BMP_MPLANET_HEIGHT, dx, dy, mapw); -#else - W_OverlayBitmapDB(mapSDB, dx - (emph_planet_seq_width / 2 + 1), - dy - (emph_planet_seq_height / 2), - emph_planet_seq[seq_n], - W_White); - - W_WriteScaleBitmapDB(mapSDB, dx - (BMP_MPLANET_WIDTH / 2), - dy - (BMP_MPLANET_HEIGHT / 2), - BMP_MPLANET_WIDTH, - BMP_MPLANET_HEIGHT, - BMP_CPLANET_WIDTH, - BMP_CPLANET_HEIGHT, - 0, - planetBitmapC(l), planetColor(l), - mapw); - /* Draw planet resources */ - planetResourcesC(mapSDB, l, BMP_MPLANET_WIDTH, BMP_MPLANET_HEIGHT, dx, dy, mapw); -#endif + planetResourcesC(l, BMP_MPLANET_WIDTH, BMP_MPLANET_HEIGHT, dx, dy, mapw); } else { -#ifndef DOUBLE_BUFFERING - W_OverlayBitmap(dx - (emph_planet_seq_width / 2 + 1), + W_WriteBitmap(dx - (emph_planet_seq_width / 2 + 1), dy - (emph_planet_seq_height / 2), emph_planet_seq[seq_n], - W_White); + W_White, mapw); W_WriteBitmap(dx - (BMP_MPLANET_WIDTH / 2), dy - (BMP_MPLANET_HEIGHT / 2), - planetmBitmap(l), planetColor(l)); -#else - W_OverlayBitmapDB(mapSDB, dx - (emph_planet_seq_width / 2 + 1), - dy - (emph_planet_seq_height / 2), - emph_planet_seq[seq_n], - W_White); - - W_WriteBitmapDB(mapSDB, dx - (BMP_MPLANET_WIDTH / 2), dy - (BMP_MPLANET_HEIGHT / 2), - planetmBitmap(l), planetColor(l)); -#endif + planetmBitmap(l), planetColor(l), mapw); } emph_planet_seq_n[l->pl_no] -= 1; l->pl_flags |= PLREDRAW; /* Leave redraw on until * * @@ -541,7 +508,6 @@ #endif // Beeplite end if (planetBitmapGalaxy == 3) { -#ifndef DOUBLE_BUFFERING W_WriteScaleBitmap (dx - (BMP_MPLANET_WIDTH / 2), dy - (BMP_MPLANET_HEIGHT / 2), BMP_MPLANET_WIDTH, @@ -553,33 +519,13 @@ planetColor (l), mapw); /* Draw planet resources */ - planetResourcesC(mapSDB, l, BMP_MPLANET_WIDTH, BMP_MPLANET_HEIGHT, dx, dy, mapw); -#else - W_WriteScaleBitmapDB (mapSDB, dx - (BMP_MPLANET_WIDTH / 2), - dy - (BMP_MPLANET_HEIGHT / 2), - BMP_MPLANET_WIDTH, - BMP_MPLANET_HEIGHT, - BMP_CPLANET_WIDTH, - BMP_CPLANET_HEIGHT, - 0, - planetBitmapC (l), - planetColor (l), - mapw); - /* Draw planet resources */ - planetResourcesC(mapSDB, l, BMP_MPLANET_WIDTH, BMP_MPLANET_HEIGHT, dx, dy, mapw); -#endif + planetResourcesC(l, BMP_MPLANET_WIDTH, BMP_MPLANET_HEIGHT, dx, dy, mapw); } else { -#ifndef DOUBLE_BUFFERING - W_OverlayBitmap (dx - (BMP_MPLANET_WIDTH / 2), + W_WriteBitmap (dx - (BMP_MPLANET_WIDTH / 2), dy - (BMP_MPLANET_HEIGHT / 2), planetmBitmap (l), - planetColor (l)); -#else - W_OverlayBitmapDB (mapSDB, dx - (BMP_MPLANET_WIDTH / 2), - dy - (BMP_MPLANET_HEIGHT / 2), planetmBitmap (l), - planetColor (l)); -#endif + planetColor (l), mapw); } #ifdef BEEPLITE } @@ -592,40 +538,22 @@ agri_name[0] = (char) (toupper (l->pl_name[0])); agri_name[1] = (char) (toupper (l->pl_name[1])); agri_name[2] = (char) (toupper (l->pl_name[2])); -#ifndef DOUBLE_BUFFERING W_WriteText (mapw, dx - (BMP_MPLANET_WIDTH / 2), dy + (BMP_MPLANET_HEIGHT / 2), getAgriColor (l), agri_name, 3, planetFont (l)); -#else - W_WriteTextDB (mapSDB, dx - (BMP_MPLANET_WIDTH / 2), - dy + (BMP_MPLANET_HEIGHT / 2), getAgriColor (l), - agri_name, 3, planetFont (l)); -#endif } else { -#ifndef DOUBLE_BUFFERING W_WriteText (mapw, dx - (BMP_MPLANET_WIDTH / 2), dy + (BMP_MPLANET_HEIGHT / 2), getAgriColor (l), l->pl_name, 3, planetFont (l)); -#else - W_WriteTextDB (mapSDB, dx - (BMP_MPLANET_WIDTH / 2), - dy + (BMP_MPLANET_HEIGHT / 2), getAgriColor (l), - l->pl_name, 3, planetFont (l)); -#endif } } else { -#ifndef DOUBLE_BUFFERING W_WriteText (mapw, dx - (BMP_MPLANET_WIDTH / 2), dy + (BMP_MPLANET_HEIGHT / 2), planetColor (l), l->pl_name, 3, planetFont (l)); -#else - W_WriteTextDB (mapSDB, dx - (BMP_MPLANET_WIDTH / 2), - dy + (BMP_MPLANET_HEIGHT / 2), planetColor (l), - l->pl_name, 3, planetFont (l)); -#endif } if (showIND && ((l->pl_info & me->p_team) @@ -634,7 +562,6 @@ #endif ) && (l->pl_owner == NOBODY)) { -#ifndef DOUBLE_BUFFERING W_MakeLine (mapw, dx + (BMP_MPLANET_WIDTH / 2 - 1), dy + (BMP_MPLANET_HEIGHT / 2 - 1), dx - (BMP_MPLANET_WIDTH / 2), @@ -643,16 +570,6 @@ dy + (BMP_MPLANET_HEIGHT / 2 - 1), dx + (BMP_MPLANET_WIDTH / 2 - 1), dy - (BMP_MPLANET_HEIGHT / 2), W_White); -#else - W_MakeLineDB (mapSDB, dx + (BMP_MPLANET_WIDTH / 2 - 1), - dy + (BMP_MPLANET_HEIGHT / 2 - 1), - dx - (BMP_MPLANET_WIDTH / 2), - dy - (BMP_MPLANET_HEIGHT / 2), W_White); - W_MakeLineDB (mapSDB, dx - (BMP_MPLANET_WIDTH / 2), - dy + (BMP_MPLANET_HEIGHT / 2 - 1), - dx + (BMP_MPLANET_WIDTH / 2 - 1), - dy - (BMP_MPLANET_HEIGHT / 2), W_White); -#endif } if (showPlanetOwner) @@ -662,13 +579,8 @@ || playback #endif )? tolower (teamlet[l->pl_owner]) : '?'); -#ifndef DOUBLE_BUFFERING W_WriteText (mapw, dx + (BMP_MPLANET_WIDTH / 2) + 2, dy - 6, planetColor (l), &ch, 1, planetFont (l)); -#else - W_WriteTextDB (mapSDB, dx + (BMP_MPLANET_WIDTH / 2) + 2, - dy - 6, planetColor (l), &ch, 1, planetFont (l)); -#endif } } } @@ -684,12 +596,7 @@ for (sl = map_hockey_lines + NUM_HOCKEY_LINES - 1; sl >= map_hockey_lines; --sl) { -#ifndef DOUBLE_BUFFERING W_CacheLine (mapw, sl->begin_x, sl->begin_y, sl->end_x, sl->end_y, sl->color); -#else - W_CacheLineDB (mapSDB, sl->begin_x, sl->begin_y, sl->end_x, sl->end_y, sl->color); -#endif - } } @@ -745,23 +652,12 @@ ori_offset = 3; kli_offset = 8; } - -#ifndef DOUBLE_BUFFERING W_WriteText (mapw, ori_offset * W_Textwidth, 1 * W_Textheight, W_Ori, ori_score_line, strlen (ori_score_line), W_RegularFont); W_WriteText (mapw, 6 * W_Textwidth, 1 * W_Textheight, W_White, ":", 1, W_RegularFont); W_WriteText (mapw, kli_offset * W_Textwidth, 1 * W_Textheight, W_Kli, kli_score_line, strlen (kli_score_line), W_RegularFont); -#else - W_WriteTextDB (mapSDB, ori_offset * W_Textwidth, 1 * W_Textheight, W_Ori, - ori_score_line, strlen (ori_score_line), W_RegularFont); - W_WriteTextDB (mapSDB, 6 * W_Textwidth, 1 * W_Textheight, W_White, - ":", 1, W_RegularFont); - W_WriteTextDB (mapSDB, kli_offset * W_Textwidth, 1 * W_Textheight, W_Kli, - kli_score_line, strlen (kli_score_line), W_RegularFont); -#endif - } #endif /* HOCKEY_LINES */ @@ -793,9 +689,8 @@ int view = WINSIDE * SCALE / 2; int mvx, mvy; -#ifdef DOUBLE_BUFFERING - W_Win2Mem (mapSDB); -#endif + if (doubleBuffering) + W_Win2Mem (mapSDB); dx = (me->p_x) / (GWIDTH / WINSIDE); dy = (me->p_y) / (GWIDTH / WINSIDE); @@ -813,12 +708,8 @@ /* Don't do anything if initPlanets() has not been called */ return; } - -#ifndef DOUBLE_BUFFERING W_ClearWindow (mapw); -#else - W_ClearWindowDB (mapSDB); -#endif + clearlock = 0; clearviewbox = 0; viewboxcleared = 0; @@ -840,13 +731,8 @@ if (clearlock) { clearlock = 0; -#ifndef DOUBLE_BUFFERING W_WriteTriangle (mapw, clearlmark[0], clearlmark[1], clearlmark[2], clearlmark[3], backColor); -#else - W_WriteTriangleDB (mapSDB, clearlmark[0], clearlmark[1], - clearlmark[2], clearlmark[3], backColor); -#endif } if (clearviewbox) @@ -854,30 +740,13 @@ clearviewbox = 0; /* clear old dots - placed here for less flicker */ if (viewx + viewdist < WINSIDE && viewy + viewdist < WINSIDE) -#ifndef DOUBLE_BUFFERING W_MakePoint (mapw, viewx + viewdist, viewy + viewdist, backColor); -#else - W_MakePointDB (mapSDB, viewx + viewdist, viewy + viewdist, backColor); -#endif if (viewx + viewdist < WINSIDE && viewy - viewdist > 0) -#ifndef DOUBLE_BUFFERING W_MakePoint (mapw, viewx + viewdist, viewy - viewdist, backColor); -#else - W_MakePointDB (mapSDB, viewx + viewdist, viewy - viewdist, backColor); -#endif if (viewx - viewdist > 0 && viewy + viewdist < WINSIDE) -#ifndef DOUBLE_BUFFERING W_MakePoint (mapw, viewx - viewdist, viewy + viewdist, backColor); -#else - W_MakePointDB (mapSDB, viewx - viewdist, viewy + viewdist, backColor); -#endif if (viewx - viewdist > 0 && viewy - viewdist > 0) -#ifndef DOUBLE_BUFFERING W_MakePoint (mapw, viewx - viewdist, viewy - viewdist, backColor); -#else - W_MakePointDB (mapSDB, viewx - viewdist, viewy - viewdist, backColor); -#endif - /* redraw any planets they overwrote */ mvx = viewx * (GWIDTH / WINSIDE); /* correct from view scale */ mvy = viewy * (GWIDTH / WINSIDE); @@ -900,14 +769,8 @@ if (mclearzone[2][i]) { /* XFIX */ -#ifndef DOUBLE_BUFFERING W_ClearArea (mapw, mclearzone[0][i], mclearzone[1][i], mclearzone[2][i], mclearzone[3][i]); -#else - W_ClearAreaDB (mapSDB, mclearzone[0][i], mclearzone[1][i], - mclearzone[2][i], mclearzone[3][i]); -#endif - /* Redraw the hole just left next update */ checkRedraw (mclearzone[4][i], mclearzone[5][i]); mclearzone[2][i] = 0; @@ -946,29 +809,13 @@ { /* draw the new points */ if (dx + viewdist < WINSIDE && dy + viewdist < WINSIDE) -#ifndef DOUBLE_BUFFERING W_MakePoint (mapw, dx + viewdist, dy + viewdist, W_White); -#else - W_MakePointDB (mapSDB, dx + viewdist, dy + viewdist, W_White); -#endif if (dx + viewdist < WINSIDE && dy - viewdist > 0) -#ifndef DOUBLE_BUFFERING W_MakePoint (mapw, dx + viewdist, dy - viewdist, W_White); -#else - W_MakePointDB (mapSDB, dx + viewdist, dy - viewdist, W_White); -#endif if (dx - viewdist > 0 && dy + viewdist < WINSIDE) -#ifndef DOUBLE_BUFFERING W_MakePoint (mapw, dx - viewdist, dy + viewdist, W_White); -#else - W_MakePointDB (mapSDB, dx - viewdist, dy + viewdist, W_White); -#endif if (dx - viewdist > 0 && dy - viewdist > 0) -#ifndef DOUBLE_BUFFERING W_MakePoint (mapw, dx - viewdist, dy - viewdist, W_White); -#else - W_MakePointDB (mapSDB, dx - viewdist, dy - viewdist, W_White); -#endif viewx = dx; /* store the points for later */ viewy = dy; /* clearing */ @@ -1014,48 +861,24 @@ if (j->p_flags & PFCLOAK) { if (omitTeamLetter) -#ifndef DOUBLE_BUFFERING W_WriteText (mapw, dx - (W_Textwidth / 2), dy - W_Textheight / 2, unColor, cloakChars, 1, W_RegularFont); -#else - W_WriteTextDB (mapSDB, dx - (W_Textwidth / 2), - dy - W_Textheight / 2, unColor, cloakChars, - (cloakChars[1] == '\0' ? 1 : 2), W_RegularFont); -#endif else -#ifndef DOUBLE_BUFFERING W_WriteText (mapw, dx - W_Textwidth, dy - W_Textheight / 2, unColor, cloakChars, (cloakChars[1] == '\0' ? 1 : 2), W_RegularFont); -#else - W_WriteTextDB (mapSDB, dx - W_Textwidth, - dy - W_Textheight / 2, unColor, cloakChars, - (cloakChars[1] == '\0' ? 1 : 2), W_RegularFont); -#endif } else { if (omitTeamLetter) -#ifndef DOUBLE_BUFFERING W_WriteText (mapw, dx - (W_Textwidth / 2), dy - W_Textheight / 2, playerColor (j), (j->p_mapchars)+1, 1, shipFont (j)); -#else - W_WriteTextDB (mapSDB, dx - (W_Textwidth / 2), - dy - W_Textheight / 2, playerColor (j), - (j->p_mapchars)+1, 1, shipFont (j)); -#endif else -#ifndef DOUBLE_BUFFERING W_WriteText (mapw, dx - W_Textwidth, dy - W_Textheight / 2, playerColor (j), j->p_mapchars, 2, shipFont (j)); -#else - W_WriteTextDB (mapSDB, dx - W_Textwidth, - dy - W_Textheight / 2, playerColor (j), - j->p_mapchars, 2, shipFont (j)); -#endif } #ifdef BEEPLITE @@ -1064,17 +887,10 @@ { int seq_n = emph_player_seq_n[i] % emph_player_seq_frames; -#ifndef DOUBLE_BUFFERING W_WriteBitmap(dx - (emph_player_seq_width / 2 - 1), dy - (emph_player_seq_height / 2 + 1), emph_player_seq[seq_n], - W_White); -#else - W_WriteBitmapDB(mapSDB, dx - (emph_player_seq_width / 2 - 1), - dy - (emph_player_seq_height / 2 + 1), - emph_player_seq[seq_n], - W_White); -#endif + W_White, mapw); emph_player_seq_n[i] -= 1; mclearzone[0][i] = dx - (emph_player_seq_width / 2 - 1); mclearzone[1][i] = dy - (emph_player_seq_height / 2 + 1); @@ -1114,11 +930,7 @@ { dx = j->p_x * WINSIDE / GWIDTH; dy = j->p_y * WINSIDE / GWIDTH; -#ifndef DOUBLE_BUFFERING W_WriteTriangle (mapw, dx, dy + 6, 4, 1, foreColor); -#else - W_WriteTriangleDB (mapSDB, dx, dy + 6, 4, 1, foreColor); -#endif clearlmark[0] = dx; clearlmark[1] = dy + 6; @@ -1133,11 +945,7 @@ dx = l->pl_x * WINSIDE / GWIDTH; dy = l->pl_y * WINSIDE / GWIDTH; -#ifndef DOUBLE_BUFFERING W_WriteTriangle (mapw, dx, dy - (BMP_MPLANET_HEIGHT) / 2 - 4, 4, 0, foreColor); -#else - W_WriteTriangleDB (mapSDB, dx, dy - (BMP_MPLANET_HEIGHT) / 2 - 4, 4, 0, foreColor); -#endif clearlmark[0] = dx; clearlmark[1] = dy - (BMP_MPLANET_HEIGHT) / 2 - 4; @@ -1146,7 +954,6 @@ clearlock = 1; } -#ifdef DOUBLE_BUFFERING - W_Mem2Win (mapSDB); -#endif + if (doubleBuffering) + W_Mem2Win (mapSDB); } \ No newline at end of file Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- defaults.c 16 May 2006 05:10:13 -0000 1.17 +++ defaults.c 21 May 2006 09:56:38 -0000 1.18 @@ -130,6 +130,12 @@ NULL } }, + {"doubleBuffering", &doubleBuffering, RC_BOOL, + { + "Use double buffering to reduce screen flicker", + NULL + } + }, {"dynamicBitmaps", &dynamicBitmaps, RC_BOOL, { "Allow switching of ship bitmaps in game. With this option disabled", @@ -1390,6 +1396,7 @@ if (timerType < T_NONE || timerType >= T_TOTAL) timerType = T_SHIP; + doubleBuffering = booleanDefault ("doubleBuffering", doubleBuffering); allowWheelActions = booleanDefault ("allowWheelActions", allowWheelActions); newQuit = booleanDefault ("newQuit", newQuit); newSound = booleanDefault ("newSound", newSound); From modemhero at users.sourceforge.net Sun May 21 04:56:40 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 21 May 2006 09:56:40 +0000 Subject: [netrek-cvs] client/netrekxp/resources/htmlhelp/html generalconfig.html, 1.9, 1.10 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv20941/resources/htmlhelp/html Modified Files: generalconfig.html Log Message: Rewrote doublebuffering to make it an rc option and not a #define - removes a lot of extra work in terms of needing twice as many write bitmap functions (client had one for regular draw, and one for DB) Added observer support to show repair/declare war flags on dashboard. Observers can also now change lock if they are observing a transwarper (server side fix, but good to know). Changed alert borders so they always redraw instead of on an alert change - was causing lots of problems with bitmaps at edge of screen, as well as with double buffering Readded the ability to see tractor/pressors if they go off screen (such as in the case of ATT tractors). Added "doubleBuffering: (on)/off" to control whether to draw with double buffering (it's recommended you do so if using the new planet and ship bitmaps). Can be changed in game through the options menu. Fixed the -c (report players on server) option so it doesn't crash the client Readded the ability to autologin by using -C name -A password. No more extra typing :). Fixed a whole bunch of startup options (-C, -A, -h, -g, etc) that were crashing client if not entered properly. Also made it so it prints out option list on a misused option. Bunch of other write bitmap function optimizations Index: generalconfig.html =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html/generalconfig.html,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- generalconfig.html 16 May 2006 05:10:13 -0000 1.9 +++ generalconfig.html 21 May 2006 09:56:38 -0000 1.10 @@ -209,6 +209,16 @@ path +doubleBuffering +Reduce screen flicker by using buffered drawing + +
        +
      • on (default)
      • +
      • off
      • +
      + + + dynamicBitmaps Allow switching of ship bitmaps in game From modemhero at users.sourceforge.net Sun May 21 04:56:40 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 21 May 2006 09:56:40 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.26, 1.27 clientr.suo, 1.6, 1.7 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv20941 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Rewrote doublebuffering to make it an rc option and not a #define - removes a lot of extra work in terms of needing twice as many write bitmap functions (client had one for regular draw, and one for DB) Added observer support to show repair/declare war flags on dashboard. Observers can also now change lock if they are observing a transwarper (server side fix, but good to know). Changed alert borders so they always redraw instead of on an alert change - was causing lots of problems with bitmaps at edge of screen, as well as with double buffering Readded the ability to see tractor/pressors if they go off screen (such as in the case of ATT tractors). Added "doubleBuffering: (on)/off" to control whether to draw with double buffering (it's recommended you do so if using the new planet and ship bitmaps). Can be changed in game through the options menu. Fixed the -c (report players on server) option so it doesn't crash the client Readded the ability to autologin by using -C name -A password. No more extra typing :). Fixed a whole bunch of startup options (-C, -A, -h, -g, etc) that were crashing client if not entered properly. Also made it so it prints out option list on a misused option. Bunch of other write bitmap function optimizations Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- NetrekXP to do list.C 20 May 2006 17:09:39 -0000 1.26 +++ NetrekXP to do list.C 21 May 2006 09:56:38 -0000 1.27 @@ -1,5 +1,4 @@ List for the netrekrc/installer: - 1) Change recommendation on metaserver from off to on! 2) there should be some sort of chance to give default resolution in GUI, which then maps windows accordingly. @@ -7,7 +6,6 @@ 4) Add chance for player to input their default login name - tired of seeing new-be-nice!! - Things not gonna happen, or server problems: 1) Player list messaging doesn't work if you can't see player (cloaked, too far away, etc). Don't think this is fixable. @@ -46,16 +44,10 @@ 8) BUG : Lock on someone as obs, then delock (or whey they die), screen doesn't go blank it stays in same drawn state. Only when short packets off and doublebuffering on. 9) Use nebula pic -10) fix clock - rewrite overlaybitmap calls to use SRCAND -10a) rewrite all scalebitmap functions to use angle not p_dir -10b) rewrite all doublebuffering so it's rc option - eliminate all these double -functions!!$!%^ -11) clean up code with resource drawing for overlay and refresh purposes -11a) get new bitmaps for resources -13) changing teams doesn't set delay to 0 for declare war , as it should (server fix pending) -14) Bug with waraction..was being called even when clicking on border (broke function) +10) get new bitmaps for resources - implement them with reasonable borders +11) Bug with waraction..was being called even when clicking on border (broke function) ..I added a default return to switch statement, but the underlying bug still remains. -15a) look into swar/war in repair time, with obs and plr - doesn't seem to be any way +12) look into swar/war in repair time, with obs and plr - doesn't seem to be any way for an obs to know what the war decs are of the person he is observing Stas's list: Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 Binary files /tmp/cvsWQyI1a and /tmp/cvsXyNiRq differ From modemhero at users.sourceforge.net Sun May 21 04:56:40 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 21 May 2006 09:56:40 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h, 1.18, 1.19 proto.h, 1.19, 1.20 struct.h, 1.8, 1.9 wlib.h, 1.6, 1.7 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv20941/include Modified Files: data.h proto.h struct.h wlib.h Log Message: Rewrote doublebuffering to make it an rc option and not a #define - removes a lot of extra work in terms of needing twice as many write bitmap functions (client had one for regular draw, and one for DB) Added observer support to show repair/declare war flags on dashboard. Observers can also now change lock if they are observing a transwarper (server side fix, but good to know). Changed alert borders so they always redraw instead of on an alert change - was causing lots of problems with bitmaps at edge of screen, as well as with double buffering Readded the ability to see tractor/pressors if they go off screen (such as in the case of ATT tractors). Added "doubleBuffering: (on)/off" to control whether to draw with double buffering (it's recommended you do so if using the new planet and ship bitmaps). Can be changed in game through the options menu. Fixed the -c (report players on server) option so it doesn't crash the client Readded the ability to autologin by using -C name -A password. No more extra typing :). Fixed a whole bunch of startup options (-C, -A, -h, -g, etc) that were crashing client if not entered properly. Also made it so it prints out option list on a misused option. Bunch of other write bitmap function optimizations Index: wlib.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/wlib.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- wlib.h 16 May 2006 05:10:13 -0000 1.6 +++ wlib.h 21 May 2006 09:56:38 -0000 1.7 @@ -126,14 +126,15 @@ extern void W_WriteBitmap (int x, int y, W_Icon bit, - W_Color color); + W_Color color, + W_Window window); extern void W_WriteScaleBitmap (int x, int y, int destwidth, int destheight, int srcwidth, int srcheight, - unsigned char p_dir, + int angle, W_Icon icon, W_Color color, W_Window window); @@ -205,7 +206,8 @@ extern void W_OverlayBitmap (int, int, W_Icon, - W_Color); + W_Color, + W_Window); extern void W_OverlayScaleBitmap (int, int, int, Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- data.h 20 May 2006 17:09:39 -0000 1.18 +++ data.h 21 May 2006 09:56:38 -0000 1.19 @@ -151,6 +151,8 @@ #endif +extern int ingame; /* If player is in game - to distinguish between whether + to use double buffering on the local and map window */ extern int ghoststart; extern int ghost_pno; extern int keepInfo; @@ -631,10 +633,10 @@ extern struct stringlist * defaults; /* pointer to defaults list */ -#ifdef DOUBLE_BUFFERING extern SDBUFFER * localSDB; /* double buffer for local window */ extern SDBUFFER * mapSDB; /* double buffer for map window */ -#endif + +extern int doubleBuffering; /* Use double buffering to draw map/local */ extern int disableWinkey; /* disable WinKey + ContextKey during the game */ Index: struct.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/struct.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- struct.h 18 May 2006 07:15:35 -0000 1.8 +++ struct.h 21 May 2006 09:56:38 -0000 1.9 @@ -667,7 +667,6 @@ struct stringlist *next; }; -#ifdef DOUBLE_BUFFERING typedef struct _sdbuffer { W_Window window; /* window for current buffer */ @@ -677,7 +676,6 @@ HBITMAP mem_bmp; /* memory to handle bitmap */ HBITMAP old_bmp; /* saved bitmap */ }SDBUFFER; -#endif // Linked list for console buffer struct cons_buffer Index: proto.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- proto.h 20 May 2006 17:09:39 -0000 1.19 +++ proto.h 21 May 2006 09:56:38 -0000 1.20 @@ -447,8 +447,8 @@ void initPlanets (void); //inline static void checkRedraw(int x, int y); extern inline W_Icon planetBitmapC(register struct planet * p); -extern inline void planetResourcesC (SDBUFFER * sdb, register struct planet *p, - int destwidth, int destheight, int dx, int dy, W_Window window); +extern inline void planetResourcesC (register struct planet *p, int destwidth, + int destheight, int dx, int dy, W_Window window); //static void DrawPlanets(); void map (void); @@ -629,21 +629,23 @@ void W_WriteBitmap (int x, int y, W_Icon icon, - W_Color color); + W_Color color, + W_Window window); void W_WriteScaleBitmap (int x, int y, int destwidth, int destheight, int srcwidth, int srcheight, - unsigned char p_dir, + int angle, W_Icon icon, W_Color color, W_Window window); void W_WriteBitmapGrey (int x, int y, W_Icon icon, - W_Color color); + W_Color color, + W_Window window); void W_TileWindow (W_Window window, W_Icon icon); void W_UnTileWindow (W_Window window); @@ -717,7 +719,8 @@ void W_OverlayBitmap (int x, int y, W_Icon icon, - W_Color color); + W_Color color, + W_Window window); void W_OverlayScaleBitmap (int x, int y, int destwidth, @@ -755,36 +758,11 @@ UINT msg, WPARAM wParam, LPARAM lParam); -#ifdef DOUBLE_BUFFERING + SDBUFFER * W_InitSDB (W_Window window); +SDBUFFER * SDB_lookup (W_Window window); void W_Win2Mem (SDBUFFER * sdb); void W_Mem2Win (SDBUFFER * sdb); -void W_ChangeBorderDB (SDBUFFER * sdb, W_Color color); -void W_FillAreaDB (SDBUFFER * sdb, int x, int y, int width, int height, int color); -void W_ClearAreaDB (SDBUFFER * sdb, int x, int y, int width, int height); -void W_CacheClearAreaDB (SDBUFFER * sdb, int x, int y, int width, int height); -void W_ClearAreasDB (SDBUFFER * sdb, int *xs, int *ys, int *widths, int *heights, int num); -void W_ClearWindowDB (SDBUFFER * sdb); -void W_MakeLineDB (SDBUFFER * sdb, int x0, int y0, int x1, int y1, W_Color color); -void W_CacheLineDB (SDBUFFER * sdb, int x0, int y0, int x1, int y1, W_Color color); -void W_MakePointDB (SDBUFFER * sdb, int x0, int y0, W_Color color); -void W_CachePointDB (SDBUFFER * sdb, int x0, int y0, W_Color color); -void W_MakeLinesDB (SDBUFFER * sdb, int *x0, int *y0, int *x1, int *y1, int num, W_Color color); -void W_MakeTractLineDB (SDBUFFER * sdb, int x0, int y0, int x1, int y1, W_Color color); -void W_MakePhaserLineDB (SDBUFFER * sdb, int x0, int y0, int x1, int y1, W_Color color); -void W_WriteTriangleDB (SDBUFFER * sdb, int x, int y, int s, int t, W_Color color); -void W_WriteTextDB (SDBUFFER * sdb, int x, int y, W_Color color, char *str, int len, W_Font font); -void W_MaskTextDB (SDBUFFER * sdb, int x, int y, W_Color color, char *str, int len, W_Font font); -void W_WriteBitmapDB (SDBUFFER * sdb, int x, int y, W_Icon icon, W_Color color); -void W_WriteScaleBitmapDB (SDBUFFER * sdb, int x, int y, int destwidth, int destheight, - int srcwidth, int srcheight, unsigned char p_dir, W_Icon icon, - W_Color color, W_Window window); -void W_WriteBitmapGreyDB (SDBUFFER * sdb, int x, int y, W_Icon icon, W_Color color); -void W_OverlayBitmapDB (SDBUFFER * sdb, int x, int y, W_Icon icon, W_Color color); -void W_OverlayScaleBitmapDB (SDBUFFER * sdb, int x, int y, int destwidth, int destheight, - int srcwidth, int srcheight, int angle, - W_Icon icon, W_Color color, W_Window window); -#endif /******************************************************************************/ /*** newwin.c From modemhero at users.sourceforge.net Sun May 21 04:56:40 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 21 May 2006 09:56:40 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.46, 1.47 netrekrc_options.txt, 1.7, 1.8 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv20941/resources/docs Modified Files: changes.txt netrekrc_options.txt Log Message: Rewrote doublebuffering to make it an rc option and not a #define - removes a lot of extra work in terms of needing twice as many write bitmap functions (client had one for regular draw, and one for DB) Added observer support to show repair/declare war flags on dashboard. Observers can also now change lock if they are observing a transwarper (server side fix, but good to know). Changed alert borders so they always redraw instead of on an alert change - was causing lots of problems with bitmaps at edge of screen, as well as with double buffering Readded the ability to see tractor/pressors if they go off screen (such as in the case of ATT tractors). Added "doubleBuffering: (on)/off" to control whether to draw with double buffering (it's recommended you do so if using the new planet and ship bitmaps). Can be changed in game through the options menu. Fixed the -c (report players on server) option so it doesn't crash the client Readded the ability to autologin by using -C name -A password. No more extra typing :). Fixed a whole bunch of startup options (-C, -A, -h, -g, etc) that were crashing client if not entered properly. Also made it so it prints out option list on a misused option. Bunch of other write bitmap function optimizations Index: netrekrc_options.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc_options.txt,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- netrekrc_options.txt 16 May 2006 05:10:13 -0000 1.7 +++ netrekrc_options.txt 21 May 2006 09:56:38 -0000 1.8 @@ -37,6 +37,7 @@ continuousMouseFix: (on/off) fix continuous mouse behavior disableWinkey (on/off) disable Windows and Context keys documentation: (path) path to documentation file +doubleBuffering: (on/off) use double buffering to reduce screen flicker dynamicBitmaps: (on/off) allow switching of ship bitmaps in game enemyPhasers: (1-10) enemy phaser line width extraAlertBorder: (on/off) change window border on enemy approach Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- changes.txt 18 May 2006 07:15:35 -0000 1.46 +++ changes.txt 21 May 2006 09:56:38 -0000 1.47 @@ -1,4 +1,17 @@ Version TBA: +- added observer support to show repair/declare war flags on dashboard. Observers can also + now change lock if they are observing a transwarper (server side fix, but good to know). +- changed alert borders so they always redraw instead of on an alert change - was causing lots + of problems with bitmaps at edge of screen, as well as with double buffering +- readded the ability to see tractor/pressors if they go off screen (such as in the case of + ATT tractors). +- added "doubleBuffering: (on)/off" to control whether to draw with double buffering (it's + recommended you do so if using the new planet and ship bitmaps). Can be changed in game + through the options menu. +- fixed the -c (report players on server) option so it doesn't crash the client +- readded the ability to autologin by using -C name -A password. No more extra typing :). +- fixed a whole bunch of startup options (-C, -A, -h, -g, etc) that were crashing client if + not entered properly. Also made it so it prints out option list on a misused option. - added timer/clock back to text dashboard - added torp count to LAB dashboard - added new status line to KRP, COW and LAB dashboard. In order of priority, it shows the following: From modemhero at users.sourceforge.net Sun May 21 04:56:41 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 21 May 2006 09:56:41 +0000 Subject: [netrek-cvs] client/netrekxp/win32 config.h,1.10,1.11 Message-ID: Update of /cvsroot/netrek/client/netrekxp/win32 In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv20941/win32 Modified Files: config.h Log Message: Rewrote doublebuffering to make it an rc option and not a #define - removes a lot of extra work in terms of needing twice as many write bitmap functions (client had one for regular draw, and one for DB) Added observer support to show repair/declare war flags on dashboard. Observers can also now change lock if they are observing a transwarper (server side fix, but good to know). Changed alert borders so they always redraw instead of on an alert change - was causing lots of problems with bitmaps at edge of screen, as well as with double buffering Readded the ability to see tractor/pressors if they go off screen (such as in the case of ATT tractors). Added "doubleBuffering: (on)/off" to control whether to draw with double buffering (it's recommended you do so if using the new planet and ship bitmaps). Can be changed in game through the options menu. Fixed the -c (report players on server) option so it doesn't crash the client Readded the ability to autologin by using -C name -A password. No more extra typing :). Fixed a whole bunch of startup options (-C, -A, -h, -g, etc) that were crashing client if not entered properly. Also made it so it prints out option list on a misused option. Bunch of other write bitmap function optimizations Index: config.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/win32/config.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- config.h 12 May 2006 20:51:31 -0000 1.10 +++ config.h 21 May 2006 09:56:39 -0000 1.11 @@ -126,9 +126,6 @@ /* RACE_COLORS - additional bitplane for race colors */ #define RACE_COLORS -/* DOUBLE_BUFFERING - paint using double buffering to remove flicker */ -#define DOUBLE_BUFFERING - #define PLIST1 #define PLIST #define CONTROL_KEY From modemhero at users.sourceforge.net Sun May 21 13:53:05 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 21 May 2006 18:53:05 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt,1.47,1.48 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11055/resources/docs Modified Files: changes.txt Log Message: Removed the constant border refresh - trying to cut down on cpu usage. Loaded planet bitmaps into both local and map icon bitmap structures, for more efficient drawing. Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- changes.txt 21 May 2006 09:56:38 -0000 1.47 +++ changes.txt 21 May 2006 18:53:03 -0000 1.48 @@ -1,8 +1,6 @@ Version TBA: - added observer support to show repair/declare war flags on dashboard. Observers can also now change lock if they are observing a transwarper (server side fix, but good to know). -- changed alert borders so they always redraw instead of on an alert change - was causing lots - of problems with bitmaps at edge of screen, as well as with double buffering - readded the ability to see tractor/pressors if they go off screen (such as in the case of ATT tractors). - added "doubleBuffering: (on)/off" to control whether to draw with double buffering (it's From modemhero at users.sourceforge.net Sun May 21 13:53:05 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 21 May 2006 18:53:05 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h, 1.19, 1.20 proto.h, 1.20, 1.21 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11055/include Modified Files: data.h proto.h Log Message: Removed the constant border refresh - trying to cut down on cpu usage. Loaded planet bitmaps into both local and map icon bitmap structures, for more efficient drawing. Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- data.h 21 May 2006 09:56:38 -0000 1.19 +++ data.h 21 May 2006 18:53:03 -0000 1.20 @@ -306,14 +306,17 @@ ori_bitmapsHR[NUM_TYPES], ind_bitmapsHR[NUM_TYPES]; // Planets -extern W_Icon planet_unknown; -extern W_Icon planet_bitmaps[8]; +extern W_Icon planet_unknown, mplanet_unknown; +extern W_Icon planet_bitmaps[8], mplanet_bitmaps[8]; extern W_Icon planet_earth[NUMTEAMS], planet_klingus[NUMTEAMS], planet_orion[NUMTEAMS], planet_romulus[NUMTEAMS], planet_agri1[NUMTEAMS], planet_agri2[NUMTEAMS], planet_rock1[NUMTEAMS], planet_rock2[NUMTEAMS]; -extern W_Icon army_bitmap; -extern W_Icon wrench_bitmap; -extern W_Icon fuel_bitmap; +extern W_Icon mplanet_earth[NUMTEAMS], mplanet_klingus[NUMTEAMS], mplanet_orion[NUMTEAMS], + mplanet_romulus[NUMTEAMS], mplanet_agri1[NUMTEAMS], mplanet_agri2[NUMTEAMS], + mplanet_rock1[NUMTEAMS], mplanet_rock2[NUMTEAMS]; +extern W_Icon army_bitmap, marmy_bitmap; +extern W_Icon wrench_bitmap, mwrench_bitmap; +extern W_Icon fuel_bitmap, mfuel_bitmap; extern W_Icon base_planets; extern W_Icon base_mplanets; extern W_Icon bplanets[PLANET_VIEWS]; Index: proto.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- proto.h 21 May 2006 09:56:38 -0000 1.20 +++ proto.h 21 May 2006 18:53:03 -0000 1.21 @@ -417,6 +417,9 @@ /*** local.c /******************************************************************************/ void initStars (void); +static inline W_Icon planetBitmapC(register struct planet * p); +static inline void planetResourcesC (register struct planet *p, int destwidth, + int destheight, int dx, int dy, W_Window window); //static void DrawPlanets(void); //static void DrawShips(void); //static void DrawTorps(void); @@ -446,9 +449,9 @@ /******************************************************************************/ void initPlanets (void); //inline static void checkRedraw(int x, int y); -extern inline W_Icon planetBitmapC(register struct planet * p); -extern inline void planetResourcesC (register struct planet *p, int destwidth, - int destheight, int dx, int dy, W_Window window); +static inline W_Icon mplanetBitmapC(register struct planet * p); +static inline void mplanetResourcesC (register struct planet *p, int destwidth, + int destheight, int dx, int dy, W_Window window); //static void DrawPlanets(); void map (void); From modemhero at users.sourceforge.net Sun May 21 13:53:05 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 21 May 2006 18:53:05 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C,1.27,1.28 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11055 Modified Files: NetrekXP to do list.C Log Message: Removed the constant border refresh - trying to cut down on cpu usage. Loaded planet bitmaps into both local and map icon bitmap structures, for more efficient drawing. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- NetrekXP to do list.C 21 May 2006 09:56:38 -0000 1.27 +++ NetrekXP to do list.C 21 May 2006 18:53:02 -0000 1.28 @@ -49,6 +49,7 @@ ..I added a default return to switch statement, but the underlying bug still remains. 12) look into swar/war in repair time, with obs and plr - doesn't seem to be any way for an obs to know what the war decs are of the person he is observing +13) Too long death message may overwrite rank message Stas's list: - color coded playerlist. From modemhero at users.sourceforge.net Sun May 21 13:53:05 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 21 May 2006 18:53:05 +0000 Subject: [netrek-cvs] client/netrekxp/src data.c, 1.23, 1.24 death.c, 1.7, 1.8 local.c, 1.24, 1.25 map.c, 1.11, 1.12 mswindow.c, 1.24, 1.25 newwin.c, 1.25, 1.26 option.c, 1.15, 1.16 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11055/src Modified Files: data.c death.c local.c map.c mswindow.c newwin.c option.c Log Message: Removed the constant border refresh - trying to cut down on cpu usage. Loaded planet bitmaps into both local and map icon bitmap structures, for more efficient drawing. Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- mswindow.c 21 May 2006 09:56:38 -0000 1.24 +++ mswindow.c 21 May 2006 18:53:03 -0000 1.25 @@ -196,6 +196,7 @@ win = (Window *)window;\ if (bitmap->hwnd != win->hwnd)\ {\ + LineToConsole("DBICON - mismatch windows\n");\ hdc = GetDC (win->hwnd);\ usebitmaphwnd = 0;\ }\ @@ -547,6 +548,14 @@ free (planet_agri2[i]); free (planet_rock1[i]); free (planet_rock2[i]); + free (mplanet_earth[i]); + free (mplanet_klingus[i]); + free (mplanet_orion[i]); + free (mplanet_romulus[i]); + free (mplanet_agri1[i]); + free (mplanet_agri2[i]); + free (mplanet_rock1[i]); + free (mplanet_rock2[i]); } free (planet_bitmaps[0]); free (planet_bitmaps[1]); @@ -557,10 +566,22 @@ free (planet_bitmaps[6]); free (planet_bitmaps[7]); free (planet_unknown); - + free (mplanet_bitmaps[0]); + free (mplanet_bitmaps[1]); + free (mplanet_bitmaps[2]); + free (mplanet_bitmaps[3]); + free (mplanet_bitmaps[4]); + free (mplanet_bitmaps[5]); + free (mplanet_bitmaps[6]); + free (mplanet_bitmaps[7]); + free (mplanet_unknown); + free (army_bitmap); + free (marmy_bitmap); free (wrench_bitmap); + free (mwrench_bitmap); free (fuel_bitmap); + free (mfuel_bitmap); for (i = 0; i < PLANET_VIEWS; i++) free (bplanets[i]); Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- newwin.c 21 May 2006 09:56:39 -0000 1.25 +++ newwin.c 21 May 2006 18:53:03 -0000 1.26 @@ -659,6 +659,98 @@ } /******************************************************************************/ +/*** loadmplanetsC() - colorized map planets, using same bitmaps but more efficient + drawing if we assign another set to map HWND +/******************************************************************************/ +void loadmplanetsC() +{ + int j; + + /* Load the eight 5x1 mplanet bitmaps */ + mplanet_bitmaps[0] = + W_StoreBitmap3 ("bitmaps/planlibm/color/earth.bmp", + BMP_CPLANET_WIDTH * NUMTEAMS, BMP_CPLANET_HEIGHT, BMP_EARTH, mapw, + LR_DEFAULTCOLOR); + mplanet_bitmaps[1] = + W_StoreBitmap3 ("bitmaps/planlibm/color/klingus.bmp", + BMP_CPLANET_WIDTH * NUMTEAMS, BMP_CPLANET_HEIGHT, BMP_KLINGUS, mapw, + LR_DEFAULTCOLOR); + mplanet_bitmaps[2] = + W_StoreBitmap3 ("bitmaps/planlibm/color/orion.bmp", + BMP_CPLANET_WIDTH * NUMTEAMS, BMP_CPLANET_HEIGHT, BMP_ORION, mapw, + LR_DEFAULTCOLOR); + mplanet_bitmaps[3] = + W_StoreBitmap3 ("bitmaps/planlibm/color/romulus.bmp", + BMP_CPLANET_WIDTH * NUMTEAMS, BMP_CPLANET_HEIGHT, BMP_ROMULUS, mapw, + LR_DEFAULTCOLOR); + mplanet_bitmaps[4] = + W_StoreBitmap3 ("bitmaps/planlibm/color/agri1.bmp", + BMP_CPLANET_WIDTH * NUMTEAMS, BMP_CPLANET_HEIGHT, BMP_AGRI1, mapw, + LR_DEFAULTCOLOR); + mplanet_bitmaps[5] = + W_StoreBitmap3 ("bitmaps/planlibm/color/agri2.bmp", + BMP_CPLANET_WIDTH * NUMTEAMS, BMP_CPLANET_HEIGHT, BMP_AGRI2, mapw, + LR_DEFAULTCOLOR); + mplanet_bitmaps[6] = + W_StoreBitmap3 ("bitmaps/planlibm/color/rock1.bmp", + BMP_CPLANET_WIDTH * NUMTEAMS, BMP_CPLANET_HEIGHT, BMP_ROCK1, mapw, + LR_DEFAULTCOLOR); + mplanet_bitmaps[7] = + W_StoreBitmap3 ("bitmaps/planlibm/color/rock2.bmp", + BMP_CPLANET_WIDTH * NUMTEAMS, BMP_CPLANET_HEIGHT, BMP_ROCK2, mapw, + LR_DEFAULTCOLOR); + + /* Make pointers to the bitmaps */ + for (j = 0; j < NUMTEAMS; j++) + { + mplanet_earth[j] = + W_PointBitmap2 (mplanet_bitmaps[0], j, 0, BMP_CPLANET_WIDTH, + BMP_CPLANET_HEIGHT); + mplanet_klingus[j]= + W_PointBitmap2 (mplanet_bitmaps[1], j, 0, BMP_CPLANET_WIDTH, + BMP_CPLANET_HEIGHT); + mplanet_orion[j]= + W_PointBitmap2 (mplanet_bitmaps[2], j, 0, BMP_CPLANET_WIDTH, + BMP_CPLANET_HEIGHT); + mplanet_romulus[j]= + W_PointBitmap2 (mplanet_bitmaps[3], j, 0, BMP_CPLANET_WIDTH, + BMP_CPLANET_HEIGHT); + mplanet_agri1[j]= + W_PointBitmap2 (mplanet_bitmaps[4], j, 0, BMP_CPLANET_WIDTH, + BMP_CPLANET_HEIGHT); + mplanet_agri2[j]= + W_PointBitmap2 (mplanet_bitmaps[5], j, 0, BMP_CPLANET_WIDTH, + BMP_CPLANET_HEIGHT); + mplanet_rock1[j]= + W_PointBitmap2 (mplanet_bitmaps[6], j, 0, BMP_CPLANET_WIDTH, + BMP_CPLANET_HEIGHT); + mplanet_rock2[j]= + W_PointBitmap2 (mplanet_bitmaps[7], j, 0, BMP_CPLANET_WIDTH, + BMP_CPLANET_HEIGHT); + } + + /* Load the unknown planet bitmap */ + mplanet_unknown = + W_StoreBitmap3 ("bitmaps/planlibm/color/unknown.bmp", + BMP_CPLANET_WIDTH, BMP_CPLANET_HEIGHT, BMP_PLANET_UNKNOWN, mapw, + LR_DEFAULTCOLOR); + + /* Load the resource bitmaps */ + marmy_bitmap = + W_StoreBitmap3 ("bitmaps/planlibm/color/army.bmp", + BMP_ARMY_WIDTH, BMP_ARMY_HEIGHT, BMP_ARMYBMP, mapw, + LR_DEFAULTCOLOR); + mwrench_bitmap = + W_StoreBitmap3 ("bitmaps/planlibm/color/wrench.bmp", + BMP_WRENCH_WIDTH, BMP_WRENCH_HEIGHT, BMP_WRENCHBMP, mapw, + LR_DEFAULTCOLOR); + mfuel_bitmap = + W_StoreBitmap3 ("bitmaps/planlibm/color/fuel.bmp", + BMP_FUEL_WIDTH, BMP_FUEL_HEIGHT, BMP_FUELBMP, mapw, + LR_DEFAULTCOLOR); +} + +/******************************************************************************/ /*** handleMessageWindowKeyDown() /******************************************************************************/ static void @@ -997,7 +1089,7 @@ planetBitmap = intDefault ("planetBitmap", planetBitmap); planetBitmapGalaxy = intDefault ("planetBitmapGalaxy", planetBitmapGalaxy); loadplanetsC(); // Always load new color planet bitmaps..for now - + loadmplanetsC(); switch (planetBitmap) // Case 3 = new color, but we never use Planlib { case 1: Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- local.c 21 May 2006 09:56:38 -0000 1.24 +++ local.c 21 May 2006 18:53:03 -0000 1.25 @@ -26,7 +26,6 @@ /* Local Variables */ #define XPI 3.1415926 -static int playalert = 0; static int clearcount = 0; static int clearzone[4][(MAXTORP + 1) * MAXPLAYER + (MAXPLASMA + 1) * MAXPLAYER + MAXPLANETS]; @@ -327,6 +326,133 @@ } } +/******************************************************************************/ +/*** planetBitmapC() +/******************************************************************************/ +static inline W_Icon +planetBitmapC (register struct planet *p) +/* + * Choose the color bitmap for a planet. + */ +{ + int i; + W_Icon (*planet_bits); + + if ((p->pl_info & me->p_team) +#ifdef RECORDGAME + || playback +#endif + ) + { + /* Logic for planet assignment: + 1) Check if it's a homeworld. If so, find which homeworld it is + 2) Check if it's a core planet + 2a) Check if it's agri + 3) Check if it's agri + 4) Default planet bitmap + 5) Switch statement by owner to determine color + */ + if (p->pl_flags & PLHOME) + { + if (!strcmp(p->pl_name, "Earth")) + planet_bits = planet_earth; + else if (!strcmp(p->pl_name, "Klingus")) + planet_bits = planet_klingus; + else if (!strcmp(p->pl_name, "Romulus")) + planet_bits = planet_romulus; + else if (!strcmp(p->pl_name, "Orion")) + planet_bits = planet_orion; + else // This should never be called + planet_bits = planet_rock1; + } + else if (p->pl_flags & PLCORE) // Not functional yet due to server + { + if (p->pl_flags & PLAGRI) + planet_bits = planet_agri1; + else + planet_bits = planet_rock1; + } + else if (p->pl_flags & PLAGRI) + planet_bits = planet_agri2; + else + planet_bits = planet_rock2; + + switch (p->pl_owner) + { + case FED: + i = 0; + break; + case KLI: + i = 2; + break; + case ORI: + i = 3; + break; + case ROM: + i = 4; + break; + default: // IND + i = 1; + break; + } + return planet_bits[i]; + } + else + { + return planet_unknown; + } +} + +/******************************************************************************/ +/*** planetResourcesC() +/******************************************************************************/ +static inline void +planetResourcesC (register struct planet *p, int destwidth, int destheight, + int dx, int dy, W_Window window) +/* + * Draw the resources for a colorized planet. + */ +{ + if ((p->pl_info & me->p_team) +#ifdef RECORDGAME + || playback +#endif + ) + { + /* Select resources */ + if (p->pl_armies > 4) + W_WriteScaleBitmap(dx - 7 * destwidth / 8, + dy - (destheight / 2), + destwidth/3, + destheight, + BMP_ARMY_WIDTH, + BMP_ARMY_HEIGHT, + 0, + army_bitmap, planetColor(p), + window); + if (p->pl_flags & PLREPAIR) + W_WriteScaleBitmap(dx - (destwidth / 2), + dy - (5 * destheight / 6), + destwidth, + destheight/3, + BMP_WRENCH_WIDTH, + BMP_WRENCH_HEIGHT, + 0, + wrench_bitmap, planetColor(p), + window); + if (p->pl_flags & PLFUEL) + W_WriteScaleBitmap(dx + 3 * destwidth / 5, + dy - (destheight / 2), + destwidth/3, + destheight, + BMP_FUEL_WIDTH, + BMP_FUEL_HEIGHT, + 0, + fuel_bitmap, planetColor(p), + window); + } + return; +} static void DrawPlanets (void) @@ -2148,25 +2274,27 @@ clearlcount++; } + /* Change border color to signify alert status */ - /* Decided to always redraw alert borders, was causing too many problems with - the infrequent draw rate - BB */ if (oldalert != (me->p_flags & (PFGREEN | PFYELLOW | PFRED))) - playalert = 1; - oldalert = (me->p_flags & (PFGREEN | PFYELLOW | PFRED)); - switch (oldalert) { - case PFGREEN: - if (extraAlertBorder) + oldalert = (me->p_flags & (PFGREEN | PFYELLOW | PFRED)); + switch (oldalert) { - W_ChangeBorder (w, gColor); - W_ChangeBorder (mapw, gColor); - } - W_ChangeBorder (baseWin, gColor); + case PFGREEN: + if (extraAlertBorder) + { +#ifndef DOUBLE_BUFFERING + W_ChangeBorder (w, gColor); + W_ChangeBorder (mapw, gColor); +#else + W_ChangeBorderDB (localSDB, gColor); + W_ChangeBorderDB (mapSDB, gColor); +#endif + } + W_ChangeBorder (baseWin, gColor); #if defined(SOUND) - if (playalert) - { if (newSound) // Kill any channels with WARNING_WAV or RED_ALERT_WAV (group 2) Mix_HaltGroup(2); else @@ -2174,20 +2302,25 @@ Abort_Sound(WARNING_SOUND); Abort_Sound(RED_ALERT_SOUND); } - } + #endif - break; - case PFYELLOW: - if (extraAlertBorder) - { - W_ChangeBorder (w, yColor); - W_ChangeBorder (mapw, yColor); - } - W_ChangeBorder (baseWin, yColor); + + break; + case PFYELLOW: + if (extraAlertBorder) + { +#ifndef DOUBLE_BUFFERING + W_ChangeBorder (w, yColor); + W_ChangeBorder (mapw, yColor); +#else + W_ChangeBorderDB (localSDB, yColor); + W_ChangeBorderDB (mapSDB, yColor); +#endif + } + W_ChangeBorder (baseWin, yColor); #if defined(SOUND) - if (playalert) - { + if (newSound) // Kill any channels with RED_ALERT_WAV (group 2) { Mix_HaltGroup(2); @@ -2198,29 +2331,33 @@ Abort_Sound(RED_ALERT_SOUND); Play_Sound(WARNING_SOUND); } - } + #endif - break; - case PFRED: - if (extraAlertBorder) - { - W_ChangeBorder (w, rColor); - W_ChangeBorder (mapw, rColor); - } - W_ChangeBorder (baseWin, rColor); - + + break; + case PFRED: + if (extraAlertBorder) + { +#ifndef DOUBLE_BUFFERING + W_ChangeBorder (w, rColor); + W_ChangeBorder (mapw, rColor); +#else + W_ChangeBorderDB (localSDB, rColor); + W_ChangeBorderDB (mapSDB, rColor); +#endif + } + W_ChangeBorder (baseWin, rColor); + #if defined(SOUND) - if (playalert) - { if (newSound) Play_Sound(RED_ALERT_WAV); else Play_Sound(RED_ALERT_SOUND); - } #endif - break; + + break; + } } - playalert = 0; #if defined(SOUND) if (newSound) Index: death.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/death.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- death.c 21 May 2006 09:56:38 -0000 1.7 +++ death.c 21 May 2006 18:53:03 -0000 1.8 @@ -57,6 +57,8 @@ } W_ChangeBorder (baseWin, gColor); oldalert = PFGREEN; + if (doubleBuffering) /* Force a border refresh */ + oldalert = 0; } if (W_IsMapped (statwin)) { Index: option.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/option.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- option.c 21 May 2006 09:56:39 -0000 1.15 +++ option.c 21 May 2006 18:53:03 -0000 1.16 @@ -897,6 +897,7 @@ W_ClearWindow (w); W_ClearWindow (mapw); redrawall = 1; + oldalert = 0; /* Force a border refresh */ } else if (op->op_option == &partitionPlist) RedrawPlayerList (); Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- data.c 21 May 2006 09:56:38 -0000 1.23 +++ data.c 21 May 2006 18:53:03 -0000 1.24 @@ -309,14 +309,17 @@ ori_bitmapsHR[NUM_TYPES], ind_bitmapsHR[NUM_TYPES]; // Planets -W_Icon planet_unknown; -W_Icon planet_bitmaps[8]; +W_Icon planet_unknown, mplanet_unknown; +W_Icon planet_bitmaps[8], mplanet_bitmaps[8]; W_Icon planet_earth[NUMTEAMS], planet_klingus[NUMTEAMS], planet_orion[NUMTEAMS], planet_romulus[NUMTEAMS], planet_agri1[NUMTEAMS], planet_agri2[NUMTEAMS], planet_rock1[NUMTEAMS], planet_rock2[NUMTEAMS]; -W_Icon army_bitmap; -W_Icon wrench_bitmap; -W_Icon fuel_bitmap; +W_Icon mplanet_earth[NUMTEAMS], mplanet_klingus[NUMTEAMS], mplanet_orion[NUMTEAMS], + mplanet_romulus[NUMTEAMS], mplanet_agri1[NUMTEAMS], mplanet_agri2[NUMTEAMS], + mplanet_rock1[NUMTEAMS], mplanet_rock2[NUMTEAMS]; +W_Icon army_bitmap, marmy_bitmap; +W_Icon wrench_bitmap, mwrench_bitmap; +W_Icon fuel_bitmap, mfuel_bitmap; W_Icon base_planets; W_Icon base_mplanets; W_Icon bplanets[PLANET_VIEWS]; Index: map.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/map.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- map.c 21 May 2006 09:56:38 -0000 1.11 +++ map.c 21 May 2006 18:53:03 -0000 1.12 @@ -253,16 +253,16 @@ } /******************************************************************************/ -/*** planetBitmapC() +/*** mplanetBitmapC() /******************************************************************************/ -extern inline W_Icon -planetBitmapC (register struct planet *p) +static inline W_Icon +mplanetBitmapC (register struct planet *p) /* - * Choose the color bitmap for a planet. + * Choose the map color bitmap for a planet. */ { int i; - W_Icon (*planet_bits); + W_Icon (*mplanet_bits); if ((p->pl_info & me->p_team) #ifdef RECORDGAME @@ -281,27 +281,27 @@ if (p->pl_flags & PLHOME) { if (!strcmp(p->pl_name, "Earth")) - planet_bits = planet_earth; + mplanet_bits = mplanet_earth; else if (!strcmp(p->pl_name, "Klingus")) - planet_bits = planet_klingus; + mplanet_bits = mplanet_klingus; else if (!strcmp(p->pl_name, "Romulus")) - planet_bits = planet_romulus; + mplanet_bits = mplanet_romulus; else if (!strcmp(p->pl_name, "Orion")) - planet_bits = planet_orion; + mplanet_bits = mplanet_orion; else // This should never be called - planet_bits = planet_rock1; + mplanet_bits = mplanet_rock1; } else if (p->pl_flags & PLCORE) // Not functional yet due to server { if (p->pl_flags & PLAGRI) - planet_bits = planet_agri1; + mplanet_bits = mplanet_agri1; else - planet_bits = planet_rock1; + mplanet_bits = mplanet_rock1; } else if (p->pl_flags & PLAGRI) - planet_bits = planet_agri2; + mplanet_bits = mplanet_agri2; else - planet_bits = planet_rock2; + mplanet_bits = mplanet_rock2; switch (p->pl_owner) { @@ -321,22 +321,22 @@ i = 1; break; } - return planet_bits[i]; + return mplanet_bits[i]; } else { - return planet_unknown; + return mplanet_unknown; } } /******************************************************************************/ -/*** planetResourcesC() +/*** mplanetResourcesC() /******************************************************************************/ -extern inline void -planetResourcesC (register struct planet *p, int destwidth, int destheight, +static inline void +mplanetResourcesC (register struct planet *p, int destwidth, int destheight, int dx, int dy, W_Window window) /* - * Draw the resources for a colorized planet. + * Draw the map resources for a colorized planet. */ { if ((p->pl_info & me->p_team) @@ -354,7 +354,7 @@ BMP_ARMY_WIDTH, BMP_ARMY_HEIGHT, 0, - army_bitmap, planetColor(p), + marmy_bitmap, planetColor(p), window); if (p->pl_flags & PLREPAIR) W_WriteScaleBitmap(dx - (destwidth / 2), @@ -364,7 +364,7 @@ BMP_WRENCH_WIDTH, BMP_WRENCH_HEIGHT, 0, - wrench_bitmap, planetColor(p), + mwrench_bitmap, planetColor(p), window); if (p->pl_flags & PLFUEL) W_WriteScaleBitmap(dx + 3 * destwidth / 5, @@ -374,7 +374,7 @@ BMP_FUEL_WIDTH, BMP_FUEL_HEIGHT, 0, - fuel_bitmap, planetColor(p), + mfuel_bitmap, planetColor(p), window); } return; @@ -481,11 +481,11 @@ BMP_CPLANET_WIDTH, BMP_CPLANET_HEIGHT, 0, - planetBitmapC(l), planetColor(l), + mplanetBitmapC(l), planetColor(l), mapw); /* Draw planet resources */ - planetResourcesC(l, BMP_MPLANET_WIDTH, BMP_MPLANET_HEIGHT, dx, dy, mapw); + mplanetResourcesC(l, BMP_MPLANET_WIDTH, BMP_MPLANET_HEIGHT, dx, dy, mapw); } else { @@ -515,11 +515,11 @@ BMP_CPLANET_WIDTH, BMP_CPLANET_HEIGHT, 0, - planetBitmapC (l), + mplanetBitmapC (l), planetColor (l), mapw); /* Draw planet resources */ - planetResourcesC(l, BMP_MPLANET_WIDTH, BMP_MPLANET_HEIGHT, dx, dy, mapw); + mplanetResourcesC(l, BMP_MPLANET_WIDTH, BMP_MPLANET_HEIGHT, dx, dy, mapw); } else { From modemhero at users.sourceforge.net Mon May 22 03:27:55 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 22 May 2006 08:27:55 +0000 Subject: [netrek-cvs] client/netrekxp/src cowmain.c, 1.13, 1.14 data.c, 1.24, 1.25 death.c, 1.8, 1.9 defaults.c, 1.18, 1.19 getship.c, 1.2, 1.3 input.c, 1.11, 1.12 local.c, 1.25, 1.26 map.c, 1.12, 1.13 mswindow.c, 1.25, 1.26 newwin.c, 1.26, 1.27 option.c, 1.16, 1.17 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30185/src Modified Files: cowmain.c data.c death.c defaults.c getship.c input.c local.c map.c mswindow.c newwin.c option.c Log Message: Added "showArmy: (on)/off" to show army count of planet you are orbiting. Can be changed in game via planets menu Added "detCircle: on/(off)" to show det circle on tactical. Can be changed in game via ship menu Pushing transwarp key will automatically lock you onto your team's base, and send the practice robot request that starts transwarp, if your team has a base, and if you aren't locked onto any player already. For games with multiple bases on the same team (i.e. chaos), you will have to lock onto the base of your choice, otherwise it will send you to the first base on your team's player list. First attempt at fixing color cycling of colorful phasers. Fix to rank message. Index: death.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/death.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- death.c 21 May 2006 18:53:03 -0000 1.8 +++ death.c 22 May 2006 08:27:53 -0000 1.9 @@ -84,14 +84,10 @@ if (promoted) { - /* Use deathmessage as a buffer because it will be updated in - a moment anyway */ - - sprintf (deathmessage, "Congratulations, You have scummed up to %s", + sprintf (rankmessage, "Congratulations, You have scummed up to %s", ranks[mystats->st_rank].name); - W_WriteText (w, 50, 100, W_Yellow, deathmessage, - strlen (deathmessage), W_BoldFont); - promoted = 0; + W_WriteText (w, 50, 80, W_Yellow, rankmessage, + strlen (rankmessage), W_BoldFont); } @@ -193,7 +189,7 @@ break; } - W_WriteText (w, 50, 80, W_Cyan, deathmessage, strlen (deathmessage), + W_WriteText (w, 50, 60, W_Cyan, deathmessage, strlen (deathmessage), deathFont); @@ -237,6 +233,7 @@ if (deathFont != W_BoldFont) /* Initialise deathFont */ deathFont = W_RegularFont; - W_WriteText (w, 50, 80, W_Cyan, deathmessage, strlen (deathmessage), - deathFont); + if (promoted) + W_WriteText (w, 50, 80, W_Yellow, rankmessage, strlen (rankmessage), W_BoldFont); + W_WriteText (w, 50, 60, W_Cyan, deathmessage, strlen (deathmessage), deathFont); } Index: getship.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/getship.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- getship.c 18 May 2006 07:15:35 -0000 1.2 +++ getship.c 22 May 2006 08:27:53 -0000 1.3 @@ -113,7 +113,7 @@ shipvals[ATT].s_width = 20; /* att: */ shipvals[ATT].s_height = 20; /* att: */ shipvals[ATT].s_type = ATT; /* att: */ - shipvals[ATT].s_phaserfuse = 1; /* att: */ + shipvals[ATT].s_phaserfuse = 2; /* att: */ shipvals[ATT].s_repair = 30000; /* att: */ shipvals[SGALAXY].s_phaserdamage = 100; /* galaxy: */ Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- mswindow.c 21 May 2006 18:53:03 -0000 1.25 +++ mswindow.c 22 May 2006 08:27:53 -0000 1.26 @@ -196,7 +196,7 @@ win = (Window *)window;\ if (bitmap->hwnd != win->hwnd)\ {\ - LineToConsole("DBICON - mismatch windows\n");\ + LineToConsole("DBICONHEADER - bitmap and window mismatch\n");\ hdc = GetDC (win->hwnd);\ usebitmaphwnd = 0;\ }\ @@ -3294,6 +3294,31 @@ ReleaseDC (win->hwnd, hdc); } +void W_WriteCircle (W_Window window, + int x, + int y, + int r, + W_Color color) +{ + DBHEADER_VOID; + + x += win->border; + y += win->border; + + if (NetrekPalette) + { + SelectPalette (hdc, NetrekPalette, FALSE); + RealizePalette (hdc); + } + SelectObject (hdc, colortable[color].pen); + SelectObject (hdc, GetStockObject (NULL_BRUSH)); + + Ellipse (hdc, x - r, y - r, x + r, y + r); + + if (!sdb || !doubleBuffering || !ingame) + ReleaseDC (win->hwnd, hdc); +} + //Draw a triangle. Yay. void W_WriteTriangle (W_Window window, Index: map.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/map.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- map.c 21 May 2006 18:53:03 -0000 1.12 +++ map.c 22 May 2006 08:27:53 -0000 1.13 @@ -347,9 +347,9 @@ { /* Select resources */ if (p->pl_armies > 4) - W_WriteScaleBitmap(dx - 7 * destwidth / 8, + W_WriteScaleBitmap(dx - 7 * destwidth / 8 - 1, dy - (destheight / 2), - destwidth/3, + destwidth/3 + 1, destheight, BMP_ARMY_WIDTH, BMP_ARMY_HEIGHT, @@ -360,16 +360,16 @@ W_WriteScaleBitmap(dx - (destwidth / 2), dy - (5 * destheight / 6), destwidth, - destheight/3, + destheight/3 + 1, BMP_WRENCH_WIDTH, BMP_WRENCH_HEIGHT, 0, mwrench_bitmap, planetColor(p), window); if (p->pl_flags & PLFUEL) - W_WriteScaleBitmap(dx + 3 * destwidth / 5, + W_WriteScaleBitmap(dx + 3 * destwidth / 5 - 1, dy - (destheight / 2), - destwidth/3, + destwidth/3 + 1, destheight, BMP_FUEL_WIDTH, BMP_FUEL_HEIGHT, @@ -432,7 +432,7 @@ if (planetBitmapGalaxy == 3) // Needs adjusting W_ClearArea (mapw, odx - 7 * BMP_MPLANET_WIDTH / 8, ody - (5 * BMP_MPLANET_HEIGHT / 6), - 7 * BMP_MPLANET_WIDTH / 4, 4 * BMP_MPLANET_HEIGHT / 3); + 7 * BMP_MPLANET_WIDTH / 4 + 1, 4 * BMP_MPLANET_HEIGHT / 3 + 1); else W_ClearArea (mapw, odx - (BMP_MPLANET_WIDTH / 2), ody - (BMP_MPLANET_HEIGHT / 2), @@ -450,7 +450,7 @@ if (planetBitmapGalaxy == 3) // Needs adjusting W_ClearArea (mapw, dx - 7 * BMP_MPLANET_WIDTH / 8, dy - (5 * BMP_MPLANET_HEIGHT / 6), - 7 * BMP_MPLANET_WIDTH / 4, 4 * BMP_MPLANET_HEIGHT / 3); + 7 * BMP_MPLANET_WIDTH / 4 + 1, 4 * BMP_MPLANET_HEIGHT / 3 + 1); else W_ClearArea (mapw, dx - (BMP_MPLANET_WIDTH / 2 + 4), Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- newwin.c 21 May 2006 18:53:03 -0000 1.26 +++ newwin.c 22 May 2006 08:27:53 -0000 1.27 @@ -1399,6 +1399,7 @@ { while (!W_EventsPending ()) { + HANDLE handles[FD_SETSIZE]; time_t elapsed; fd_set rfds; struct timeval tv; @@ -1414,8 +1415,8 @@ FD_SET (sock, &rfds); if (udpSock >= 0) FD_SET (udpSock, &rfds); - select (32, &rfds, 0, 0, &tv); /* hmm, 32 might be too - * small */ + // WaitForMultipleObjects(32, handles, TRUE, INFINITE); + select (32, &rfds, 0, 0, &tv); /* hmm, 32 might be too small */ if (FD_ISSET (sock, &rfds) || (udpSock >= 0 && FD_ISSET (udpSock, &rfds))) Index: input.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/input.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- input.c 21 May 2006 09:56:38 -0000 1.11 +++ input.c 22 May 2006 08:27:53 -0000 1.12 @@ -303,6 +303,32 @@ }; /******************************************************************************/ +/*** lockBase() - for use with twarp key ***/ +/******************************************************************************/ +static void +lockBase (void) +{ + register int i; + register struct player *j; + register int targnum = -1; + + for (i = 0, j = &players[i]; i < MAXPLAYER; i++, j++) + { + if (j->p_status != PALIVE) + continue; + if (j == me) + continue; + if ((j->p_ship.s_type == STARBASE) && (j->p_team == me->p_team)) + targnum = i; + } + if (targnum != -1) + { + sendPlaylockReq (targnum); + me->p_playerl = (short) targnum; + } +} + +/******************************************************************************/ /*** lockPlanetOrBase() ***/ /******************************************************************************/ static void @@ -2197,6 +2223,8 @@ void Key42 (void) { + if (!(me->p_flags & PFPLOCK)) + lockBase (); sendPractrReq (); } Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- local.c 21 May 2006 18:53:03 -0000 1.25 +++ local.c 22 May 2006 08:27:53 -0000 1.26 @@ -30,6 +30,9 @@ static int clearzone[4][(MAXTORP + 1) * MAXPLAYER + (MAXPLASMA + 1) * MAXPLAYER + MAXPLANETS]; +#ifdef JUBILEE_PHASERS +static int ph_counter = 0; +#endif static int clearlcount = 0; #ifdef HOCKEY_LINES static int clearline[4][MAXPLAYER + 2 * MAXPLAYER + NUM_HOCKEY_LINES]; @@ -522,6 +525,43 @@ clearzone[3][clearcount] = W_Textheight; clearcount++; } + + if (showArmy && (me->p_flags & PFORBIT) + && (me->p_planet = get_closest_planet(me->p_x, me->p_y)) == l->pl_no) + { + char armbuf[4]; + int armbuflen; + + if (l->pl_armies < 10) + { + armbuf[0] = (char) (l->pl_armies + '0'); + armbuf[1] = '\0'; + armbuflen = 2; + } + else if (l->pl_armies < 100) + { + armbuf[0] = (char) (l->pl_armies / 10 + '0'); + armbuf[1] = (char) (l->pl_armies % 10 + '0'); + armbuf[2] = '\0'; + armbuflen = 3; + } + else + { + armbuf[0] = (char) (l->pl_armies / 100 + '0'); + armbuf[1] = (char) (l->pl_armies / 10 + '0'); + armbuf[2] = (char) (l->pl_armies % 10 + '0'); + armbuf[3] = '\0'; + armbuflen = 4; + } + W_MaskText (w, dx - (7 * BMP_PLANET_WIDTH / 8), + dy - (5 * BMP_PLANET_HEIGHT / 6), planetColor (l), + armbuf, armbuflen, planetFont (l)); + clearzone[0][clearcount] = dx - (7 * BMP_PLANET_WIDTH / 8); + clearzone[1][clearcount] = dy - (5 * BMP_PLANET_HEIGHT / 6); + clearzone[2][clearcount] = W_Textwidth * armbuflen; + clearzone[3][clearcount] = W_Textheight; + clearcount++; + } if (planetBitmap == 3) // Needs adjusting { clearzone[0][clearcount] = dx - (7 * BMP_PLANET_WIDTH / 8); @@ -574,6 +614,11 @@ } +void +DrawDetCircle() +{ + W_WriteCircle(w, WINSIDE/2, WINSIDE/2, DETDIST/SCALE, W_Red); +} static void DrawShips (void) @@ -583,7 +628,7 @@ char idbuf[10]; int buflen = 1; - static W_Color ph_col; + static int ph_col = 0; const int view = SCALE * WINSIDE / 2 + BMP_SHIELD_WIDTH * SCALE / 2; int dx, dy, px, py, wx, wy, tx, ty, lx, ly; int new_dx, new_dy; @@ -1356,24 +1401,33 @@ switch (ph_col) { case 0: + case 1: col = W_Red; break; - case 1: + case 2: + case 3: col = W_Green; break; - case 2: + case 4: + case 5: col = W_Yellow; break; - case 3: + case 6: + case 7: col = W_Cyan; break; default: col = shipCol[remap[j->p_team]]; + break; + } + ph_counter++; + ph_col += (100/j->p_ship.s_phaserfuse/updatesPerSec); + if (ph_counter == (updatesPerSec - 1)) + { + ph_counter = 0; ph_col = 0; } - - ph_col++; - + LineToConsole("Counter is %d, ph_col is %d\n", ph_counter, ph_col); if (phaserShrinkStyle == 1) { get_shrink_phaser_coords(&new_dx, &new_dy, @@ -2482,6 +2536,8 @@ DrawStars(); DrawShips (); + if (detCircle) + DrawDetCircle(); DrawTorps (); DrawPlasmaTorps (); Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- data.c 21 May 2006 18:53:03 -0000 1.24 +++ data.c 22 May 2006 08:27:53 -0000 1.25 @@ -54,6 +54,8 @@ * dashboard, 6/2/93 LAB */ int old_db = 0; /* should be same as * newDashboard */ +int detCircle = 0; /* Show det circle on tactical */ +int showArmy = 1; /* Show army count of planet you are orbiting */ int fastQuit = 0; int gen_distress = 0; /* generic distress/macro * system support */ @@ -385,6 +387,7 @@ LONG packets_received = 0; /* # all packets received */ W_Window pStats = NULL; +char rankmessage[80]; char deathmessage[80]; char outmessage[MAX_MLENGTH]; /* maximum message length */ Index: cowmain.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/cowmain.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- cowmain.c 21 May 2006 09:56:38 -0000 1.13 +++ cowmain.c 22 May 2006 08:27:53 -0000 1.14 @@ -1082,6 +1082,7 @@ Play_Sound(ENGINE_SOUND); } #endif + promoted = 0; ingame = 1; /* Get input until the player quits or dies */ input (); Index: option.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/option.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- option.c 21 May 2006 18:53:03 -0000 1.16 +++ option.c 22 May 2006 08:27:53 -0000 1.17 @@ -29,7 +29,7 @@ static int old_rotate, old_rotate_deg; #endif -static int lastUpdateSpeed = 5; +static int lastUpdateSpeed = 10; static char newkeys[14]; char *localmes[] = { "Show owner on local planets", @@ -269,6 +269,7 @@ {1, "shrink their phasers by %d/16", &theirPhaserShrink, 0, 0, 0, NULL, &phaserShrinkRng}, {1, "shrink phasers on a miss", &shrinkPhaserOnMiss, 0, 0, 0, NULL, NULL}, {1, "report kills", &reportKills, 0, 0, 0, NULL, NULL}, + {1, "show det circle", &detCircle, 0, 0, 0, NULL, NULL}, {1, "done", ¬done, 0, 0, 0, NULL, NULL}, {-1, NULL, 0, 0, 0, 0, NULL, NULL} }; @@ -279,6 +280,7 @@ {1, "", &planetBitmap, 0, 0, 0, planetbitmapmess, &planetbitmaprange}, {1, "", &planetBitmapGalaxy, 0, 0, 0, planetbitmapgalaxymess, &planetbitmapgalaxyrange}, {1, "show planet names on local", &showPlanetNames, 0, 0, 0, NULL, NULL}, + {1, "show army count on orbit", &showArmy, 0, 0, 0, NULL, NULL}, {1, "show owner on galactic", &showPlanetOwner, 0, 0, 0, NULL, NULL}, {1, "show IND planets", &showIND, 0, 0, 0, NULL, NULL}, {1, "show AGRI in caps on map", &agriCAPS, 0, 0, 0, NULL, NULL}, @@ -899,6 +901,11 @@ redrawall = 1; oldalert = 0; /* Force a border refresh */ } + /* Let's see if this is we need to clear the det circle */ + else if (op->op_option == &detCircle && detCircle == 0) + { + W_WriteCircle(w, WINSIDE/2, WINSIDE/2, DETDIST/SCALE, backColor); + } else if (op->op_option == &partitionPlist) RedrawPlayerList (); else if (op->op_option == &sortPlayers) Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- defaults.c 21 May 2006 09:56:38 -0000 1.18 +++ defaults.c 22 May 2006 08:27:53 -0000 1.19 @@ -124,6 +124,12 @@ } }, #endif + {"detCircle", &detCircle, RC_BOOL, + { + "Show det circle around your ship", + NULL + } + }, {"disableWinkey", &disableWinkey, RC_BOOL, { "Disable Windows and Context Keys", @@ -489,6 +495,12 @@ NULL } }, + {"showArmy", &showArmy, RC_BOOL, + { + "Show army count of planet you are orbiting", + NULL + } + }, {"showHints", &showHints, RC_BOOL, { "Show hints window", @@ -1425,6 +1437,8 @@ keepInfo = intDefault ("keepInfo", keepInfo); showPlanetOwner = booleanDefault ("showPlanetOwner", showPlanetOwner); newDashboard = intDefault ("newDashboard", newDashboard); + detCircle = booleanDefault ("detCircle", detCircle); + showArmy = booleanDefault ("showArmy", showArmy); updatesPerSec = intDefault ("updatesPerSec", updatesPerSec); redrawDelay = intDefault ("redrawDelay", redrawDelay); logging = booleanDefault ("logging", logging); From modemhero at users.sourceforge.net Mon May 22 03:27:55 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 22 May 2006 08:27:55 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.48, 1.49 netrekrc_options.txt, 1.8, 1.9 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30185/resources/docs Modified Files: changes.txt netrekrc_options.txt Log Message: Added "showArmy: (on)/off" to show army count of planet you are orbiting. Can be changed in game via planets menu Added "detCircle: on/(off)" to show det circle on tactical. Can be changed in game via ship menu Pushing transwarp key will automatically lock you onto your team's base, and send the practice robot request that starts transwarp, if your team has a base, and if you aren't locked onto any player already. For games with multiple bases on the same team (i.e. chaos), you will have to lock onto the base of your choice, otherwise it will send you to the first base on your team's player list. First attempt at fixing color cycling of colorful phasers. Fix to rank message. Index: netrekrc_options.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc_options.txt,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- netrekrc_options.txt 21 May 2006 09:56:38 -0000 1.8 +++ netrekrc_options.txt 22 May 2006 08:27:53 -0000 1.9 @@ -35,7 +35,8 @@ continueTractor: (on/off) show tractors after lock continuousMouse: (on/off) use continuous mouse mode continuousMouseFix: (on/off) fix continuous mouse behavior -disableWinkey (on/off) disable Windows and Context keys +detCircle: (on/off) show det circle around your ship +disableWinkey: (on/off) disable Windows and Context keys documentation: (path) path to documentation file doubleBuffering: (on/off) use double buffering to reduce screen flicker dynamicBitmaps: (on/off) allow switching of ship bitmaps in game @@ -210,6 +211,7 @@ server.: (address) is a nickname for (address) shiftedMouse: (on/off) shift+mouse buttons will work as commands showAllTractorPressor: (on/off) show each player's tractor/pressor beams (requires server support) +showArmy: (on/off) show army count of planet you are orbiting showHints: (on/off) show hints window showHockeyLinesLocal: (on/off) show hockey lines on tactical showHockeyLinesMap: (on/off) show hockey lines on galactic Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- changes.txt 21 May 2006 18:53:03 -0000 1.48 +++ changes.txt 22 May 2006 08:27:53 -0000 1.49 @@ -1,4 +1,13 @@ Version TBA: +- added "showArmy: (on)/off" to show army count of planet you are orbiting. Can be changed + in game via planets menu +- added "detCircle: on/(off)" to show det circle on tactical. Can be changed in game via + ship menu +- pushing transwarp key will automatically lock you onto your team's base, and send the practice + robot request that starts transwarp, if your team has a base, and if you aren't locked onto + any player already. For games with multiple bases on the same team (i.e. chaos), you will + have to lock onto the base of your choice, otherwise it will send you to the first base on + your team's player list. - added observer support to show repair/declare war flags on dashboard. Observers can also now change lock if they are observing a transwarper (server side fix, but good to know). - readded the ability to see tractor/pressors if they go off screen (such as in the case of From modemhero at users.sourceforge.net Mon May 22 03:27:55 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 22 May 2006 08:27:55 +0000 Subject: [netrek-cvs] client/netrekxp/resources/htmlhelp/html generalconfig.html, 1.10, 1.11 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30185/resources/htmlhelp/html Modified Files: generalconfig.html Log Message: Added "showArmy: (on)/off" to show army count of planet you are orbiting. Can be changed in game via planets menu Added "detCircle: on/(off)" to show det circle on tactical. Can be changed in game via ship menu Pushing transwarp key will automatically lock you onto your team's base, and send the practice robot request that starts transwarp, if your team has a base, and if you aren't locked onto any player already. For games with multiple bases on the same team (i.e. chaos), you will have to lock onto the base of your choice, otherwise it will send you to the first base on your team's player list. First attempt at fixing color cycling of colorful phasers. Fix to rank message. Index: generalconfig.html =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html/generalconfig.html,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- generalconfig.html 21 May 2006 09:56:38 -0000 1.10 +++ generalconfig.html 22 May 2006 08:27:53 -0000 1.11 @@ -194,6 +194,16 @@ +detCircle +Show det circle around your ship + +
        +
      • on
      • +
      • off (default)
      • +
      + + + disableWinkey Disable Windows and Context keyboard keys @@ -881,6 +891,16 @@ +showArmy +Show army count of planet you are orbiting + +
        +
      • on (default)
      • +
      • off
      • +
      + + + showHints Show hints window From modemhero at users.sourceforge.net Mon May 22 03:27:54 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 22 May 2006 08:27:54 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.28, 1.29 clientr.suo, 1.7, 1.8 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30185 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Added "showArmy: (on)/off" to show army count of planet you are orbiting. Can be changed in game via planets menu Added "detCircle: on/(off)" to show det circle on tactical. Can be changed in game via ship menu Pushing transwarp key will automatically lock you onto your team's base, and send the practice robot request that starts transwarp, if your team has a base, and if you aren't locked onto any player already. For games with multiple bases on the same team (i.e. chaos), you will have to lock onto the base of your choice, otherwise it will send you to the first base on your team's player list. First attempt at fixing color cycling of colorful phasers. Fix to rank message. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- NetrekXP to do list.C 21 May 2006 18:53:02 -0000 1.28 +++ NetrekXP to do list.C 22 May 2006 08:27:52 -0000 1.29 @@ -49,7 +49,18 @@ ..I added a default return to switch statement, but the underlying bug still remains. 12) look into swar/war in repair time, with obs and plr - doesn't seem to be any way for an obs to know what the war decs are of the person he is observing -13) Too long death message may overwrite rank message +14) cpu leak with double buffering? + +Bug fixes needed from Paradise: +1) Make it so The login screen doesn't use 100% CPU anymore. +2) Fix this major bug present in all netrek clients since UDP was added: +The client will refresh all the windows and redraw the tactical every time it +gets a packet. This means every time you get a message from a player or a +warning (like "bombing Ori: 5 armies left") the client does an extra refresh, +because all these things are sent with TCP and come in an extra packet. Turn +on double buffering and the 20+ redraws per second you get when bombing or +dropping start to make a difference. +3) Get Jubilee phasers to work at all updates and ship phaser cycle settings Stas's list: - color coded playerlist. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 Binary files /tmp/cvsQxl9Uc and /tmp/cvsNJADnT differ From modemhero at users.sourceforge.net Mon May 22 03:27:55 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 22 May 2006 08:27:55 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h, 1.20, 1.21 defs.h, 1.8, 1.9 proto.h, 1.21, 1.22 wlib.h, 1.7, 1.8 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30185/include Modified Files: data.h defs.h proto.h wlib.h Log Message: Added "showArmy: (on)/off" to show army count of planet you are orbiting. Can be changed in game via planets menu Added "detCircle: on/(off)" to show det circle on tactical. Can be changed in game via ship menu Pushing transwarp key will automatically lock you onto your team's base, and send the practice robot request that starts transwarp, if your team has a base, and if you aren't locked onto any player already. For games with multiple bases on the same team (i.e. chaos), you will have to lock onto the base of your choice, otherwise it will send you to the first base on your team's player list. First attempt at fixing color cycling of colorful phasers. Fix to rank message. Index: wlib.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/wlib.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- wlib.h 21 May 2006 09:56:38 -0000 1.7 +++ wlib.h 22 May 2006 08:27:52 -0000 1.8 @@ -192,6 +192,11 @@ int, int, W_Color); +extern void W_WriteCircle (W_Window, + int, + int, + int, + W_Color); extern void W_WriteTriangle (W_Window, int, int, @@ -218,12 +223,6 @@ W_Icon, W_Color, W_Window); -extern void W_WriteTriangle (W_Window, - int, - int, - int, - int, - W_Color); #define W_EV_EXPOSE 1 #define W_EV_KEY 2 Index: defs.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/defs.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- defs.h 18 May 2006 07:15:35 -0000 1.8 +++ defs.h 22 May 2006 08:27:52 -0000 1.9 @@ -56,7 +56,7 @@ * for 20 spaces */ #define EXPDIST 350 /* At this range a torp will * explode */ -#define DETDIST 1600 /* At this range a player +#define DETDIST 1700 /* At this range a player * can detonate a torp */ #define PHASEDIST 6000 /* At this range a player @@ -152,7 +152,6 @@ #define TARG_ENEMY 0x10 #define TARG_FRIEND 0x20 - #define DEFAULT_PORT 2592 /* Other stuff that Ed added */ Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- data.h 21 May 2006 18:53:03 -0000 1.20 +++ data.h 22 May 2006 08:27:52 -0000 1.21 @@ -165,6 +165,8 @@ extern int dynamicBitmaps; extern int colorWeapons; extern int newDashboard, old_db; +extern int detCircle; +extern int showArmy; extern int niftyNewMessages; extern int fastQuit; extern char *shipnos; @@ -363,6 +365,7 @@ extern LONG packets_received; /* # all packets received */ extern W_Window pStats; +extern char rankmessage[80]; extern char deathmessage[80]; extern char outmessage[]; extern char *xdisplay_name; Index: proto.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- proto.h 21 May 2006 18:53:03 -0000 1.21 +++ proto.h 22 May 2006 08:27:52 -0000 1.22 @@ -592,6 +592,11 @@ int x1, int y1, W_Color color); +void W_WriteCircle (W_Window window, + int x, + int y, + int r, + W_Color color); void W_WriteTriangle (W_Window window, int x, int y, From quozl at users.sourceforge.net Mon May 22 08:10:47 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Mon, 22 May 2006 13:10:47 +0000 Subject: [netrek-cvs] client/cow ChangeLog,1.31,1.32 Message-ID: Update of /cvsroot/netrek/client/cow In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv27442 Modified Files: ChangeLog Log Message: Index: ChangeLog =================================================================== RCS file: /cvsroot/netrek/client/cow/ChangeLog,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- ChangeLog 20 May 2006 08:48:16 -0000 1.31 +++ ChangeLog 22 May 2006 13:10:45 -0000 1.32 @@ -1,9 +1,51 @@ -Sat May 20 18:48:13 2006 James Cameron +Mon May 22 23:06:52 2006 James Cameron - * cowmain.c, feature.c, socket.c: fix some valgrind reports of use - of uninitialised data, possible sources of random information - leakage in packets sent to server in situations where auto (stack) - variables for packets may not be initialised. + * x11window.c: add video mode change support, switches to 1024x768 + if it is available, and switches back to previous mode on exit. + + * system.mk.in: add libXxf86vm. + +Mon May 22 22:59:54 2006 James Cameron + + * x11window.c, x11window.h: fix all compilation warnings. + + * defaults.h, smessage.h, defaults.h, x11sprite.h: add prototypes. + + * Wlib.h: change set handlers to void return. + +Mon May 22 22:59:54 2006 James Cameron + + * camera.c, camera.h: add frame counter and per frame file names, + defer imlib2 initialisation to first use in an attempt to find + segfaults. + + * input.c, playback.c: during playback, 's' toggles per frame + camera snapshots. During game, 'C' takes a snapshot. + +Mon May 22 22:59:06 2006 James Cameron + + * ping.c, short.c, socket.c: initialise some more packet buffers + before sending, to fix valgrind reports. + +Mon May 22 22:59:06 2006 James Cameron + + * data.c: change default to LABs dashboard, while it isn't well + liked by the experienced players it is well liked by newbies, and + it's newbies who count. + + * playerlist.c: change default to sorted player list. Same + reasoning as above. + +Mon May 22 22:58:43 2006 James Cameron + + * configure.in: enable XPM in build. + +Sat May 20 19:22:35 2006 James Cameron + + * cowmain.c, feature.c, socket.c, ping.c, short.c: fix some + valgrind reports of use of uninitialised data, possible sources of + random information leakage in packets sent to server in situations + where auto (stack) variables for packets may not be initialised. Sat May 20 18:10:01 2006 James Cameron From quozl at users.sourceforge.net Mon May 22 08:11:23 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Mon, 22 May 2006 13:11:23 +0000 Subject: [netrek-cvs] client/cow x11window.c,1.8,1.9 system.mk.in,1.9,1.10 Message-ID: Update of /cvsroot/netrek/client/cow In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv27795 Modified Files: x11window.c system.mk.in Log Message: add video mode change support Index: x11window.c =================================================================== RCS file: /cvsroot/netrek/client/cow/x11window.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- x11window.c 16 May 2006 12:59:38 -0000 1.8 +++ x11window.c 22 May 2006 13:11:21 -0000 1.9 @@ -4,6 +4,9 @@ * Kevin P. Smith 6/11/89 Much modified by Jerry Frain and Joe Young * * $Log$ + * Revision 1.9 2006/05/22 13:11:21 quozl + * add video mode change support + * * Revision 1.8 2006/05/16 12:59:38 quozl * tactical camera, based on Imlib2 * @@ -58,6 +61,11 @@ #include "teams.bitmap" #include "mapcursor.bitmap" #include "localcursor.bitmap" +#include "smessage.h" +#include "defaults.h" +#include "x11window.h" +#include "x11sprite.h" +#include "camera.h" #ifdef VMS void vms_event_window(void); @@ -225,8 +233,6 @@ None, }; -static XSizeHints wm_size_hint; - #ifdef WINDOWMAKER char **wm_argv; int wm_argc; @@ -264,35 +270,6 @@ #define WIN_MENU 3 #define WIN_SCROLL 4 -struct window - { - Window window; - int type; - char *data; - int mapped; - int width, height; - char *name; - W_Callback handle_keydown; - W_Callback handle_keyup; - W_Callback handle_button; - W_Callback handle_expose; - -#ifdef SHORT_PACKETS - int insensitive; -#endif - Cursor cursor; - }; - -struct scrollingWindow - { - int lines; - int updated; - int topline; - struct stringList *head; - struct stringList *tail; - struct stringList *index; - }; - static void scrollUp(struct window *win, int y); static void scrollDown(struct window *win, int y); static void scrollPosition(struct window *win, int y); @@ -405,7 +382,7 @@ abort(); } -pastebuffer(void) +void pastebuffer(void) { int nbytes, x; char *buff, c; @@ -456,19 +433,20 @@ fprintf(stderr, "I can't open your display, twink!\n"); terminate(1); } - /* tmp */ - /* XSynchronize(W_Display, True); */ - /* XSetErrorHandler(_myerror); */ - camera_set_display(W_Display); - W_Root = DefaultRootWindow(W_Display); + // uncomment this to synchronise display for testing + XSynchronize(W_Display, True); - W_Visual = DefaultVisual(W_Display, DefaultScreen(W_Display)); + // uncomment this to enable a fatal error handler + // XSetErrorHandler(_myerror); + W_Root = DefaultRootWindow(W_Display); + W_Visual = DefaultVisual(W_Display, DefaultScreen(W_Display)); W_Screen = DefaultScreen(W_Display); W_Colormap = DefaultColormap(W_Display, W_Screen); myroot.window = W_Root; myroot.type = WIN_GRAPH; + video_mode_begin(); GetFonts(); GetColors(); @@ -484,11 +462,12 @@ #ifdef BEEPLITE init_tts(); #endif + camera_set_display(W_Display); } /* Make sure the font will work, ie: that it fits in the 6x10 character cell * that we expect. */ -checkFont(XFontStruct * fontinfo, char *fontname) +void checkFont(XFontStruct * fontinfo, char *fontname) { #ifndef SMALL_SCREEN @@ -505,10 +484,10 @@ #endif } -GetFonts(void) +void GetFonts(void) { - Font regular, italic, bold, big, ind; - int i, j; + Font regular, italic, bold, big; + int i; XGCValues values; XFontStruct *fontinfo; char *fontname; @@ -665,17 +644,15 @@ {0x80, 0xa0, 0xb0, 0xc0, 0x00, 0x20, 0x40, 0x60}; -GetColors(void) +void GetColors(void) { int i, j; XGCValues values; - XColor foo, garbage; + XColor foo; int white, black; unsigned long pixel; char defaultstring[100]; char *defaults; - - char *colorname; unsigned long extracolors[COLORS]; XColor colordef; @@ -962,8 +939,7 @@ } } -W_Window -W_RenameWindow(struct window *window, char *str) +void W_RenameWindow(struct window *window, char *str) { XStoreName(W_Display, window->window, str); } @@ -1011,7 +987,7 @@ &attrs), WIN_GRAPH); if (strcmp(name, "netrek") == 0) { - camera_set_window(newwin->window, width, height); + camera_set_window(&newwin->window); } /* top window */ sz_hints = XAllocSizeHints(); @@ -1297,7 +1273,6 @@ #endif unsigned char ch; - int nchars, ind; struct window *win; #ifdef FUNCTION_KEYS @@ -1754,7 +1729,7 @@ W_FlushLineCaches(W_Window window) { Window win = W_Void2Window(window)->window; - register i; + int i; for (i = 0; i < NCOLORS; i++) { @@ -1919,7 +1894,6 @@ { struct icon *newicon; struct window *win; - int black, white; #ifdef DEBUG printf("Storing bitmap for %d (%d x %d)\n", window, width, height); @@ -2133,7 +2107,7 @@ return (NULL); } -addToHash(struct window * win) +void addToHash(struct window * win) { struct windowlist **new; @@ -2328,8 +2302,8 @@ #ifndef NO_COPYAREA else { - register struct stringList *item; - register y; + struct stringList *item; + int y; if (win->height > sw->updated) { @@ -2368,8 +2342,8 @@ struct window *win; struct scrollingWindow *sw; { - register x, y, h; - int savedlines, maxrow, thumbTop, thumbHeight, totalHeight, winheight; + int x, y, h; + int savedlines, maxrow, thumbTop, thumbHeight, totalHeight, winheight; /* * savedlines : Number of offscreen text lines, @@ -2444,7 +2418,7 @@ } #ifdef SHORT_PACKETS -W_SetSensitive(W_Window w, int v) +void W_SetSensitive(W_Window w, int v) { struct window *win = W_Void2Window(w); @@ -2524,7 +2498,7 @@ return (W_Window2Void(newwin)); } -redrawMenu(struct window * win) +void redrawMenu(struct window * win) { int count; @@ -2541,7 +2515,7 @@ } } -redrawMenuItem(struct window *win, int n) +void redrawMenuItem(struct window *win, int n) { struct menuItem *items; @@ -2560,10 +2534,9 @@ } } -changeMenuItem(struct window *win, int col, int n, char *str, int len, W_Color color) +void changeMenuItem(struct window *win, int col, int n, char *str, int len, W_Color color) { struct menuItem *items; - char *news; items = (struct menuItem *) win->data; @@ -3017,8 +2990,6 @@ static Cursor curs; Pixmap cursbits; Pixmap cursmask; - short *curdata; - short *maskdata; struct window *win; XColor whiteCol, blackCol; @@ -3124,7 +3095,7 @@ } -deleteWindow(struct window *window) +void deleteWindow(struct window *window) { struct windowlist **rm; struct windowlist *temp; @@ -3357,7 +3328,7 @@ return XParseGeometry(geom_default, x, y, (unsigned int *) width, (unsigned int *) height); } -checkParent(char *name, W_Window * parent) +void checkParent(char *name, W_Window * parent) { char *adefault; char buf[100]; @@ -3389,18 +3360,16 @@ } } -checkMapped(char *name) +int checkMapped(char *name) { - char *adefault; char buf[100]; sprintf(buf, "%s.mapped", name); return (booleanDefault(buf, 0)); } -checkMappedPref(char *name, int preferred) +int checkMappedPref(char *name, int preferred) { - char *adefault; char buf[100]; sprintf(buf, "%s.mapped", name); @@ -3428,7 +3397,7 @@ } } -findMouse(int *x, int *y) +void findMouse(int *x, int *y) { Window theRoot, theChild; int wX, wY, rootX, rootY, status; @@ -3475,7 +3444,7 @@ return 0; } -W_Flush(void) +void W_Flush(void) { XFlush(W_Display); } @@ -3487,7 +3456,7 @@ } #define MAKE_WINDOW_SETTER(name, part) \ - W_Callback name(W_Window w, W_Callback c) \ + void name(W_Window w, W_Callback c) \ { \ W_Void2Window(w)->part = c; \ } @@ -3556,7 +3525,7 @@ return (XEventsQueued(W_Display, QueuedAfterReading)); } -W_ReadEvents(void) +int W_ReadEvents(void) { XEvent event; static @@ -3698,14 +3667,14 @@ void W_EraseTTSText(W_Window window, int max_width, int y, int width) { - struct window *win = W_Void2Window(window); - register int x = (max_width - width) / 2; + // struct window *win = W_Void2Window(window); + int x = (max_width - width) / 2; if (x < 0) x = 4; y -= W_TTSTextHeight(); - W_ClearArea(w, x, y, width, W_TTSTextHeight()); + W_ClearArea(window, x, y, width, W_TTSTextHeight()); } void @@ -3719,7 +3688,7 @@ /* length of string */ { struct window *win = W_Void2Window(window); - register int x = (max_width - width) / 2; + int x = (max_width - width) / 2; if (x < 0) x = 4; @@ -3747,3 +3716,80 @@ } } #endif /* HAVE_XPM */ + +/* XFree86 VidMode X extension handling */ + +#include + +XF86VidModeModeInfo **video_mode_list; +XF86VidModeModeInfo *video_mode_current; +int video_mode_dotclock, video_mode_list_size; + +/* restore video mode to known previous mode */ +void video_mode_end() +{ + if (video_mode_current != NULL) { + XF86VidModeSwitchToMode(W_Display, W_Screen, video_mode_current); + fprintf(stderr, "video_mode_begin: restored previous video mode\n"); + } +} + +/* set video mode to that preferred for game */ +void video_mode_begin() +{ + int major, minor, line; + XF86VidModeModeLine current; + + /* do not change mode if configuration setting requests no change */ + if (!booleanDefault("VideoModeChange", 1)) { + return; + } + + /* do not change if X server has no support for change */ + if (!XF86VidModeQueryVersion(W_Display, &major, &minor)) { + fprintf(stderr, "XFree86-VidMode X extension absent\n"); + return; + } + + /* obtain the current mode line and list of known mode lines */ + XF86VidModeGetModeLine(W_Display, W_Screen, &video_mode_dotclock, ¤t); + XF86VidModeGetAllModeLines(W_Display, W_Screen, + &video_mode_list_size, &video_mode_list); + + /* find the current mode within the list of known mode lines */ + video_mode_current = NULL; + for (line=0; line < video_mode_list_size; line++) { + XF86VidModeModeInfo *mode = video_mode_list[line]; + if (mode->hdisplay == current.hdisplay && + mode->vdisplay == current.vdisplay && + mode->dotclock == video_mode_dotclock && + mode->htotal == current.htotal && + mode->vtotal == current.vtotal && + mode->flags == current.flags) { + video_mode_current = mode; + } + } + + /* do not change if the current mode was not found */ + if (video_mode_current == NULL) { + fprintf(stderr, "video_mode_begin: this mode not found, " + "cannot switch back, so not switching\n"); + return; + } + + /* schedule a change-back at program end */ + atexit(video_mode_end); + + /* if there is a mode line for 1024x768 then use it */ + for (line=0; line < video_mode_list_size; line++) { + XF86VidModeModeInfo *mode = video_mode_list[line]; + if (mode->hdisplay == 1024 && mode->vdisplay == 768) { + XF86VidModeSwitchToMode(W_Display, W_Screen, mode); + fprintf(stderr, "video_mode_begin: changed to 1024x768\n"); + return; + } + } + + /* mode was not changed, discard the scheduled change-back */ + video_mode_current = NULL; +} Index: system.mk.in =================================================================== RCS file: /cvsroot/netrek/client/cow/system.mk.in,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- system.mk.in 20 May 2006 08:12:54 -0000 1.9 +++ system.mk.in 22 May 2006 13:11:21 -0000 1.10 @@ -108,12 +108,12 @@ SHARED = $(SL_CFLAGS) INCDIRS = $(MPINC) $(INCS) CFLAGS = $(OPT) $($S) $(EXTRACFLAGS) $(SDL_CFLAGS) $(RSA_FLAGS) $(INCDIRS) -LFLAGS = $(EXTRALINKFLAGS) +LFLAGS = -g $(EXTRALINKFLAGS) LIBRARIES = $(LMP) $(LIBS) $(EXTRALIBS) $(SDL_LIBS) $(SDL_MIXER_LIBS) netrek: $(RSAOBJ) $(PMAKE) null $(ROBJ) $(MAINOBJ) $(INPUTOBJ) $(X11OBJ) $(WIN32OBJ) $(RANDOMOBJ) cflags.c randomize $(CC) $(LFLAGS) -o netrek `./randomize $(ROBJ) $(RSAOBJ) $(INPUTOBJ) \ - $(MAINOBJ) $(X11OBJ) $(WIN32OBJ) $(RANDOMOBJ)` $(LIBRARIES) -lImlib2 + $(MAINOBJ) $(X11OBJ) $(WIN32OBJ) $(RANDOMOBJ)` $(LIBRARIES) -lXxf86vm -lImlib2 netrek.shared: done.libcow $(MAINOBJ) $(COWAPI) $(CC) $(LFLAGS) $(MAINOBJ) -L. -lcow $(LIBS) -o netrek.shared From quozl at users.sourceforge.net Mon May 22 08:12:21 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Mon, 22 May 2006 13:12:21 +0000 Subject: [netrek-cvs] client/cow Wlib.h,1.2,1.3 Message-ID: Update of /cvsroot/netrek/client/cow In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28315 Modified Files: Wlib.h Log Message: fix compilation warnings Index: Wlib.h =================================================================== RCS file: /cvsroot/netrek/client/cow/Wlib.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Wlib.h 21 Aug 2001 20:52:15 -0000 1.2 +++ Wlib.h 22 May 2006 13:12:19 -0000 1.3 @@ -11,6 +11,9 @@ * W_Red, W_Green, W_Yellow, W_Cyan, W_Grey, W_Textwidth, and W_Textheight. * * $Log$ + * Revision 1.3 2006/05/22 13:12:19 quozl + * fix compilation warnings + * * Revision 1.2 2001/08/21 20:52:15 siegl * * mouse wheel support @@ -46,10 +49,10 @@ extern W_Callback W_GetWindowKeyUpHandler (W_Window w); extern W_Callback W_GetWindowButtonHandler (W_Window w); extern W_Callback W_GetWindowExposeHandler (W_Window w); -extern W_Callback W_SetWindowKeyDownHandler (W_Window w, W_Callback c); -extern W_Callback W_SetWindowKeyUpHandler (W_Window w, W_Callback c); -extern W_Callback W_SetWindowButtonHandler (W_Window w, W_Callback c); -extern W_Callback W_SetWindowExposeHandler (W_Window w, W_Callback c); +extern void W_SetWindowKeyDownHandler (W_Window w, W_Callback c); +extern void W_SetWindowKeyUpHandler (W_Window w, W_Callback c); +extern void W_SetWindowButtonHandler (W_Window w, W_Callback c); +extern void W_SetWindowExposeHandler (W_Window w, W_Callback c); typedef char *W_Icon; typedef char *W_Font; From quozl at users.sourceforge.net Mon May 22 08:13:26 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Mon, 22 May 2006 13:13:26 +0000 Subject: [netrek-cvs] client/cow ping.c, 1.1.1.1, 1.2 short.c, 1.3, 1.4 socket.c, 1.10, 1.11 Message-ID: Update of /cvsroot/netrek/client/cow In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28798 Modified Files: ping.c short.c socket.c Log Message: initialise packet buffers Index: short.c =================================================================== RCS file: /cvsroot/netrek/client/cow/short.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- short.c 11 Jun 1999 16:14:17 -0000 1.3 +++ short.c 22 May 2006 13:13:24 -0000 1.4 @@ -3,6 +3,9 @@ /* HW 19.07.93 * * $Log$ + * Revision 1.4 2006/05/22 13:13:24 quozl + * initialise packet buffers + * * Revision 1.3 1999/06/11 16:14:17 siegl * cambot replay patches * @@ -1286,6 +1289,7 @@ { struct shortreq_cpacket shortReq; + bzero(&shortReq, sizeof(shortReq)); shortReq.type = CP_S_REQ; shortReq.req = state; shortReq.version = shortversion; /* need a var now because 2 Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/cow/socket.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- socket.c 20 May 2006 08:48:16 -0000 1.10 +++ socket.c 22 May 2006 13:13:24 -0000 1.11 @@ -8,6 +8,9 @@ * Routines to allow connection to the xtrek server. * * $Log$ + * Revision 1.11 2006/05/22 13:13:24 quozl + * initialise packet buffers + * * Revision 1.10 2006/05/20 08:48:16 quozl * fix some valgrind use of uninitialised data reports * @@ -1650,6 +1653,7 @@ { struct speed_cpacket speedReq; + bzero(&speedReq, sizeof(speedReq)); speedReq.type = type; speedReq.speed = state; sendServerPacket((struct player_spacket *) &speedReq); @@ -1947,6 +1951,7 @@ { struct outfit_cpacket outfitReq; + bzero(&outfitReq, sizeof(outfitReq)); outfitReq.type = CP_OUTFIT; outfitReq.team = team; outfitReq.ship = ship; @@ -2221,6 +2226,7 @@ { struct mesg_cpacket mesPacket; + bzero(&mesPacket, sizeof(mesPacket)); #ifdef SHORT_PACKETS if (recv_short) { @@ -2577,6 +2583,7 @@ { struct reserved_cpacket response; + bzero(&response, sizeof(response)); #ifdef CORRUPTED_PACKETS if (sock == udpSock) { @@ -2656,6 +2663,7 @@ #endif + bzero(&response, sizeof(response)); response.type = CP_RSA_KEY; /* encryptRSAPacket (packet, &response); old style rsa-client */ Index: ping.c =================================================================== RCS file: /cvsroot/netrek/client/cow/ping.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- ping.c 1 Nov 1998 17:24:11 -0000 1.1.1.1 +++ ping.c 22 May 2006 13:13:24 -0000 1.2 @@ -2,6 +2,9 @@ /* ping.c * * $Log$ + * Revision 1.2 2006/05/22 13:13:24 quozl + * initialise packet buffers + * * Revision 1.1.1.1 1998/11/01 17:24:11 siegl * COW 3.0 initial revision * */ @@ -117,6 +120,7 @@ else s = sock; + bzero(&packet, sizeof(packet)); packet.type = CP_PING_RESPONSE; packet.pingme = (char) ping; packet.number = (unsigned char) number; From quozl at users.sourceforge.net Mon May 22 08:12:00 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Mon, 22 May 2006 13:12:00 +0000 Subject: [netrek-cvs] client/cow x11window.h, NONE, 1.1 defaults.h, NONE, 1.1 smessage.h, NONE, 1.1 x11sprite.h, NONE, 1.1 defaults.c, 1.5, 1.6 smessage.c, 1.1.1.1, 1.2 x11sprite.c, 1.3, 1.4 Message-ID: Update of /cvsroot/netrek/client/cow In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv27927 Modified Files: defaults.c smessage.c x11sprite.c Added Files: x11window.h defaults.h smessage.h x11sprite.h Log Message: fix compilation warnings --- NEW FILE: x11sprite.h --- void GetPixmaps(Display * d, struct window *win); Index: smessage.c =================================================================== RCS file: /cvsroot/netrek/client/cow/smessage.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- smessage.c 1 Nov 1998 17:24:11 -0000 1.1.1.1 +++ smessage.c 22 May 2006 13:11:58 -0000 1.2 @@ -2,6 +2,9 @@ /* smessage.c * * $Log$ + * Revision 1.2 2006/05/22 13:11:58 quozl + * fix compilation warnings + * * Revision 1.1.1.1 1998/11/01 17:24:11 siegl * COW 3.0 initial revision * */ @@ -16,6 +19,7 @@ #include "defs.h" #include "struct.h" #include "data.h" +#include "smessage.h" static int lcount; static int HUDoffset; --- NEW FILE: smessage.h --- void smessage(char ichar); Index: x11sprite.c =================================================================== RCS file: /cvsroot/netrek/client/cow/x11sprite.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- x11sprite.c 11 Jun 1999 16:14:17 -0000 1.3 +++ x11sprite.c 22 May 2006 13:11:58 -0000 1.4 @@ -1,6 +1,9 @@ /* * $Log$ + * Revision 1.4 2006/05/22 13:11:58 quozl + * fix compilation warnings + * * Revision 1.3 1999/06/11 16:14:17 siegl * cambot replay patches * @@ -28,25 +31,8 @@ #include "defs.h" #include "struct.h" #include "data.h" - -struct window - { - Window window; - int type; - char *data; - int mapped; - int width, height; - char *name; - W_Callback handle_keydown; - W_Callback handle_keyup; - W_Callback handle_button; - W_Callback handle_expose; - -#ifdef SHORT_PACKETS - int insensitive; -#endif - Cursor cursor; - }; +#include "x11window.h" +#include "x11sprite.h" #define W_Void2Window(win) ((win) ? ((struct window *) (win)) : (mylocal)) #define NoPixmapError 0 Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/cow/defaults.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- defaults.c 16 May 2006 06:25:25 -0000 1.5 +++ defaults.c 22 May 2006 13:11:58 -0000 1.6 @@ -8,6 +8,9 @@ /****************************************************************************/ /* * $Log$ + * Revision 1.6 2006/05/22 13:11:58 quozl + * fix compilation warnings + * * Revision 1.5 2006/05/16 06:25:25 quozl * some compilation fixes * @@ -35,6 +38,7 @@ #include "data.h" #include #include "playerlist.h" +#include "defaults.h" #include INC_IO #include INC_STRINGS --- NEW FILE: x11window.h --- struct window { Window window; int type; char *data; int mapped; int width, height; char *name; W_Callback handle_keydown; W_Callback handle_keyup; W_Callback handle_button; W_Callback handle_expose; #ifdef SHORT_PACKETS int insensitive; #endif Cursor cursor; }; struct scrollingWindow { int lines; int updated; int topline; struct stringList *head; struct stringList *tail; struct stringList *index; }; /* x11window.c */ int _myerror(Display *d, XErrorEvent *e); void pastebuffer(void); void W_Initialize(char *str); void checkFont(XFontStruct *fontinfo, char *fontname); void GetFonts(void); XFontStruct *find_font(char *oldf, char **fonts); void GetColors(void); void W_RenameWindow(struct window *window, char *str); W_Window W_MakeWindow(char *name, int x, int y, int width, int height, W_Window parent, int border, W_Color color); void W_ChangeBorder(W_Window window, int color); void W_MapWindow(W_Window window); void W_UnmapWindow(W_Window window); int W_IsMapped(W_Window window); void W_FillArea(W_Window window, int x, int y, int width, int height, W_Color color); void W_CacheClearArea(W_Window window, int x, int y, int width, int height); void W_FlushClearAreaCache(W_Window window); void W_ClearArea(W_Window window, int x, int y, int width, int height); void W_ClearWindow(W_Window window); int W_EventsPending(void); void W_NextEvent(W_Event *wevent); int W_SpNextEvent(W_Event *wevent); void W_MakeLine(W_Window window, int x0, int y0, int x1, int y1, W_Color color); void W_CacheLine(W_Window window, int x0, int y0, int x1, int y1, int color); void W_FlushLineCaches(W_Window window); void W_MakeTractLine(W_Window window, int x0, int y0, int x1, int y1, W_Color color); void W_MakePhaserLine(W_Window window, int x0, int y0, int x1, int y1, W_Color color); void W_WriteTriangle(W_Window window, int x, int y, int s, int t, W_Color color); void W_WriteText(W_Window window, int x, int y, W_Color color, char *str, int len, W_Font font); void W_MaskText(W_Window window, int x, int y, W_Color color, char *str, int len, W_Font font); W_Icon W_StoreBitmap(int width, int height, char *data, W_Window window); void W_WriteBitmap(int x, int y, W_Icon bit, W_Color color); void W_TileWindow(W_Window window, W_Icon bit); void W_UnTileWindow(W_Window window); W_Window W_MakeTextWindow(char *name, int x, int y, int width, int height, W_Window parent, int border); struct window *newWindow(Window window, int type); struct window *findWindow(Window window); void addToHash(struct window *win); W_Window W_MakeScrollingWindow(char *name, int x, int y, int width, int height, W_Window parent, int border); void W_FlushScrollingWindow(W_Window window); void W_SetSensitive(W_Window w, int v); W_Window W_MakeMenu(char *name, int x, int y, int width, int height, W_Window parent, int border); void redrawMenu(struct window *win); void redrawMenuItem(struct window *win, int n); void changeMenuItem(struct window *win, int col, int n, char *str, int len, W_Color color); void W_DefineMapcursor(W_Window window); void W_DefineLocalcursor(W_Window window); void W_DefineFedCursor(W_Window window); void W_DefineRomCursor(W_Window window); void W_DefineKliCursor(W_Window window); void W_DefineOriCursor(W_Window window); void W_DefineTrekCursor(W_Window window); void W_DefineWarningCursor(W_Window window); void W_DefineArrowCursor(W_Window window); void W_DefineTextCursor(W_Window window); void W_DefineCursor(W_Window window, int width, int height, char *bits, char *mask, int xhot, int yhot); int W_LoadBitmap(W_Window window, char *path, Pixmap *pixmap, int *width, int *height, int *x_hot, int *y_hot); void W_Beep(void); int W_WindowWidth(W_Window window); int W_WindowHeight(W_Window window); int W_Socket(void); void W_DestroyWindow(W_Window window); void W_SetTransientForHint(W_Window w, W_Window pw); void deleteWindow(struct window *window); void W_SetIconWindow(W_Window main, W_Window icon); void checkParent(char *name, W_Window *parent); int checkMapped(char *name); int checkMappedPref(char *name, int preferred); void W_WarpPointer(W_Window window, int x, int y); void findMouse(int *x, int *y); int findMouseInWin(int *x, int *y, W_Window w); void W_Flush(void); W_Callback W_GetWindowKeyDownHandler(W_Window w); void W_SetWindowKeyDownHandler(W_Window w, W_Callback c); W_Callback W_GetWindowKeyUpHandler(W_Window w); void W_SetWindowKeyUpHandler(W_Window w, W_Callback c); W_Callback W_GetWindowButtonHandler(W_Window w); void W_SetWindowButtonHandler(W_Window w, W_Callback c); W_Callback W_GetWindowExposeHandler(W_Window w); void W_SetWindowExposeHandler(W_Window w, W_Callback c); void W_ResizeWindow(W_Window window, int neww, int newh); void W_ResizeTextWindow(W_Window window, int neww, int newh); int W_Mono(void); int W_EventsQueued(void); int W_EventsQueuedCk(void); int W_ReadEvents(void); void W_OverlayBitmap(int x, int y, W_Icon bit, W_Color color); void W_SetWindowName(W_Window w, char *name); int W_TTSTextHeight(void); int W_TTSTextWidth(char *s, int l); void init_tts(void); void W_EraseTTSText(W_Window window, int max_width, int y, int width); void W_WriteTTSText(W_Window window, int max_width, int y, int width, char *str, int len); void W_Halo(int x, int y, W_Color color); void video_mode_begin(); --- NEW FILE: defaults.h --- /* defaults.c */ int initDefaults(char *deffile); char *getdefault(char *str); int strcmpi(char *str1, char *str2); int strncmpi(char *str1, char *str2, int max); int booleanDefault(char *def, int preferred); int intDefault(char *def, int preferred); int findDefaults(char *deffile, char *file); int resetdefaults(void); int shipchange(int type); int findfile(char *fname, char *found); From quozl at users.sourceforge.net Mon May 22 08:12:51 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Mon, 22 May 2006 13:12:51 +0000 Subject: [netrek-cvs] client/cow camera.h, NONE, 1.1 camera.c, 1.1, 1.2 input.c, 1.12, 1.13 playback.c, 1.13, 1.14 Message-ID: Update of /cvsroot/netrek/client/cow In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28402 Modified Files: camera.c input.c playback.c Added Files: camera.h Log Message: add camera frame counter Index: camera.c =================================================================== RCS file: /cvsroot/netrek/client/cow/camera.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- camera.c 16 May 2006 12:59:38 -0000 1.1 +++ camera.c 22 May 2006 13:12:48 -0000 1.2 @@ -1,6 +1,7 @@ /* prototype camera support */ #include +#include #include #include #include "defs.h" @@ -13,13 +14,27 @@ static Window rw, tw; static int rx, ry; static unsigned int rdx, rdy; +static int frame; +static int initialised = 0; + +/* maximum file name size */ +#define MAXFRAMEFILENAMESIZE 80 /* set the display used by the camera */ void camera_set_display(Display *arg_disp) { - int depth; - disp = arg_disp; +} + +/* set the window used by the camera */ +void camera_set_window(Window *arg_window) +{ + tw = *arg_window; +} + +void camera_init() { + if (initialised) return; + int depth; scr = ScreenOfDisplay(disp, DefaultScreen(disp)); vis = DefaultVisual(disp, XScreenNumberOfScreen(scr)); depth = DefaultDepth(disp, XScreenNumberOfScreen(scr)); @@ -31,26 +46,30 @@ imlib_context_set_colormap(cm); imlib_context_set_color_modifier(NULL); imlib_context_set_operation(IMLIB_OP_COPY); -} + frame = 0; -/* set the window used by the camera */ -void camera_set_window(Window arg_window, int arg_width, int arg_height) -{ - tw = arg_window; rx = 0; ry = 0; rdx = TWINSIDE; /* restrict to tactical */ rdy = TWINSIDE; imlib_context_set_drawable(tw); + + initialised++; } void camera_snap() { Imlib_Image image; + char *name; + camera_init(); image = imlib_create_image_from_drawable(rw, rx, ry, rdx, rdy, 0); imlib_context_set_image(image); imlib_image_attach_data_value("quality", NULL, 15, NULL); - imlib_save_image("cow-camera-frame.png"); + name = malloc(MAXFRAMEFILENAMESIZE); + snprintf(name, MAXFRAMEFILENAMESIZE-1, "netrek-%03d.png", frame++); + imlib_save_image(name); imlib_free_image_and_decache(); + fprintf(stderr, "camera_snap: %s\n", name); + free(name); } Index: input.c =================================================================== RCS file: /cvsroot/netrek/client/cow/input.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- input.c 16 May 2006 06:25:25 -0000 1.12 +++ input.c 22 May 2006 13:12:48 -0000 1.13 @@ -2,6 +2,9 @@ /* input.c * * $Log$ + * Revision 1.13 2006/05/22 13:12:48 quozl + * add camera frame counter + * * Revision 1.12 2006/05/16 06:25:25 quozl * some compilation fixes * @@ -1107,6 +1110,7 @@ case 'R': case 'j': case 'J': + case 's': pbsetspeed(key); return; break; @@ -1981,6 +1985,7 @@ Key67(void) { sendCoupReq(); + camera_snap(); } Key68(void) --- NEW FILE: camera.h --- /* camera.c */ void camera_set_display(Display *arg_disp); void camera_set_window(Window *arg_window); void camera_init(void); void camera_snap(void); Index: playback.c =================================================================== RCS file: /cvsroot/netrek/client/cow/playback.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- playback.c 27 Jan 2006 09:57:27 -0000 1.13 +++ playback.c 22 May 2006 13:12:48 -0000 1.14 @@ -5,6 +5,9 @@ * Routines neccessary to playback a game recording. * * $Log$ + * Revision 1.14 2006/05/22 13:12:48 quozl + * add camera frame counter + * * Revision 1.13 2006/01/27 09:57:27 quozl * *** empty log message *** * @@ -189,6 +192,7 @@ int pb_num_fast_forward = 0; int pb_sequence_count = 0; int pb_stepping = 0; /* non-zero if doing a step */ +int pb_snapping = 0; /* non-zero if taking camera snapshots */ const char *INDEX_FORMAT = "%d,%d,%d"; const int INDEX_GRANULARITY = 100; @@ -215,14 +219,6 @@ struct player *packetsme; struct player *displayme; -/* We want reverse-playback!!! */ -#define REVERSE_PLAYBACK - -/* Forward declarations for reverse playback */ -void rpb_init(void); -void rpb_analyze(int diskpos, void *packet); -void rpb_dorev(char *buf); - int pbmain(char *name) { @@ -496,6 +492,7 @@ intrupt(); W_Flush(); if (!pb_stepping) usleep(pbdelay); + if (pb_snapping) camera_snap(); } } @@ -639,6 +636,10 @@ jump_idx = 0; jump_str[0] = '\0'; break; + case 's': + fprintf(stderr, "toggle-snap\n"); + pb_snapping = ~pb_snapping; + break; } end: From quozl at users.sourceforge.net Mon May 22 08:13:41 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Mon, 22 May 2006 13:13:41 +0000 Subject: [netrek-cvs] client/cow data.c,1.8,1.9 playerlist.c,1.1.1.1,1.2 Message-ID: Update of /cvsroot/netrek/client/cow In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28872 Modified Files: data.c playerlist.c Log Message: change defaults Index: playerlist.c =================================================================== RCS file: /cvsroot/netrek/client/cow/playerlist.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- playerlist.c 1 Nov 1998 17:24:11 -0000 1.1.1.1 +++ playerlist.c 22 May 2006 13:13:39 -0000 1.2 @@ -13,6 +13,9 @@ * Sort observers separatly: opserver if (pl->p_flags & PFOBSERV) is true. * * $Log$ + * Revision 1.2 2006/05/22 13:13:39 quozl + * change defaults + * * Revision 1.1.1.1 1998/11/01 17:24:11 siegl * COW 3.0 initial revision * */ @@ -89,7 +92,7 @@ int plistStyle = 0; int plistUpdated = FALSE; int sortMyTeamFirst = FALSE; -int sortPlayers = FALSE; +int sortPlayers = TRUE; char updatePlayer[MAXPLAYER + 1]; #ifdef PLIST2 Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/cow/data.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- data.c 21 Aug 2001 20:52:15 -0000 1.8 +++ data.c 22 May 2006 13:13:39 -0000 1.9 @@ -1,6 +1,9 @@ /* data.c * * $Log$ + * Revision 1.9 2006/05/22 13:13:39 quozl + * change defaults + * * Revision 1.8 2001/08/21 20:52:15 siegl * * mouse wheel support @@ -71,11 +74,11 @@ int theirPhaserShrink = 0; int shrinkPhaserOnMiss = 0; -int newDashboard = 0; /* use new graphic * +int newDashboard = 3; /* use new graphic * * * * dashboard, 6/2/93 LAB */ -int old_db = 0; /* should be same as * +int old_db = 3; /* should be same as * * * * newDashboard */ From quozl at users.sourceforge.net Mon May 22 08:14:04 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Mon, 22 May 2006 13:14:04 +0000 Subject: [netrek-cvs] client/cow configure.in,1.18,1.19 Message-ID: Update of /cvsroot/netrek/client/cow In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28931 Modified Files: configure.in Log Message: enable XPM in build again Index: configure.in =================================================================== RCS file: /cvsroot/netrek/client/cow/configure.in,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- configure.in 27 Jan 2006 09:57:27 -0000 1.18 +++ configure.in 22 May 2006 13:14:02 -0000 1.19 @@ -199,32 +199,21 @@ AC_SUBST(NOX11) AC_SUBST(NOWIN32) -if test "$code" = cow; then - if test "$stable" = nope; then - SAVELIBS="$LIBS" - LIBS="$LIBS $XLIBSWDIR $XLIBSWLIB" - SAVEINCS="$INCS" - INCS="$INCS $XINCLUDES" - AC_CHECK_LIB(Xpm, main, [AC_DEFINE(HAVE_XPM) XPMLIBS="-lXpm"]) - AC_CHECK_HEADERS(X11/xpm.h) - LIBS="$SAVELIBS" - INCS="$SAVEINCS" - fi -fi +SAVELIBS="$LIBS" +LIBS="$LIBS $XLIBSWDIR $XLIBSWLIB" +SAVEINCS="$INCS" +INCS="$INCS $XINCLUDES" +AC_CHECK_LIB(Xpm, main, [AC_DEFINE(HAVE_XPM) XPMLIBS="-lXpm"]) +AC_CHECK_HEADERS(X11/xpm.h) +LIBS="$SAVELIBS" +INCS="$SAVEINCS" # Fix link order for Xpm XLIBSW="$XLIBSWDIR $XPMLIBS $XLIBSWLIB" -if test "$code" = server; then - AC_SUBST(XINCLUDES) - AC_SUBST(XLIBSW) - true # dummy line -else - INCS="$INCS $XINCLUDES" - AC_SUBST(INCS) - LIBS="$LIBS $XLIBSW" -fi - +INCS="$INCS $XINCLUDES" +AC_SUBST(INCS) +LIBS="$LIBS $XLIBSW" #-------------------------------------------------------------------- # Check for gmp and mp From modemhero at users.sourceforge.net Mon May 22 17:05:16 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 22 May 2006 22:05:16 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.29, 1.30 clientr.suo, 1.8, 1.9 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv3430 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Fixed longstanding bug with UDP where display was redrawn too frequently (once for udp redraw, and again anytime a TCP packet was sent, like with warning messages). Observer support for show speed on tactical Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- NetrekXP to do list.C 22 May 2006 08:27:52 -0000 1.29 +++ NetrekXP to do list.C 22 May 2006 22:05:13 -0000 1.30 @@ -53,14 +53,7 @@ Bug fixes needed from Paradise: 1) Make it so The login screen doesn't use 100% CPU anymore. -2) Fix this major bug present in all netrek clients since UDP was added: -The client will refresh all the windows and redraw the tactical every time it -gets a packet. This means every time you get a message from a player or a -warning (like "bombing Ori: 5 armies left") the client does an extra refresh, -because all these things are sent with TCP and come in an extra packet. Turn -on double buffering and the 20+ redraws per second you get when bombing or -dropping start to make a difference. -3) Get Jubilee phasers to work at all updates and ship phaser cycle settings +2) Get Jubilee phasers to work at all updates and ship phaser cycle settings Stas's list: - color coded playerlist. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 Binary files /tmp/cvsip0Dtl and /tmp/cvscJheFW differ From modemhero at users.sourceforge.net Mon May 22 17:05:16 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 22 May 2006 22:05:16 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt,1.49,1.50 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv3430/resources/docs Modified Files: changes.txt Log Message: Fixed longstanding bug with UDP where display was redrawn too frequently (once for udp redraw, and again anytime a TCP packet was sent, like with warning messages). Observer support for show speed on tactical Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- changes.txt 22 May 2006 08:27:53 -0000 1.49 +++ changes.txt 22 May 2006 22:05:14 -0000 1.50 @@ -1,4 +1,7 @@ Version TBA: +- fixed longstanding bug with UDP where display was redrawn too frequently (once for udp redraw, +and again anytime a TCP packet was sent, like with warning messages). +- observer support for show speed on tactical - added "showArmy: (on)/off" to show army count of planet you are orbiting. Can be changed in game via planets menu - added "detCircle: on/(off)" to show det circle on tactical. Can be changed in game via From modemhero at users.sourceforge.net Mon May 22 17:05:16 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 22 May 2006 22:05:16 +0000 Subject: [netrek-cvs] client/netrekxp/src local.c, 1.26, 1.27 newwin.c, 1.27, 1.28 socket.c, 1.5, 1.6 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv3430/src Modified Files: local.c newwin.c socket.c Log Message: Fixed longstanding bug with UDP where display was redrawn too frequently (once for udp redraw, and again anytime a TCP packet was sent, like with warning messages). Observer support for show speed on tactical Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- newwin.c 22 May 2006 08:27:53 -0000 1.27 +++ newwin.c 22 May 2006 22:05:14 -0000 1.28 @@ -1399,7 +1399,6 @@ { while (!W_EventsPending ()) { - HANDLE handles[FD_SETSIZE]; time_t elapsed; fd_set rfds; struct timeval tv; @@ -1415,6 +1414,7 @@ FD_SET (sock, &rfds); if (udpSock >= 0) FD_SET (udpSock, &rfds); + // HANDLE handles[FD_SETSIZE]; // WaitForMultipleObjects(32, handles, TRUE, INFINITE); select (32, &rfds, 0, 0, &tv); /* hmm, 32 might be too small */ Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- local.c 22 May 2006 08:27:53 -0000 1.26 +++ local.c 22 May 2006 22:05:14 -0000 1.27 @@ -1135,7 +1135,7 @@ buflen = 1; } - if (j == me) + if (myPlayer(j) || isObsLockPlayer(j)) { switch (me->p_flags & (PFGREEN | PFYELLOW | PFRED)) { @@ -1422,7 +1422,7 @@ } ph_counter++; ph_col += (100/j->p_ship.s_phaserfuse/updatesPerSec); - if (ph_counter == (updatesPerSec - 1)) + if (ph_counter == (updatesPerSec - 1)*j->p_ship.s_phaserfuse/10) { ph_counter = 0; ph_col = 0; Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- socket.c 7 May 2006 16:59:27 -0000 1.5 +++ socket.c 22 May 2006 22:05:14 -0000 1.6 @@ -738,7 +738,11 @@ chan = sock; if (commMode == COMM_TCP) drop_flag = 0; /* just in case */ - retval += doRead (sock); + /* Bug fix for unnecessary redraws with UDP on - reported by TP */ + if (commMode == COMM_UDP) + doRead (sock); + else + retval += doRead (sock); } dotimers (); From modemhero at users.sourceforge.net Tue May 23 02:14:10 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 23 May 2006 07:14:10 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.30, 1.31 clientr.suo, 1.9, 1.10 Message-ID: <20060523082455.C8A3A87815@mx1.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv1919 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Rewrote det circle to work better for observers. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- NetrekXP to do list.C 22 May 2006 22:05:13 -0000 1.30 +++ NetrekXP to do list.C 23 May 2006 07:14:08 -0000 1.31 @@ -13,11 +13,12 @@ 3) Can't bomb enemy 3rd space planets in your T-mode opponent's space. 4) ATT not listed as valid ship even if it's in sysdef. 5) in orbit.c, pftranswarp strangeness. +6) look into swar/war in repair time, with obs and plr - doesn't seem to be any way +for an obs to know what the war decs are of the person he is observing Things that go wrong when short packets are on: 1) cloaking/shields at warp 0 doesn't update someone else's tactical on what you did 2) observer sound messes up when someone flips shields at warp 0 -3) Locking onto robot cause the observer sound to mess up for shields up/down 4) Observers don't get any geno message at all (head to default which is error message) 5) The new smooth turning only working on self, not obs or others - short packets only send headings of 16 positions. @@ -47,8 +48,6 @@ 10) get new bitmaps for resources - implement them with reasonable borders 11) Bug with waraction..was being called even when clicking on border (broke function) ..I added a default return to switch statement, but the underlying bug still remains. -12) look into swar/war in repair time, with obs and plr - doesn't seem to be any way -for an obs to know what the war decs are of the person he is observing 14) cpu leak with double buffering? Bug fixes needed from Paradise: Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 Binary files /tmp/cvs1bcIeq and /tmp/cvsOuaNY8 differ From modemhero at users.sourceforge.net Tue May 23 02:14:10 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 23 May 2006 07:14:10 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt,1.50,1.51 Message-ID: <20060523082453.BDFA8877EE@mx1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv1919/resources/docs Modified Files: changes.txt Log Message: Rewrote det circle to work better for observers. Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- changes.txt 22 May 2006 22:05:14 -0000 1.50 +++ changes.txt 23 May 2006 07:14:08 -0000 1.51 @@ -1,4 +1,5 @@ Version TBA: +- fixed phaser stats reporting for long packets - fixed longstanding bug with UDP where display was redrawn too frequently (once for udp redraw, and again anytime a TCP packet was sent, like with warning messages). - observer support for show speed on tactical From modemhero at users.sourceforge.net Tue May 23 02:14:10 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 23 May 2006 07:14:10 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h,1.21,1.22 Message-ID: <20060523082637.26E7987814@mx1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv1919/include Modified Files: data.h Log Message: Rewrote det circle to work better for observers. Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- data.h 22 May 2006 08:27:52 -0000 1.21 +++ data.h 23 May 2006 07:14:08 -0000 1.22 @@ -46,6 +46,7 @@ extern struct planet pdata[]; extern unsigned int oldalert; +extern int olddetcircle; extern int remap[]; extern int udcounter; extern char *title; From modemhero at users.sourceforge.net Tue May 23 02:14:10 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 23 May 2006 07:14:10 +0000 Subject: [netrek-cvs] client/netrekxp/src data.c, 1.25, 1.26 local.c, 1.27, 1.28 newwin.c, 1.28, 1.29 option.c, 1.17, 1.18 Message-ID: <20060523082453.01EAA87814@mx1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv1919/src Modified Files: data.c local.c newwin.c option.c Log Message: Rewrote det circle to work better for observers. Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- newwin.c 22 May 2006 22:05:14 -0000 1.28 +++ newwin.c 23 May 2006 07:14:08 -0000 1.29 @@ -1414,8 +1414,9 @@ FD_SET (sock, &rfds); if (udpSock >= 0) FD_SET (udpSock, &rfds); + // For replacing select to cut down on cpu usage, but not working yet // HANDLE handles[FD_SETSIZE]; - // WaitForMultipleObjects(32, handles, TRUE, INFINITE); + // WaitForMultipleObjects(32, handles, TRUE, INFINITE); select (32, &rfds, 0, 0, &tv); /* hmm, 32 might be too small */ if (FD_ISSET (sock, &rfds) || Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- local.c 22 May 2006 22:05:14 -0000 1.27 +++ local.c 23 May 2006 07:14:08 -0000 1.28 @@ -614,12 +614,6 @@ } -void -DrawDetCircle() -{ - W_WriteCircle(w, WINSIDE/2, WINSIDE/2, DETDIST/SCALE, W_Red); -} - static void DrawShips (void) { @@ -1111,6 +1105,21 @@ dy - (shield_height / 2), shield, color, w); #endif } + /* Det circle */ + if (detCircle) + { + if (myPlayer(j) || isObsLockPlayer(j)) + { + W_WriteCircle(w, WINSIDE/2, WINSIDE/2, DETDIST/SCALE, W_Red); + olddetcircle = 1; + } + else if (olddetcircle && (me->p_flags & PFOBSERV) && !(me->p_flags & PFPLOCK)) + { + W_WriteCircle(w, WINSIDE/2, WINSIDE/2, DETDIST/SCALE, backColor); + olddetcircle = 0; + } + } + if (j->p_flags & PFCLOAK) /* when cloaked stop here */ continue; @@ -2536,8 +2545,7 @@ DrawStars(); DrawShips (); - if (detCircle) - DrawDetCircle(); + DrawTorps (); DrawPlasmaTorps (); Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- data.c 22 May 2006 08:27:53 -0000 1.25 +++ data.c 23 May 2006 07:14:08 -0000 1.26 @@ -61,6 +61,7 @@ * system support */ int niftyNewMessages = 1; unsigned int oldalert = 0; +int olddetcircle = 0; int remap[16] = { 0, 1, 2, 0, 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0 }; int messpend = 0; #ifdef XTRA_MESSAGE_UI Index: option.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/option.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- option.c 22 May 2006 08:27:53 -0000 1.17 +++ option.c 23 May 2006 07:14:08 -0000 1.18 @@ -905,6 +905,7 @@ else if (op->op_option == &detCircle && detCircle == 0) { W_WriteCircle(w, WINSIDE/2, WINSIDE/2, DETDIST/SCALE, backColor); + olddetcircle = 0; } else if (op->op_option == &partitionPlist) RedrawPlayerList (); From modemhero at users.sourceforge.net Tue May 23 20:14:42 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 24 May 2006 01:14:42 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt,1.51,1.52 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv15093/resources/docs Modified Files: changes.txt Log Message: Some formating spacing fixes. Fixed up changes list to be more accurate. Detcircle done the right way (for clearing). Addition of toggle angular sound on/off to SDL sound window. Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- changes.txt 23 May 2006 07:14:08 -0000 1.51 +++ changes.txt 24 May 2006 01:14:39 -0000 1.52 @@ -1,12 +1,12 @@ Version TBA: - fixed phaser stats reporting for long packets - fixed longstanding bug with UDP where display was redrawn too frequently (once for udp redraw, -and again anytime a TCP packet was sent, like with warning messages). + and again anytime a TCP packet was sent, like with warning messages). - observer support for show speed on tactical - added "showArmy: (on)/off" to show army count of planet you are orbiting. Can be changed - in game via planets menu + in game via planets menu. - added "detCircle: on/(off)" to show det circle on tactical. Can be changed in game via - ship menu + ship menu. - pushing transwarp key will automatically lock you onto your team's base, and send the practice robot request that starts transwarp, if your team has a base, and if you aren't locked onto any player already. For games with multiple bases on the same team (i.e. chaos), you will @@ -35,34 +35,32 @@ - new netrekrc option, "newQuit (on/off)", to use new quit window - new netrekrc option, "planetBitmapGalaxy: (0-3)", same options as planetBitmap, but now you have the choice to change map display planets too! And have map and local planets use different - bitmap sets. + bitmap sets. Can be changed via planets menu. - fixed bug where map window border wasn't being redrawn on death -- shortpackets is now off by default. In the current state of internet connectivity, most people - don't need the reduced packets, which don't send complete information and break certain features - such as which direction other players are moving, robot shields, observer geno messages, - shield/cloak status for warp 0 players, etc. +- shortpackets is now "off" by default. This may be changed at a later date, but for now, + they are off, mainly due to short packets only reporting ship heading to 16 positions, whereas + all bitmap sets in this client use 32 positions, or in the case of the new highres bitmaps, + 256 positions. Some other minor quibbles with short packets on is that observers do not + get geno messages, and shield/cloak status for warp 0 players are not sent by short packets. - fix to problem with bottom and right borders in certain windows (like map) getting overwritten - new planet bitmaps! Using Defcom's art. Changeable via planets menu. - client now recognizes planets that are flagged as "core": this shows up in planet list menu, planet info, and core planets also use different bitmaps in the "New Color" bitmap set - redesigned color1 ori GA so it's not the same pic as base -- double buffering now in (to reduce flicker) - added link to genocide.netrek.org newbie manual to replace broken link - fix to background star jumpiness with short packets off - fixed a bunch of stray pixels in mono color and tinted GA bitmaps - fixed some playerlist bugs, and increased playerlist window from 21 to 32 lines + - *.tamu.edu removed from metaserver listing, and direct connect via -h servername also removed, for those with default logins. This is due to the policy of blocking all players with the default login that comes with the client. -- added new scaling/rotation function that allows us to use higher resolution bitmaps. - The new bitmap set (made by Defcom) are stored in 80x80 pixel blocks (rather than 20x20 - for all other bitmap sets). In addition, only 1 bitmap per ship is needed rather than - 32 for each ship position - the rotation is done on the fly by Windows. To take - advantage of the high res bitmap set, Windows 2000 or later is required. + + - added pretty geno bitmap (no it's not Kathy Ireland, it's a color galaxy picture) - Added new plasma_kill sound (Fatality!) for when someone dies to plasma (note the - sound fires based on kill messages, so if reportKills is off, you won't hear it). -- fixed the reportKills option, it wasn't working, now it does. + sound fires based on kill messages, so if reportKills is off, you won't hear it) +- fixed the reportKills option, it wasn't working, now it does - Added new value (choice 3) for playerListObserver so that observers appear at the bottom of the playerlist. Options are: # What kind of players to list @@ -82,13 +80,13 @@ torp/plasma size and color ratio, the addition of a separate color bitmap for your own weapons fire, and the addition of separate bitmaps for "friendly" and "enemy" weapons, so you can tell who is at peace with you visually by the shading of their weapons. - This option can be toggled in game from the Ships Menu. + This option can be toggled in game from the ships menu. - improved mono plasma explosion animation bitmaps - added a new Playerlist menu to the Options Menus, so the other menus are not as - cluttered, and all playerlist options are now on the same menu page. + cluttered, and all playerlist options are now on the same menu page - added "newSoundAngles: (on)/off" so one can choose to use SDL sound but lose the directionality component (sounds will still be toned down in volume with distance, but - there will be no 3d sound component) + there will be no 3d sound component). Changeable via sound menu (if using SDL sound). - made it so cloak sounds don't play at your twarp flash event (happens at warp 15, 31, 46) - changed self destruct sound so it doesn't sound like enter ship sound - added 2 new message sounds (they can be called by beeplite) @@ -101,7 +99,7 @@ made the red_alert sound file the red alert sound. - change to plasma_other sounds: uses closest other_plasma for sound location, as there is no good way to determine which torp on screen is most recent for sound purposes. -- change to plasma_hit sounds: nothing special other than stereo effect +- change to plasma_hit sounds: nothing special other than stereo effect. - change to phaser sounds: observers now hear phasers! Also fixed it so observers locked onto a player hear self-phaser sounds rather than phaser_other sounds when that player fire phasers @@ -116,53 +114,62 @@ - change to explosion sounds: changed it so observers who are locked onto a player who blows up hear the self-explosion sound rather than the explosion_other sound. - added a minimum distance to have the angular/distance modulation of sound effects (so close - sounds will sound like they are right on top of you). + sounds will sound like they are right on top of you) - added sound reduction with distance and stereo effect based on angle, for sound events that occur on the tactical (weapons, explosions, cloaking, etc). Current list includes cloak, uncloak, torp_other, torp_explosion, explosion_other, phaser_other, plasma_other, - plasma_hit + plasma_hit. - fire_plasma_other sound now works - added "newSound: (on)/off". Allows one to choose not to use the new sound system. Note that this option is not settable in game through options menu, only through the .netrekrc file. - SDL implementation - up to 16 sounds can play at once, with sound volume scaling with the distance of the sound event from your ship -- continuousMouse and continuousMouseFix now default to on +- continuousMouse and continuousMouseFix now default to "on" - fixed the mono fed sb bitmaps so they rotate more cleanly -- updated NetrekXP manual (in docs folder), removed old cow manuals. -- all greyscale and shaded old color starbase bitmaps now rotate. -- the new color fed starbase bitmaps now rotate. -- keeppeace default is now "on". +- updated NetrekXP manual (in docs folder), removed old cow manuals +- all greyscale and shaded old color starbase bitmaps now rotate +- the new color fed starbase bitmaps now rotate +- keeppeace default is now "on" - tidied up the save_options function, fixing some spacing errors, and putting the keymap/buttonmap on the top of the list due to its importance. Also added the sounddir option. -- fixed mainResizeable loading/saving from netrekrc. Also made default setting = on. +- fixed mainResizeable loading/saving (the option that allows you to resize the main + netrek window) from netrekrc. Also made "on" the default setting. - rewrote TTS centering/refresh code so that text is properly centered and clears properly when the message expires. Updated manual to reflect change of tts_pos variable to tts_ypos. -- readded beeplite functionality. Configuration options described in cow manual. +- readded beeplite functionality. Configuration options described in netrekxp manual. Basic rc options are useLite: on/off to turn beeplite on and off, and defLite: on/off to use the default settings. The beeplite option is highly configurable, see manual - for details. Can also be turned on via "Use RCD highlighting" on the Visual Menu. - Default is "on" for both useLite and defLite; + for details. Can also be turned on via the Visual Menu. Default is "on" for both useLite + and defLite. - added preventative measures against loading bitmap files that might not exist - if bitmaps are missing, it defaults to the mono bitmaps -- if dynamicBitmap is set to off, only the necessary bitmap files will load into - memory - cleaned up a lot of dead space sound at the end of sound files, most noticeably, the phaser sound - fixed a bug in the options menu that incorrectly reported whether the phaser window was mapped or not - phasering plasma now has less of an effect on phaser average damage statistics, it is counted as your average damage hit, rather than the previous way of counting it - as a 38 point phaser hit. + as a 38 point phaser hit - added "dynamicBitmap: (on)/off". Enables dynamic bitmap switching from the options - menu + menu. If dynamicBitmap is set to off, only the necessary bitmap files will load into + memory. - renumbered the ship bitmap sets for the colorClient option. Choices are 0=mono, - 1=new color graphics, 2=single color graphics, and 3=shaded single color graphics. - Default setting is still 1. Settings 2 and 3 have the bonus effect of turning your - ship color to white (similar to COW) due to there being a greyscale bitmap library - with matching ship designs. + 1=new color graphics, 2=single color graphics, 3=shaded single color graphics, and + 4 = experimental high res graphics (the new 80x80 bitmaps). Default setting is still 1. + Settings 2 and 3 have the bonus effect of turning your ship color to white (similar to COW) + due to there being a greyscale bitmap library with matching ship designs. +- added a new ship bitmap set (made by Defcom). These bitmaps are stored in 80x80 pixel + blocks (rather than 20x20 for all other bitmap sets). In addition, only 1 bitmap per ship + is needed rather than 32 for each ship position - the rotation is done on the fly by Windows. + To take advantage of the high res bitmap set, Windows 2000 or later may be required, due to + needing a native Windows transform function to have your CPU do the bitmap rotation on + the fly. The long term goal is to replace all client bitmaps with higher resolution versions, + to have the client scale/rotate as necessary, and to increase tactical size so we can + take advantage of the higher quality bitmap sets. +- added new scaling/rotation function for displaying bitmaps. - fixed hightlightFriendlyPhaser option to work again: on for white phasers on hits, off for flicker between team color and white - added some more hints to the hint database From modemhero at users.sourceforge.net Tue May 23 20:14:42 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 24 May 2006 01:14:42 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.31, 1.32 clientr.suo, 1.10, 1.11 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv15093 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Some formating spacing fixes. Fixed up changes list to be more accurate. Detcircle done the right way (for clearing). Addition of toggle angular sound on/off to SDL sound window. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- NetrekXP to do list.C 23 May 2006 07:14:08 -0000 1.31 +++ NetrekXP to do list.C 24 May 2006 01:14:39 -0000 1.32 @@ -48,7 +48,7 @@ 10) get new bitmaps for resources - implement them with reasonable borders 11) Bug with waraction..was being called even when clicking on border (broke function) ..I added a default return to switch statement, but the underlying bug still remains. -14) cpu leak with double buffering? +12) cpu leak with double buffering? Bug fixes needed from Paradise: 1) Make it so The login screen doesn't use 100% CPU anymore. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 Binary files /tmp/cvsEZOwRz and /tmp/cvsIcPSPK differ From modemhero at users.sourceforge.net Tue May 23 20:14:41 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 24 May 2006 01:14:41 +0000 Subject: [netrek-cvs] client/netrekxp/src data.c, 1.26, 1.27 defaults.c, 1.19, 1.20 local.c, 1.28, 1.29 newwin.c, 1.29, 1.30 option.c, 1.18, 1.19 sound.c, 1.11, 1.12 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv15093/src Modified Files: data.c defaults.c local.c newwin.c option.c sound.c Log Message: Some formating spacing fixes. Fixed up changes list to be more accurate. Detcircle done the right way (for clearing). Addition of toggle angular sound on/off to SDL sound window. Index: sound.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/sound.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- sound.c 1 May 2006 00:55:11 -0000 1.11 +++ sound.c 24 May 2006 01:14:39 -0000 1.12 @@ -357,7 +357,8 @@ #define SOUND_INIT MESSAGE_SOUND + 2 #define SOUND_DONE MESSAGE_SOUND + 3 -#define SDL_SOUND_DONE 1 +#define SDL_SOUND_ANGLE 1 +#define SDL_SOUND_DONE 2 static void soundrefresh (int i); static void sdlsoundrefresh (int i); @@ -389,6 +390,11 @@ sprintf (buf, "Sound is turned %s", (sound_toggle == 1) ? "ON" : "OFF"); } + else if (i == SDL_SOUND_ANGLE) + { + sprintf (buf, "Angular sound is turned %s", + (newSoundAngles) ? "ON" : "OFF"); + } else if (i == SDL_SOUND_DONE) { strcpy (buf, "Done"); @@ -514,7 +520,12 @@ { if (sound_init) sound_toggle = (sound_toggle == 1) ? 0 : 1; - soundrefresh (SOUND_TOGGLE); + sdlsoundrefresh (SOUND_TOGGLE); + } + else if (i == SDL_SOUND_ANGLE) + { + newSoundAngles = (newSoundAngles) ? 0 : 1; + sdlsoundrefresh (SDL_SOUND_ANGLE); } else { Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- newwin.c 23 May 2006 07:14:08 -0000 1.29 +++ newwin.c 24 May 2006 01:14:39 -0000 1.30 @@ -998,7 +998,7 @@ if (newSound) { soundWin = W_MakeMenu("sound", WINSIDE + 20, -BORDER + 10, 30, - 2, NULL, 2); + 3, NULL, 2); W_SetWindowKeyDownHandler(soundWin, sdlsoundaction); W_SetWindowButtonHandler(soundWin, sdlsoundaction); W_DefineArrowCursor(soundWin); Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- local.c 23 May 2006 07:14:08 -0000 1.28 +++ local.c 24 May 2006 01:14:39 -0000 1.29 @@ -1110,14 +1110,13 @@ { if (myPlayer(j) || isObsLockPlayer(j)) { - W_WriteCircle(w, WINSIDE/2, WINSIDE/2, DETDIST/SCALE, W_Red); - olddetcircle = 1; + W_WriteCircle(w, WINSIDE/2, WINSIDE/2, DETDIST/SCALE, W_Red); + clearzone[0][clearcount] = WINSIDE/2 - (DETDIST/SCALE); + clearzone[1][clearcount] = WINSIDE/2 - (DETDIST/SCALE); + clearzone[2][clearcount] = 2*DETDIST/SCALE; + clearzone[3][clearcount] = 2*DETDIST/SCALE; + clearcount++; } - else if (olddetcircle && (me->p_flags & PFOBSERV) && !(me->p_flags & PFPLOCK)) - { - W_WriteCircle(w, WINSIDE/2, WINSIDE/2, DETDIST/SCALE, backColor); - olddetcircle = 0; - } } if (j->p_flags & PFCLOAK) /* when cloaked stop here */ Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- defaults.c 22 May 2006 08:27:53 -0000 1.19 +++ defaults.c 24 May 2006 01:14:39 -0000 1.20 @@ -776,7 +776,7 @@ int notdone; unsigned char c; char *str; - struct stringlist *sl; + struct stringlist *sl; #ifdef MULTILINE_MACROS unsigned char keysused[256]; @@ -1373,14 +1373,14 @@ if (findfile (NETREKRC, file)) return 1; - if (findfile (NETREKRCTXT, file)) - return 1; + if (findfile (NETREKRCTXT, file)) + return 1; if (findfile (XTREKRC, file)) return 1; - if (findfile (XTREKRCTXT, file)) - return 1; + if (findfile (XTREKRCTXT, file)) + return 1; #ifdef SYSTEM_DEFAULTFILE /* now try for a system default defaults file */ @@ -1401,8 +1401,8 @@ char tmp[100]; int i; - if (strlen (pigcall) == 0) - sprintf (pigcall, "Netrek XP Mod (%s) - the smarter netrek eXPerience!", mvers); + if (strlen (pigcall) == 0) + sprintf (pigcall, "Netrek XP 2006 (%s) - the smarter netrek eXPerience!", mvers); timerType = intDefault ("timerType", timerType); if (timerType < T_NONE || timerType >= T_TOTAL) @@ -1415,7 +1415,7 @@ newSoundAngles = booleanDefault ("newSoundAngles", newSoundAngles); tpDotDist = intDefault ("tpDotDist", tpDotDist); omitTeamLetter = booleanDefault ("omitTeamLetter", omitTeamLetter); - beepOnPrivateMessage = booleanDefault ("beepOnPrivateMessage", beepOnPrivateMessage); + beepOnPrivateMessage = booleanDefault ("beepOnPrivateMessage", beepOnPrivateMessage); viewBox = booleanDefault ("viewBox", viewBox); warpStreaks = booleanDefault ("warpStreaks", warpStreaks); showStars = booleanDefault ("showStars", showStars); @@ -1538,7 +1538,7 @@ agriCAPS = booleanDefault ("agriCAPS", agriCAPS); agriColor = intDefault ("agriColor", agriColor); - playerListMessaging = booleanDefault ("playerListMessaging", playerListMessaging); + playerListMessaging = booleanDefault ("playerListMessaging", playerListMessaging); highlightFriendlyPhasers = booleanDefault ("highlightFriendlyPhasers", highlightFriendlyPhasers); Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- data.c 23 May 2006 07:14:08 -0000 1.26 +++ data.c 24 May 2006 01:14:39 -0000 1.27 @@ -61,7 +61,6 @@ * system support */ int niftyNewMessages = 1; unsigned int oldalert = 0; -int olddetcircle = 0; int remap[16] = { 0, 1, 2, 0, 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0 }; int messpend = 0; #ifdef XTRA_MESSAGE_UI Index: option.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/option.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- option.c 23 May 2006 07:14:08 -0000 1.18 +++ option.c 24 May 2006 01:14:39 -0000 1.19 @@ -901,12 +901,6 @@ redrawall = 1; oldalert = 0; /* Force a border refresh */ } - /* Let's see if this is we need to clear the det circle */ - else if (op->op_option == &detCircle && detCircle == 0) - { - W_WriteCircle(w, WINSIDE/2, WINSIDE/2, DETDIST/SCALE, backColor); - olddetcircle = 0; - } else if (op->op_option == &partitionPlist) RedrawPlayerList (); else if (op->op_option == &sortPlayers) From modemhero at users.sourceforge.net Tue May 23 20:14:41 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 24 May 2006 01:14:41 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h,1.22,1.23 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv15093/include Modified Files: data.h Log Message: Some formating spacing fixes. Fixed up changes list to be more accurate. Detcircle done the right way (for clearing). Addition of toggle angular sound on/off to SDL sound window. Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- data.h 23 May 2006 07:14:08 -0000 1.22 +++ data.h 24 May 2006 01:14:39 -0000 1.23 @@ -46,7 +46,6 @@ extern struct planet pdata[]; extern unsigned int oldalert; -extern int olddetcircle; extern int remap[]; extern int udcounter; extern char *title; From modemhero at users.sourceforge.net Tue May 23 20:41:59 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 24 May 2006 01:41:59 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C,1.32,1.33 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25248 Modified Files: NetrekXP to do list.C Log Message: Removed tamu.edu block, as it now allows new-be-nice logins. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- NetrekXP to do list.C 24 May 2006 01:14:39 -0000 1.32 +++ NetrekXP to do list.C 24 May 2006 01:41:56 -0000 1.33 @@ -38,21 +38,22 @@ - option server/servernick/servertype needs to be saved 5) A lot of annoying pop up windows (like macro window, default controls) should be closeable by shift right click. -6) Implement Defcom's new planet and ship bitmaps -6a) Border issue - quite complex problem, how to know the borders to obey after the bitmap - is rotated, and where to center bitmap -7) login not read in before metaserver info (for metablocking purposes) -8) BUG : Lock on someone as obs, then delock (or whey they die), screen doesn't go blank it -stays in same drawn state. Only when short packets off and doublebuffering on. +***6) Implement Defcom's new planet and ship bitmaps +***6a) Border issue - quite complex problem, how to know the borders to obey after the bitmap +*** is rotated, and where to center bitmap +***7) login not read in before metaserver info (for metablocking purposes) +***8) BUG : Lock on someone as obs, then delock (or whey they die), screen doesn't go blank it +***stays in same drawn state. Only when short packets off and doublebuffering on. 9) Use nebula pic -10) get new bitmaps for resources - implement them with reasonable borders +10) rewrite placement/refresh of new resource bitmaps to work better with a scaled tactical 11) Bug with waraction..was being called even when clicking on border (broke function) ..I added a default return to switch statement, but the underlying bug still remains. 12) cpu leak with double buffering? Bug fixes needed from Paradise: 1) Make it so The login screen doesn't use 100% CPU anymore. -2) Get Jubilee phasers to work at all updates and ship phaser cycle settings +2) Get Jubilee phasers to work at all updates and ship phaser cycle settings - and set + the jubilee counter to 0 when the phaser end packet is received. Stas's list: - color coded playerlist. From modemhero at users.sourceforge.net Tue May 23 20:41:59 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 24 May 2006 01:41:59 +0000 Subject: [netrek-cvs] client/netrekxp/src parsemeta.c,1.7,1.8 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25248/src Modified Files: parsemeta.c Log Message: Removed tamu.edu block, as it now allows new-be-nice logins. Index: parsemeta.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/parsemeta.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- parsemeta.c 12 May 2006 01:58:38 -0000 1.7 +++ parsemeta.c 24 May 2006 01:41:57 -0000 1.8 @@ -172,9 +172,8 @@ metablock (char *host) /* Block connections to known servers not willing to handle default logins */ { - if ( ((!strcmp(login, "new-be-nice") || !strcmp(login, "netrek-player")) && (strstr(host,".tamu.edu") != NULL)) - || (strstr(host,".tamu.edu") != NULL) ) - return 1; +// if ( ((!strcmp(login, "new-be-nice") || !strcmp(login, "netrek-player")) && (strstr(host,".antinewbie.server") != NULL)) +// return 1; return 0; } From modemhero at users.sourceforge.net Tue May 23 20:41:59 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 24 May 2006 01:41:59 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt,1.52,1.53 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25248/resources/docs Modified Files: changes.txt Log Message: Removed tamu.edu block, as it now allows new-be-nice logins. Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- changes.txt 24 May 2006 01:14:39 -0000 1.52 +++ changes.txt 24 May 2006 01:41:57 -0000 1.53 @@ -51,12 +51,6 @@ - fix to background star jumpiness with short packets off - fixed a bunch of stray pixels in mono color and tinted GA bitmaps - fixed some playerlist bugs, and increased playerlist window from 21 to 32 lines - -- *.tamu.edu removed from metaserver listing, and direct connect via -h servername - also removed, for those with default logins. This is due to the policy of blocking - all players with the default login that comes with the client. - - - added pretty geno bitmap (no it's not Kathy Ireland, it's a color galaxy picture) - Added new plasma_kill sound (Fatality!) for when someone dies to plasma (note the sound fires based on kill messages, so if reportKills is off, you won't hear it) From modemhero at users.sourceforge.net Wed May 24 04:10:10 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 24 May 2006 09:10:10 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C,1.33,1.34 Message-ID: <20060524091209.BDD4387819@mx1.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30016 Modified Files: NetrekXP to do list.C Log Message: Fix to bugs with observers and screen not being redrawn on observee death. Fix to short packet position reporting to correctly report negative positions (i.e. where players get sent on death). Some more tidying up of todo list. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- NetrekXP to do list.C 24 May 2006 01:41:56 -0000 1.33 +++ NetrekXP to do list.C 24 May 2006 09:10:08 -0000 1.34 @@ -17,10 +17,10 @@ for an obs to know what the war decs are of the person he is observing Things that go wrong when short packets are on: -1) cloaking/shields at warp 0 doesn't update someone else's tactical on what you did -2) observer sound messes up when someone flips shields at warp 0 -4) Observers don't get any geno message at all (head to default which is error message) -5) The new smooth turning only working on self, not obs or others - short packets only +1) cloaking/shields at warp 0 doesn't update someone else's tactical on what you did if +there is no movement anywhere on map, and observer sound also messes up +2) Observers don't get any geno message at all (head to default which is error message) +3) The new smooth turning only working on self, not obs or others - short packets only send headings of 16 positions. Things to do: @@ -41,9 +41,8 @@ ***6) Implement Defcom's new planet and ship bitmaps ***6a) Border issue - quite complex problem, how to know the borders to obey after the bitmap *** is rotated, and where to center bitmap -***7) login not read in before metaserver info (for metablocking purposes) -***8) BUG : Lock on someone as obs, then delock (or whey they die), screen doesn't go blank it -***stays in same drawn state. Only when short packets off and doublebuffering on. +7) Workable windows installer would be nice +8) Include good rc in source 9) Use nebula pic 10) rewrite placement/refresh of new resource bitmaps to work better with a scaled tactical 11) Bug with waraction..was being called even when clicking on border (broke function) From modemhero at users.sourceforge.net Wed May 24 04:10:10 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 24 May 2006 09:10:10 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt,1.53,1.54 Message-ID: <20060524091208.69879877EF@mx1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30016/resources/docs Modified Files: changes.txt Log Message: Fix to bugs with observers and screen not being redrawn on observee death. Fix to short packet position reporting to correctly report negative positions (i.e. where players get sent on death). Some more tidying up of todo list. Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- changes.txt 24 May 2006 01:41:57 -0000 1.53 +++ changes.txt 24 May 2006 09:10:08 -0000 1.54 @@ -1,4 +1,9 @@ Version TBA: +- fixed bug with observers with short packets on which was causing incorrect drawing of local + map in the case of losing player/planet lock (most noticeable effect was a single background + star being drawn at all times, instead of the usual blank local). This was actually both a + server side and client side fix, relating to an incorrect sign on the player position packet, + but I mention it here. - fixed phaser stats reporting for long packets - fixed longstanding bug with UDP where display was redrawn too frequently (once for udp redraw, and again anytime a TCP packet was sent, like with warning messages). From modemhero at users.sourceforge.net Wed May 24 04:10:10 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 24 May 2006 09:10:10 +0000 Subject: [netrek-cvs] client/netrekxp/src local.c, 1.29, 1.30 short.c, 1.7, 1.8 Message-ID: <20060524091631.8B50D14583E@mx2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30016/src Modified Files: local.c short.c Log Message: Fix to bugs with observers and screen not being redrawn on observee death. Fix to short packet position reporting to correctly report negative positions (i.e. where players get sent on death). Some more tidying up of todo list. Index: short.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/short.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- short.c 12 May 2006 01:58:38 -0000 1.7 +++ short.c 24 May 2006 09:10:08 -0000 1.8 @@ -706,8 +706,8 @@ { /* S_P2 */ struct player_s2_spacket *pa2 = (struct player_s2_spacket *) sbuf; - x = SCALE * ntohs (pa2->x); - y = SCALE * ntohs (pa2->y); + x = SCALE * (short) ntohs (pa2->x); + y = SCALE * (short) ntohs (pa2->y); new_flags (ntohl (pa2->flags), 0); } else Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- local.c 24 May 2006 01:14:39 -0000 1.29 +++ local.c 24 May 2006 09:10:08 -0000 1.30 @@ -2535,7 +2535,10 @@ clearLocal (); - if (me->p_x < 0) + /* Keep redrawing for double buffered observers who get set out of normal gameplay bounds, + whether due to locking onto an ineligible planet, or observing a player who dies - + otherwise screen doesn't refresh*/ + if (me->p_x < 0 && !doubleBuffering && !(me->p_flags & PFOBSERV)) return; DrawPlanets (); From modemhero at users.sourceforge.net Thu May 25 03:43:59 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 25 May 2006 08:43:59 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.34, 1.35 build.cmd, 1.16, 1.17 clientr.suo, 1.11, 1.12 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv2025 Modified Files: NetrekXP to do list.C build.cmd clientr.suo Log Message: Added global variable for metacache name. Added name, login, metacache to list of saved options. Added a good default netrekrc to source, removed crappy sample_xtrekrc. Fixed wrong planet positions in earth bitmap. Logic fix to detcircle display. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- NetrekXP to do list.C 24 May 2006 09:10:08 -0000 1.34 +++ NetrekXP to do list.C 25 May 2006 08:43:56 -0000 1.35 @@ -2,8 +2,7 @@ 1) Change recommendation on metaserver from off to on! 2) there should be some sort of chance to give default resolution in GUI, which then maps windows accordingly. -3) Default keymap/buttonamp is horrible. -4) Add chance for player to input their default login name - tired of seeing +3) Add chance for player to input their default login name - tired of seeing new-be-nice!! Things not gonna happen, or server problems: @@ -31,7 +30,6 @@ noticeable with viewbox disappearing at low speeds , depending on what length of menu you flip to. Also, closing hint window has same effect 4) Save options -- name/login/meta stuff needs to be saved - Default windows placements need to be saved - uselite options need to be saved - review window mapping needs to be saved @@ -41,13 +39,15 @@ ***6) Implement Defcom's new planet and ship bitmaps ***6a) Border issue - quite complex problem, how to know the borders to obey after the bitmap *** is rotated, and where to center bitmap +***6b) Bottom and right borders are 1 pixel too short with double buffering on 7) Workable windows installer would be nice -8) Include good rc in source 9) Use nebula pic 10) rewrite placement/refresh of new resource bitmaps to work better with a scaled tactical 11) Bug with waraction..was being called even when clicking on border (broke function) ..I added a default return to switch statement, but the underlying bug still remains. -12) cpu leak with double buffering? +12) Is there a cpu leak with double buffering? +13) Use masking for things like player team/letter display on galactic. Ship draw on tactical +(have it overwrite the planet/wrench/gas/army for example, not just combine colors). Bug fixes needed from Paradise: 1) Make it so The login screen doesn't use 100% CPU anymore. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 Binary files /tmp/cvsUEJ9zP and /tmp/cvsXmbMUV differ Index: build.cmd =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/build.cmd,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- build.cmd 16 May 2006 05:10:13 -0000 1.16 +++ build.cmd 25 May 2006 08:43:56 -0000 1.17 @@ -482,6 +482,7 @@ copy resources\docs\*.doc %InstCWD%\netrek\docs copy resources\docs\*.dat %InstCWD%\netrek\docs copy resources\docs\*.txt %InstCWD%\netrek\docs +copy resources\docs\netrekrc %InstCWD%\netrek mkdir %InstCWD%\netrek\sounds copy resources\sounds\*.wav %InstCWD%\netrek\sounds From modemhero at users.sourceforge.net Thu May 25 03:43:59 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 25 May 2006 08:43:59 +0000 Subject: [netrek-cvs] client/netrekxp/src data.c, 1.27, 1.28 defaults.c, 1.20, 1.21 local.c, 1.30, 1.31 parsemeta.c, 1.8, 1.9 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv2025/src Modified Files: data.c defaults.c local.c parsemeta.c Log Message: Added global variable for metacache name. Added name, login, metacache to list of saved options. Added a good default netrekrc to source, removed crappy sample_xtrekrc. Fixed wrong planet positions in earth bitmap. Logic fix to detcircle display. Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- local.c 24 May 2006 09:10:08 -0000 1.30 +++ local.c 25 May 2006 08:43:57 -0000 1.31 @@ -2538,7 +2538,7 @@ /* Keep redrawing for double buffered observers who get set out of normal gameplay bounds, whether due to locking onto an ineligible planet, or observing a player who dies - otherwise screen doesn't refresh*/ - if (me->p_x < 0 && !doubleBuffering && !(me->p_flags & PFOBSERV)) + if (me->p_x < 0 && !(doubleBuffering && (me->p_flags & PFOBSERV))) return; DrawPlanets (); Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- defaults.c 24 May 2006 01:14:39 -0000 1.20 +++ defaults.c 25 May 2006 08:43:57 -0000 1.21 @@ -84,7 +84,7 @@ "0 - mono", "1 - new color bitmaps (default)", "2 - old color bitmaps", - "3 - shaded old color bitmaps" + "3 - shaded old color bitmaps", "4 - experimental high res bitmaps", NULL } @@ -1819,6 +1819,28 @@ sprintf (str, "Saving options to: %s", save_file); warning (str); + // Default character name + if (pseudo != NULL) + { + if (saveBig) + fputs ("# Default character name\n", fp); + sprintf (str, "name: %s\n", pseudo); + fputs (str, fp); + if (saveBig) + fputs ("\n", fp); + } + + // Login + if (login != NULL) + { + if (saveBig) + fputs ("# Login name\n", fp); + sprintf (str, "login: %s\n", login); + fputs (str, fp); + if (saveBig) + fputs ("\n", fp); + } + // Let's print buttonmap str[0] = '\0'; str1[0] = '\0'; @@ -1960,6 +1982,17 @@ if (saveBig) fputs ("\n", fp); } + + // metacache + if (metaCache != NULL) + { + if (saveBig) + fputs ("# Metacache file\n", fp); + sprintf (str, "metaCache: %s\n", metaCache); + fputs (str, fp); + if (saveBig) + fputs ("\n", fp); + } // player list if (strlen (plistLayout) != 0) Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- data.c 24 May 2006 01:14:39 -0000 1.27 +++ data.c 25 May 2006 08:43:57 -0000 1.28 @@ -226,6 +226,7 @@ char *metaServer[] = {"metaserver.us.netrek.org", "metaserever2.us.netrek.org"}; int metaPort = 3521; +char *metaCache = NULL; #ifdef METAPING int metaPing = 1; /* ICMP ping the metaserverlist */ #endif Index: parsemeta.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/parsemeta.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- parsemeta.c 24 May 2006 01:41:57 -0000 1.8 +++ parsemeta.c 25 May 2006 08:43:57 -0000 1.9 @@ -332,7 +332,6 @@ /* Read from the meta-server. Return TRUE on success and FALSE on failure. */ { FILE *out; - char *cacheName; char cacheFileName[PATH_MAX]; char tmpFileName[PATH_MAX]; char *sockbuf, *buf; @@ -387,11 +386,11 @@ return 0; } - cacheName = stringDefault ("metaCache"); - if (cacheName && !findfile (cacheName, cacheFileName)) - strcpy (cacheFileName, cacheName); /* overwrite existing file if possible */ + metaCache = stringDefault ("metaCache"); + if (metaCache && !findfile (metaCache, cacheFileName)) + strcpy (cacheFileName, metaCache); /* overwrite existing file if possible */ - if (cacheName) + if (metaCache) { len = strlen (cacheFileName); strcpy (tmpFileName, cacheFileName); @@ -427,11 +426,11 @@ /* Can't rename file to existing name under NT */ #ifdef _MSC_VER - _unlink (cacheName); + _unlink (metaCache); #else - unlink (cacheName); + unlink (metaCache); #endif - if (rename (tmpFileName, cacheName) == -1) + if (rename (tmpFileName, metaCache) == -1) perror ("Could not write to cache file"); } @@ -447,27 +446,26 @@ /* Read from the cache. Return TRUE on success and FALSE on failure. */ { FILE *in; - char *cacheName; struct servers *slist; char *sockbuf, *buf; int bufleft = BUF - 1; int len; char cacheFileName[PATH_MAX]; - cacheName = stringDefault ("metaCache"); + metaCache = stringDefault ("metaCache"); - if (!cacheName) + if (!metaCache) { - LineToConsole ("You must define the .xtrekrc variable `metaCache' in\n"); + LineToConsole ("You must define the netrekrc variable `metaCache' in\n"); LineToConsole ("order to use the `show known servers' option.\n"); return 0; } - else if (!findfile (cacheName, cacheFileName) + else if (!findfile (metaCache, cacheFileName) || !(in = fopen (cacheFileName, "r"))) { LineToConsole ( "The metaCache file `%s' is empty or not accessable.\n", - cacheName); + metaCache); return 0; } From modemhero at users.sourceforge.net Thu May 25 03:43:59 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 25 May 2006 08:43:59 +0000 Subject: [netrek-cvs] client/netrekxp/resources/planlibm/color earth.bmp, 1.2, 1.3 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/planlibm/color In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv2025/resources/planlibm/color Modified Files: earth.bmp Log Message: Added global variable for metacache name. Added name, login, metacache to list of saved options. Added a good default netrekrc to source, removed crappy sample_xtrekrc. Fixed wrong planet positions in earth bitmap. Logic fix to detcircle display. Index: earth.bmp =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/planlibm/color/earth.bmp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvsLtxw6d and /tmp/cvsBAtial differ From modemhero at users.sourceforge.net Thu May 25 03:43:59 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 25 May 2006 08:43:59 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h,1.23,1.24 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv2025/include Modified Files: data.h Log Message: Added global variable for metacache name. Added name, login, metacache to list of saved options. Added a good default netrekrc to source, removed crappy sample_xtrekrc. Fixed wrong planet positions in earth bitmap. Logic fix to detcircle display. Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- data.h 24 May 2006 01:14:39 -0000 1.23 +++ data.h 25 May 2006 08:43:57 -0000 1.24 @@ -106,6 +106,7 @@ #ifdef META extern char *metaServer[]; extern int metaPort; +extern char *metaCache; #ifdef METAPING extern int metaPing; #endif From modemhero at users.sourceforge.net Thu May 25 03:43:59 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 25 May 2006 08:43:59 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs netrekrc, NONE, 1.1 changes.txt, 1.54, 1.55 sample_xtrekrc.txt, 1.3, NONE Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv2025/resources/docs Modified Files: changes.txt Added Files: netrekrc Removed Files: sample_xtrekrc.txt Log Message: Added global variable for metacache name. Added name, login, metacache to list of saved options. Added a good default netrekrc to source, removed crappy sample_xtrekrc. Fixed wrong planet positions in earth bitmap. Logic fix to detcircle display. --- sample_xtrekrc.txt DELETED --- --- NEW FILE: netrekrc --- # Default character name name: guest # Login name login: netrek_player # Key mapping keymap: Ppa%d_eyftg^jmnrpPrls3tfuwvDwsye d # Key to switch to macro mode # TAB, ESC could be used too macroKey: m # Show AGRI planet names in caps on map agriCAPS: on # Color of AGRI planet name on the map # 0 - owner race color # 1 - white # 2 - gray agriColor: 1 # allow mouse wheel to produce action in non-scrollable windows allowWheelActions: on # Autoquit timer (default 60) autoQuit: 60 # Base UDP local port baseUdpLocalPort: 0 # Beep if received private message beepOnPrivateMessage: off # What type of ship bitmaps to use # 0 - mono # 1 - new color bitmaps (default) # 2 - old color bitmaps # 3 - shaded old color bitmaps # 4 - experimental high res bitmaps colorClient: 4 # Display color phasers colorfulPhasers: on # Use colored bitmaps for torps and plasmas colorWeapons: on # Show tractor/pressor after lock continueTractor: on # Use mouse for continuous steering and firing continuousMouse: on # When in continuousMouse mode allow more than one button to be pressed # to generate more actions continuousMouseFix: on # Show det circle around your ship detCircle: on # Disable Windows and Context Keys disableWinkey: on # Use double buffering to reduce screen flicker doubleBuffering: on # Allow switching of ship bitmaps in game. With this option disabled # not all bitmaps load into memory. This option is thus not changeable # in game. Do not attempt to edit your netrekrc to turn dynamic bitmaps # on and then reload the netrekrc with the & key - restart the client instead. dynamicBitmaps: on # Angle between enemy phaser lines # 1-10 range enemyPhasers: 1 # Change window border on enemy approach extraAlertBorder: on # Number of colors the client will display # 0 - find best available color option (default) # 1 - 16 colors # 2 - 256 colors # 3 - true color forceDisplay: 1 # Outdated option. Will force display to 16 colors # (but only works if forceDisplay = 0). forceMono: off # Highlight friendly phasers highlightFriendlyPhasers: on # Ignore Caps Lock key state ignoreCaps: on # How many updates to keep info window on (default 15) keepInfo: 15 # Keep peace with enemy team after death keepPeace: on # Log all messages to file. Requires "logfile" option logging: off # Make main window resizeable mainResizeable: on # Message hold threshold messageHoldThresh: 0 # Output message to local window while typing # 0 - nowhere # 1 - top of the window # 2 - bottom of the window messageHUD: 0 # Metaserver port metaPort: 3521 # What servers to get from metaserver # 0 - with players # 1 - as above + with queue # 2 - as above + with nobody playing # 3 - as above + timed out servers (default) # 4 - as above + servers that metaserver could not connect to metaStatusLevel: 3 # Use ICMP to ping the metaserver list metaPing: on # Mouse motion threshold motionThresh: 0 # Use mouse buttons as Shift keys mouseAsShift: off # Paint dark scrollbars mungScrollbarColors: off # Type of dashboard # 0 - Text # 1 - COW # 2 - KRP (default) # 3 - LABs newDashboard: 1 # Indent RCD messages newDistress: off # Use new quit window newQuit: on # Use new layered, stereo sound newSound: on # Use 3D sound effects (only works if newSound is on) newSoundAngles: off # Omit team letter on galaxy omitTeamLetter: off # Add space between teams in player list partitionPlist: off # Shrink our phaser by x/16 of its length # 0-16 range for COW style phaser shrink # 0-11 range for BRMH style phaser shrink phaserShrink: 0 # Style of phaser srhinkage # 0 - COW style # 1 - BRMH style phaserShrinkStyle: 0 # Log phaser statistics phaserStats: on # Show phaser window phaserWindow: off # Type of planet bitmaps on local map # 0 - Bronco (default) # 1 - Moo # 2 - Rabbitear # 3 - New color planetBitmap: 3 # Type of planet bitmaps on galactic map # 0 - Bronco (default) # 1 - Moo # 2 - Rabbitear # 3 - New color planetBitmapGalaxy: 3 # Suppose that players with letter greater than 'f' are observers playerListHack: off # Enable mouse clicks in player list to send messages playerListMessaging: on # What kind of players to list # 0 - all (default) # 1 - players # 2 - observers # 3 - players, then observers playerListObserver: 3 # Predefined player list # 0 - use style from playerList # 1 - old style "nTRNKWLr O D d" # 2 - COW style "nTR N K lrSd" (default) # 3 - kill watch style "nTK RNlr Sd" # 4 - BRMH style "nTR N K l M" playerListStyle: 4 # Port to connect port: 2592 # Use new UDP code portSwap: on # Number of updates before redraw redrawDelay: 0 # Reject macros rejectMacro: off # Report kills reportKills: on # Save options with comments saveBig: on # Save macros to saveFile saveMacro: on # Save RCD to saveFile saveRCD: on # Save RCM to saveFile saveRCM: on # Shift+Mouse gives additional commands shiftedMouse: on # Show tractor/pressor for all players # This option actually helps to turn the feature off # Server god decides whether to enable it on server showAllTractorPressor: on # Show army count of planet you are orbiting showArmy: on # Show hints window showHints: off # Show hockey lines on map # Works only on hockey server showHockeyLinesMap: off # Show hockey lines on local # Works only on hockey server showHockeyLinesLocal: off # Show hockey score on the galaxy top left corner # Works only on hockey server showHockeyScore: on # Cross independent planets with X showIND: off # Where to show lock triangle # 0 - nowhere # 1 - map # 2 - local # 3 - both (default) showLock: 3 # Show MOTD if waiting on queue showMotd: on # Show my speed on local showMySpeed: on # Show planet names on local showPlanetNames: on # Show planet owner on galaxy showPlanetOwner: off # Draw background stars showStars: on # Show statistics window showStats: off # Draw lines for tractor/pressor showTractorPressor: on # Shrink phasers if missed shrinkPhaserOnMiss: off # Put my team first in the player list sortMyTeamFirst: off # Sort players by team sortPlayers: on # Enable sound sound: on # Shrink enemy phaser by x/16 of its length # 1-16 range theirPhaserShrink: 0 # Type of dashboard timer to show # 0 - don't show timer # 1 - show current time # 2 - show time on server # 3 - show time in ship # 4 - show user-set time timerType: 1 # Distance between tractor/pressor dots tpDotDist: 10 # Use short packets for communications tryShort: on # Use UDP for communications tryUdp: on # Type of incoming UDP traffic # 0 - TCP # 1 - simple UDP (default) # 2 - fat UDP udpClientReceive: 1 # Type of outgoing UDP traffic # 0 - TCP # 1 - simple UDP (default) # 2 - enforced UDP (state) # 3 - enfotrced UDP (state & weapons) udpClientSend: 1 # Print UDP debug information udpDebug: 0 # Check sequence of UDP traffic udpSequenceCheck: on # How much updates to send/receive # 1-10 range updatesPerSec: 10 # Use beeplite useLite: on # Use default beeplite settings defLite: on # Use RSA verification useRsa: on # Change shields color on ship damage varyShields: on # Show limits of tactical display on galaxy viewBox: on # Change shields color on enemy approach warnShields: off # Draw warp streaks while transwarping to starbase warpStreaks: on # Enable internal windows moving windowMove: on # Two characters to show cloaked player on map window cloakChars: ?? # Sound directory sounddir: .\sounds # Metacache file metaCache: metacache # Custom style for player list # ' ' - White Space # 'b' - Armies Bombed # 'd' - Damage Inflicted (DI) # 'k' - Max Kills # 'l' - Login Name # 'n' - Ship Number# 'p' - Planets Taken # 'r' - Ratio # 's' - Speed # 'v' - Deaths per hour # 'w' - War staus # 'B' - Bombing # 'C' - Curt (short) rank # 'D' - Defense # 'H' - Hours Played # 'K' - Kills # 'L' - Losses # 'M' - Display, Host Machine # 'N' - Name # 'O' - Offense # 'P' - Planets # 'R' - Rank # 'S' - Total Rating (stats) # 'T' - Ship Type # 'V' - Kills per hour # 'W' - Wins playerList: nTR N K l M ## Window Options WaitMotd.mapped: on netrek.geometry: 1024x768 local.parent: netrek map.parent: netrek help.parent: netrek help.geometry: 500x25+0+525 planet.parent: netrek planet.geometry: +660+0 message.parent: netrek message.geometry: 502x19+508+504 message.mapped: on warn.parent: netrek warn.geometry: 502x18+508+523 warn.mapped: on tstat.parent: netrek tstat.geometry: 506x45+0+504 tstat.mapped: on review.parent: netrek review.geometry: 82x20+508+542 review.mapped: off review_your.parent: netrek review_your.geometry: 82x4+508+542 review_your.mapped: on review_team.parent: netrek review_team.geometry: 82x6+508+591 review_team.mapped: on review_all.parent: netrek review_all.geometry: 82x4+508+660 review_all.mapped: on review_phaser.parent: netrek review_phaser.geometry: +510+710 review_phaser.mapped: off reportkills: on review_kill.parent: netrek review_kill.geometry: 82x4+508+708 review_kill.mapped: on review_kill.allow: KP player.parent: netrek player.geometry: +0+549 player.mapped: on udp.geometry: +0+0 udp.mapped: off stats.parent: netrek stats.geommac.s.%i:%y loss, %v ping, %V stddev stats geometry: 160x108+332+550 # puts the stats window further down stats.geometry: 160x94+842+500 # Macros section # Also '?' can still not be used as a macro key. The following definitions will # work in a macro (where 'target x' = whatever x the mouse cursor is closest to # when the macro is sent): # # Standard: # # %a armies carried by sender # %d sender damage percentage # %s sender shield percentage # %f sender fuel percentage # %w sender wtemp percentage # %e sender etemp percentage # %t team id character of target planet # %T team id character of sender team # %c sender id character # %n armies on target planet # %E 1 if etemped, 0 if not # %W 1 if wtemped, 0 if not # %S sender two character ship type # %p id character of target player # %g id char of target friendly player # %h id char of target enemy player # %P id character of player nearest sender # %G id char of friendly player nearest sender # %H id char of enemy player nearest sender # %l three character name of target planet # %i sender full player name (16 character max) # %u full name of target player (16 character max) # %z 3 letter team id of target planet # %b planet nearest sender # %o three letter team name of sender # %k number of kills sender has # %K number of kills target player has # %* if this is encountered, the macro IS NOT PRINTED # %(SPACE) this is replaced by a space, mainly useful for starting a message # # # FULLY CAPITALIZED: # # %L three character name of target planet # %I sender full player name (16 character max) # %U full name of target player (16 character max) # %Z 3 letter team id of target planet # %B sender nearest planet # %O three letter team name of sender # # Ping stats: (may differ slightly from server '!' ping stats) # # %v average ping stat round trip time # %V ping stat round trip standard deviation # %y percent total packet loss as calculated by server formula # # Miscellanous: # # %m the last message you sent # %M the last message you sent in all caps # # As a further extension to NEWMACRO, a macro may now be sent to any of the following destinations: # %i %I %c send message to self # %u %U %p send message to player nearest mouse # %t %z %Z send message to team of player nearest mouse # %g send message to nearest friendly player to my ship # %h send message to nearest enemy player to my ship # # with a syntax like # # #useful for INL... # mac.C.%i: CAPTAIN # mac.N.%i: NEWGALAXY # mac.S.%i: START # mac.T.%i: %Z # # mac.W.%t: SHUT UP, TWINKS!! # mac.I.%u: %u: det when you escort! # mac.O.%u: (%i) ogging # # What this does is allows you to send a macro to a player or team specified by your mouse # location instead of requiring a 3rd character to be input. Also, it allows you to send # message to yourself without having to actual sit there and figure out who you are (they # tried and failed back in the '60s). # # Further, tests may be done within the macro system, the syntax for these test is as follows. # # %? introduces a test # = equivalence # > greater # < less # # Expressions are evaluated on a character by character basis until the test is resolved. # The text of the test is then replaced in the macro by 1 or 0. # # Test are then fed to a syntax I call conditional text. The best way to demonstrate # how this works is example. # # "1%{included if true%!included if false%}" # # This would print: # # "included if true" # # whereas # # "0%{included if true%!included if false%}" # # would print: # # "included if false" # # Combining the whole package, a very robust macroing system is quickly generated. # One can easily design or mimic Distress calls, including the variable NBT # distress of the BRM client and all the hardcoded message macroing built into my # own client but never released. # # Here are a few more samples to work from: # # mac.F.T: Help! Carrying %a!! # mac.f: Help! Carrying %a!! # mac.c.T: %p++ near %l # mac.b.T: %?%n>4%{bomb %l at %n%!bomb%} # mac.d.T: %E%{%!%W%{%!I'm fine. How are you? %}%}%E%{ETEMPED!!! %} # %W%{WTEMPED!!! %}Carrying %?%a>0%{%a armies!%!NO armies.%} # mac.a.T: %E%{ETEMPED!!! %}%W%{WTEMPED!!! %}Carrying %?%a>0%{%a # armies! %!NO armies.%} # mac.R.A: I'm a %?%S=SB%{star base!%!twink!%} # mac.K.A: KissMy%S # mac.t: thanks # mac.y: yes # mac.n: no # mac.B: bye, getting hungry/sleep/horny # mac.e.T: need escort going to %l%?%a>0%{, carrying %a armies!%} # mac.v.%t %T%c PING stats: Average: %v ms, Stdv: %V ms, Loss: %y%% # Keys that will trigger macro without going to macro mode singleMacro: EF macro.a.A:. o Just | Squeal boy... macro.a.A:. //\ %p: ABUSED! Plain | just like a macro.a.A:. o )/ Wrong (tm) | hog! macro.a.A:. //<<\\ macro.P.A:% \~~\ _ _ ,----------------------------------, macro.P.A:% \**\___\/ \............| %u: Sucks to be you! macro.P.A:% X*####*+~~\_\ '----------------------------------' macro.P.A:% o/\ \ macro.P.A:% \__\ macro.r.A:. _ macro.r.A:. ( | macro.r.A:. ___\ \ macro.r.A:. (__() `-| macro.r.A:. (___() | %u r0xx0rz! macro.l.A:% /##\ /##\ /##\ /##\ /##\ /##\ macro.l.A:% ######### ######### ######### macro.l.A:% `#######' `#######' `#######' macro.l.A:% `\#/' `\#/' `\#/' macro.f.A:% (~)-=_ %p: _/~~~\~~~~~~) ******* macro.f.A:% <~~~]/`) MAJOR _- )~)~~~ /+ + /* ... moi?? macro.f.A:% (~~~]L/\ FUCKING (_/~) / < /@* macro.f.A:% (~~] . TWINK -\___L~) |~~~ |* macro.f.A:% ~~\ ~ \__/\ macro.h.A:% _____ ______ ______ _____ _____ /^/ macro.h.A:% / / / / / / / / / / / macro.h.A:% /_____/ /__ /_____/ / / /__ /_____ /_/ macro.h.A:% / / / / \ / / / / __ macro.h.A:% / / /_____ / \ /_____/ /_____ _____/ /_/ macro.c.A:% ._ _ KILL _ _ ^__^You loser, you couldn't fight your way macro.c.A:% | |_| |___ _ _| | _| | (oo)\_______ out of a wet paper bag. macro.c.A:% | _ / _ \ '_| |/ /_| (__)\ )\/\ %u: KILL HORKER macro.c.A:% |_| |_\___/_| |_|\_(_) ||----W |<---------- Me = cow of prey macro.c.A:% .MOooooooooooooooooo! || ||.,#@,. <-- You = piece of shit macro.C.A:% Nothing fucks _____---=======---_____ . Yo: >>%p<< macro.C.A:% you up _====____\ /.. ..\ /____====_ In Space no one macro.C.A:% like a + / / ---\__O__/--- \ \ can hear you macro.C.A:% CA \_\ . /_/ . Suck! macro.s.A:% _ You macro.s.A:% Yo %p: _(_). Are macro.s.A:% ( \ ,_\ Just macro.s.A:% (_\/(_)/ PLAIN (tm) macro.s.A:% \_| . \ STUPID! macro.B.A:% | | ___ | | ___ | | ___ | | ___ | | Aww %p, macro.B.A:% |/|{~._.~} |/| {~._.~} |/| {~._.~} |/| {~._.~}|/| do you need macro.B.A:% | | ( Y ) | | ( Y ) | | ( Y ) | | ( Y ) | | your teddy macro.B.A:% |/|()~*~() |/| ()~*~() |/| ()~*~() |/| ()~*~()|/| to cry on? macro.B.A:% | |(_)-(_) | | (_)-(_) | | (_)-(_) | | (_)-(_)| | macro.G.A:% /''|I Tons of Armies dropped on %L macro.G.A:% __________________/____|I . . . . macro.G.A:% /^: o o |__o__o o ,"' <' '> <' '> <' '> <' '> macro.G.A:% `o_______ /__ _\ ( Is something ) macro.%.A:%. \ \( | ( happening? ) macro.%.A:%. \__|\ | (_____________) macro.%.A:%. ' '--' macro.D.A:. (. .) Behold the destroyer, a ship built light for speed macro.D.A:. / VVVV\ and dodginess ... it is quick, and it buttorps very macro.D.A:. @\^^^/@ well, yet its hull is so light, it is crushed like macro.D.A:. _| |_ an egg ... behold its beauty and dangerous allure! macro.$.A:% Confucius says: ,---. macro.$.A:% I sense fear and resentment. C0-|| Y macro.$.A:% \ O || | macro.$.A:% | D J macro.$.A:% //./"""' macro.H.A:% ("`-''-/").___..--''"`-._ macro.H.A:% `6_ 6 ) `-. ( ).`-.__.`) %u: You're just a big macro.H.A:% (_Y_.)' ._ ) `._ `. ``-..-' macro.H.A:% ..`--'_..-_/ /--'_.' ,' P U S S Y macro.H.A:% (__),-'' (__),' ((!.-' macro.T.A:% o _____ yo, %u: macro.T.A:% .][__n_n_|DD[ ====_____ when the clue macro.T.A:% >(________|__|_[_________]_ train rolls by try macro.T.A:% _/oo OOOOO oo` ooo ooo to hop on board! macro.T.A:% -+-+-+-+-+-+-+-+-+-+-+-+-+-+ macro.0.A:% ***PUBLIC SERVICE ANNOUNCEMENT*** macro.0.A:% Hit shift O (that's O the letter, not zero) to bring up the netrek macro.0.A:% menus. You will be on page zero. See the bar that says updates macro.0.A:% per second? If it doesn't say 10 updates per second, you should macro.0.A:% change it! Click on the box until it gets to 10 updates per second! macro.1.A:% |\__/,| (`\ macro.1.A:% Mew! - |o o |__ _) ) I'm coming after you, macro.1.A:% n n._ _.( T ) ` / macro.1.A:% <" _ }=- ((_ `^--' /_< \ %u (%p)! macro.1.A:% '` " `` `-'(((/ (((/ macro.2.A:% /\ /\ Intel reports that I UNDERSTAND macro.2.A:% \ \_/ / %p is leaving %L (. .) OBERFUEHRER, AND macro.2.A:% ('.') with a shipment |VVVV | VOLUNTEER TO SINK macro.2.A:% () () of vital gravy... @| + |@ THE VITAL ENEMY macro.2.A:% (_)-(_) _| _| GRAVY TRANSPORT! macro.3.A:% __[`]__ macro.3.A:% (. .) Don't mess with %u (%p)! macro.3.A:% / VVVV `(=]==o macro.3.A:% @ |___|`-@ macro.3.A:% *-U_ U_ macro.4.A:% /\ /\ macro.4.A:% (- <) - I hate my team. \ \_/ / - Captain, macro.4.A:% /VVVV \ ('.') I sense macro.4.A:% @ ^^^^@~ () () hostility. macro.4.A:% _| _| (_)-(_) macro.5.A:% /~~/ Oh, My Pussy Hurts! I Better Call: (952) 943-8700 macro.5.A:% ~// macro.5.A:% __// /~) /~~/ /~) /~/~/ /| /| / /| / /~~~ /~~) macro.5.A:% /__/ /-< / / /~< / /~| / | / / | / /~~ /~~| macro.5.A:% }_ /__/ /__/ /__/ / / |/ |/ / |/ /___ / \ macro.6.A:. @ (. .) @ . ' . ___ %u (%p): macro.6.A:. \ VVVV/ . (: .) You are the weakest twink, macro.6.A:. / ^^^^__| ~~~ GOODBYE!! macro.6.A:. \ macro.7.A:% o- - - \o __| %u (%p): macro.7.A:% o/ /| vv`\ What's it feel like to be macro.7.A:% /| | | _ macro.7.A:% | / \_ | | \ _ ._ o _ _| | | macro.7.A:% / \ | | |_/ (/_ | | | (/_ (_| | | macro.8.A:% ___ macro.8.A:% ::====( )__ - Lean over for that Sodomy, macro.8.A:% o/__ <--- /~~~~~~~~~\ %u. macro.8.A:% | (\ \O.O.O.O.O/ macro.9.A:% . . /\_.----. macro.9.A:% All your base . : \_/ / / \ macro.9.A:% are belong to us! < < / / // /\ \o/ macro.9.A:% .:>: .> >. :/*/:./.X__ | macro.9.A:% --------------------:--:--**#:-<<:^/^<**#**#**:._/--------/->--- mac.e.T: Escorting %g (%d%%D %s%%S %f%%F) mac.V.A: %T%c PING stats: Average: %v ms, Stdv: %V ms, Loss: %y%% mac.x.T: (%T%c) My Fuel: %f%% mac.X.%p: My condition: %d%%D %s%%S %f%%F %a armies # Receiver configurable distress macros dist.^t.taking: %T%c->%O (%S) Carrying %a to %l%?%n>-1%{ @ %n%} dist.^o.ogg: %T%c->%O Help Ogg %p at %l dist.^b.bomb: %T%c->%O %?%n>4%{bomb %l @ %n%!bomb%} dist.^c.space_control: %T%c->%O Help Control at %L dist.^1.save_planet: %T%c->%O Emergency at %L!!!! dist.^2.base_ogg: %T%c->%O Sync with --]> %g <[-- OGG ogg OGG base!! dist.^3.help1: %T%c->%O Help me! %d%% dam, %s%% shd, %f%% fuel %a armies. dist.^4.help2: %T%c->%O Help me! %d%% dam, %s%% shd, %f%% fuel %a armies. dist.^e.escorting: %T%c->%O ESCORTING %g (%d%%D %s%%S %f%%F) dist.^p.ogging: %T%c->%O Ogging %h dist.^m.bombing: %T%c->%O Bombing %l @ %n dist.^l.controlling: %T%c->%O Controlling at %l dist.^5.asw: %T%c->%O Anti-bombing %p near %b. dist.^6.asbomb: %T%c->%O DON'T BOMB %l. Let me bomb it (%S) dist.^7.doing1: %T%c->%O (%i)%?%a>0%{ has %a arm%?%a=1%{y%!ies%}%} at %l. (%d%% dam, %s%% shd, %f%% fuel) dist.^8.doing2: %T%c->%O (%i)%?%a>0%{ has %a arm%?%a=1%{y%!ies%}%} at %l. (%d%% dam, %s%% shd, %f%% fuel) dist.^f.free_beer: %T%c->%O %p is free beer dist.^n.no_gas: %T%c->%O %p @ %l has no gas dist.^h.crippled: %T%c->%O %p @ %l crippled dist.^9.pickup: %T%c->%O %p++ @ %l dist.^0.pop: %T%c->%O %l%?%n>-1%{ @ %n%}! dist.F.carrying: %T%c->%O %?%S=SB%{Your Starbase is c%!C%}arrying %?%a>0%{%a%!NO%} arm%?%a=1%{y%!ies%}. dist.^@.other1: %T%c->%O (%i)%?%a>0%{ has %a arm%?%a=1%{y%!ies%}%} at %l. (%d%%D, %s%%S, %f%%F) dist.^#.other2: %T%c->%O (%i)%?%a>0%{ has %a arm%?%a=1%{y%!ies%}%} at %l. (%d%%D, %s%%S, %f%%F) dist.E.help: %T%c->%O Help(%S)! %s%% shd, %d%% dmg, %f%% fuel,%?%S=SB%{ %w%% wtmp,%!%}%E%{ ETEMP!%}%W%{ WTEMP!%} %a armies! # Receiver configurable messages msg.kill: GOD->ALL %i (%S) (%T%c%?%a>0%{+%a armies%!%}) was kill %?%d>0%{%k%!(NO CREDIT)%} for %u (%r%p) %?%w>0%{%W%!%} msg.planet: GOD->ALL %i (%S) (%T%c%?%a>0%{+%a armies%!%} killed by %l (%z) %?%w>0%{%W%!%} msg.bomb: %N->%Z We are being attacked by %i (%T%c) who is %d%% damaged. msg.destroy: %N->%Z %N destroyed by %i (%T%c) msg.take: %N->%O %N taken by %i (%T%c) msg.ghostbust: GOD->ALL %i (%S) (%T%c) was kill %k for the GhostBusters Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- changes.txt 24 May 2006 09:10:08 -0000 1.54 +++ changes.txt 25 May 2006 08:43:57 -0000 1.55 @@ -1,4 +1,10 @@ Version TBA: +- added a better default netrekrc file (my personal file), which has a better keymap, window + placements, and macros than your average rc :). Plus it has all the settable rc options + listed. The format of the netrekrc is nearly identical to that of the netrek.sav file + that can be generated in game from the options menu. Currently the only difference between + the two is lack of windows placements, custom review window settings, custom beeplite settings, + and custom server/servernick/servertype settings. - fixed bug with observers with short packets on which was causing incorrect drawing of local map in the case of losing player/planet lock (most noticeable effect was a single background star being drawn at all times, instead of the usual blank local). This was actually both a From modemhero at users.sourceforge.net Thu May 25 04:24:49 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 25 May 2006 09:24:49 +0000 Subject: [netrek-cvs] client/netrekxp/src local.c,1.31,1.32 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv16355/src Modified Files: local.c Log Message: Fix to colorful phasers so they work at all updates/sec and ship phaser fuse values. Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- local.c 25 May 2006 08:43:57 -0000 1.31 +++ local.c 25 May 2006 09:24:46 -0000 1.32 @@ -29,10 +29,6 @@ static int clearcount = 0; static int clearzone[4][(MAXTORP + 1) * MAXPLAYER + (MAXPLASMA + 1) * MAXPLAYER + MAXPLANETS]; - -#ifdef JUBILEE_PHASERS -static int ph_counter = 0; -#endif static int clearlcount = 0; #ifdef HOCKEY_LINES static int clearline[4][MAXPLAYER + 2 * MAXPLAYER + NUM_HOCKEY_LINES]; @@ -1281,6 +1277,13 @@ /* Now draw his phaser (if it exists) */ php = &phasers[j->p_no]; + + /* Reset colorful phasers here */ +#ifdef JUBILEE_PHASERS + if (j == me && colorfulPhasers + && (php->ph_status == PHFREE || php->ph_updateFuse == 0)) + ph_col = 0; +#endif if (php->ph_status != PHFREE) { @@ -1408,34 +1411,28 @@ switch (ph_col) { - case 0: case 1: + case 2: col = W_Red; break; - case 2: case 3: + case 4: col = W_Green; break; - case 4: case 5: + case 6: col = W_Yellow; break; - case 6: case 7: + case 8: col = W_Cyan; break; default: col = shipCol[remap[j->p_team]]; + ph_col = 0; break; } - ph_counter++; ph_col += (100/j->p_ship.s_phaserfuse/updatesPerSec); - if (ph_counter == (updatesPerSec - 1)*j->p_ship.s_phaserfuse/10) - { - ph_counter = 0; - ph_col = 0; - } - LineToConsole("Counter is %d, ph_col is %d\n", ph_counter, ph_col); if (phaserShrinkStyle == 1) { get_shrink_phaser_coords(&new_dx, &new_dy, From modemhero at users.sourceforge.net Thu May 25 04:24:48 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 25 May 2006 09:24:48 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C,1.35,1.36 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv16355 Modified Files: NetrekXP to do list.C Log Message: Fix to colorful phasers so they work at all updates/sec and ship phaser fuse values. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- NetrekXP to do list.C 25 May 2006 08:43:56 -0000 1.35 +++ NetrekXP to do list.C 25 May 2006 09:24:46 -0000 1.36 @@ -51,8 +51,6 @@ Bug fixes needed from Paradise: 1) Make it so The login screen doesn't use 100% CPU anymore. -2) Get Jubilee phasers to work at all updates and ship phaser cycle settings - and set - the jubilee counter to 0 when the phaser end packet is received. Stas's list: - color coded playerlist. From modemhero at users.sourceforge.net Thu May 25 04:24:48 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 25 May 2006 09:24:48 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt,1.55,1.56 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv16355/resources/docs Modified Files: changes.txt Log Message: Fix to colorful phasers so they work at all updates/sec and ship phaser fuse values. Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- changes.txt 25 May 2006 08:43:57 -0000 1.55 +++ changes.txt 25 May 2006 09:24:46 -0000 1.56 @@ -1,4 +1,6 @@ Version TBA: +- fixed colorful phasers to work as intended (cycle through 4 colors and then your team color). + This feature hasn't worked right since netrek moved to 10 updates/sec. - added a better default netrekrc file (my personal file), which has a better keymap, window placements, and macros than your average rc :). Plus it has all the settable rc options listed. The format of the netrekrc is nearly identical to that of the netrek.sav file From modemhero at users.sourceforge.net Fri May 26 00:58:10 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 26 May 2006 05:58:10 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.56, 1.57 hints.dat, 1.6, 1.7 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11850/resources/docs Modified Files: changes.txt hints.dat Log Message: Team select screen no longer uses 99% cpu power (credit to Gregory Hermann for the solution) Planet kill messages now show armies dooshed (if any), thanks to server short packet change. Index: hints.dat =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/hints.dat,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- hints.dat 16 May 2006 05:10:13 -0000 1.6 +++ hints.dat 26 May 2006 05:58:08 -0000 1.7 @@ -7,7 +7,7 @@ an observer can lock onto a cloaked teammate from the player list. macros can be sent using players from the player list as the target. Some default distresses can be sent this way too. you can change the dashboard clock to a timer through the Visuals Menu. The \ key is default for reseting the timer. -short packets reduce the amount of information your client receives. Unless you are playing on a terrible net connection, leave short packets off! +using short packets saves bandwidth, and allows more user customization of the messages you receive. See the section on RCMs in the manual. when you are low on planets, you should let the more experienced players pick the armies. Those should not be wasted. when you are in doubt, you should ask a Commodore, Rear Adm. or Admiral for advice. when your team has lots of armies, you should not be afraid to pick them. They'll get bombed anyway. Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- changes.txt 25 May 2006 09:24:46 -0000 1.56 +++ changes.txt 26 May 2006 05:58:08 -0000 1.57 @@ -1,4 +1,6 @@ Version TBA: +- team select screen no longer uses 99% cpu power +- planet kill messages now show armies dooshed (if any) - fixed colorful phasers to work as intended (cycle through 4 colors and then your team color). This feature hasn't worked right since netrek moved to 10 updates/sec. - added a better default netrekrc file (my personal file), which has a better keymap, window From modemhero at users.sourceforge.net Fri May 26 00:58:10 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 26 May 2006 05:58:10 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.36, 1.37 clientr.suo, 1.12, 1.13 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11850 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Team select screen no longer uses 99% cpu power (credit to Gregory Hermann for the solution) Planet kill messages now show armies dooshed (if any), thanks to server short packet change. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- NetrekXP to do list.C 25 May 2006 09:24:46 -0000 1.36 +++ NetrekXP to do list.C 26 May 2006 05:58:08 -0000 1.37 @@ -18,9 +18,12 @@ Things that go wrong when short packets are on: 1) cloaking/shields at warp 0 doesn't update someone else's tactical on what you did if there is no movement anywhere on map, and observer sound also messes up -2) Observers don't get any geno message at all (head to default which is error message) +2) Observers don't get any geno message at all (head to default which is error message) - +actually, they do get the whydead, but it's somehow after they are sent to quit screen. +When obs quits, their state is K_WINNER ..and they see the new geno bitmap. 3) The new smooth turning only working on self, not obs or others - short packets only send headings of 16 positions. +4) Observers get wrong x,y pos upon observee death. Things to do: 1) Add warning hull. @@ -48,9 +51,7 @@ 12) Is there a cpu leak with double buffering? 13) Use masking for things like player team/letter display on galactic. Ship draw on tactical (have it overwrite the planet/wrench/gas/army for example, not just combine colors). - -Bug fixes needed from Paradise: -1) Make it so The login screen doesn't use 100% CPU anymore. +14) Ask stas about addfontresource change in 4.4.0.4 Stas's list: - color coded playerlist. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 Binary files /tmp/cvsAbKWgP and /tmp/cvs26h4Lu differ From modemhero at users.sourceforge.net Fri May 26 00:58:10 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 26 May 2006 05:58:10 +0000 Subject: [netrek-cvs] client/netrekxp/src distress.c, 1.3, 1.4 newwin.c, 1.30, 1.31 short.c, 1.8, 1.9 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11850/src Modified Files: distress.c newwin.c short.c Log Message: Team select screen no longer uses 99% cpu power (credit to Gregory Hermann for the solution) Planet kill messages now show armies dooshed (if any), thanks to server short packet change. Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- newwin.c 24 May 2006 01:14:39 -0000 1.30 +++ newwin.c 26 May 2006 05:58:08 -0000 1.31 @@ -1400,30 +1400,12 @@ while (!W_EventsPending ()) { time_t elapsed; - fd_set rfds; - struct timeval tv; me->p_ghostbuster = 0; - /* Since we don't have a socket to check on Win32 - for windowing system events, we set the timeout to zero and - effectively poll. Yes, I could do the correct thing - and call WaitForMultipleObjects() etc. but I don't feel like it */ - tv.tv_sec = 0; - tv.tv_usec = 0; - FD_ZERO (&rfds); - FD_SET (sock, &rfds); - if (udpSock >= 0) - FD_SET (udpSock, &rfds); - // For replacing select to cut down on cpu usage, but not working yet - // HANDLE handles[FD_SETSIZE]; - // WaitForMultipleObjects(32, handles, TRUE, INFINITE); - select (32, &rfds, 0, 0, &tv); /* hmm, 32 might be too small */ - - if (FD_ISSET (sock, &rfds) || - (udpSock >= 0 && FD_ISSET (udpSock, &rfds))) - { - readFromServer (&rfds); - } + /* Select() causes infinite CPU usage, can't use WaitForMultipleObjects + due to UI working on same thread (no blocking), so a simple Sleep + is the best solution. */ + Sleep(10); elapsed = time (0) - startTime; if (elapsed > (time_t)(autoQuit)) { Index: short.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/short.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- short.c 24 May 2006 09:10:08 -0000 1.8 +++ short.c 26 May 2006 05:58:08 -0000 1.9 @@ -1289,7 +1289,7 @@ static int arg3, arg4; /* Here are the arguments * for warnings with more * than 2 arguments */ - static int karg3, karg4, karg5 = 0; + static int karg3, karg4, karg5, karg6 = 0; #ifndef RCM char killmess[20]; #endif @@ -1544,6 +1544,7 @@ break; case KILLARGS2: karg5 = (unsigned char) packet->argument; + karg6 = (unsigned char) packet->argument2; break; case DMKILLP: @@ -1553,12 +1554,14 @@ { struct mesg_spacket msg; + unsigned char victim; + victim = (unsigned char) (((unsigned char) packet->argument) & 0x3f); #ifdef RCM dist.distype = rcm; - dist.sender = packet->argument; - dist.tclose_j = packet->argument; - dist.arms = '\0'; + dist.sender = victim; + dist.tclose_j = victim; + dist.arms = karg6; dist.dam = '\0'; dist.shld = '\0'; dist.tclose_pl = packet->argument2; @@ -1566,9 +1569,9 @@ makedistress (&dist, msg.mesg, rcm_msg[2].macro); #else (void) sprintf (msg.mesg, "GOD->ALL %s (%c%c) killed by %s (%c)", - players[packet->argument].p_name, - teamlet[players[packet->argument].p_team], - shipnos[packet->argument], + players[victim].p_name, + teamlet[players[victim].p_team], + shipnos[victim], planets[(unsigned char) packet->argument2]. pl_name, teamlet[planets Index: distress.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/distress.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- distress.c 7 May 2006 16:59:27 -0000 1.3 +++ distress.c 26 May 2006 05:58:08 -0000 1.4 @@ -869,7 +869,7 @@ break; #endif - case '*': /* push %} into buf */ + case '*': /* push %* into buf */ case '}': /* push %} into buf */ case '{': /* push %{ into buf */ case '!': /* push %! into buf */ From modemhero at users.sourceforge.net Fri May 26 01:58:21 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 26 May 2006 06:58:21 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.57, 1.58 netrekxp.doc, 1.6, 1.7 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv618/resources/docs Modified Files: changes.txt netrekxp.doc Log Message: Fixed cambot playback with double buffering. Added cambot info to manual. Index: netrekxp.doc =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekxp.doc,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- netrekxp.doc 22 Apr 2006 14:11:47 -0000 1.6 +++ netrekxp.doc 26 May 2006 06:58:19 -0000 1.7 @@ -34,7 +34,7 @@ 7.0 MACROs, RCD, RCM 8.0 MetaServer Options 9.0 Player List Options - 10.0 Other Stuff (Beeplite, etc) + 10.0 Other Stuff (Beeplite, Cambot, etc) 1.0 Overview @@ -1119,3 +1119,27 @@ tts_time: Time a TTS message is displayed tts_ypos: y location of the TTS message +10.1 Cambot + +Making the recordings: +To make a recording, use the command: netrek -f cambot.pkt, where cambot.pkt is a file name of your choosing (where the playback will be saved). + +Playing the recordings: +To view the recordings use the command: netrek -F cambot.pkt + +While in the recording the following commands can be used: (These keys are +referenced after the netrekrc keymap.) + +Lock Player(l) to lock onto a player. +Lock Planet(;) to lock onto a planet. +Speed keys(1-8) to change the speed of the recording. +Speed 9, or #, or !, or @, or % for maximum playback speed. +Speed 0 (0) for pause. +The key ?? halves playback speed. +The key ?R? starts recording back at the beginning. + +The key '(' to reverse recording. +The key ')' to return to normal play. +Quit (q/Q) to quit + Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- changes.txt 26 May 2006 05:58:08 -0000 1.57 +++ changes.txt 26 May 2006 06:58:19 -0000 1.58 @@ -1,4 +1,5 @@ Version TBA: +- cambot works now with double buffering, and added cambot howto to the NetrekXP manual - team select screen no longer uses 99% cpu power - planet kill messages now show armies dooshed (if any) - fixed colorful phasers to work as intended (cycle through 4 colors and then your team color). From modemhero at users.sourceforge.net Fri May 26 01:58:21 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 26 May 2006 06:58:21 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C,1.37,1.38 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv618 Modified Files: NetrekXP to do list.C Log Message: Fixed cambot playback with double buffering. Added cambot info to manual. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- NetrekXP to do list.C 26 May 2006 05:58:08 -0000 1.37 +++ NetrekXP to do list.C 26 May 2006 06:58:19 -0000 1.38 @@ -63,25 +63,16 @@ ! after res if there cloaker around he will be seen briefly (speed 0 bug) - whydead dies when out of range (not confirmed) - add "reset to defaults" to options menu -+ add installer - add bitmap themes option (change default bitmap naming and processing) - add shiftMouse, controlMouse on/off -- add timestamps for messages (no place for timestamp) - fix accelerated scroll for microsoft mice - add msg.phaser to enable formatting of phaser messages -- add detCircle - add copy/paste possibility from message windows (richtext ?) - add clickable urls from message windows (richtext ?) + fix bug with undefined behavior in case of odd keymap/buttonmap/ckeymap length (partially fixed) - add "mKeyOnlyToStartMessages: on/off" to ignore keys [0-9][a-z][ATFOKRG] in message window when the messageon=0 - scrollable player list - parse Announcer messages in hockey games -- check geno/shift-q wrong behavior - resize documentation window - pasting multiline prints \r\n instead of splitting lines - fix makedistress bug that creates 0 instead of empty string when macro starts with conditional - -Simple in-game, realtime variable checking: - char text[120]; - sprintf (text, "Variable has value %d.", variable); - W_MessageAllowedWindows (WAM_ALL, 0, 0, textColor, text, 120, 0); \ No newline at end of file From modemhero at users.sourceforge.net Fri May 26 01:58:21 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 26 May 2006 06:58:21 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h,1.24,1.25 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv618/include Modified Files: data.h Log Message: Fixed cambot playback with double buffering. Added cambot info to manual. Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- data.h 25 May 2006 08:43:57 -0000 1.24 +++ data.h 26 May 2006 06:58:19 -0000 1.25 @@ -69,6 +69,7 @@ extern int showHints; #ifdef RECORDGAME extern FILE *recordFile; /* recorder */ +extern int inplayback; extern int playback; #define PL_PAUSE 1 #define PL_FORWARD 2 From modemhero at users.sourceforge.net Fri May 26 01:58:21 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 26 May 2006 06:58:21 +0000 Subject: [netrek-cvs] client/netrekxp/src data.c, 1.28, 1.29 local.c, 1.32, 1.33 main.c, 1.6, 1.7 map.c, 1.13, 1.14 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv618/src Modified Files: data.c local.c main.c map.c Log Message: Fixed cambot playback with double buffering. Added cambot info to manual. Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- local.c 25 May 2006 09:24:46 -0000 1.32 +++ local.c 26 May 2006 06:58:19 -0000 1.33 @@ -2527,9 +2527,13 @@ Draw out the 'tactical' map */ { +#ifdef RECORDGAME + if (doubleBuffering && !inplayback) + W_Win2Mem (localSDB); +#else if (doubleBuffering) W_Win2Mem (localSDB); - +#endif clearLocal (); /* Keep redrawing for double buffered observers who get set out of normal gameplay bounds, @@ -2550,9 +2554,14 @@ weaponUpdate = 0; DrawMisc (); - + +#ifdef RECORDGAME + if (doubleBuffering && !inplayback) + W_Mem2Win (localSDB); +#else if (doubleBuffering) W_Mem2Win (localSDB); +#endif } Index: main.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/main.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- main.c 21 May 2006 09:56:38 -0000 1.6 +++ main.c 26 May 2006 06:58:19 -0000 1.7 @@ -86,8 +86,7 @@ { int usage = 0; int err = 0; - int inplayback = 0; - int hideConsole = 1; + int hideConsole = 1; char *name, *ptr; int i; Index: map.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/map.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- map.c 22 May 2006 08:27:53 -0000 1.13 +++ map.c 26 May 2006 06:58:19 -0000 1.14 @@ -689,8 +689,13 @@ int view = WINSIDE * SCALE / 2; int mvx, mvy; +#ifdef RECORDGAME + if (doubleBuffering && !inplayback) + W_Win2Mem (mapSDB); +#else if (doubleBuffering) W_Win2Mem (mapSDB); +#endif dx = (me->p_x) / (GWIDTH / WINSIDE); dy = (me->p_y) / (GWIDTH / WINSIDE); @@ -954,6 +959,11 @@ clearlock = 1; } +#ifdef RECORDGAME + if (doubleBuffering && !inplayback) + W_Mem2Win (mapSDB); +#else if (doubleBuffering) W_Mem2Win (mapSDB); +#endif } \ No newline at end of file Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- data.c 25 May 2006 08:43:57 -0000 1.28 +++ data.c 26 May 2006 06:58:19 -0000 1.29 @@ -156,6 +156,7 @@ FILE *recordFile = NULL; /* recorder: slurp packets * here */ int playback = 0; +int inplayback = 0; #endif FILE *logFile = NULL; /* log messages to this file */ From modemhero at users.sourceforge.net Sun May 28 01:28:15 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 28 May 2006 06:28:15 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.38, 1.39 clientr.suo, 1.13, 1.14 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv4475 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Fixed issue with borders not redrawing with extraalertborders off and doublebuffering on - since borders drawn at the login window aren't transfered to the game window with doublebuffering mode on, instead we will redraw the noncolored local and map borders at the same time we execute the extraalertborder checks. Fixed hard to find bug with extra alert borders being drawn 1 pixel too short on local window (was from setting graphics mode to GM_ADVANCED for SetWorldTransform and not changing back to GM_COMPATIBLE afterwards). Tidied up WriteScaleBitmap and OverlayScaleBitmap to only go through the angular rigamole if the angle is nonzero (saves cpu power for drawing planets and such that don't need rotation). Gave up on trying to figure out border conditions with rotated scale bitmaps, instead they will sometimes overwrite alert border but this gets refreshed pretty often anyways. Something to fix in the future. Redrawing border every screen refresh too cpu intensive unfortunately to be practical. Fixed some tab/spacing issues in one of the mswindow functions. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- NetrekXP to do list.C 26 May 2006 06:58:19 -0000 1.38 +++ NetrekXP to do list.C 28 May 2006 06:28:13 -0000 1.39 @@ -39,10 +39,8 @@ - option server/servernick/servertype needs to be saved 5) A lot of annoying pop up windows (like macro window, default controls) should be closeable by shift right click. -***6) Implement Defcom's new planet and ship bitmaps -***6a) Border issue - quite complex problem, how to know the borders to obey after the bitmap -*** is rotated, and where to center bitmap -***6b) Bottom and right borders are 1 pixel too short with double buffering on +6) Border issue - quite complex problem, how to know the borders to obey after the bitmap +is rotated. Only solution so far is to ignore borders with scaled bitmaps. 7) Workable windows installer would be nice 9) Use nebula pic 10) rewrite placement/refresh of new resource bitmaps to work better with a scaled tactical @@ -55,7 +53,6 @@ Stas's list: - color coded playerlist. -! change default playerListStlyle to 1 (nah, this won't happen) - check inl server for behavior + add option to parse netrekrc.txt and xtrekrc.txt files ! server: ita won't block RCDs (why not ?) Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 Binary files /tmp/cvsyI64Rs and /tmp/cvsdRdMtF differ From modemhero at users.sourceforge.net Sun May 28 01:28:16 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 28 May 2006 06:28:16 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs netrekxp.doc,1.7,1.8 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv4475/resources/docs Modified Files: netrekxp.doc Log Message: Fixed issue with borders not redrawing with extraalertborders off and doublebuffering on - since borders drawn at the login window aren't transfered to the game window with doublebuffering mode on, instead we will redraw the noncolored local and map borders at the same time we execute the extraalertborder checks. Fixed hard to find bug with extra alert borders being drawn 1 pixel too short on local window (was from setting graphics mode to GM_ADVANCED for SetWorldTransform and not changing back to GM_COMPATIBLE afterwards). Tidied up WriteScaleBitmap and OverlayScaleBitmap to only go through the angular rigamole if the angle is nonzero (saves cpu power for drawing planets and such that don't need rotation). Gave up on trying to figure out border conditions with rotated scale bitmaps, instead they will sometimes overwrite alert border but this gets refreshed pretty often anyways. Something to fix in the future. Redrawing border every screen refresh too cpu intensive unfortunately to be practical. Fixed some tab/spacing issues in one of the mswindow functions. Index: netrekxp.doc =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekxp.doc,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- netrekxp.doc 26 May 2006 06:58:19 -0000 1.7 +++ netrekxp.doc 28 May 2006 06:28:13 -0000 1.8 @@ -1135,11 +1135,11 @@ Speed keys(1-8) to change the speed of the recording. Speed 9, or #, or !, or @, or % for maximum playback speed. Speed 0 (0) for pause. -The key ?? halves playback speed. -The key ?R? starts recording back at the beginning. +The key < doubles playback speed. +The key > halves playback speed. +The key R starts recording back at the beginning. -The key '(' to reverse recording. -The key ')' to return to normal play. +The key ( reverses the recording. +The key ) returns to normal play. Quit (q/Q) to quit From modemhero at users.sourceforge.net Sun May 28 01:28:16 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 28 May 2006 06:28:16 +0000 Subject: [netrek-cvs] client/netrekxp/src local.c, 1.33, 1.34 main.c, 1.7, 1.8 mswindow.c, 1.26, 1.27 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv4475/src Modified Files: local.c main.c mswindow.c Log Message: Fixed issue with borders not redrawing with extraalertborders off and doublebuffering on - since borders drawn at the login window aren't transfered to the game window with doublebuffering mode on, instead we will redraw the noncolored local and map borders at the same time we execute the extraalertborder checks. Fixed hard to find bug with extra alert borders being drawn 1 pixel too short on local window (was from setting graphics mode to GM_ADVANCED for SetWorldTransform and not changing back to GM_COMPATIBLE afterwards). Tidied up WriteScaleBitmap and OverlayScaleBitmap to only go through the angular rigamole if the angle is nonzero (saves cpu power for drawing planets and such that don't need rotation). Gave up on trying to figure out border conditions with rotated scale bitmaps, instead they will sometimes overwrite alert border but this gets refreshed pretty often anyways. Something to fix in the future. Redrawing border every screen refresh too cpu intensive unfortunately to be practical. Fixed some tab/spacing issues in one of the mswindow functions. Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- mswindow.c 22 May 2006 08:27:53 -0000 1.26 +++ mswindow.c 28 May 2006 06:28:14 -0000 1.27 @@ -1201,9 +1201,9 @@ } } - /* Here we have name and parent, so let's set them */ - strcpy (window->name, name); - window->parent = parentwin; + /* Here we have name and parent, so let's set them */ + strcpy (window->name, name); + window->parent = parentwin; //Actually create the window //Hacked to allow negative create locations -SAC @@ -1870,7 +1870,7 @@ short wheel; struct Icon *icon; RECT r; - WORD lwParam; + WORD lwParam; #if defined(MOTION_MOUSE) || defined(XTRA_MESSAGE_UI) static POINTS prev_pos; static HWND LastPressHwnd; @@ -2123,46 +2123,45 @@ STORE_EVENT_MOUSE; LastPressHwnd = hwnd; - - lwParam = LOWORD (wParam); + lwParam = LOWORD (wParam); #ifdef SHIFTED_MOUSE if (shiftedMouse) { if ((lwParam & MK_SHIFT) && (lwParam & MK_CONTROL)) - { - if (lwParam & MK_XBUTTON1) - EventQueue[EventTail].key = W_XBUTTON1_4; - else if (lwParam & MK_XBUTTON2) - EventQueue[EventTail].key = W_XBUTTON2_4; - } + { + if (lwParam & MK_XBUTTON1) + EventQueue[EventTail].key = W_XBUTTON1_4; + else if (lwParam & MK_XBUTTON2) + EventQueue[EventTail].key = W_XBUTTON2_4; + } else if (lwParam & MK_SHIFT) - { - if (lwParam & MK_XBUTTON1) - EventQueue[EventTail].key = W_XBUTTON1_2; - else if (lwParam & MK_XBUTTON2) - EventQueue[EventTail].key = W_XBUTTON2_2; - } + { + if (lwParam & MK_XBUTTON1) + EventQueue[EventTail].key = W_XBUTTON1_2; + else if (lwParam & MK_XBUTTON2) + EventQueue[EventTail].key = W_XBUTTON2_2; + } else if (lwParam & MK_CONTROL) - { - if (lwParam & MK_XBUTTON1) - EventQueue[EventTail].key = W_XBUTTON1_3; - else if (lwParam & MK_XBUTTON2) - EventQueue[EventTail].key = W_XBUTTON2_3; - } + { + if (lwParam & MK_XBUTTON1) + EventQueue[EventTail].key = W_XBUTTON1_3; + else if (lwParam & MK_XBUTTON2) + EventQueue[EventTail].key = W_XBUTTON2_3; + } else - { - if (lwParam & MK_XBUTTON1) - EventQueue[EventTail].key = W_XBUTTON1; - else if (lwParam & MK_XBUTTON2) - EventQueue[EventTail].key = W_XBUTTON2; - } + { + if (lwParam & MK_XBUTTON1) + EventQueue[EventTail].key = W_XBUTTON1; + else if (lwParam & MK_XBUTTON2) + EventQueue[EventTail].key = W_XBUTTON2; + } } else - if (lwParam & MK_XBUTTON1) - EventQueue[EventTail].key = W_XBUTTON1; - else if (lwParam & MK_XBUTTON2) - EventQueue[EventTail].key = W_XBUTTON2; + if (lwParam & MK_XBUTTON1) + EventQueue[EventTail].key = W_XBUTTON1; + else if (lwParam & MK_XBUTTON2) + EventQueue[EventTail].key = W_XBUTTON2; #else if (lwParam & MK_XBUTTON1) EventQueue[EventTail].key = W_XBUTTON1; @@ -4002,71 +4001,122 @@ srcy = 0; x += border; y += border; - - if (x < border) - { - newwidth = destwidth - (border - x); - srcx += border - x; - x = border; - } - else if ((newwidth = (usebitmaphwnd ? bitmap->ClipRectAddr->right : win->ClipRect.right) - x) > destwidth) - newwidth = destwidth; - if (y < border) - { - newheight = destheight - (border - y); - srcy += (border - y); - y = border; - } - else if ((newheight = (usebitmaphwnd? bitmap->ClipRectAddr->bottom : win->ClipRect.bottom) - y) > destheight) - newheight = destheight; - + if (NetrekPalette) { SelectPalette (hdc, NetrekPalette, FALSE); RealizePalette (hdc); } - //Set the color of the bitmap //(oddly enough, 1-bit = bk color, 0-bit = text (fg) color) SetBkColor (hdc, colortable[color].rgb); SetTextColor (hdc, colortable[BLACK].rgb); - - //Convert angle to radians - radians=(2*3.14159*angle/360); - cosine=(float)cos(radians); - sine=(float)sin(radians); - - // Scale used to find bitmap center - xscale = (float)(newwidth/2); - yscale = (float)(newheight/2); + if (angle != 0) + { + //Convert angle to radians + radians=(2*3.14159*angle/360); - eDx = x + xscale - cosine*(xscale) + sine*(yscale); - eDy = y + yscale - cosine*(yscale) - sine*(xscale); - SetGraphicsMode(hdc,GM_ADVANCED); + cosine=(float)cos(radians); + sine=(float)sin(radians); + + /* Can't get this to work + * Feel free to try and fix it - BB - xForm.eM11=cosine; - xForm.eM12=sine; - xForm.eM21=-sine; - xForm.eM22=cosine; - xForm.eDx = eDx; - xForm.eDy = eDy; + int x1, x2, x3, y1, y2, y3, minx, maxx, miny, maxy, w, h; - SetWorldTransform(hdc,&xForm); - BitBlt(hdc, 0, 0, newwidth, newheight, GlobalMemDC2, srcx, srcy, SRCPAINT); - - // Reset xForm - xForm.eM11 = (FLOAT) 1.0; - xForm.eM12 = (FLOAT) 0.0; - xForm.eM21 = (FLOAT) 0.0; - xForm.eM22 = (FLOAT) 1.0; - xForm.eDx = (FLOAT) 0.0; - xForm.eDy = (FLOAT) 0.0; + // Time to find out the new width and height of the rotated bitmap! + // First get the coordinates of the 3 corners (assume 1 corner at 0,0) + x1 = (int)(destheight * sine); + y1 = (int)(destheight * cosine); + x2 = (int)(destwidth * cosine + destheight * sine); + y2 = (int)(destheight * cosine - destwidth * sine); + x3 = (int)(destwidth * cosine); + y3 = (int)(-destwidth * sine); + + minx = min(0,min(x1, min(x2,x3))); + miny = min(0,min(y1, min(y2,y3))); + maxx = max(0,max(x1, max(x2,x3))); + maxy = max(0,max(y1, max(y2,y3))); + + w = abs (maxx - minx); + h = abs (maxy - miny); + + // Calculate border constraints with rotated bitmap width/height + if (x < border) + { + newwidth = w - (border - x); + srcx += border - x; + x = border; + } + else if ((newwidth = (usebitmaphwnd ? bitmap->ClipRectAddr->right : win->ClipRect.right) - x) > w) + newwidth = w; + if (y < border) + { + newheight = h - (border - y); + srcy += (border - y); + y = border; + } + else if ((newheight = (usebitmaphwnd ? bitmap->ClipRectAddr->bottom : win->ClipRect.bottom) - y) > h) + newheight = h; + */ + newwidth = destwidth; + newheight = destheight; + + // Scale used to find bitmap center + xscale = (float)(destwidth/2); + yscale = (float)(destheight/2); + + eDx = x + xscale - cosine*(xscale) + sine*(yscale); + eDy = y + yscale - cosine*(yscale) - sine*(xscale); + SetGraphicsMode(hdc,GM_ADVANCED); + + xForm.eM11=cosine; + xForm.eM12=sine; + xForm.eM21=-sine; + xForm.eM22=cosine; + xForm.eDx = eDx; + xForm.eDy = eDy; + + SetWorldTransform(hdc,&xForm); + BitBlt(hdc, 0, 0, newwidth, newheight, GlobalMemDC2, srcx, srcy, SRCPAINT); + + // Reset xForm + xForm.eM11 = (FLOAT) 1.0; + xForm.eM12 = (FLOAT) 0.0; + xForm.eM21 = (FLOAT) 0.0; + xForm.eM22 = (FLOAT) 1.0; + xForm.eDx = (FLOAT) 0.0; + xForm.eDy = (FLOAT) 0.0; + + SetWorldTransform(hdc,&xForm); + SetGraphicsMode(hdc,GM_COMPATIBLE); + } + else + { + // Calculate border constraints with bitmap width/height + if (x < border) + { + newwidth = destwidth - (border - x); + srcx += border - x; + x = border; + } + else if ((newwidth = (usebitmaphwnd ? bitmap->ClipRectAddr->right : win->ClipRect.right) - x) > destwidth) + newwidth = destwidth; + if (y < border) + { + newheight = destheight - (border - y); + srcy += (border - y); + y = border; + } + else if ((newheight = (usebitmaphwnd? bitmap->ClipRectAddr->bottom : win->ClipRect.bottom) - y) > destheight) + newheight = destheight; + + BitBlt(hdc, x, y, newwidth, newheight, GlobalMemDC2, srcx, srcy, SRCPAINT); + } - SetWorldTransform(hdc,&xForm); - DeleteObject (newbmp); - + if (!sdb || !doubleBuffering || !ingame) { if (usebitmaphwnd) @@ -5008,10 +5058,8 @@ int b) { HDC hdc; - FNHEADER_VOID; - b; /* Makes compiler happy -SAC */ if (win->type == WIN_SCROLL) { @@ -5114,12 +5162,12 @@ SelectObject (GlobalMemDC, bitmap->bm); SelectObject (GlobalMemDC2, newbmp); - + // Copy selected section of main bitmap into newbmp before rotation SetStretchBltMode(GlobalMemDC2, COLORONCOLOR); StretchBlt(GlobalMemDC2, 0, 0, destwidth, destheight, GlobalMemDC, srcx, srcy, srcwidth, srcheight, SRCPAINT); - + //Fast (I hope) rectangle intersection, don't overwrite our borders if (usebitmaphwnd) border = bitmap->ClipRectAddr->top; @@ -5131,69 +5179,80 @@ srcy = 0; x += border; y += border; - - if (x < border) - { - newwidth = destwidth - (border - x); - srcx += border - x; - x = border; - } - else if ((newwidth = (usebitmaphwnd ? bitmap->ClipRectAddr->right: win->ClipRect.right) - x) > destwidth) - newwidth = destwidth; - if (y < border) - { - newheight = destheight - (border - y); - srcy += (border - y); - y = border; - } - else if ((newheight = (usebitmaphwnd ? bitmap->ClipRectAddr->bottom : win->ClipRect.bottom) - y) > destheight) - newheight = destheight; if (NetrekPalette) { SelectPalette (hdc, NetrekPalette, FALSE); RealizePalette (hdc); } - //Set the color of the bitmap //(oddly enough, 1-bit = bk color, 0-bit = text (fg) color) SetBkColor (hdc, colortable[color].rgb); SetTextColor (hdc, colortable[BLACK].rgb); + + if (angle != 0) + { + //Convert angle to radians + radians=(2*3.14159*angle/360); - //Convert angle to radians - radians=(2*3.14159*angle/360); + cosine=(float)cos(radians); + sine=(float)sin(radians); - cosine=(float)cos(radians); - sine=(float)sin(radians); - - // Scale used to find bitmap center - xscale = (float)(newwidth/2); - yscale = (float)(newheight/2); + newwidth = destwidth; + newheight = destheight; - eDx = x + xscale - cosine*(xscale) + sine*(yscale); - eDy = y + yscale - cosine*(yscale) - sine*(xscale); - SetGraphicsMode(hdc,GM_ADVANCED); + // Scale used to find bitmap center + xscale = (float)(destwidth/2); + yscale = (float)(destheight/2); - xForm.eM11=cosine; - xForm.eM12=sine; - xForm.eM21=-sine; - xForm.eM22=cosine; - xForm.eDx = eDx; - xForm.eDy = eDy; + eDx = x + xscale - cosine*(xscale) + sine*(yscale); + eDy = y + yscale - cosine*(yscale) - sine*(xscale); + SetGraphicsMode(hdc,GM_ADVANCED); - SetWorldTransform(hdc,&xForm); + xForm.eM11=cosine; + xForm.eM12=sine; + xForm.eM21=-sine; + xForm.eM22=cosine; + xForm.eDx = eDx; + xForm.eDy = eDy; - BitBlt(hdc, 0, 0, newwidth, newheight, GlobalMemDC2, srcx, srcy, SRCAND); + SetWorldTransform(hdc,&xForm); - // Reset xForm - xForm.eM11 = (FLOAT) 1.0; - xForm.eM12 = (FLOAT) 0.0; - xForm.eM21 = (FLOAT) 0.0; - xForm.eM22 = (FLOAT) 1.0; - xForm.eDx = (FLOAT) 0.0; - xForm.eDy = (FLOAT) 0.0; + BitBlt(hdc, 0, 0, newwidth, newheight, GlobalMemDC2, srcx, srcy, SRCAND); + + // Reset xForm + xForm.eM11 = (FLOAT) 1.0; + xForm.eM12 = (FLOAT) 0.0; + xForm.eM21 = (FLOAT) 0.0; + xForm.eM22 = (FLOAT) 1.0; + xForm.eDx = (FLOAT) 0.0; + xForm.eDy = (FLOAT) 0.0; - SetWorldTransform(hdc,&xForm); + SetWorldTransform(hdc,&xForm); + SetGraphicsMode(hdc,GM_COMPATIBLE); + } + else + { + // Calculate border constraints with bitmap width/height + if (x < border) + { + newwidth = destwidth - (border - x); + srcx += border - x; + x = border; + } + else if ((newwidth = (usebitmaphwnd ? bitmap->ClipRectAddr->right : win->ClipRect.right) - x) > destwidth) + newwidth = destwidth; + if (y < border) + { + newheight = destheight - (border - y); + srcy += (border - y); + y = border; + } + else if ((newheight = (usebitmaphwnd? bitmap->ClipRectAddr->bottom : win->ClipRect.bottom) - y) > destheight) + newheight = destheight; + + BitBlt(hdc, x, y, newwidth, newheight, GlobalMemDC2, srcx, srcy, SRCAND); + } DeleteObject (newbmp); Index: main.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/main.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- main.c 26 May 2006 06:58:19 -0000 1.7 +++ main.c 28 May 2006 06:28:14 -0000 1.8 @@ -86,7 +86,7 @@ { int usage = 0; int err = 0; - int hideConsole = 1; + int hideConsole = 1; char *name, *ptr; int i; Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- local.c 26 May 2006 06:58:19 -0000 1.33 +++ local.c 28 May 2006 06:28:14 -0000 1.34 @@ -2334,7 +2334,6 @@ } /* Change border color to signify alert status */ - if (oldalert != (me->p_flags & (PFGREEN | PFYELLOW | PFRED))) { oldalert = (me->p_flags & (PFGREEN | PFYELLOW | PFRED)); @@ -2343,13 +2342,13 @@ case PFGREEN: if (extraAlertBorder) { -#ifndef DOUBLE_BUFFERING W_ChangeBorder (w, gColor); W_ChangeBorder (mapw, gColor); -#else - W_ChangeBorderDB (localSDB, gColor); - W_ChangeBorderDB (mapSDB, gColor); -#endif + } + else + { + W_ChangeBorder (w, W_White); + W_ChangeBorder (mapw, W_White); } W_ChangeBorder (baseWin, gColor); @@ -2368,13 +2367,13 @@ case PFYELLOW: if (extraAlertBorder) { -#ifndef DOUBLE_BUFFERING W_ChangeBorder (w, yColor); W_ChangeBorder (mapw, yColor); -#else - W_ChangeBorderDB (localSDB, yColor); - W_ChangeBorderDB (mapSDB, yColor); -#endif + } + else + { + W_ChangeBorder (w, W_White); + W_ChangeBorder (mapw, W_White); } W_ChangeBorder (baseWin, yColor); @@ -2397,13 +2396,13 @@ case PFRED: if (extraAlertBorder) { -#ifndef DOUBLE_BUFFERING W_ChangeBorder (w, rColor); W_ChangeBorder (mapw, rColor); -#else - W_ChangeBorderDB (localSDB, rColor); - W_ChangeBorderDB (mapSDB, rColor); -#endif + } + else + { + W_ChangeBorder (w, W_White); + W_ChangeBorder (mapw, W_White); } W_ChangeBorder (baseWin, rColor); From modemhero at users.sourceforge.net Sun May 28 18:05:14 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 28 May 2006 23:05:14 +0000 Subject: [netrek-cvs] client/netrekxp/src beeplite.c, 1.8, 1.9 cowmain.c, 1.14, 1.15 data.c, 1.29, 1.30 defaults.c, 1.21, 1.22 input.c, 1.12, 1.13 mswindow.c, 1.27, 1.28 newwin.c, 1.31, 1.32 option.c, 1.19, 1.20 senddist.c, 1.4, 1.5 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv9198/src Modified Files: beeplite.c cowmain.c data.c defaults.c input.c mswindow.c newwin.c option.c senddist.c Log Message: Fixed some inconsistencies in how a few RCDs were named - "taking" renamed to "take", "generic" renamed to "help", "help3 and help4" renamed to "help1 and help2", and "doing3 and doing4" renamed to "doing1 and doing2" Added "saveWindow: (on)/off" and "saveBeeplite: (on)/off" to allow saving of window placments and beeplite macros to the netrek.sav file. Save options now can save windows placements, review window .allow settings, and beeplite macros Changed some default window sizes/locations that were either too small (i.e. help window) or in a bad spot (i.e. planet window) Fixed a bunch of spacing inconsistencies Added/modified a few checkmapped calls in newwin.c to either use the "newish" checkmappedpref function, or to add a checkmapped check if I felt it should be checked Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- mswindow.c 28 May 2006 06:28:14 -0000 1.27 +++ mswindow.c 28 May 2006 23:05:12 -0000 1.28 @@ -1258,12 +1258,12 @@ W_Color color) { Window *newwin; - int orig_x, orig_y, orig_width, orig_height; + int orig_x, orig_y, orig_width, orig_height; - orig_x = x; - orig_y = y; - orig_width = width; - orig_height = height; + orig_x = x; + orig_y = y; + orig_width = width; + orig_height = height; //Get the default position, etc. checkGeometry (name, &x, &y, &width, &height); @@ -1276,12 +1276,12 @@ newWindow (name, x, y, width, height, parent, border, color, WIN_GRAPH))) return (0); - - /* Set original coordinates, so we will be able to restore to them */ - newwin->orig_x = orig_x; - newwin->orig_y = orig_y; - newwin->orig_width = orig_width; - newwin->orig_height = orig_height; + + /* Set original coordinates, so we will be able to restore to them */ + newwin->orig_x = orig_x; + newwin->orig_y = orig_y; + newwin->orig_width = orig_width; + newwin->orig_height = orig_height; //Map (show) the window if the user spec'd it if (checkMapped (name)) @@ -1306,12 +1306,12 @@ int border) { Window *newwin; - int orig_x, orig_y, orig_width, orig_height; + int orig_x, orig_y, orig_width, orig_height; - orig_x = x; - orig_y = y; - orig_width = width; - orig_height = height; + orig_x = x; + orig_y = y; + orig_width = width; + orig_height = height; //Get the default position, etc. checkGeometry (name, &x, &y, &width, &height); @@ -1328,12 +1328,12 @@ //Store the original textheight, width newwin->TextHeight = (short) height; newwin->TextWidth = (short) width; - - /* Set original coordinates, so we will be able to restore to them */ - newwin->orig_x = orig_x; - newwin->orig_y = orig_y; - newwin->orig_width = orig_width; - newwin->orig_height = orig_height; + + /* Set original coordinates, so we will be able to restore to them */ + newwin->orig_x = orig_x; + newwin->orig_y = orig_y; + newwin->orig_width = orig_width; + newwin->orig_height = orig_height; //Map (show) the window if the user spec'd it if (checkMapped (name)) @@ -1355,12 +1355,12 @@ int border) { Window *newwin; - int orig_x, orig_y, orig_width, orig_height; + int orig_x, orig_y, orig_width, orig_height; - orig_x = x; - orig_y = y; - orig_width = width; - orig_height = height; + orig_x = x; + orig_y = y; + orig_width = width; + orig_height = height; //Get the default position, etc. checkGeometry (name, &x, &y, &width, &height); @@ -1378,12 +1378,12 @@ //Store the original textheight, width newwin->TextHeight = (short) height; newwin->TextWidth = (short) width; - - /* Set original coordinates, so we will be able to restore to them */ - newwin->orig_x = orig_x; - newwin->orig_y = orig_y; - newwin->orig_width = orig_width; - newwin->orig_height = orig_height; + + /* Set original coordinates, so we will be able to restore to them */ + newwin->orig_x = orig_x; + newwin->orig_y = orig_y; + newwin->orig_width = orig_width; + newwin->orig_height = orig_height; //Give it a scroll bar, and set the range (to zero, initially) SetWindowLongPtr (newwin->hwnd, GWL_STYLE, @@ -1414,12 +1414,12 @@ Window *newwin; int i; - int orig_x, orig_y, orig_width, orig_height; + int orig_x, orig_y, orig_width, orig_height; - orig_x = x; - orig_y = y; - orig_width = width; - orig_height = height; + orig_x = x; + orig_y = y; + orig_width = width; + orig_height = height; //Get the default position, etc. checkGeometry (name, &x, &y, &width, &height); @@ -1447,12 +1447,12 @@ newwin->items = items; newwin->NumItems = (short) height; newwin->TextHeight = (short) height; - - /* Set original coordinates, so we will be able to restore to them */ - newwin->orig_x = orig_x; - newwin->orig_y = orig_y; - newwin->orig_width = orig_width; - newwin->orig_height = orig_height; + + /* Set original coordinates, so we will be able to restore to them */ + newwin->orig_x = orig_x; + newwin->orig_y = orig_y; + newwin->orig_width = orig_width; + newwin->orig_height = orig_height; //Map (show) the window if the user spec'd it if (checkMapped (name)) Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- newwin.c 26 May 2006 05:58:08 -0000 1.31 +++ newwin.c 28 May 2006 23:05:12 -0000 1.32 @@ -789,27 +789,28 @@ mapSDB = W_InitSDB (mapw); - tstatw = W_MakeWindow ("tstat", 0, WINSIDE + 6, WINSIDE + 3, + tstatw = W_MakeWindow ("tstat", 0, WINSIDE + 6, WINSIDE + 5, STATSIZE + 2, baseWin, BORDER, foreColor); W_SetWindowExposeHandler (tstatw, redrawTstats); - - warnw = W_MakeWindow ("warn", WINSIDE + 6, WINSIDE + 23, WINSIDE + 4, MESSAGESIZE - 4, + + warnw = W_MakeWindow ("warn", WINSIDE + 6, WINSIDE + 23, WINSIDE + 4, MESSAGESIZE - 4, baseWin, BORDER, foreColor); W_SetWindowKeyDownHandler (warnw, handleMessageWindowKeyDown); - - messagew = W_MakeWindow ("message", WINSIDE + 6, WINSIDE + 6, + + messagew = W_MakeWindow ("message", WINSIDE + 6, WINSIDE + 6, WINSIDE + 4, MESSAGESIZE - 4, baseWin, BORDER, foreColor); + W_SetWindowKeyDownHandler (messagew, handleMessageWindowKeyDown); W_SetWindowButtonHandler (messagew, handleMessageWindowButton); - W_SetWindowExposeHandler (messagew, DisplayMessage); + W_SetWindowExposeHandler (messagew, DisplayMessage); - planetw = W_MakeTextWindow ("planet", 10, 10, 57, MAXPLANETS + 3, w, 2); + planetw = W_MakeTextWindow ("planet", WINSIDE + 160, 10, 57, MAXPLANETS + 3, baseWin, 2); W_SetWindowExposeHandler (planetw, planetlist); - rankw = W_MakeTextWindow ("rank", 50, 300, 65, NUMRANKS + 9, w, 2); + rankw = W_MakeTextWindow ("rank", 50, 300, 65, NUMRANKS + 9, baseWin, 2); W_SetWindowExposeHandler (rankw, ranklist); playerw = W_MakeTextWindow ("player", 0, WINSIDE + 50, PlistMaxWidth (), 32, baseWin, 2); @@ -827,7 +828,7 @@ #endif helpWin = W_MakeTextWindow ("help", 20, YOFF + WINSIDE + 2 * BORDER + 2 * MESSAGESIZE + 30, - 160, 19, NULL, BORDER); + 160, 21, NULL, BORDER); #ifdef RECORDGAME if (playback) @@ -888,9 +889,9 @@ messwk = W_MakeScrollingWindow ("review_kill", 506, 727, 81, 3, baseWin, BORDER); wam_windows[3] = messwk; - phaserwin = W_MakeScrollingWindow ("review_phaser", WINSIDE + BORDER + 6, YOFF + + phaserwin = W_MakeScrollingWindow ("review_phaser", WINSIDE + 6, YOFF + WINSIDE + 3 * BORDER + 2 * MESSAGESIZE + - 15 * W_Textheight + 16, 80, 4, baseWin, BORDER); + 15 * W_Textheight + 16, 81, 4, baseWin, BORDER); wam_windows[4] = phaserwin; reviewWin = W_MakeScrollingWindow ("review", 506, 540, 81, 22, baseWin, BORDER); @@ -980,7 +981,6 @@ war = W_MakeMenu ("war", WINSIDE + 10, -BORDER + 10, WARWIDTH, 6, baseWin, WARBORDER); W_SetWindowButtonHandler (war, waraction); - W_DefineArrowCursor (war); fillhint (); @@ -1024,8 +1024,7 @@ W_MapWindow (tstatw); W_MapWindow (warnw); #ifdef XTRA_MESSAGE_UI - /* Grr. checkMapped() defaults to off - not nice */ - if (booleanDefault ("message.mapped", 1)) + if (checkMappedPref ("message", 1)) #endif W_MapWindow (messagew); W_MapWindow (w); @@ -1040,12 +1039,6 @@ W_MapWindow (rankw); if (checkMapped ("help")) W_MapWindow (helpWin); - -#ifdef META - if (checkMapped ("MetaServer List")) - metawindow (); -#endif - if (checkMapped ("review_all")) W_MapWindow (messwa); if (checkMapped ("review_team")) @@ -1072,7 +1065,8 @@ if (checkMapped ("network")) spwindow (); #endif - + if (checkMapped ("stats")) + W_MapWindow (statwin); } Index: input.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/input.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- input.c 22 May 2006 08:27:53 -0000 1.12 +++ input.c 28 May 2006 23:05:12 -0000 1.13 @@ -2547,7 +2547,7 @@ void Key69 (W_Event * data) { - emergency (generic, data); + emergency (help, data); } /******************************************************************************/ @@ -3525,7 +3525,7 @@ void Key147 (W_Event * data) { - emergency (help3, data); + emergency (help1, data); } /******************************************************************************/ @@ -3534,7 +3534,7 @@ void Key148 (W_Event * data) { - emergency (help4, data); + emergency (help2, data); } /******************************************************************************/ @@ -3625,7 +3625,7 @@ void Key151 (W_Event * data) { - emergency (doing3, data); + emergency (doing1, data); } /******************************************************************************/ @@ -3634,7 +3634,7 @@ void Key152 (W_Event * data) { - emergency (doing4, data); + emergency (doing2, data); } /******************************************************************************/ Index: cowmain.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/cowmain.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- cowmain.c 22 May 2006 08:27:53 -0000 1.14 +++ cowmain.c 28 May 2006 23:05:12 -0000 1.15 @@ -778,16 +778,16 @@ } #endif - /* Now we want get serverNick */ - if (serverName) - serverNick = getServerNick (serverName); + /* Now we want get serverNick */ + if (serverName) + serverNick = getServerNick (serverName); - /* If we have nickname then we probably have type.serverNick defined */ - if (serverType == ST_UNKNOWN && serverNick) - serverType = getServerType (serverNick); + /* If we have nickname then we probably have type.serverNick defined */ + if (serverType == ST_UNKNOWN && serverNick) + serverType = getServerType (serverNick); - /* Set observer flag as soon as we know port number */ - setObserverMode (xtrekPort); + /* Set observer flag as soon as we know port number */ + setObserverMode (xtrekPort); resetdefaults (); savebitmaps (); Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- defaults.c 25 May 2006 08:43:57 -0000 1.21 +++ defaults.c 28 May 2006 23:05:12 -0000 1.22 @@ -451,6 +451,12 @@ NULL } }, + {"saveWindow", &saveWindow, RC_BOOL, + { + "Save window placements to saveFile", + NULL + } + }, {"saveMacro", &saveMacro, RC_BOOL, { "Save macros to saveFile", @@ -463,6 +469,14 @@ NULL } }, +#ifdef BEEPLITE + {"saveBeeplite", &saveBeeplite, RC_BOOL, + { + "Save beeplite macros to saveFile", + NULL + } + }, +#endif #ifdef RCM {"saveRCM", &saveRCM, RC_BOOL, { @@ -1008,7 +1022,7 @@ #ifdef BEEPLITE else if (strncasecmp(file, "lite.", 5) == 0) { - int offset = 5; + int offset = 5; char **lt; if (file[6] == '.') @@ -1107,76 +1121,76 @@ getdefault (char *str) { struct stringlist *sl; - char tmp[256]; - - /* We want to be able to have option.observer or option.serverNick in rc */ - if (observerMode) - { - strcpy (tmp, str); - strcat (tmp, ".observer"); - - sl = defaults; - while (sl != NULL) - { - if (strcmpi (sl->string, tmp) == 0) - return (sl->value); - sl = sl->next; - } - } - - if (serverNick) - { - strcpy (tmp, str); - strcat (tmp, "."); - strcat (tmp, serverNick); - - sl = defaults; - while (sl != NULL) - { - if (strcmpi (sl->string, tmp) == 0) - return (sl->value); - sl = sl->next; - } - } - - if (serverType != ST_UNKNOWN) - { - strcpy (tmp, str); - switch (serverType) - { - case ST_PARADISE: - strcat (tmp, ".paradise"); - break; - case ST_BRONCO: - strcat (tmp, ".bronco"); - break; - case ST_CHAOS: - strcat (tmp, ".chaos"); - break; - case ST_INL: - strcat (tmp, ".inl"); - break; - case ST_STURGEON: - strcat (tmp, ".sturgeon"); - break; - case ST_HOCKEY: - strcat (tmp, ".hockey"); - break; - case ST_DOGFIGHT: - strcat (tmp, ".dogfight"); - break; - default: - strcat (tmp, ".unknown"); - } - - sl = defaults; - while (sl != NULL) - { - if (strcmpi (sl->string, tmp) == 0) - return (sl->value); - sl = sl->next; - } - } + char tmp[256]; + + /* We want to be able to have option.observer or option.serverNick in rc */ + if (observerMode) + { + strcpy (tmp, str); + strcat (tmp, ".observer"); + + sl = defaults; + while (sl != NULL) + { + if (strcmpi (sl->string, tmp) == 0) + return (sl->value); + sl = sl->next; + } + } + + if (serverNick) + { + strcpy (tmp, str); + strcat (tmp, "."); + strcat (tmp, serverNick); + + sl = defaults; + while (sl != NULL) + { + if (strcmpi (sl->string, tmp) == 0) + return (sl->value); + sl = sl->next; + } + } + + if (serverType != ST_UNKNOWN) + { + strcpy (tmp, str); + switch (serverType) + { + case ST_PARADISE: + strcat (tmp, ".paradise"); + break; + case ST_BRONCO: + strcat (tmp, ".bronco"); + break; + case ST_CHAOS: + strcat (tmp, ".chaos"); + break; + case ST_INL: + strcat (tmp, ".inl"); + break; + case ST_STURGEON: + strcat (tmp, ".sturgeon"); + break; + case ST_HOCKEY: + strcat (tmp, ".hockey"); + break; + case ST_DOGFIGHT: + strcat (tmp, ".dogfight"); + break; + default: + strcat (tmp, ".unknown"); + } + + sl = defaults; + while (sl != NULL) + { + if (strcmpi (sl->string, tmp) == 0) + return (sl->value); + sl = sl->next; + } + } sl = defaults; while (sl != NULL) @@ -1205,8 +1219,8 @@ { if (strcmpi (sl->value, srvName) == 0) { - tmpServerNick = strtok (sl->string, "."); /* Remove server. */ - tmpServerNick = strtok (NULL, "."); /* Get actual server nick */ + tmpServerNick = strtok (sl->string, "."); /* Remove server. */ + tmpServerNick = strtok (NULL, "."); /* Get actual server nick */ return strdup (tmpServerNick); } sl = sl->next; @@ -1222,31 +1236,31 @@ getServerType (char *srvName) { struct stringlist *sl; - char tmpTypeStr[128]; - - sprintf (tmpTypeStr, "servertype.%s", srvName); + char tmpTypeStr[128]; + + sprintf (tmpTypeStr, "servertype.%s", srvName); sl = defaults; while (sl != NULL) { if (strcmpi (sl->string, tmpTypeStr) == 0) { - if (strcmpi (sl->value, "paradise") == 0) - return ST_PARADISE; - else if (strcmpi (sl->value, "bronco") == 0) - return ST_BRONCO; - else if (strcmpi (sl->value, "chaos") == 0) - return ST_CHAOS; - else if (strcmpi (sl->value, "inl") == 0) - return ST_INL; - else if (strcmpi (sl->value, "sturgeon") == 0) - return ST_STURGEON; - else if (strcmpi (sl->value, "hockey") == 0) - return ST_HOCKEY; - else if (strcmpi (sl->value, "dogfight") == 0) - return ST_DOGFIGHT; - else - return ST_UNKNOWN; + if (strcmpi (sl->value, "paradise") == 0) + return ST_PARADISE; + else if (strcmpi (sl->value, "bronco") == 0) + return ST_BRONCO; + else if (strcmpi (sl->value, "chaos") == 0) + return ST_CHAOS; + else if (strcmpi (sl->value, "inl") == 0) + return ST_INL; + else if (strcmpi (sl->value, "sturgeon") == 0) + return ST_STURGEON; + else if (strcmpi (sl->value, "hockey") == 0) + return ST_HOCKEY; + else if (strcmpi (sl->value, "dogfight") == 0) + return ST_DOGFIGHT; + else + return ST_UNKNOWN; } sl = sl->next; } @@ -1429,6 +1443,10 @@ saveBig = booleanDefault ("saveBig", saveBig); saveMacro = booleanDefault ("saveMacro", saveMacro); saveRCD = booleanDefault ("saveRCD", saveRCD); + saveWindow = booleanDefault ("saveWindow", saveWindow); +#ifdef RCM + saveBeeplite = booleanDefault ("saveBeeplite", saveBeeplite); +#endif #ifdef RCM saveRCM = booleanDefault ("saveRCM", saveRCM); #endif @@ -1643,6 +1661,7 @@ updateWindowsGeometry (planetw); updateWindowsGeometry (rankw); updateWindowsGeometry (playerw); + updateWindowsGeometry (playerw2); updateWindowsGeometry (helpWin); updateWindowsGeometry (messwa); updateWindowsGeometry (messwt); @@ -1665,7 +1684,8 @@ updateWindowsGeometry (defWin); #endif #ifdef DOC_WIN - updateWindowsGeometry (docwin); + updateWindowsGeometry (DocWin); + updateWindowsGeometry (xtrekrcWin); #endif for (i = 0; i < 4; i++) updateWindowsGeometry (teamWin[i]); @@ -1822,23 +1842,23 @@ // Default character name if (pseudo != NULL) { - if (saveBig) - fputs ("# Default character name\n", fp); - sprintf (str, "name: %s\n", pseudo); - fputs (str, fp); - if (saveBig) - fputs ("\n", fp); + if (saveBig) + fputs ("# Default character name\n", fp); + sprintf (str, "name: %s\n", pseudo); + fputs (str, fp); + if (saveBig) + fputs ("\n", fp); } // Login if (login != NULL) { - if (saveBig) - fputs ("# Login name\n", fp); - sprintf (str, "login: %s\n", login); - fputs (str, fp); - if (saveBig) - fputs ("\n", fp); + if (saveBig) + fputs ("# Login name\n", fp); + sprintf (str, "login: %s\n", login); + fputs (str, fp); + if (saveBig) + fputs ("\n", fp); } // Let's print buttonmap @@ -1975,23 +1995,23 @@ // sound directory if (sounddir != NULL) { - if (saveBig) - fputs ("# Sound directory\n", fp); - sprintf (str, "sounddir: %s\n", sounddir); - fputs (str, fp); - if (saveBig) - fputs ("\n", fp); + if (saveBig) + fputs ("# Sound directory\n", fp); + sprintf (str, "sounddir: %s\n", sounddir); + fputs (str, fp); + if (saveBig) + fputs ("\n", fp); } // metacache if (metaCache != NULL) { - if (saveBig) - fputs ("# Metacache file\n", fp); - sprintf (str, "metaCache: %s\n", metaCache); - fputs (str, fp); - if (saveBig) - fputs ("\n", fp); + if (saveBig) + fputs ("# Metacache file\n", fp); + sprintf (str, "metaCache: %s\n", metaCache); + fputs (str, fp); + if (saveBig) + fputs ("\n", fp); } // player list @@ -2036,6 +2056,585 @@ fputs ("\n", fp); + // Window placements + if (saveWindow) + { + char *adefault; + + if (saveBig) + { + fputs ("# Window placements section\n", fp); + fputs ("\n", fp); + } + + // Main window - always mapped + if ((adefault = stringDefault ("netrek.parent")) != NULL) + { + sprintf (str, "netrek.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("netrek.geometry")) != NULL) + { + sprintf (str, "netrek.geometry: %s\n", adefault); + fputs (str, fp); + } + fputs ("\n", fp); + + // Local window - always mapped + if ((adefault = stringDefault ("local.parent")) != NULL) + { + sprintf (str, "local.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("local.geometry")) != NULL) + { + sprintf (str, "local.geometry: %s\n", adefault); + fputs (str, fp); + } + fputs ("\n", fp); + + // Map window - always mapped + if ((adefault = stringDefault ("map.parent")) != NULL) + { + sprintf (str, "map.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("map.geometry")) != NULL) + { + sprintf (str, "map.geometry: %s\n", adefault); + fputs (str, fp); + } + fputs ("\n", fp); + + // Dashboard window - always mapped + if ((adefault = stringDefault ("tstat.parent")) != NULL) + { + sprintf (str, "tstat.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("tstat.geometry")) != NULL) + { + sprintf (str, "tstat.geometry: %s\n", adefault); + fputs (str, fp); + } + fputs ("\n", fp); + + // Warning window - always mapped + if ((adefault = stringDefault ("warn.parent")) != NULL) + { + sprintf (str, "warn.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("warn.geometry")) != NULL) + { + sprintf (str, "warn.geometry: %s\n", adefault); + fputs (str, fp); + } + fputs ("\n", fp); + + // Message window - preferred mapped + if ((adefault = stringDefault ("message.parent")) != NULL) + { + sprintf (str, "message.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("message.geometry")) != NULL) + { + sprintf (str, "message.geometry: %s\n", adefault); + fputs (str, fp); + } + if (booleanDefault ("message.mapped", 1)) + sprintf (str, "message.mapped: on\n"); + else + sprintf (str, "message.mapped: off\n"); + fputs (str, fp); + fputs ("\n", fp); + + // Planet window + if ((adefault = stringDefault ("planet.parent")) != NULL) + { + sprintf (str, "planet.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("planet.geometry")) != NULL) + { + sprintf (str, "planet.geometry: %s\n", adefault); + fputs (str, fp); + } + if (booleanDefault ("planet.mapped", 0)) + sprintf (str, "planet.mapped: on\n"); + else + sprintf (str, "planet.mapped: off\n"); + fputs (str, fp); + fputs ("\n", fp); + + // Rank window + if ((adefault = stringDefault ("rank.parent")) != NULL) + { + sprintf (str, "rank.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("rank.geometry")) != NULL) + { + sprintf (str, "rank.geometry: %s\n", adefault); + fputs (str, fp); + } + if (booleanDefault ("rank.mapped", 0)) + sprintf (str, "rank.mapped: on\n"); + else + sprintf (str, "rank.mapped: off\n"); + fputs (str, fp); + fputs ("\n", fp); + + // Playerlist window - preferred mapped + if ((adefault = stringDefault ("player.parent")) != NULL) + { + sprintf (str, "player.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("player.geometry")) != NULL) + { + sprintf (str, "player.geometry: %s\n", adefault); + fputs (str, fp); + } + if (booleanDefault ("player.mapped", 1)) + sprintf (str, "player.mapped: on\n"); + else + sprintf (str, "player.mapped: off\n"); + fputs (str, fp); + fputs ("\n", fp); + + // Alternate playerlist window + if ((adefault = stringDefault ("player2.parent")) != NULL) + { + sprintf (str, "player2.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("player2.geometry")) != NULL) + { + sprintf (str, "player2.geometry: %s\n", adefault); + fputs (str, fp); + } + if (booleanDefault ("player2.mapped", 0)) + sprintf (str, "player2.mapped: on\n"); + else + sprintf (str, "player2.mapped: off\n"); + fputs (str, fp); + fputs ("\n", fp); + + // Help window + if ((adefault = stringDefault ("help.parent")) != NULL) + { + sprintf (str, "help.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("help.geometry")) != NULL) + { + sprintf (str, "help.geometry: %s\n", adefault); + fputs (str, fp); + } + if (booleanDefault ("help.mapped", 0)) + sprintf (str, "help.mapped: on\n"); + else + sprintf (str, "help.mapped: off\n"); + fputs (str, fp); + fputs ("\n", fp); + + // Review all window + if ((adefault = stringDefault ("review_all.parent")) != NULL) + { + sprintf (str, "review_all.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("review_all.geometry")) != NULL) + { + sprintf (str, "review_all.geometry: %s\n", adefault); + fputs (str, fp); + } + if (booleanDefault ("review_all.mapped", 0)) + sprintf (str, "review_all.mapped: on\n"); + else + sprintf (str, "review_all.mapped: off\n"); + fputs (str, fp); + if ((adefault = stringDefault ("review_all.allow")) != NULL) + { + sprintf (str, "review_all.allow: %s\n", adefault); + fputs (str, fp); + } + fputs ("\n", fp); + + // Review team window + if ((adefault = stringDefault ("review_team.parent")) != NULL) + { + sprintf (str, "review_team.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("review_team.geometry")) != NULL) + { + sprintf (str, "review_team.geometry: %s\n", adefault); + fputs (str, fp); + } + if (booleanDefault ("review_team.mapped", 0)) + sprintf (str, "review_team.mapped: on\n"); + else + sprintf (str, "review_team.mapped: off\n"); + fputs (str, fp); + if ((adefault = stringDefault ("review_team.allow")) != NULL) + { + sprintf (str, "review_team.allow: %s\n", adefault); + fputs (str, fp); + } + fputs ("\n", fp); + + // Review your window + if ((adefault = stringDefault ("review_your.parent")) != NULL) + { + sprintf (str, "review_your.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("review_your.geometry")) != NULL) + { + sprintf (str, "review_your.geometry: %s\n", adefault); + fputs (str, fp); + } + if (booleanDefault ("review_your.mapped", 0)) + sprintf (str, "review_your.mapped: on\n"); + else + sprintf (str, "review_your.mapped: off\n"); + fputs (str, fp); + if ((adefault = stringDefault ("review_your.allow")) != NULL) + { + sprintf (str, "review_your.allow: %s\n", adefault); + fputs (str, fp); + } + fputs ("\n", fp); + + // Review kill window + if ((adefault = stringDefault ("review_kill.parent")) != NULL) + { + sprintf (str, "review_kill.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("review_kill.geometry")) != NULL) + { + sprintf (str, "review_kill.geometry: %s\n", adefault); + fputs (str, fp); + } + if (booleanDefault ("review_kill.mapped", 0)) + sprintf (str, "review_kill.mapped: on\n"); + else + sprintf (str, "review_kill.mapped: off\n"); + fputs (str, fp); + if ((adefault = stringDefault ("review_kill.allow")) != NULL) + { + sprintf (str, "review_kill.allow: %s\n", adefault); + fputs (str, fp); + } + fputs ("\n", fp); + + // Review phaser window + if ((adefault = stringDefault ("review_phaser.parent")) != NULL) + { + sprintf (str, "review_phaser.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("review_phaser.geometry")) != NULL) + { + sprintf (str, "review_phaser.geometry: %s\n", adefault); + fputs (str, fp); + } + if (booleanDefault ("review_phaser.mapped", 0)) + sprintf (str, "review_phaser.mapped: on\n"); + else + sprintf (str, "review_phaser.mapped: off\n"); + fputs (str, fp); + if ((adefault = stringDefault ("review_phaser.allow")) != NULL) + { + sprintf (str, "review_phaser.allow: %s\n", adefault); + fputs (str, fp); + } + fputs ("\n", fp); + + // Review window - preferred mapped + if ((adefault = stringDefault ("review.parent")) != NULL) + { + sprintf (str, "review.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("review.geometry")) != NULL) + { + sprintf (str, "review.geometry: %s\n", adefault); + fputs (str, fp); + } + if (booleanDefault ("review.mapped", 1)) + sprintf (str, "review.mapped: on\n"); + else + sprintf (str, "review.mapped: off\n"); + fputs (str, fp); + if ((adefault = stringDefault ("review.allow")) != NULL) + { + sprintf (str, "review.allow: %s\n", adefault); + fputs (str, fp); + } + fputs ("\n", fp); + + // Ping Stats window + if ((adefault = stringDefault ("pingStats.parent")) != NULL) + { + sprintf (str, "pingStats.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("pingStats.geometry")) != NULL) + { + sprintf (str, "pingStats.geometry: %s\n", adefault); + fputs (str, fp); + } + if (booleanDefault ("pingStats.mapped", 0)) + sprintf (str, "pingStats.mapped: on\n"); + else + sprintf (str, "pingStats.mapped: off\n"); + fputs (str, fp); + fputs ("\n", fp); + + // UDP window + if ((adefault = stringDefault ("UDP.parent")) != NULL) + { + sprintf (str, "UDP.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("UDP.geometry")) != NULL) + { + sprintf (str, "UDP.geometry: %s\n", adefault); + fputs (str, fp); + } + if (booleanDefault ("UDP.mapped", 0)) + sprintf (str, "UDP.mapped: on\n"); + else + sprintf (str, "UDP.mapped: off\n"); + fputs (str, fp); + fputs ("\n", fp); + +#ifdef SHORT_PACKETS + // Short packets window + if ((adefault = stringDefault ("network.parent")) != NULL) + { + sprintf (str, "network.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("network.geometry")) != NULL) + { + sprintf (str, "network.geometry: %s\n", adefault); + fputs (str, fp); + } + if (booleanDefault ("network.mapped", 0)) + sprintf (str, "network.mapped: on\n"); + else + sprintf (str, "network.mapped: off\n"); + fputs (str, fp); + fputs ("\n", fp); +#endif + +#ifdef TOOLS + // Tools window + if ((adefault = stringDefault ("tools.parent")) != NULL) + { + sprintf (str, "tools.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("tools.geometry")) != NULL) + { + sprintf (str, "tools.geometry: %s\n", adefault); + fputs (str, fp); + } + if (booleanDefault ("tools.mapped", 0)) + sprintf (str, "tools.mapped: on\n"); + else + sprintf (str, "tools.mapped: off\n"); + fputs (str, fp); + fputs ("\n", fp); +#endif + +#ifdef XTREKRC_HELP + // Xtrekrc help window + if ((adefault = stringDefault ("xtrekrc_help.parent")) != NULL) + { + sprintf (str, "xtrekrc_help.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("xtrekrc_help.geometry")) != NULL) + { + sprintf (str, "xtrekrc_help.geometry: %s\n", adefault); + fputs (str, fp); + } + if (booleanDefault ("xtrekrc_help.mapped", 0)) + sprintf (str, "xtrekrc_help.mapped: on\n"); + else + sprintf (str, "xtrekrc_help.mapped: off\n"); + fputs (str, fp); + fputs ("\n", fp); +#endif + +#ifdef DOC_WIN + // Documentation window + if ((adefault = stringDefault ("DocWin.parent")) != NULL) + { + sprintf (str, "DocWin.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("DocWin.geometry")) != NULL) + { + sprintf (str, "DocWin.geometry: %s\n", adefault); + fputs (str, fp); + } + if (booleanDefault ("DocWin.mapped", 0)) + sprintf (str, "DocWin.mapped: on\n"); + else + sprintf (str, "DocWin.mapped: off\n"); + fputs (str, fp); + fputs ("\n", fp); + + // Xtrekrc window + if ((adefault = stringDefault ("xtrekrcWin.parent")) != NULL) + { + sprintf (str, "xtrekrcWin.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("xtrekrcWin.geometry")) != NULL) + { + sprintf (str, "xtrekrcWin.geometry: %s\n", adefault); + fputs (str, fp); + } + if (booleanDefault ("xtrekrcWin.mapped", 0)) + sprintf (str, "xtrekrcWin.mapped: on\n"); + else + sprintf (str, "xtrekrcWin.mapped: off\n"); + fputs (str, fp); + fputs ("\n", fp); +#endif + + // Fed team window - always mapped + if ((adefault = stringDefault ("fed.parent")) != NULL) + { + sprintf (str, "fed.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("fed.geometry")) != NULL) + { + sprintf (str, "fed.geometry: %s\n", adefault); + fputs (str, fp); + } + fputs ("\n", fp); + + // Kli team window - always mapped + if ((adefault = stringDefault ("kli.parent")) != NULL) + { + sprintf (str, "kli.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("kli.geometry")) != NULL) + { + sprintf (str, "kli.geometry: %s\n", adefault); + fputs (str, fp); + } + fputs ("\n", fp); + + // Ori team window - always mapped + if ((adefault = stringDefault ("ori.parent")) != NULL) + { + sprintf (str, "ori.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("ori.geometry")) != NULL) + { + sprintf (str, "ori.geometry: %s\n", adefault); + fputs (str, fp); + } + fputs ("\n", fp); + + // Rom team window - always mapped + if ((adefault = stringDefault ("rom.parent")) != NULL) + { + sprintf (str, "rom.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("rom.geometry")) != NULL) + { + sprintf (str, "rom.geometry: %s\n", adefault); + fputs (str, fp); + } + fputs ("\n", fp); + + // Quit window - always mapped + if ((adefault = stringDefault ("quit.parent")) != NULL) + { + sprintf (str, "quit.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("quit.geometry")) != NULL) + { + sprintf (str, "quit.geometry: %s\n", adefault); + fputs (str, fp); + } + fputs ("\n", fp); + + // Stats window + if ((adefault = stringDefault ("stats.parent")) != NULL) + { + sprintf (str, "stats.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("stats.geometry")) != NULL) + { + sprintf (str, "stats.geometry: %s\n", adefault); + fputs (str, fp); + } + if (booleanDefault ("stats.mapped", 0)) + sprintf (str, "stats.mapped: on\n"); + else + sprintf (str, "stats.mapped: off\n"); + fputs (str, fp); + fputs ("\n", fp); + + // War window + if ((adefault = stringDefault ("war.parent")) != NULL) + { + sprintf (str, "war.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("war.geometry")) != NULL) + { + sprintf (str, "war.geometry: %s\n", adefault); + fputs (str, fp); + } + if (booleanDefault ("war.mapped", 0)) + sprintf (str, "war.mapped: on\n"); + else + sprintf (str, "war.mapped: off\n"); + fputs (str, fp); + fputs ("\n", fp); + + // Sound window + if ((adefault = stringDefault ("sound.parent")) != NULL) + { + sprintf (str, "sound.parent: %s\n", adefault); + fputs (str, fp); + } + if ((adefault = stringDefault ("sound.geometry")) != NULL) + { + sprintf (str, "sound.geometry: %s\n", adefault); + fputs (str, fp); + } + if (booleanDefault ("sound.mapped", 0)) + sprintf (str, "sound.mapped: on\n"); + else + sprintf (str, "sound.mapped: off\n"); + fputs (str, fp); + fputs ("\n", fp); + + if (saveBig) + fputs ("\n", fp); + } + // macros if (saveMacro) { @@ -2347,7 +2946,6 @@ strcat (str, ": "); strcat (str, dm->macro); strcat (str, "\n"); - fputs (str, fp); } @@ -2357,6 +2955,36 @@ fputs ("\n", fp); } +#ifdef BEEPLITE + // Beeplite macros + if (saveBeeplite) + { + char **lt; + if (saveBig) + fputs ("# Beeplite macros\n", fp); + + for (lt = &distlite[1], dm = &dist_prefered[1]; dm->name; lt++, dm++) + { + if (*lt != NULL) // distlite array defined as NULL, so only save the ones + // that have been set either through reading in netrekrc + // or from defLite settings + { + strcpy (str, "lite."); + strcat (str, dm->name); + strcat (str, ": "); + strcat (str, *lt); + strcat (str, "\n"); + fputs (str, fp); + } + } + + fputs ("\n", fp); + + if (saveBig) + fputs ("\n", fp); + } +#endif + #ifdef RCM // RCM macros if (saveRCM) Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- data.c 26 May 2006 06:58:19 -0000 1.29 +++ data.c 28 May 2006 23:05:12 -0000 1.30 @@ -65,7 +65,7 @@ int messpend = 0; #ifdef XTRA_MESSAGE_UI int messageHUD = 0; /* Show message being typed on the local display */ -int messageHoldThresh = 0; /* Threshold value for putting a message on hold (squared) */ +int messageHoldThresh = 0; /* Threshold value for putting a message on hold (squared) */ int messMouseDelta = 0; /* To keep track of mouse movement delta */ #endif int lastcount = 0; @@ -433,7 +433,7 @@ struct dmacro_list dist_defaults[] = { {(unsigned char) ('X'), "no zero", "this should never get looked at"}, /* ^t */ - {(unsigned char) ('\xd4'), "taking", " %T%c->%O (%S) Carrying %a to %l%?%n>-1%{ @ %n%}\0"}, + {(unsigned char) ('\xd4'), "take", " %T%c->%O (%S) Carrying %a to %l%?%n>-1%{ @ %n%}\0"}, /* ^o */ {(unsigned char) ('\xcf'), "ogg", " %T%c->%O Help Ogg %p at %l\0"}, /* ^b */ @@ -700,9 +700,15 @@ char *saveFile = NULL; int saveBig = 1; +int saveWindow = 1; int saveMacro = 1; int saveRCD = 1; +#ifdef BEEPLITE +int saveBeeplite = 1; +#endif +#ifdef RCM int saveRCM = 1; +#endif int tpDotDist = 10; Index: beeplite.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/beeplite.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- beeplite.c 30 Apr 2006 15:59:39 -0000 1.8 +++ beeplite.c 28 May 2006 23:05:12 -0000 1.9 @@ -52,8 +52,8 @@ distlite[base_ogg] = "/g/m"; if (distlite[pickup] == NULL) distlite[pickup] = "/p"; - if (distlite[generic] == NULL) - distlite[generic] = "%?%S=SB%{/c%}"; + if (distlite[help] == NULL) + distlite[help] = "%?%S=SB%{/c%}"; } void liteplanet(struct planet *l) Index: senddist.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/senddist.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- senddist.c 7 May 2006 16:59:27 -0000 1.4 +++ senddist.c 28 May 2006 23:05:12 -0000 1.5 @@ -57,8 +57,8 @@ dist->cloakflag = (unsigned char) (((me->p_flags & PFCLOAK) > 0) ? 1 : 0); dist->distype = (unsigned char) i; - if (dist->distype > generic || dist->distype < take) - dist->distype = generic; + if (dist->distype > help || dist->distype < take) + dist->distype = help; target = gettarget2 (me->p_x, me->p_y, TARG_PLANET); dist->close_pl = (unsigned char) (target->o_num); Index: option.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/option.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- option.c 24 May 2006 01:14:39 -0000 1.19 +++ option.c 28 May 2006 23:05:12 -0000 1.20 @@ -398,8 +398,12 @@ {0, "Save Menu", &MenuPage, 0, 0, 0, NULL, &Menus_Range}, {1, "Page %d (click to change)", &MenuPage, 0, 0, 0, NULL, &Menus_Range}, {1, "", &saveBig, 0, 0, 0, savebigmess, NULL}, + {1, "save window placements", &saveWindow, 0, 0, 0, NULL, NULL}, {1, "save macros", &saveMacro, 0, 0, 0, NULL, NULL}, {1, "save RCD", &saveRCD, 0, 0, 0, NULL, NULL}, +#ifdef BEEPLITE + {1, "save beeplite macros", &saveBeeplite, 0, 0, 0, NULL, NULL}, +#endif #ifdef RCM {1, "save RCM", &saveRCM, 0, 0, 0, NULL, NULL}, #endif From modemhero at users.sourceforge.net Sun May 28 18:05:14 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 28 May 2006 23:05:14 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h, 1.25, 1.26 struct.h, 1.9, 1.10 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv9198/include Modified Files: data.h struct.h Log Message: Fixed some inconsistencies in how a few RCDs were named - "taking" renamed to "take", "generic" renamed to "help", "help3 and help4" renamed to "help1 and help2", and "doing3 and doing4" renamed to "doing1 and doing2" Added "saveWindow: (on)/off" and "saveBeeplite: (on)/off" to allow saving of window placments and beeplite macros to the netrek.sav file. Save options now can save windows placements, review window .allow settings, and beeplite macros Changed some default window sizes/locations that were either too small (i.e. help window) or in a bad spot (i.e. planet window) Fixed a bunch of spacing inconsistencies Added/modified a few checkmapped calls in newwin.c to either use the "newish" checkmappedpref function, or to add a checkmapped check if I felt it should be checked Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- data.h 26 May 2006 06:58:19 -0000 1.25 +++ data.h 28 May 2006 23:05:11 -0000 1.26 @@ -598,9 +598,15 @@ extern char * saveFile; /* file name to save options to */ extern int saveBig; /* save options with comments */ +extern int saveWindow; /* save options with window placements */ extern int saveMacro; /* save options with macros */ extern int saveRCD; /* save options with RCD */ +#ifdef BEEPLITE +extern int saveBeeplite; /* save options with Beeplite */ +#endif +#ifdef RCM extern int saveRCM; /* save options with RCM */ +#endif extern int tpDotDist; /* distance between tractor/pressor dots */ Index: struct.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/struct.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- struct.h 21 May 2006 09:56:38 -0000 1.9 +++ struct.h 28 May 2006 23:05:11 -0000 1.10 @@ -44,13 +44,13 @@ take = 1, ogg, bomb, space_control, save_planet, base_ogg, - help3, help4, + help1, help2, /* doing series */ escorting, ogging, bombing, controlling, asw, asbomb, - doing3, doing4, + doing1, doing2, /* other info series */ free_beer, /* ie. player x is totally @@ -64,7 +64,7 @@ other1, other2, /* just a generic distress call */ - generic + help #ifdef RCM , rcm #endif From modemhero at users.sourceforge.net Sun May 28 18:05:14 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 28 May 2006 23:05:14 +0000 Subject: [netrek-cvs] client/netrekxp/resources/htmlhelp/html generalconfig.html, 1.11, 1.12 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv9198/resources/htmlhelp/html Modified Files: generalconfig.html Log Message: Fixed some inconsistencies in how a few RCDs were named - "taking" renamed to "take", "generic" renamed to "help", "help3 and help4" renamed to "help1 and help2", and "doing3 and doing4" renamed to "doing1 and doing2" Added "saveWindow: (on)/off" and "saveBeeplite: (on)/off" to allow saving of window placments and beeplite macros to the netrek.sav file. Save options now can save windows placements, review window .allow settings, and beeplite macros Changed some default window sizes/locations that were either too small (i.e. help window) or in a bad spot (i.e. planet window) Fixed a bunch of spacing inconsistencies Added/modified a few checkmapped calls in newwin.c to either use the "newish" checkmappedpref function, or to add a checkmapped check if I felt it should be checked Index: generalconfig.html =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html/generalconfig.html,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- generalconfig.html 22 May 2006 08:27:53 -0000 1.11 +++ generalconfig.html 28 May 2006 23:05:12 -0000 1.12 @@ -835,6 +835,16 @@ +saveBeeplite +Save beeplite macros when saving settings + +
        +
      • on (default)
      • +
      • off
      • +
      + + + saveMacro Save macros when saving settings @@ -865,6 +875,16 @@ +saveWindow +Save window placements when saving settings + +
        +
      • on (default)
      • +
      • off
      • +
      + + + server Server name to connect to by default hostname From modemhero at users.sourceforge.net Sun May 28 18:05:13 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 28 May 2006 23:05:13 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.39, 1.40 clientr.suo, 1.14, 1.15 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv9198 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Fixed some inconsistencies in how a few RCDs were named - "taking" renamed to "take", "generic" renamed to "help", "help3 and help4" renamed to "help1 and help2", and "doing3 and doing4" renamed to "doing1 and doing2" Added "saveWindow: (on)/off" and "saveBeeplite: (on)/off" to allow saving of window placments and beeplite macros to the netrek.sav file. Save options now can save windows placements, review window .allow settings, and beeplite macros Changed some default window sizes/locations that were either too small (i.e. help window) or in a bad spot (i.e. planet window) Fixed a bunch of spacing inconsistencies Added/modified a few checkmapped calls in newwin.c to either use the "newish" checkmappedpref function, or to add a checkmapped check if I felt it should be checked Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- NetrekXP to do list.C 28 May 2006 06:28:13 -0000 1.39 +++ NetrekXP to do list.C 28 May 2006 23:05:11 -0000 1.40 @@ -25,6 +25,13 @@ send headings of 16 positions. 4) Observers get wrong x,y pos upon observee death. +Things that are sorta fixed, but could use improvement: +1) rewrite placement/refresh of new resource bitmaps to work better with a scaled tactical +2) Bug with waraction..was being called even when clicking on border (broke function) +..I added a default return to switch statement, but the underlying bug still remains. +3) Border issue - quite complex problem, how to know the borders to obey after the bitmap +is rotated. Only solution so far is to ignore borders with scaled bitmaps. + Things to do: 1) Add warning hull. 2) resizeable message windows. Perhaps memory of window positions if you choose @@ -32,24 +39,16 @@ 3) flipping through options menus clears too large a path to the right on the galactic, noticeable with viewbox disappearing at low speeds , depending on what length of menu you flip to. Also, closing hint window has same effect -4) Save options -- Default windows placements need to be saved -- uselite options need to be saved -- review window mapping needs to be saved -- option server/servernick/servertype needs to be saved +4) Save options for observer/servernick/servertype need to be saved 5) A lot of annoying pop up windows (like macro window, default controls) should be closeable by shift right click. -6) Border issue - quite complex problem, how to know the borders to obey after the bitmap -is rotated. Only solution so far is to ignore borders with scaled bitmaps. -7) Workable windows installer would be nice -9) Use nebula pic -10) rewrite placement/refresh of new resource bitmaps to work better with a scaled tactical -11) Bug with waraction..was being called even when clicking on border (broke function) -..I added a default return to switch statement, but the underlying bug still remains. -12) Is there a cpu leak with double buffering? -13) Use masking for things like player team/letter display on galactic. Ship draw on tactical +6) Workable windows installer would be nice +7) Use nebula pic +8) Is there a cpu leak with double buffering? +9) Use masking for things like player team/letter display on galactic. Ship draw on tactical (have it overwrite the planet/wrench/gas/army for example, not just combine colors). -14) Ask stas about addfontresource change in 4.4.0.4 +10) Ask stas about addfontresource change in 4.4.0.4 +11) In game volume adjustment not working with SDL. Stas's list: - color coded playerlist. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 Binary files /tmp/cvssT8e4F and /tmp/cvsaItkk4 differ From modemhero at users.sourceforge.net Sun May 28 18:05:14 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 28 May 2006 23:05:14 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.58, 1.59 netrekrc_options.txt, 1.9, 1.10 netrekxp.doc, 1.8, 1.9 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv9198/resources/docs Modified Files: changes.txt netrekrc_options.txt netrekxp.doc Log Message: Fixed some inconsistencies in how a few RCDs were named - "taking" renamed to "take", "generic" renamed to "help", "help3 and help4" renamed to "help1 and help2", and "doing3 and doing4" renamed to "doing1 and doing2" Added "saveWindow: (on)/off" and "saveBeeplite: (on)/off" to allow saving of window placments and beeplite macros to the netrek.sav file. Save options now can save windows placements, review window .allow settings, and beeplite macros Changed some default window sizes/locations that were either too small (i.e. help window) or in a bad spot (i.e. planet window) Fixed a bunch of spacing inconsistencies Added/modified a few checkmapped calls in newwin.c to either use the "newish" checkmappedpref function, or to add a checkmapped check if I felt it should be checked Index: netrekxp.doc =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekxp.doc,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- netrekxp.doc 28 May 2006 06:28:13 -0000 1.8 +++ netrekxp.doc 28 May 2006 23:05:12 -0000 1.9 @@ -52,6 +52,7 @@ J. Mark Noworolski Tedd Hadley Heiko Wengler + Andy McFadden Chris Guthrie Ed James @@ -403,7 +404,7 @@ Or you can specifiy just the position: - .geometrey: ++ + .geometry: ++ or just the size: @@ -485,10 +486,9 @@ Short Packets: -Short packets are supported by COW. These have been shown to substantially reduce the volume of traffic between the client and server, and will improve lag in many situations. Not all -servers support short packets yet, but that is changing rapidly. +Short packets are supported by Netrek XP. These have been shown to substantially reduce the volume of traffic between the client and server, and will improve lag in many situations. All modern servers support short packets. -COW has a short packet window which is brought up with the "`" key. In this window you can turn short packets on and off as well as configure it in various ways. +Netrek XP has a short packet window which is brought up with the "`" key. In this window you can turn short packets on and off as well as configure it in various ways. Also in your netrek defaults file you can add the line @@ -546,7 +546,7 @@ Note that except for E and F, these are all control keys. Key Name Default Distress Macro -t taking %T%c->%O (%S) Carrying %a to %l%?%n>-1%{ @ %n%} +t take %T%c->%O (%S) Carrying %a to %l%?%n>-1%{ @ %n%} o ogg %T%c->%O Help Ogg %p at %l b bomb %T%c->%O %?%n>4%{bomb %l @ %n%!bomb%} c space_control %T%c->%O Help Control at %L @@ -568,8 +568,9 @@ 9 pickup %T%c->%O %p++ @ %l 0 pop %T%c->%O %l%?%n>-1%{ @ %n%}! F carrying %T%c->%O %?%S=SB%{Your Starbase is c%!C%}arrying %?%a>0%{%a%!NO%} arm%?%a=1%{y%!ies%}. -@ other2 %T%c->%O (%i)%?%a>0%{ has %a arm%?%a=1%{y%!ies%}%} at %l. (%d%%D, %s%%S, %f%%F) -# other3 %T%c->%O (%i)%?%a>0%{ has %a arm%?%a=1%{y%!ies%}%} at %l. (%d%%D, %s%%S, %f%%F) +@ other1 %T%c->%O (%i)%?%a>0%{ has %a arm%?%a=1%{y%!ies%}%} at %l. (%d%%D, %s%%S, %f%%F) + +# other2 %T%c->%O (%i)%?%a>0%{ has %a arm%?%a=1%{y%!ies%}%} at %l. (%d%%D, %s%%S, %f%%F) E help %T%c->%O Help(%S)! %s%% shd, %d%% dmg, %f%% fuel,%?%S=SB%{ %w%% wtmp,%!%}%E%{ ETEMP!%}%W%{ WTEMP!%} %a armies! @@ -582,7 +583,7 @@ 2. Map AS bombing (asbomb) to '^A', don't change the message. - First try to seperate in your mind the two types of configurability + First try to separate in your mind the two types of configurability that are going on here. 1) you are changing the key that sends the message @@ -738,7 +739,6 @@ %l three character name of target planet %N full name of target planet %i sender full player name (16 character max) - %u full name of target player (16 character max) %z 3 letter team id of target planet %b 3 char name of sender nearest planet @@ -809,8 +809,7 @@ 0%{included if true%!included if false%} included if false -Combining the whole package, a very robust macroing system is quickly generated. One can easily design or mimic Distress calls, including the variable NBT distress of the COW client and all the -hardcoded message macroing built into my own client but never released. +Combining the whole package, a very robust macroing system is quickly generated. One can easily design or mimic Distress calls, including the variable NBT distress of the COW client and all the hardcoded message macroing built into my own client but never released. Here are a few more samples to work from: @@ -862,7 +861,7 @@ set [name of key] [destination id] -to the shell ("!") tools. Of corse this may be done with macros as well. +to the shell ("!") tools. Of course this may be done with macros as well. Examples: mac.^C.!: set captain %g @@ -1030,8 +1029,7 @@ Local weenies cheat. They talk to each other. Those of us who have never met another netrek player are forced to rely heavily on the message window. - In order to even the playing field, the current feature was proposed. This feature causes certain types of RCD messages to beep or even highlite specific objects on the screen. This is done via a -macro-like interface which is highly configurable. Further, bitmaps used to highlite can be substituted with your preferences. + In order to even the playing field, the current feature was proposed. This feature causes certain types of RCD messages to beep or even highlite specific objects on the screen. This is done via a macro-like interface which is highly configurable. Further, bitmaps used to highlite can be substituted with your preferences. 1) Turning Beeping and Highliting on Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- changes.txt 26 May 2006 06:58:19 -0000 1.58 +++ changes.txt 28 May 2006 23:05:12 -0000 1.59 @@ -1,4 +1,13 @@ Version TBA: +- fixed some inconsistencies in how a few RCDs were named - "taking" renamed to "take", + "generic" renamed to "help", "help3 and help4" renamed to "help1 and help2", and + "doing3 and doing4" renamed to "doing1 and doing2" +- added "saveWindow: (on)/off" and "saveBeeplite: (on)/off" to allow saving of window placments + and beeplite macros to the netrek.sav file. +- save options now can save windows placements, review window .allow settings, and beeplite + macros +- changed some default window sizes/locations that were either too small (i.e. help window) + or in a bad spot (i.e. planet window) - cambot works now with double buffering, and added cambot howto to the NetrekXP manual - team select screen no longer uses 99% cpu power - planet kill messages now show armies dooshed (if any) Index: netrekrc_options.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc_options.txt,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- netrekrc_options.txt 22 May 2006 08:27:53 -0000 1.9 +++ netrekrc_options.txt 28 May 2006 23:05:12 -0000 1.10 @@ -204,9 +204,11 @@ romshipMbmpfile: (path) - mono bitmaps saveFile: (path) path to saved options file saveBig: (on/off) save options with remarks +saveBeeplite: (on/off) save beeplite macros to saveFile saveMacro: (on/off) save macros to saveFile saveRCD: (on/off) save receiver configurable distresses to saveFile saveRCM: (on/off) save receiver configurable messages to saveFile +saveWindow: (on/off) save window placements to saveFile server: (address) default server server.: (address) is a nickname for (address) shiftedMouse: (on/off) shift+mouse buttons will work as commands From modemhero at users.sourceforge.net Sun May 28 19:18:11 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 29 May 2006 00:18:11 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.40, 1.41 clientr.suo, 1.15, 1.16 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv6824 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Fixed changing volume in-game with SDL. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- NetrekXP to do list.C 28 May 2006 23:05:11 -0000 1.40 +++ NetrekXP to do list.C 29 May 2006 00:18:09 -0000 1.41 @@ -47,8 +47,8 @@ 8) Is there a cpu leak with double buffering? 9) Use masking for things like player team/letter display on galactic. Ship draw on tactical (have it overwrite the planet/wrench/gas/army for example, not just combine colors). -10) Ask stas about addfontresource change in 4.4.0.4 -11) In game volume adjustment not working with SDL. +10) Ask stas about addfontresource change in 4.4.0.4 - causing problems with win 98 machines. +11) Get square planet bitmaps from defcom so I can turn them into mapped rotating globes. Stas's list: - color coded playerlist. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 Binary files /tmp/cvsuVfAPl and /tmp/cvsh7rcYN differ From modemhero at users.sourceforge.net Sun May 28 19:18:11 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 29 May 2006 00:18:11 +0000 Subject: [netrek-cvs] client/netrekxp/include proto.h,1.22,1.23 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv6824/include Modified Files: proto.h Log Message: Fixed changing volume in-game with SDL. Index: proto.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- proto.h 22 May 2006 08:27:52 -0000 1.22 +++ proto.h 29 May 2006 00:18:09 -0000 1.23 @@ -1272,5 +1272,5 @@ void StopSound (); int StartSound (char *name); int SoundPlaying (); - +void CheckVolumeSettings (); #endif /* __INCLUDED_proto_h__ */ From modemhero at users.sourceforge.net Sun May 28 19:18:11 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 29 May 2006 00:18:11 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs netrekxp.doc,1.9,1.10 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv6824/resources/docs Modified Files: netrekxp.doc Log Message: Fixed changing volume in-game with SDL. Index: netrekxp.doc =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekxp.doc,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- netrekxp.doc 28 May 2006 23:05:12 -0000 1.9 +++ netrekxp.doc 29 May 2006 00:18:09 -0000 1.10 @@ -52,7 +52,6 @@ J. Mark Noworolski Tedd Hadley Heiko Wengler - Andy McFadden Chris Guthrie Ed James From modemhero at users.sourceforge.net Sun May 28 19:18:11 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 29 May 2006 00:18:11 +0000 Subject: [netrek-cvs] client/netrekxp/src sound.c, 1.12, 1.13 winsndlib.c, 1.3, 1.4 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv6824/src Modified Files: sound.c winsndlib.c Log Message: Fixed changing volume in-game with SDL. Index: winsndlib.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/winsndlib.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- winsndlib.c 21 Apr 2006 12:00:07 -0000 1.3 +++ winsndlib.c 29 May 2006 00:18:09 -0000 1.4 @@ -52,8 +52,8 @@ /* Sound cache size */ #define MAXBYTES (256*1024*10) -int caps_vol = 0; /* can control volume */ -int caps_lr = 0; /* has separate volume control for each channel */ +static int caps_vol = 0; /* can control volume */ +static int caps_lr = 0; /* has separate volume control for each channel */ /* Macro to create DWORD from HIWORD and LOWORD */ #define MAKEDWORD(a, b) ((DWORD) (((WORD) (a)) | ((DWORD) ((WORD) (b))) << 16)) @@ -315,7 +315,6 @@ static PCMWAVEFORMAT lastfmt; struct sound *snd; DWORD err; - WAVEOUTCAPS caps; #ifdef DEBUG LineToConsole ("Request to play sound %s\n", name); @@ -361,24 +360,7 @@ waveOutPrepareHeader (hw, &snd->hdr, sizeof (WAVEHDR)); waveOutWrite (hw, &snd->hdr, sizeof (WAVEHDR)); - /* Now let's see whether our device supports volume control */ - waveOutGetDevCaps (WAVE_MAPPER, &caps, sizeof (WAVEOUTCAPS)); - if (caps.dwSupport & WAVECAPS_VOLUME) - caps_vol = 1; - if (caps.dwSupport & WAVECAPS_LRVOLUME) - caps_lr = 1; - - /* Now let's see whether volume is balanced or not */ - if (caps_lr) - { - DWORD curvol; - - waveOutGetVolume (hw, &curvol); - - if (LOWORD(curvol) != HIWORD(curvol)) - waveOutSetVolume (hw, MAKEDWORD(LOWORD(curvol), LOWORD(curvol))); - } - + CheckVolumeSettings(); return 0; } return -1; @@ -449,4 +431,28 @@ waveOutSetVolume (hw, MAKEDWORD(HIWORD(curvol), LOWORD(curvol) - 0x1111)); break; } +} + +void +CheckVolumeSettings () +{ + WAVEOUTCAPS caps; + + /* Let's see whether our device supports volume control */ + waveOutGetDevCaps (WAVE_MAPPER, &caps, sizeof (WAVEOUTCAPS)); + if (caps.dwSupport & WAVECAPS_VOLUME) + caps_vol = 1; + if (caps.dwSupport & WAVECAPS_LRVOLUME) + caps_lr = 1; + + /* Now let's see whether volume is balanced or not */ + if (caps_lr) + { + DWORD curvol; + waveOutGetVolume (hw, &curvol); + + if (LOWORD(curvol) != HIWORD(curvol)) + waveOutSetVolume (hw, MAKEDWORD(LOWORD(curvol), LOWORD(curvol))); + } + return; } \ No newline at end of file Index: sound.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/sound.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- sound.c 24 May 2006 01:14:39 -0000 1.12 +++ sound.c 29 May 2006 00:18:09 -0000 1.13 @@ -186,6 +186,8 @@ LineToConsole("Mix_PlayChannel: %s\n", Mix_GetError()); } sound_toggle = 1; + /* See if volume is adjustable */ + CheckVolumeSettings (); /* Default of 8 channels not enough */ Mix_AllocateChannels(16); } From modemhero at users.sourceforge.net Sun May 28 21:41:37 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 29 May 2006 02:41:37 +0000 Subject: [netrek-cvs] client/netrekxp/src local.c,1.34,1.35 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv2084/src Modified Files: local.c Log Message: Client side fix to SP2 not sending negative coords correctly..simply check against GWIDTH for redraw checks. Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- local.c 28 May 2006 06:28:14 -0000 1.34 +++ local.c 29 May 2006 02:41:35 -0000 1.35 @@ -140,7 +140,7 @@ check first to make sure it's valid. This is mainly important for if it tries to redraw and we're already dead */ - if (sectorx < 0 || sectory < 0) + if (sectorx < 0 || sectory < 0 || sectorx > MAXSECTOR || sectory > MAXSECTOR ) return; l = sector_offx < view && sectorx > 0; @@ -2538,7 +2538,7 @@ /* Keep redrawing for double buffered observers who get set out of normal gameplay bounds, whether due to locking onto an ineligible planet, or observing a player who dies - otherwise screen doesn't refresh*/ - if (me->p_x < 0 && !(doubleBuffering && (me->p_flags & PFOBSERV))) + if (me->p_x < 0 || me->p_x >= GWIDTH && !(doubleBuffering && (me->p_flags & PFOBSERV))) return; DrawPlanets (); From modemhero at users.sourceforge.net Sun May 28 21:41:37 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 29 May 2006 02:41:37 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt,1.59,1.60 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv2084/resources/docs Modified Files: changes.txt Log Message: Client side fix to SP2 not sending negative coords correctly..simply check against GWIDTH for redraw checks. Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- changes.txt 28 May 2006 23:05:12 -0000 1.59 +++ changes.txt 29 May 2006 02:41:34 -0000 1.60 @@ -17,13 +17,10 @@ placements, and macros than your average rc :). Plus it has all the settable rc options listed. The format of the netrekrc is nearly identical to that of the netrek.sav file that can be generated in game from the options menu. Currently the only difference between - the two is lack of windows placements, custom review window settings, custom beeplite settings, - and custom server/servernick/servertype settings. + the two is custom pbserver/servernick/servertype settings. - fixed bug with observers with short packets on which was causing incorrect drawing of local map in the case of losing player/planet lock (most noticeable effect was a single background - star being drawn at all times, instead of the usual blank local). This was actually both a - server side and client side fix, relating to an incorrect sign on the player position packet, - but I mention it here. + star being drawn at all times, instead of the usual blank local). - fixed phaser stats reporting for long packets - fixed longstanding bug with UDP where display was redrawn too frequently (once for udp redraw, and again anytime a TCP packet was sent, like with warning messages). From modemhero at users.sourceforge.net Sun May 28 21:41:37 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 29 May 2006 02:41:37 +0000 Subject: [netrek-cvs] client/netrekxp clientr.suo,1.16,1.17 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv2084 Modified Files: clientr.suo Log Message: Client side fix to SP2 not sending negative coords correctly..simply check against GWIDTH for redraw checks. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 Binary files /tmp/cvsrvkW5a and /tmp/cvs4Ku1r1 differ From modemhero at users.sourceforge.net Mon May 29 18:59:55 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 29 May 2006 23:59:55 +0000 Subject: [netrek-cvs] client/netrekxp/src dashboard.c, 1.8, 1.9 local.c, 1.35, 1.36 newwin.c, 1.32, 1.33 sound.c, 1.13, 1.14 winsndlib.c, 1.4, 1.5 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv6983/src Modified Files: dashboard.c local.c newwin.c sound.c winsndlib.c Log Message: Best guess solution to deal with observers and observees orbitting a repair planet. Reimplemented select() on login screen, but put it in combination with sleep(). This reduces CPU usage and keeps the desirable things about using select, such as constant updated player list. Minor fix to observer draw logic in local.c Fix to volume setting check so it doesn't get called every time a sound is played (using old sound). Removed some completed/fixed bugs from Stas's todo list. Index: dashboard.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/dashboard.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- dashboard.c 21 May 2006 09:56:38 -0000 1.8 +++ dashboard.c 29 May 2006 23:59:53 -0000 1.9 @@ -855,6 +855,7 @@ int repair_time (void) { + int obs = 0; int shieldtime = 0; int hulltime = 0; int shieldneeded, hullneeded; @@ -862,7 +863,10 @@ struct player *plr; if ((me->p_flags & (PFPLOCK | PFOBSERV)) == (PFPLOCK | PFOBSERV)) + { plr = players + me->p_playerl; + obs = 1; + } else plr = me; @@ -875,9 +879,12 @@ if (me->p_flags & PFORBIT) { /* Damn server doesn't send us p_planet info, have to calculate it ourselves! */ + /* And since observers don't get war flags, assume that if ship is orbiting a repair + planet in repair mode, the planet is friendly - best we can do until server + sends us more info */ me->p_planet = get_closest_planet(me->p_x, me->p_y); if ((planets[me->p_planet].pl_flags & PLREPAIR) - &&(!(planets[me->p_planet].pl_owner & (plr->p_swar | plr->p_hostile)))) + &&(obs || !(planets[me->p_planet].pl_owner & (plr->p_swar | plr->p_hostile)))) me->p_subshield += me->p_ship.s_repair * 4; if (me->p_flags & PFDOCK) me->p_subshield += me->p_ship.s_repair * 6; @@ -894,9 +901,12 @@ if (me->p_flags & PFORBIT) { /* Damn server doesn't send us p_planet info, have to calculate it ourselves! */ + /* And since observers don't get war flags, assume that if ship is orbiting a repair + planet in repair mode, the planet is friendly - best we can do until server + sends us more info */ me->p_planet = get_closest_planet(me->p_x, me->p_y); if ((planets[me->p_planet].pl_flags & PLREPAIR) - && (!(planets[me->p_planet].pl_owner & (plr->p_swar | plr->p_hostile)))) + && (obs || !(planets[me->p_planet].pl_owner & (plr->p_swar | plr->p_hostile)))) me->p_subdamage += me->p_ship.s_repair * 2; if (me->p_flags & PFDOCK) me->p_subdamage += me->p_ship.s_repair * 3; Index: sound.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/sound.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- sound.c 29 May 2006 00:18:09 -0000 1.13 +++ sound.c 29 May 2006 23:59:53 -0000 1.14 @@ -202,6 +202,8 @@ { sound_init = 1; sound_toggle = 1; + /* See if volume is adjustable */ + CheckVolumeSettings (); } strcpy (sound_prefix, sounddir); Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- newwin.c 28 May 2006 23:05:12 -0000 1.32 +++ newwin.c 29 May 2006 23:59:53 -0000 1.33 @@ -1394,12 +1394,31 @@ while (!W_EventsPending ()) { time_t elapsed; + fd_set rfds; + struct timeval tv; me->p_ghostbuster = 0; + /* Since we don't have a socket to check on Win32 + for windowing system events, we set the timeout to zero and + effectively poll. Yes, I could do the correct thing + and call WaitForMultipleObjects() etc. but I don't feel like it */ + tv.tv_sec = 0; + tv.tv_usec = 0; + FD_ZERO (&rfds); + FD_SET (sock, &rfds); + if (udpSock >= 0) + FD_SET (udpSock, &rfds); /* Select() causes infinite CPU usage, can't use WaitForMultipleObjects due to UI working on same thread (no blocking), so a simple Sleep is the best solution. */ Sleep(10); + select (32, &rfds, 0, 0, &tv); /* hmm, 32 might be too + * small */ + if (FD_ISSET (sock, &rfds) || + (udpSock >= 0 && FD_ISSET (udpSock, &rfds))) + { + readFromServer (&rfds); + } elapsed = time (0) - startTime; if (elapsed > (time_t)(autoQuit)) { Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- local.c 29 May 2006 02:41:35 -0000 1.35 +++ local.c 29 May 2006 23:59:53 -0000 1.36 @@ -2538,7 +2538,7 @@ /* Keep redrawing for double buffered observers who get set out of normal gameplay bounds, whether due to locking onto an ineligible planet, or observing a player who dies - otherwise screen doesn't refresh*/ - if (me->p_x < 0 || me->p_x >= GWIDTH && !(doubleBuffering && (me->p_flags & PFOBSERV))) + if ((me->p_x < 0 || me->p_x >= GWIDTH) && !(doubleBuffering && (me->p_flags & PFOBSERV))) return; DrawPlanets (); Index: winsndlib.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/winsndlib.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- winsndlib.c 29 May 2006 00:18:09 -0000 1.4 +++ winsndlib.c 29 May 2006 23:59:53 -0000 1.5 @@ -359,8 +359,6 @@ #endif waveOutPrepareHeader (hw, &snd->hdr, sizeof (WAVEHDR)); waveOutWrite (hw, &snd->hdr, sizeof (WAVEHDR)); - - CheckVolumeSettings(); return 0; } return -1; From modemhero at users.sourceforge.net Mon May 29 18:59:55 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 29 May 2006 23:59:55 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.41, 1.42 clientr.suo, 1.17, 1.18 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv6983 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Best guess solution to deal with observers and observees orbitting a repair planet. Reimplemented select() on login screen, but put it in combination with sleep(). This reduces CPU usage and keeps the desirable things about using select, such as constant updated player list. Minor fix to observer draw logic in local.c Fix to volume setting check so it doesn't get called every time a sound is played (using old sound). Removed some completed/fixed bugs from Stas's todo list. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- NetrekXP to do list.C 29 May 2006 00:18:09 -0000 1.41 +++ NetrekXP to do list.C 29 May 2006 23:59:53 -0000 1.42 @@ -13,7 +13,8 @@ 4) ATT not listed as valid ship even if it's in sysdef. 5) in orbit.c, pftranswarp strangeness. 6) look into swar/war in repair time, with obs and plr - doesn't seem to be any way -for an obs to know what the war decs are of the person he is observing +for an obs to know what the war decs are of the person he is observing. Best solution +is to just have server send repair time and planet orbit info. Things that go wrong when short packets are on: 1) cloaking/shields at warp 0 doesn't update someone else's tactical on what you did if @@ -23,7 +24,6 @@ When obs quits, their state is K_WINNER ..and they see the new geno bitmap. 3) The new smooth turning only working on self, not obs or others - short packets only send headings of 16 positions. -4) Observers get wrong x,y pos upon observee death. Things that are sorta fixed, but could use improvement: 1) rewrite placement/refresh of new resource bitmaps to work better with a scaled tactical @@ -47,13 +47,12 @@ 8) Is there a cpu leak with double buffering? 9) Use masking for things like player team/letter display on galactic. Ship draw on tactical (have it overwrite the planet/wrench/gas/army for example, not just combine colors). -10) Ask stas about addfontresource change in 4.4.0.4 - causing problems with win 98 machines. +10) Addfontresource change in 4.4.0.4 - causing problems with win 98 machines. 11) Get square planet bitmaps from defcom so I can turn them into mapped rotating globes. Stas's list: - color coded playerlist. -- check inl server for behavior -+ add option to parse netrekrc.txt and xtrekrc.txt files +- check inl server for behavior (observers and tractor/pressor packets) ! server: ita won't block RCDs (why not ?) - add usage on metaserver window (well, what would you write there ?) ! after res if there cloaker around he will be seen briefly (speed 0 bug) @@ -65,10 +64,8 @@ - add msg.phaser to enable formatting of phaser messages - add copy/paste possibility from message windows (richtext ?) - add clickable urls from message windows (richtext ?) -+ fix bug with undefined behavior in case of odd keymap/buttonmap/ckeymap length (partially fixed) - add "mKeyOnlyToStartMessages: on/off" to ignore keys [0-9][a-z][ATFOKRG] in message window when the messageon=0 - scrollable player list - parse Announcer messages in hockey games - resize documentation window - pasting multiline prints \r\n instead of splitting lines -- fix makedistress bug that creates 0 instead of empty string when macro starts with conditional Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 Binary files /tmp/cvseYAMdE and /tmp/cvsZzw4TR differ From modemhero at users.sourceforge.net Mon May 29 20:10:38 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 30 May 2006 01:10:38 +0000 Subject: [netrek-cvs] client/netrekxp/src map.c, 1.14, 1.15 newwin.c, 1.33, 1.34 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv32752/src Modified Files: map.c newwin.c Log Message: Changed default team window size from 8 to 7 lines. Updated netrekrc. Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- newwin.c 29 May 2006 23:59:53 -0000 1.33 +++ newwin.c 30 May 2006 01:10:36 -0000 1.34 @@ -848,11 +848,11 @@ /* Message windows */ if (richText) { - messwa = W_MakeScrollingRichTextWindow ("review_all", 506, 668, 81, 5, baseWin, BORDER); + messwa = W_MakeScrollingRichTextWindow ("review_all", 506, 658, 81, 5, baseWin, BORDER); wam_windows[0] = messwa; W_SetWindowKeyDownHandler (messwa, handleMessageWindowKeyDown); - messwt = W_MakeScrollingRichTextWindow ("review_team", 506, 579, 81, 8, baseWin, BORDER); + messwt = W_MakeScrollingRichTextWindow ("review_team", 506, 579, 81, 7, baseWin, BORDER); wam_windows[1] = messwt; W_SetWindowKeyDownHandler (messwt, handleMessageWindowKeyDown); @@ -860,7 +860,7 @@ wam_windows[2] = messwi; W_SetWindowKeyDownHandler (messwi, handleMessageWindowKeyDown); - messwk = W_MakeScrollingRichTextWindow ("review_kill", 506, 727, 81, 3, baseWin, BORDER); + messwk = W_MakeScrollingRichTextWindow ("review_kill", 506, 717, 81, 3, baseWin, BORDER); wam_windows[3] = messwk; phaserwin = W_MakeScrollingRichTextWindow ("review_phaser", WINSIDE + BORDER + 6, YOFF + @@ -874,11 +874,11 @@ } else { - messwa = W_MakeScrollingWindow ("review_all", 506, 668, 81, 5, baseWin, BORDER); + messwa = W_MakeScrollingWindow ("review_all", 506, 658, 81, 5, baseWin, BORDER); wam_windows[0] = messwa; W_SetWindowKeyDownHandler (messwa, handleMessageWindowKeyDown); - messwt = W_MakeScrollingWindow ("review_team", 506, 579, 81, 8, baseWin, BORDER); + messwt = W_MakeScrollingWindow ("review_team", 506, 579, 81, 7, baseWin, BORDER); wam_windows[1] = messwt; W_SetWindowKeyDownHandler (messwt, handleMessageWindowKeyDown); @@ -886,7 +886,7 @@ wam_windows[2] = messwi; W_SetWindowKeyDownHandler (messwi, handleMessageWindowKeyDown); - messwk = W_MakeScrollingWindow ("review_kill", 506, 727, 81, 3, baseWin, BORDER); + messwk = W_MakeScrollingWindow ("review_kill", 506, 717, 81, 3, baseWin, BORDER); wam_windows[3] = messwk; phaserwin = W_MakeScrollingWindow ("review_phaser", WINSIDE + 6, YOFF + Index: map.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/map.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- map.c 26 May 2006 06:58:19 -0000 1.14 +++ map.c 30 May 2006 01:10:36 -0000 1.15 @@ -432,7 +432,7 @@ if (planetBitmapGalaxy == 3) // Needs adjusting W_ClearArea (mapw, odx - 7 * BMP_MPLANET_WIDTH / 8, ody - (5 * BMP_MPLANET_HEIGHT / 6), - 7 * BMP_MPLANET_WIDTH / 4 + 1, 4 * BMP_MPLANET_HEIGHT / 3 + 1); + 7 * BMP_MPLANET_WIDTH / 4 + 2, 4 * BMP_MPLANET_HEIGHT / 3 + 2); else W_ClearArea (mapw, odx - (BMP_MPLANET_WIDTH / 2), ody - (BMP_MPLANET_HEIGHT / 2), From modemhero at users.sourceforge.net Mon May 29 20:10:38 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 30 May 2006 01:10:38 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.60, 1.61 netrekrc, 1.1, 1.2 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv32752/resources/docs Modified Files: changes.txt netrekrc Log Message: Changed default team window size from 8 to 7 lines. Updated netrekrc. Index: netrekrc =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- netrekrc 25 May 2006 08:43:57 -0000 1.1 +++ netrekrc 30 May 2006 01:10:35 -0000 1.2 @@ -4,6 +4,9 @@ # Login name login: netrek_player +# Mouse button mapping +buttonmap: 1P2k + # Key mapping keymap: Ppa%d_eyftg^jmnrpPrls3tfuwvDwsye d @@ -41,7 +44,7 @@ colorClient: 4 # Display color phasers -colorfulPhasers: on +colorfulPhasers: off # Use colored bitmaps for torps and plasmas colorWeapons: on @@ -233,12 +236,18 @@ # Save options with comments saveBig: on +# Save window placements to saveFile +saveWindow: on + # Save macros to saveFile saveMacro: on # Save RCD to saveFile saveRCD: on +# Save beeplite macros to saveFile +saveBeeplite: on + # Save RCM to saveFile saveRCM: on @@ -416,67 +425,119 @@ # 'W' - Wins playerList: nTR N K l M -## Window Options -WaitMotd.mapped: on + +# Window placements section + +netrek.parent: netrek netrek.geometry: 1024x768 + local.parent: netrek +local.geometry: 500x500+0+0 + map.parent: netrek +map.geometry: 500x500+506+0 -help.parent: netrek -help.geometry: 500x25+0+525 +tstat.parent: netrek +tstat.geometry: 505x43+0+506 -planet.parent: netrek -planet.geometry: +660+0 +warn.parent: netrek +warn.geometry: 504x16+506+523 message.parent: netrek -message.geometry: 502x19+508+504 +message.geometry: 504x16+506+506 message.mapped: on -warn.parent: netrek -warn.geometry: 502x18+508+523 -warn.mapped: on +planet.parent: netrek +planet.geometry: 57x43+660+0 +planet.mapped: off -tstat.parent: netrek -tstat.geometry: 506x45+0+504 -tstat.mapped: on +rank.parent: netrek +rank.geometry: 65x18+50+300 +rank.mapped: off -review.parent: netrek -review.geometry: 82x20+508+542 -review.mapped: off +player.parent: netrek +player.geometry: +0+550 +player.mapped: on -review_your.parent: netrek -review_your.geometry: 82x4+508+542 -review_your.mapped: on +player2.parent: netrek +player2.geometry: +140+100 +player2.mapped: off -review_team.parent: netrek -review_team.geometry: 82x6+508+591 -review_team.mapped: on +help.parent: netrek +help.mapped: off review_all.parent: netrek -review_all.geometry: 82x4+508+660 +review_all.geometry: 81x5+506+658 review_all.mapped: on -review_phaser.parent: netrek -review_phaser.geometry: +510+710 -review_phaser.mapped: off +review_team.parent: netrek +review_team.geometry: 81x7+506+579 +review_team.mapped: on + +review_your.parent: netrek +review_your.geometry: 81x3+506+540 +review_your.mapped: on -reportkills: on review_kill.parent: netrek -review_kill.geometry: 82x4+508+708 +review_kill.geometry: 81x3+506+717 review_kill.mapped: on -review_kill.allow: KP +review_kill.allow: KP -player.parent: netrek -player.geometry: +0+549 -player.mapped: on +review_phaser.parent: netrek +review_phaser.geometry: 81x4+506+676 +review_phaser.mapped: off -udp.geometry: +0+0 -udp.mapped: off +review.parent: netrek +review.geometry: 81x22+506+540 +review.mapped: off + +pingStats.parent: netrek +pingStats.geometry: +500+4 +pingStats.mapped: off + +UDP.parent: netrek +UDP.geometry: +510+9 +UDP.mapped: off + +network.parent: netrek +network.geometry: +510+9 +network.mapped: off + +DocWin.parent: netrek +DocWin.geometry: 500x500+0+181 +DocWin.mapped: off + +xtrekrcWin.parent: netrek +xtrekrcWin.geometry: 500x500+0+200 +xtrekrcWin.mapped: off + +fed.parent: local +fed.geometry: 100x100+0+400 + +kli.parent: local +kli.geometry: 100x100+200+400 + +ori.parent: local +ori.geometry: 100x100+300+400 + +rom.parent: local +rom.geometry: 100x100+100+400 + +quit.parent: local +quit.geometry: 100x100+400+400 stats.parent: netrek -stats.geommac.s.%i:%y loss, %v ping, %V stddev -stats geometry: 160x108+332+550 # puts the stats window further down -stats.geometry: 160x94+842+500 +stats.geometry: 100x80+405+506 +stats.mapped: off + +war.parent: netrek +war.geometry: 20x6+510+9 +war.mapped: off + +sound.parent: netrek +sound.geometry: +520+9 +sound.mapped: off + # Macros section # Also '?' can still not be used as a macro key. The following definitions will @@ -788,10 +849,11 @@ mac.V.A: %T%c PING stats: Average: %v ms, Stdv: %V ms, Loss: %y%% mac.x.T: (%T%c) My Fuel: %f%% +mac.L.%i: %y loss, %v ping, %V stddev mac.X.%p: My condition: %d%%D %s%%S %f%%F %a armies # Receiver configurable distress macros -dist.^t.taking: %T%c->%O (%S) Carrying %a to %l%?%n>-1%{ @ %n%} +dist.^t.take: %T%c->%O (%S) Carrying %a to %l%?%n>-1%{ @ %n%} dist.^o.ogg: %T%c->%O Help Ogg %p at %l dist.^b.bomb: %T%c->%O %?%n>4%{bomb %l @ %n%!bomb%} dist.^c.space_control: %T%c->%O Help Control at %L @@ -818,9 +880,16 @@ dist.E.help: %T%c->%O Help(%S)! %s%% shd, %d%% dmg, %f%% fuel,%?%S=SB%{ %w%% wtmp,%!%}%E%{ ETEMP!%}%W%{ WTEMP!%} %a armies! +# Beeplite macros +lite.take: /c/l +lite.base_ogg: /g/m +lite.pickup: /p +lite.help: %?%S=SB%{/c%}%?%a>0%{/c%} + + # Receiver configurable messages msg.kill: GOD->ALL %i (%S) (%T%c%?%a>0%{+%a armies%!%}) was kill %?%d>0%{%k%!(NO CREDIT)%} for %u (%r%p) %?%w>0%{%W%!%} -msg.planet: GOD->ALL %i (%S) (%T%c%?%a>0%{+%a armies%!%} killed by %l (%z) %?%w>0%{%W%!%} +msg.planet: GOD->ALL %i (%S) (%T%c%?%a>0%{+%a armies%!%}) killed by %l (%z) %?%w>0%{%W%!%} msg.bomb: %N->%Z We are being attacked by %i (%T%c) who is %d%% damaged. msg.destroy: %N->%Z %N destroyed by %i (%T%c) msg.take: %N->%O %N taken by %i (%T%c) Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- changes.txt 29 May 2006 02:41:34 -0000 1.60 +++ changes.txt 30 May 2006 01:10:35 -0000 1.61 @@ -1,4 +1,5 @@ Version TBA: +- changed default team window size from 8 to 7 lines - fixed some inconsistencies in how a few RCDs were named - "taking" renamed to "take", "generic" renamed to "help", "help3 and help4" renamed to "help1 and help2", and "doing3 and doing4" renamed to "doing1 and doing2" From modemhero at users.sourceforge.net Tue May 30 22:59:29 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 31 May 2006 03:59:29 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs README for Win95, Win98, and WinME.TXT, NONE, 1.1 Message-ID: Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23519/resources/docs Added Files: README for Win95, Win98, and WinME.TXT Log Message: Reverted to old font resource calls due to it breaking client on Win98 and earlier. Slight fixes to refresh zones for new planet bitmaps. Compile fix for BCC (doesn't like header files defined halfway through a file). New README file for Win 95/98/ME users, explaining what options not to use as they won't work right. --- NEW FILE: README for Win95, Win98, and WinME.TXT --- The following options will NOT work with Windows 95/98/ME. In fact, they are very likely to crash the client, so do not use them. newClock: on colorClient: 4 planetBitmap: 3 planetBitmapGalaxy: 3 So in conclusion, don't have any of those above options in your netrekrc, and the client should work fine! Also, I would recommend not switching between ship or planet bitmaps in game via options menu, as it may also break your client. Just choose a bitmap set you like and stick with it. From modemhero at users.sourceforge.net Tue May 30 22:59:29 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 31 May 2006 03:59:29 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h,1.26,1.27 Message-ID: Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23519/include Modified Files: data.h Log Message: Reverted to old font resource calls due to it breaking client on Win98 and earlier. Slight fixes to refresh zones for new planet bitmaps. Compile fix for BCC (doesn't like header files defined halfway through a file). New README file for Win 95/98/ME users, explaining what options not to use as they won't work right. Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- data.h 28 May 2006 23:05:11 -0000 1.26 +++ data.h 31 May 2006 03:59:27 -0000 1.27 @@ -1,5 +1,6 @@ /* data.h */ #include "copyright.h" +#include #ifndef _h_data #define _h_data @@ -587,7 +588,6 @@ DWORD InputThreadID; // Missing global variables -#include extern int autoQuit; extern int forceDisplay; From modemhero at users.sourceforge.net Tue May 30 22:59:29 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 31 May 2006 03:59:29 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.42, 1.43 clientr.suo, 1.18, 1.19 Message-ID: Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23519 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Reverted to old font resource calls due to it breaking client on Win98 and earlier. Slight fixes to refresh zones for new planet bitmaps. Compile fix for BCC (doesn't like header files defined halfway through a file). New README file for Win 95/98/ME users, explaining what options not to use as they won't work right. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- NetrekXP to do list.C 29 May 2006 23:59:53 -0000 1.42 +++ NetrekXP to do list.C 31 May 2006 03:59:26 -0000 1.43 @@ -31,6 +31,8 @@ ..I added a default return to switch statement, but the underlying bug still remains. 3) Border issue - quite complex problem, how to know the borders to obey after the bitmap is rotated. Only solution so far is to ignore borders with scaled bitmaps. +4) AddFontResourceEx caused problems with win 98 machines. Commented out, and using +old AddFontResource function. Things to do: 1) Add warning hull. @@ -47,7 +49,7 @@ 8) Is there a cpu leak with double buffering? 9) Use masking for things like player team/letter display on galactic. Ship draw on tactical (have it overwrite the planet/wrench/gas/army for example, not just combine colors). -10) Addfontresource change in 4.4.0.4 - causing problems with win 98 machines. +10) mono kil scout rotation seems off 11) Get square planet bitmaps from defcom so I can turn them into mapped rotating globes. Stas's list: Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 Binary files /tmp/cvssNDDjR and /tmp/cvskOH3Fh differ From modemhero at users.sourceforge.net Tue May 30 22:59:29 2006 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 31 May 2006 03:59:29 +0000 Subject: [netrek-cvs] client/netrekxp/src map.c, 1.15, 1.16 mswindow.c, 1.28, 1.29 Message-ID: Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23519/src Modified Files: map.c mswindow.c Log Message: Reverted to old font resource calls due to it breaking client on Win98 and earlier. Slight fixes to refresh zones for new planet bitmaps. Compile fix for BCC (doesn't like header files defined halfway through a file). New README file for Win 95/98/ME users, explaining what options not to use as they won't work right. Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- mswindow.c 28 May 2006 23:05:12 -0000 1.28 +++ mswindow.c 31 May 2006 03:59:27 -0000 1.29 @@ -444,8 +444,9 @@ strcpy (FileName, GetExeDir ()); strcat (FileName, FontFileName); - RemoveFontResourceEx (FileName, FR_PRIVATE | FR_NOT_ENUM, 0); - +// Breaks client in Windows 95, 98, and possibly ME +// RemoveFontResourceEx (FileName, FR_PRIVATE | FR_NOT_ENUM, 0); + RemoveFontResource (FileName); //Select the original bitmaps back and delete our memory DCs SelectObject (GlobalMemDC, GlobalOldMemDCBitmap); DeleteDC (GlobalMemDC); @@ -766,8 +767,9 @@ //Create the fonts that we need. The fonts are actually in our resource file strcpy (FileName, GetExeDir ()); strcat (FileName, FontFileName); - AddFontResourceEx (FileName, FR_PRIVATE | FR_NOT_ENUM, 0); - +// Breaks client in Windows 95, 98, and possibly ME +// AddFontResourceEx (FileName, FR_PRIVATE | FR_NOT_ENUM, 0); + AddFontResource (FileName); memset (&lf, 0, sizeof (LOGFONT)); lf.lfCharSet = ANSI_CHARSET; Index: map.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/map.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- map.c 30 May 2006 01:10:36 -0000 1.15 +++ map.c 31 May 2006 03:59:27 -0000 1.16 @@ -430,9 +430,9 @@ /* XFIX */ if (planetBitmapGalaxy == 3) // Needs adjusting - W_ClearArea (mapw, odx - 7 * BMP_MPLANET_WIDTH / 8, + W_ClearArea (mapw, odx - 7 * BMP_MPLANET_WIDTH / 8 - 1, ody - (5 * BMP_MPLANET_HEIGHT / 6), - 7 * BMP_MPLANET_WIDTH / 4 + 2, 4 * BMP_MPLANET_HEIGHT / 3 + 2); + 7 * BMP_MPLANET_WIDTH / 4, 4 * BMP_MPLANET_HEIGHT / 3); else W_ClearArea (mapw, odx - (BMP_MPLANET_WIDTH / 2), ody - (BMP_MPLANET_HEIGHT / 2), @@ -448,9 +448,9 @@ /* XFIX */ if (planetBitmapGalaxy == 3) // Needs adjusting - W_ClearArea (mapw, dx - 7 * BMP_MPLANET_WIDTH / 8, - dy - (5 * BMP_MPLANET_HEIGHT / 6), - 7 * BMP_MPLANET_WIDTH / 4 + 1, 4 * BMP_MPLANET_HEIGHT / 3 + 1); + W_ClearArea (mapw, dx - 7 * BMP_MPLANET_WIDTH / 8 - 5, + dy - (5 * BMP_MPLANET_HEIGHT / 6) - 4, + 7 * BMP_MPLANET_WIDTH / 4 + 8, 4 * BMP_MPLANET_HEIGHT / 3 + 8); else W_ClearArea (mapw, dx - (BMP_MPLANET_WIDTH / 2 + 4), From quozl at users.sourceforge.net Wed May 31 22:17:28 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Thu, 01 Jun 2006 03:17:28 +0000 Subject: [netrek-cvs] server/Vanilla/tools Makefile.in, 1.8, 1.9 metaget.c, 1.3, 1.4 players.c, 1.7, 1.8 Message-ID: Update of /cvsroot/netrek/server/Vanilla/tools In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28256/tools Modified Files: Makefile.in metaget.c players.c Log Message: merge 2.11.1 from darcs Index: Makefile.in =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/tools/Makefile.in,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Makefile.in 12 May 2006 03:44:49 -0000 1.8 +++ Makefile.in 1 Jun 2006 03:17:26 -0000 1.9 @@ -32,13 +32,15 @@ ${srcdir}/update.c ${srcdir}/convert.c \ ${srcdir}/conq_vert.c $(RANDOMC) \ ${srcdir}/sortdb.c \ - ${srcdir}/ntpasswd.c ${srcdir}/setplanet.c + ${srcdir}/ntpasswd.c \ + ${srcdir}/setgame.c ${srcdir}/setplanet.c ${srcdir}/setteam.c EXECS = blotpassword loadchecker mess message newscores planets players \ scores \ setgalaxy showgalaxy stat trimscores watchmes xtkill \ mergescores keyman updated fun conq_vert convert sortdb cambot \ - ntpasswd ltd_dump ltd_convert nuke trekon metaget setplanet + ntpasswd ltd_dump ltd_convert nuke trekon metaget \ + setgame setplanet setteam all: $(PMAKE) $(EXECS) @@ -78,7 +80,9 @@ $(INSTALLPROG) $(INSTALLOPTS) updated $(DESTDIR)$(LIBDIR)/updated $(INSTALLPROG) $(INSTALLOPTS) cambot $(DESTDIR)$(LIBDIR)/cambot $(INSTALLPROG) $(INSTALLOPTS) metaget $(DESTDIR)$(LIBDIR)/tools/metaget + $(INSTALLPROG) $(INSTALLOPTS) setgame $(DESTDIR)$(LIBDIR)/tools/setgame $(INSTALLPROG) $(INSTALLOPTS) setplanet $(DESTDIR)$(LIBDIR)/tools/setplanet + $(INSTALLPROG) $(INSTALLOPTS) setteam $(DESTDIR)$(LIBDIR)/tools/setteam cambot: cambot.o $(OBJS) $(CC) -o $@ $(CFLAGS) ${LDFLAGS} cambot.o $(OBJS) $(RSA_LIB) @@ -161,9 +165,15 @@ metaget: metaget.o $(CC) -o $@ $(CFLAGS) ${LDFLAGS} metaget.o $(EXTRALIBS) +setgame: setgame.o $(OBJS) + $(CC) -o $@ $(CFLAGS) ${LDFLAGS} setgame.o $(OBJS) + setplanet: setplanet.o $(OBJS) $(CC) -o $@ $(CFLAGS) ${LDFLAGS} setplanet.o $(OBJS) +setteam: setteam.o $(OBJS) + $(CC) -o $@ $(CFLAGS) ${LDFLAGS} setteam.o $(OBJS) + trekon: ${srcdir}/mktrekon ${srcdir}/trekon.bitmap ${srcdir}/trekoff.bitmap ${srcdir}/mktrekon $(LIBDIR) chmod a+x trekon Index: players.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/tools/players.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- players.c 12 May 2006 03:44:50 -0000 1.7 +++ players.c 1 Jun 2006 03:17:26 -0000 1.8 @@ -4,6 +4,7 @@ #include #include #include +#include #include "defs.h" #include "struct.h" #include "data.h" From quozl at users.sourceforge.net Wed May 31 22:17:28 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Thu, 01 Jun 2006 03:17:28 +0000 Subject: [netrek-cvs] server/Vanilla/rpm netrek.spec,1.5,1.6 Message-ID: Update of /cvsroot/netrek/server/Vanilla/rpm In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28256/rpm Modified Files: netrek.spec Log Message: merge 2.11.1 from darcs Index: netrek.spec =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/rpm/netrek.spec,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- netrek.spec 15 May 2006 09:13:18 -0000 1.5 +++ netrek.spec 1 Jun 2006 03:17:26 -0000 1.6 @@ -1,6 +1,6 @@ Summary: Netrek Software Suite Name: netrek -Version: 2.11.0 +Version: 2.11.1 Release: 0 Copyright: Undetermined Packager: Vanilla Server Development Team From quozl at users.sourceforge.net Wed May 31 22:17:28 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Thu, 01 Jun 2006 03:17:28 +0000 Subject: [netrek-cvs] server/Vanilla/robots inl.c, 1.5, 1.6 newbie.c, 1.4, 1.5 rmove.c, 1.3, 1.4 Message-ID: Update of /cvsroot/netrek/server/Vanilla/robots In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28256/robots Modified Files: inl.c newbie.c rmove.c Log Message: merge 2.11.1 from darcs Index: rmove.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robots/rmove.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- rmove.c 12 May 2006 03:44:49 -0000 1.3 +++ rmove.c 1 Jun 2006 03:17:26 -0000 1.4 @@ -201,7 +201,7 @@ (me->p_team != 0)) { messAll(me->p_no,roboname,"I'm bored."); hostile++; - declare_war(ALLTEAM); + declare_war(ALLTEAM, 0); } /* Our first priority is to phaser plasma torps in nearby vicinity... */ @@ -739,7 +739,7 @@ if (target >= 0) { j = &players[target]; if (!(me->p_war & j->p_team)) - declare_war(players[target].p_team); /* make sure we're at war 7/31/91 TC */ + declare_war(players[target].p_team, 0); /* make sure we're at war 7/31/91 TC */ /* We have an enemy */ /* Get his range */ Index: newbie.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robots/newbie.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- newbie.c 12 May 2006 03:44:49 -0000 1.4 +++ newbie.c 1 Jun 2006 03:17:26 -0000 1.5 @@ -75,6 +75,7 @@ static int rprog(char *login, char *monitor); static void stop_this_bot(struct player * p); static void save_armies(struct player *p); +static int checkpos(void); static void reaper(int sig) @@ -99,8 +100,8 @@ #ifndef TREKSERVER if (gethostname(hostname, 64) != 0) { - perror("gethostname"); - exit(1); + perror("gethostname"); + exit(1); } #else strcpy(hostname, TREKSERVER); @@ -117,7 +118,7 @@ if (!debug) SIGNAL(SIGINT, cleanup); - class = STARBASE; + class = ATT; target = -1; /* no target 7/27/91 TC */ if ( (pno = pickslot(QU_NEWBIE_DMN)) < 0) { printf("exiting! %d\n", pno); @@ -137,20 +138,42 @@ me->p_pos = -1; /* So robot stats don't get saved */ me->p_flags |= PFROBOT; /* Mark as a robot */ - me->p_x = 75000; /* displace to on overlooking position */ - me->p_y = 100; /* maybe we should just make it fight? */ + +#define POSITIONX 55000 +#define POSITIONY 50000 + + me->p_x = POSITIONX; /* displace to on overlooking position */ + me->p_y = POSITIONY; /* maybe we should just make it fight? */ me->p_hostile = 0; me->p_swar = 0; me->p_war = 0; me->p_team = 0; /* indep */ oldmctl = mctl->mc_current; + #ifdef nodef for (i = 0; i <= oldmctl; i++) { check_command(&messages[i]); } #endif +#ifdef nodef + /* Could make Merlin hostile to everybody, pretty fun */ + me->p_hostile = (FED | ROM | KLI | ORI); /* WAR! */ + me->p_swar = (FED | ROM | KLI | ORI); /* WAR! */ + me->p_war = (FED | ROM | KLI | ORI); /* WAR! */ +#endif + +#ifdef nodef + /* Could make Merlin friendly and allow docking JKH */ + /* since he is in the middle of the galaxy */ + me->p_ship.s_type = STARBASE; /* kludge to allow docking */ + me->p_flags |= PFDOCKOK; /* allow docking */ + /* Merlin Cloaks when t-mode starts, so this is useless for now */ + /* It's an interesting bug as all the bots like hunterkiller are */ + /* also invisible */ +#endif + status->gameup |= GU_NEWBIE; queues[QU_NEWBIE_PLR].q_flags |= (QU_REPORT | QU_OPEN); queues[QU_NEWBIE_OBS].q_flags |= (QU_REPORT | QU_OPEN); @@ -168,12 +191,6 @@ me->p_status = PALIVE; /* Put robot in game */ - /* Only allow Rom/Fed game to make robot team selection easier. */ - /* Disable this because it breaks on timercide. The other team - needs to come in as a 3rd race after being timercided. - queues[QU_PICKUP].tournmask = FED|ROM; - */ - while (1) { PAUSE(SIGALRM); } @@ -183,7 +200,7 @@ { int shmemKey = PKEY; static int no_humans = 0; - + HANDLE_SIG(SIGALRM,checkmess); me->p_ghostbuster = 0; /* keep ghostbuster away */ if (me->p_status != PALIVE){ /*So I'm not alive now...*/ @@ -210,27 +227,37 @@ no_humans = 0; } - /* Stop or start a robot. */ - if ((ticks % ROBOEXITWAIT) == 0) - { - if ((QUPLAY(QU_NEWBIE_PLR) + QUPLAY(QU_NEWBIE_BOT)) > queues[QU_PICKUP].max_slots) { - stop_a_robot(); + /* Stop a robot. */ + if ((ticks % ROBOEXITWAIT) == 0) { + if ((QUPLAY(QU_NEWBIE_PLR) + QUPLAY(QU_NEWBIE_BOT)) > + queues[QU_PICKUP].max_slots) { + stop_a_robot(); } } + + /* Start a robot */ if ((ticks % ROBOCHECK) == 0) { int next_team; num_players(&next_team); - - if (((QUPLAY(QU_NEWBIE_PLR) + QUPLAY(QU_NEWBIE_BOT)) < (queues[QU_PICKUP].max_slots - 1)) && (nb_robots < NB_ROBOTS)) - { + + if (((QUPLAY(QU_NEWBIE_PLR) + QUPLAY(QU_NEWBIE_BOT)) < (queues[QU_PICKUP].max_slots - 1)) && (nb_robots < NB_ROBOTS)) { if (next_team == FED) start_a_robot("-Tf"); - else + if (next_team == ROM) start_a_robot("-Tr"); + if (next_team == ORI) + start_a_robot("-To"); + if (next_team == KLI) + start_a_robot("-Tk"); } } + /* Check Merlin's x and y position */ + if ( (ticks % ROBOCHECK) == 0 ) { + checkpos(); + } + if ((ticks % SENDINFO) == 0) { static int alternate = 0; @@ -247,6 +274,41 @@ } +/* assuming this gets called once a second... */ +static int checkpos(void) +{ + static int oldx=POSITIONX; + static int oldy=POSITIONY; + static int moving=0; + static int stopped=0; + + /* are we moving? */ + if ( (me->p_x != oldx) || (me->p_y != oldy) ) { + moving=1; + stopped=0; + oldx=me->p_x; + oldy=me->p_y; + } + + /* if we stopped moving */ + /* count how long */ + if ( (me->p_x == oldx) && (me->p_y == oldy) ) { + moving=0; + stopped=stopped + 1; + } + + /* stopped for sometime now */ + if ( moving==0 && stopped > 15 ) { + /* move us back to overlooking position */ + if ( me->p_x != POSITIONX ) + me->p_x = POSITIONX; + if ( me->p_y != POSITIONY ) + me->p_y = POSITIONY; + stopped=0; /*do we need to reset this? */ + } + + return 1; +} static int is_robots_only(void) { @@ -279,7 +341,7 @@ int i; struct player *j; - /* Nuke robot from the team with the fewest humans. */ + /* nuke the first available bot */ for (i = 0, j = players; i < MAXPLAYER; i++, j++) { if (j->p_status == PFREE) continue; @@ -306,6 +368,33 @@ return 0; } +int killrobot(pp_team) +{ + struct player *j; + int i, keep, kill; + + keep = 0; + kill = 0; + for (i = 0, j = players; i < MAXPLAYER; i++) { + if (j[i].p_status == PFREE) + continue; + if (j[i].p_status == POBSERV) + continue; + + if (strcmp(j[i].p_login,"robot!") == 0) { + if (j[i].p_status == PALIVE ) { + if (j[i].p_team & pp_team) { + keep = i; + kill = 1; + } + } + } + } + if (kill == 1) + stop_this_bot(&j[keep]); + return kill; +} + static void stop_this_bot(struct player *p) { p->p_ship.s_type = STARBASE; p->p_whydead=KQUIT; @@ -339,27 +428,161 @@ { int i; struct player *j; - int team_count[MAXTEAM+1]; - + int tc, team_count[MAXTEAM+1]; + long int rt; int c = 0; team_count[ROM] = 0; team_count[FED] = 0; + team_count[ORI] = 0; + team_count[KLI] = 0; + tc = 0; for (i = 0, j = players; i < MAXPLAYER; i++, j++) { if (j->p_status != PFREE && j->p_status != POBSERV && - !(j->p_flags & PFROBOT)) - { - team_count[j->p_team]++; - c++; - } + !(j->p_flags & PFROBOT)) { + team_count[j->p_team]++; + c++; + } } /* Assign which team gets the next robot. */ - if (team_count[ROM] > team_count[FED]) - *next_team = FED; - else - *next_team = ROM; + + /* Count number of teams */ + if (team_count[ROM] > 0) + tc++; + if (team_count[FED] > 0) + tc++; + if (team_count[KLI] > 0) + tc++; + if (team_count[ORI] > 0) + tc++; + + if (tc == 0) { /* no teams yet, join anybody */ + rt = random() % 4; + + if (rt==0) + *next_team = FED; + if (rt==1) + *next_team = ROM; + if (rt==2) + *next_team = KLI; + if (rt==3) + *next_team = ORI; + } + + if (tc == 1) { /* 1 team, join 1 of 2 possible opposing teams */ + rt = random() % 2; + + if (team_count[FED] > 0) { + if (rt == 1) { + *next_team = ROM; + } + else { + *next_team = ORI; + } + } + + if (team_count[ROM] > 0) { + if (rt == 1) { + *next_team = FED; + } + else { + *next_team = KLI; + } + } + + if (team_count[KLI] > 0) { + if (rt == 1) { + *next_team = ROM; + } + else { + *next_team = ORI; + } + } + + if (team_count[ORI] > 0) { + if (rt == 1) { + *next_team = FED; + } + else { + *next_team = KLI; + } + } + + } + + if (tc >= 2) { /* 2 or more teams, join opposing team with less members */ + rt = random()%2; + + if (team_count[FED]>0 && team_count[ROM]>0) { + if (team_count[ROM]>team_count[FED]) + *next_team=FED; + else + *next_team=ROM; + } + + if (team_count[ORI]>0 && team_count[KLI]>0) { + if (team_count[KLI]>team_count[ORI]) + *next_team=ORI; + else + *next_team=KLI; + } + + if (team_count[FED]>0 && team_count[ORI]>0) { + if (team_count[ORI]>team_count[FED]) + *next_team=FED; + else + *next_team=ORI; + } + + if (team_count[ROM]>0 && team_count[KLI]>0) { + if (team_count[KLI]>team_count[ROM]) + *next_team=ROM; + else + *next_team=KLI; + } + + } + + /* 3 or more tourn teams.... */ + /* kill off bots in teams with less than 4 players */ + /* re-align *next_team so we don't be polish about it */ + if (tc >= 3) { /* 3 or more teams */ + if (team_count[ROM]>=4 && team_count[FED]>=4) { + killrobot(KLI); + killrobot(ORI); + if (team_count[ROM]>team_count[FED]) + *next_team=FED; + else + *next_team=ROM; + } + if (team_count[FED]>=4 && team_count[ORI]>=4) { + killrobot(ROM); + killrobot(KLI); + if (team_count[ORI]>team_count[FED]) + *next_team=FED; + else + *next_team=ORI; + } + if (team_count[ROM]>=4 && team_count[KLI]>=4) { + killrobot(FED); + killrobot(ORI); + if (team_count[KLI]>team_count[ROM]) + *next_team=ROM; + else + *next_team=KLI; + } + if (team_count[KLI]>=4 && team_count[ORI]>=4) { + killrobot(FED); + killrobot(ROM); + if (team_count[KLI]>team_count[ORI]) + *next_team=ORI; + else + *next_team=KLI; + } + } + return c; } @@ -400,9 +623,34 @@ char command[256]; int pid; - sprintf(command, "%s %s %s %s -h %s -p %d -n '%s' -X robot! -b -O -i", + /* How Merlin forks a robot + * + * RCMD -> remote command, usually "" + * robot_host -> hostname of robot server, usually "" + * OROBOT -> robot executable, usually "robot" + * team -> whichever team, usually "-Tr" for Roms. + * hostname -> target newbie netrek server + * PORT -> usually 3592 + * namearg() -> Name of the bot, circulates from the namelist above + * + * So robot command usually looks like: + * robot -Tr -h localhost -p 3592 -n Obliterator -X robot! -g -b -0 -i + * -Tr join Romulans + * -h hostname + * -p portname + * -n player name + * -X login name + * -g send the OggV byte to ID self as a robot, the bots use this + * -b blind mode, do not listen to anybody + * -0 no passwd during login sequence + * -i INL mode, sets robot updates to 5 updates per second + * -C read commands file, usually ROBOTDIR/og + */ + sprintf(command, "%s %s %s %s -h %s -p %d -n '%s' -X robot! -g -b -O -i", RCMD, robot_host, OROBOT, team, hostname, PORT, namearg() ); - + + sprintf(command, "%s -C %s",command, COMFILE); + pid = fork(); if (pid == -1) return; From quozl at users.sourceforge.net Wed May 31 22:17:27 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Thu, 01 Jun 2006 03:17:27 +0000 Subject: [netrek-cvs] server/Vanilla/ntserv Makefile.in, 1.7, 1.8 daemonII.c, 1.14, 1.15 data.c, 1.8, 1.9 detonate.c, 1.3, 1.4 enter.c, 1.4, 1.5 findslot.c, 1.5, 1.6 genspkt.c, 1.6, 1.7 getship.c, 1.1, 1.2 input.c, 1.1, 1.2 interface.c, 1.4, 1.5 main.c, 1.10, 1.11 ntscmds.c, 1.12, 1.13 openmem.c, 1.5, 1.6 orbit.c, 1.3, 1.4 redraw.c, 1.4, 1.5 socket.c, 1.8, 1.9 transwarp.c, 1.1, 1.2 Message-ID: Update of /cvsroot/netrek/server/Vanilla/ntserv In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28256/ntserv Modified Files: Makefile.in daemonII.c data.c detonate.c enter.c findslot.c genspkt.c getship.c input.c interface.c main.c ntscmds.c openmem.c orbit.c redraw.c socket.c transwarp.c Log Message: merge 2.11.1 from darcs Index: redraw.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/redraw.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- redraw.c 12 May 2006 03:44:48 -0000 1.4 +++ redraw.c 1 Jun 2006 03:17:25 -0000 1.5 @@ -210,7 +210,7 @@ me->p_wtemp = pl->p_wtemp; me->p_etemp = pl->p_etemp; /* These flags shouldn't be propagated to observers */ -#define NOOBSMASK (PFWAR|PFREFITTING|PFSELFDEST|PFPLOCK|PFPLLOCK|PFOBSERV) +#define NOOBSMASK (PFSELFDEST|PFPLOCK|PFPLLOCK|PFOBSERV) me->p_flags = (pl->p_flags & ~NOOBSMASK) | (me->p_flags & NOOBSMASK); me->p_dir = pl->p_dir; Index: ntscmds.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/ntscmds.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- ntscmds.c 12 May 2006 03:44:48 -0000 1.12 +++ ntscmds.c 1 Jun 2006 03:17:25 -0000 1.13 @@ -56,6 +56,9 @@ void do_sbtime_msg(char *comm, struct message *mess); void do_queue_msg(char *comm, struct message *mess); void do_nowobble(char *comm, struct message *mess); +#ifdef EXPERIMENTAL_BECOME +void do_become(char *comm, struct message *mess); +#endif #ifdef GENO_COUNT void do_genos_query(char *comm, struct message *mess, int who); @@ -153,6 +156,12 @@ 0, "Test new wobble on planet lock fix.", do_nowobble }, /* NOWOBBLE */ +#ifdef EXPERIMENTAL_BECOME + { "BECOME", + 0, + "Become a different slot number", + do_become }, /* BECOME */ +#endif { "TIME", C_PR_INPICKUP, "Show time left on surrender timer.", @@ -745,6 +754,42 @@ nowobble ? "on (new test mode)" : "off (classic mode)", nowobble, comm ); } +#ifdef EXPERIMENTAL_BECOME +/* become another slot ... lacking client support, in progress */ +void do_become(char *comm, struct message *mess) +{ + int who, pno; + char *addr; + + who = mess->m_from; + addr = addr_mess(who,MINDIV); + + pno = atoi(comm+strlen("become ")); + + if (pno < 0) return; + if (pno > (MAXPLAYER-1)) return; + + if (me->p_no == pno) { + pmessage(who, MINDIV, addr, "you are this slot already"); + return; + } + + struct player *be = &players[pno]; + if (be->p_status != PFREE) { + pmessage(who, MINDIV, addr, "slot is not free"); + return; + } + + memcpy(be, me, sizeof(struct player)); + me->p_status = PFREE; + me = be; + me->p_no = pno; + sprintf(me->p_mapchars,"%c%c",teamlet[me->p_team], shipnos[me->p_no]); + sprintf(me->p_longname, "%s (%s)", me->p_name, me->p_mapchars); + updateSelf(1); +} +#endif + void do_password(char *comm, struct message *mess) { int who = mess->m_from; Index: orbit.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/orbit.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- orbit.c 10 Apr 2006 10:56:32 -0000 1.3 +++ orbit.c 1 Jun 2006 03:17:25 -0000 1.4 @@ -33,6 +33,9 @@ { me->p_flags &= ~(PFPLOCK | PFPLLOCK | PFTRACT | PFPRESS); #ifdef SB_TRANSWARP + /* upon arrival at a base, during a dock attempt, if the dock fails, + and we were transwarping in, force a refit delay for five + seconds. */ if (me->p_flags & PFTWARP){ me->p_flags &= ~PFTWARP; me->p_flags |= PFREFITTING; Index: Makefile.in =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/Makefile.in,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Makefile.in 6 May 2006 13:12:56 -0000 1.7 +++ Makefile.in 1 Jun 2006 03:17:25 -0000 1.8 @@ -2,6 +2,8 @@ srcdir = @srcdir@ CONFIG = system.mk +RANLIB = @RANLIB@ +RANLIB_FLAGS = @RANLIB_FLAGS@ include ../$(CONFIG) @@ -80,23 +82,23 @@ all: $(PMAKE) ntserv daemonII ntserv: $(PMAKE) $(R_OBJS) - $(CC) $(CFLAGS) ${LDFLAGS} -o ntserv $(R_OBJS) $(LIBS) $(LIBCRYPT) `glib-config --libs` -lgdbm + $(CC) $(CFLAGS) ${LDFLAGS} -o ntserv $(R_OBJS) $(LIBS) $(LIBCRYPT) -lgdbm daemonII: $(PMAKE) $(D_OBJS) $(CC) $(CFLAGS) ${LDFLAGS} -o daemonII $(D_OBJS) $(EXTRALIBS) libnetrek.a: $(L_OBJS) - ar cru $@ $(L_OBJS) - ranlib $@ + $(AR) cru $@ $(L_OBJS) + $(RANLIB) $(RANLIB_FLAGS) $@ libnetrek.so: $(L_OBJS) - gcc -shared -Wl,-soname,$@ -o $@ $(L_OBJS) -lc + $(CC) -shared -Wl,-soname,$@ -o $@ $(L_OBJS) -lc commands.o: $(PMAKE) ${srcdir}/commands.c $(CC) $(CFLAGS) $(DEP) -c ${srcdir}/commands.c db.o: $(PMAKE) db.c - $(CC) $(CFLAGS) $(DEP) `glib-config --cflags` -c db.c + $(CC) $(CFLAGS) $(DEP) -c db.c cflags: echo "static char cflags[]=\"$(CFLAGS) $(LIBS)\";" >../cflags.h @@ -131,6 +133,11 @@ touch $(DESTDIR)$(LOCALSTATEDIR)/planets chmod 600 $(DESTDIR)$(LOCALSTATEDIR)/planets +install-ntserv: ntserv + mkdir $(DESTDIR)$(LIBDIR)/ntserv-archive + mv $(DESTDIR)$(LIBDIR)/ntserv $(DESTDIR)$(LIBDIR)/ntserv-archive/ntserv.`date +%Y-%m-%d`.$$ + $(INSTALLPROG) $(INSTALLOPTS) ntserv $(DESTDIR)$(LIBDIR)/ntserv + installbin: install echo "target installbin deprecated, assumed install" Index: input.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/input.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- input.c 21 Mar 2005 05:23:43 -0000 1.1 +++ input.c 1 Jun 2006 03:17:25 -0000 1.2 @@ -22,6 +22,7 @@ #include "struct.h" #include "data.h" #include "proto.h" +#include "packets.h" #define GHOSTTIME (30 * 1000000 / UPDATE) /* 30 secs */ @@ -56,10 +57,8 @@ ERROR(2,("%s: ghostbusted by ping loss\n", me->p_mapchars)); fflush(stderr); - } else + } #endif /*PING*/ - - me->p_ghostbuster = 0; } static int resurrect(void) @@ -110,6 +109,15 @@ return 1; } +static void gamedown() +{ + struct badversion_spacket packet; + packet.type = SP_BADVERSION; + packet.why = 6; + sendClientPacket(&packet); + flushSockBuf(); +} + void input(void) { fd_set readfds; @@ -127,6 +135,7 @@ resurrect(); } if (! (status -> gameup & GU_GAMEOK)){ + gamedown(); freeslot(me); exit(0); } @@ -150,6 +159,7 @@ } readFromClient(); + me->p_ghostbuster = 0; if (sendflag) { intrupt(); sendflag=0; @@ -159,5 +169,3 @@ } } - - Index: enter.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/enter.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- enter.c 26 Apr 2006 09:52:43 -0000 1.4 +++ enter.c 1 Jun 2006 03:17:25 -0000 1.5 @@ -210,7 +210,7 @@ #endif /*LTD_STATS*/ /* If switching, become hostile to former team 6/29/92 TC */ if (lastteam >= 0) - declare_war(1<st_rank; /* NBT patch */ lastteam=tno; Index: getship.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/getship.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- getship.c 21 Mar 2005 05:23:43 -0000 1.1 +++ getship.c 1 Jun 2006 03:17:25 -0000 1.2 @@ -276,8 +276,8 @@ shipvals[ATT].s_mass = 32765; /* att: */ shipvals[ATT].s_tractstr = 32765; /* att: */ shipvals[ATT].s_tractrng = 25; /* att: */ - shipvals[ATT].s_width = 28; /* att: */ - shipvals[ATT].s_height = 28; /* att: */ + shipvals[ATT].s_width = 20; /* att: */ + shipvals[ATT].s_height = 20; /* att: */ shipvals[ATT].s_type = ATT; /* att: */ shipvals[CRUISER].s_turns = 170000; /* cruiser: */ shipvals[CRUISER].s_accint = 150; /* cruiser: */ Index: openmem.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/openmem.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- openmem.c 12 May 2006 03:44:48 -0000 1.5 +++ openmem.c 1 Jun 2006 03:17:25 -0000 1.6 @@ -1,6 +1,3 @@ -/* - * $Id$ - */ #include "copyright.h" #include @@ -10,9 +7,7 @@ #include #include #include -#include -#include -#include /* 7/16/91 TC */ +#include #include "defs.h" #include "struct.h" #include "data.h" @@ -53,10 +48,59 @@ * */ +/* identifier of the shared memory segment */ +static int shmid; + +/* shared memory key */ +static int pkey = PKEY; + +/* shared memory pointer */ +static struct memory *sharedMemory = NULL; + +/* daemon initialisation is pending */ +static int daemon_initialisation_pending; + +/* set a different shared memory key for this process and children */ +void setpkey(int nkey) +{ + char ev[32]; + pkey = nkey; + sprintf(ev, "NETREK_PKEY=%d", nkey); + if (putenv(ev) != 0) { + perror("setpkey: putenv"); + } +} + +/* get the current shared memory key for this process */ +int getpkey() +{ + return pkey; +} + +/* initialise shared memory key from environment variables */ +static void initpkey() +{ + char *ev = getenv("NETREK_PKEY"); + if (ev == NULL) return; + pkey = atoi(ev); + if (pkey < 1) pkey = PKEY; +} + +/* called when daemon initialisation is complete */ +static void daemon_ready(int signum) +{ + daemon_initialisation_pending = 0; +} + +/* start the daemon, wait for it to finish initialising */ static void startdaemon(void) { pid_t i; + /* ask to be told when daemon initialisation completes */ + daemon_initialisation_pending = 1; + signal(SIGUSR1, daemon_ready); + i = fork(); if (i == (pid_t)0) { execl(Daemon, "daemon", (char *) NULL); @@ -64,8 +108,13 @@ ERROR(1,("Couldn't start daemon!!!\n")); _exit(1); } + + /* wait until daemon has initialised */ + while (daemon_initialisation_pending) pause(); + signal(SIGUSR1, NULL); } +/* connect all the pointers to the various areas of the segment */ static void setup_memory(struct memory *sharedMemory) { players = sharedMemory->players; @@ -86,14 +135,8 @@ /*ARGSUSED*/ int openmem(int trystart) { - extern int errno; - int shmemKey = PKEY; - struct memory *sharedMemory; - int shmid; - - errno = 0; - - shmid = shmget(shmemKey, SHMFLAG, 0); + initpkey(); + shmid = shmget(pkey, SHMFLAG, 0); if (shmid < 0) { /* Could not find the shared memory */ if (errno != ENOENT) { /* Error other not created yet */ perror("shmget"); @@ -101,7 +144,6 @@ } if (trystart==1){ /* Create the memory */ startdaemon(); - sleep(2); } else if (trystart < 0){ /* Just checking if it exists */ return 0; @@ -110,7 +152,7 @@ fprintf(stderr,"Warning: Daemon not running!\n"); exit(1); } - shmid = shmget(shmemKey, SHMFLAG, 0); + shmid = shmget(pkey, SHMFLAG, 0); if (shmid < 0) { /* This is a bummer of an error */ ERROR(1, ("Daemon not running (err:%d)\n",errno)); exit(1); @@ -123,30 +165,22 @@ exit(1); } setup_memory(sharedMemory); - return 1; } -/* Static variable only used by these routines in the daemon*/ -static int shmid; /* The id of the shared memory segment */ - int setupmem(void) { - extern int errno; - int shmemKey = PKEY; - struct memory *sharedMemory; struct shmid_ds smbuf; - errno = 0; - + initpkey(); /* Kill any existing segments */ - if ((shmid = shmget(shmemKey, SHMFLAG , 0)) >= 0) { + if ((shmid = shmget(pkey, SHMFLAG , 0)) >= 0) { ERROR(2,("setupmem: Killing existing segment\n")); shmctl(shmid, IPC_RMID, (struct shmid_ds *) 0); } /* Get them memory id */ - shmid = shmget(shmemKey, sizeof(struct memory), IPC_CREAT | 0777); + shmid = shmget(pkey, sizeof(struct memory), IPC_CREAT | 0777); if (shmid < 0) { ERROR(1,("setupmem: Can't open shared memory, error %i\n",errno)); return 0; @@ -177,11 +211,12 @@ if (shmctl(shmid, IPC_RMID, (struct shmid_ds *) 0) < 0){ return 0; } + perror("removemem"); return 1; } -#ifdef nodef -static int detachmem(void) { - return shmdt((void*)players); /* cheat! what is a better way?? jc */ +int detachmem(void) { + if (shmdt(sharedMemory) < 0) return 0; + perror("detachmem"); + return 1; } -#endif Index: transwarp.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/transwarp.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- transwarp.c 21 Mar 2005 05:23:44 -0000 1.1 +++ transwarp.c 1 Jun 2006 03:17:25 -0000 1.2 @@ -56,7 +56,7 @@ } if (!((!(j->p_war & me->p_team)) && (!(me->p_war & j->p_team)))) { - new_warning(UNDEF, "The starbase is not peaceful, captain!", -1); + new_warning(UNDEF, "Transwarp request rejected by battle computers, captain!", -1); return (0); } if (!(j->p_flags & PFDOCKOK)) { Index: findslot.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/findslot.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- findslot.c 6 May 2006 14:02:37 -0000 1.5 +++ findslot.c 1 Jun 2006 03:17:25 -0000 1.6 @@ -17,22 +17,20 @@ #include "packets.h" #include "proto.h" -#ifdef NO_DUPLICATE_HOSTS -/* return true if the host is not already in the game */ -static int absent(int w_queue, char *host) { - int i; - for (i=0; igameup & GU_GAMEOK)) { return (-1); } sleep(1); } } -#endif /* If no one is waiting, I will try to enter now */ if (queues[w_queue].first == -1) Index: data.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/data.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- data.c 12 May 2006 03:44:48 -0000 1.8 +++ data.c 1 Jun 2006 03:17:25 -0000 1.9 @@ -413,3 +413,4 @@ int eject_vote_enable=0; int eject_vote_only_if_queue=0; int eject_vote_vicious=0; +int duplicates=3; Index: genspkt.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/genspkt.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- genspkt.c 6 May 2006 14:02:37 -0000 1.6 +++ genspkt.c 1 Jun 2006 03:17:25 -0000 1.7 @@ -151,8 +151,8 @@ u_char clientVKills[MAXPLAYER*2+2 +4]; int clientVKillsCount; struct stats_s_spacket singleStats; -unsigned char n_flags[MAXPLAYER]; -int highest_active_player; +static unsigned char n_flags[MAXPLAYER]; +static int highest_active_player; #if MAXPLAYER > 32 static u_char clientVXPlayers[33*4]; @@ -300,13 +300,16 @@ } +/* This function is for sending the flags of OTHER players, the player's + own flags are handled elsewhere. The cambot will set f_many_self, + and use this function to record the flags of all players. */ int sndFlags( struct flags_spacket *flags, struct player *pl, int howmuch) { /*#define FLAGMASK (PFSHIELD|PFBOMB|PFORBIT|PFCLOAK|PFROBOT|PFBEAMUP|PFBEAMDOWN|PFPRACTR|PFDOCK|PFTRACT|PFPRESS|PFDOCKOK) aieee, too much. 7/27/91 TC */ /*#define FLAGMASK (PFSHIELD|PFBOMB|PFORBIT|PFCLOAK|PFROBOT| PFPRACTR|PFDOCK|PFTRACT|PFPRESS|PFDOCKOK) still more than needed */ /* Flags we get to know about players not seen */ -#define INVISOMASK (PFCLOAK|PFROBOT|PFPRACTR|PFDOCKOK|PFOBSERV) +#define INVISOMASK (PFCLOAK|PFROBOT|PFPRACTR|PFDOCKOK|PFOBSERV|PFBPROBOT) /* Flags we get to know about players who are seen */ #define FLAGMASK (PFSHIELD | INVISOMASK) @@ -314,16 +317,17 @@ int tractor = ((F_show_all_tractors || f_many_self) && pl->p_flags&PFTRACT)? (pl->p_tractor|0x40):0; +#ifdef OBSERVERS + if (!f_many_self && pl->p_status == POBSERV) { + mask = PFOBSERV; /* All we need to know about observers. */ + tractor = 0; + } else +#endif if (howmuch == UPDT_ALL) { mask = FLAGMASK; if(F_show_all_tractors || f_many_self) mask |= PFTRACT|PFPRESS; } else mask = INVISOMASK; - - /* With short packets 2 flag sampling, these don't need to be sent */ - if (send_short>1 && pl->p_no<32) - mask &= ~(PFSHIELD|PFCLOAK); - if ((ntohl(flags->flags)&mask) == (pl->p_flags&mask) && flags->tractor==tractor) @@ -561,6 +565,7 @@ tp->type = SP_TORP; tp->x = htonl(t->t_x); tp->y = htonl(t->t_y); + tp->dir = t->t_dir; /* The robot needs this */ tp->tnum = htons(i); sendClientPacket(tp); if ( (t->t_status != tpi->status) @@ -623,6 +628,11 @@ || ((t->t_war & me->p_team) != tpi->war)) { tpi->type = SP_PLASMA_INFO; tpi->war = t->t_war & me->p_team; + /* In PP plasma mode, plasmas change teams, but client doesn't + know. If player is at war with plasma's new team, set the + plasma's war flag, so client knows it is hostile. */ + if (pingpong_plasma && (t->t_team & me->p_war)) + tpi->war |= me->p_team; tpi->pnum = htons(i); tpi->status = t->t_status; sendClientPacket(tpi); @@ -759,7 +769,8 @@ updtPlanet(struct planet_spacket *pl, struct planet *plan, int howmuch) { -#define PLFLAGMASK (PLREPAIR|PLFUEL|PLAGRI|PLHOME|PLCOUP) +#define PLFLAGMASK (PLREPAIR|PLFUEL|PLAGRI|PLHOME|PLCOUP|PLCORE) + if (howmuch == UPDT_ALL) { if ( pl->info != plan->pl_info @@ -887,7 +898,7 @@ case DMKILLP: #ifdef CHAIN_REACTION if (why_dead) { - swarning(KILLARGS2,(u_char)cur->args[5],0); + swarning(KILLARGS2,(u_char)cur->args[5],(u_char)cur->args[4]); } #endif swarning(DMKILLP, (u_char)cur->args[1], (u_char)cur->args[2]); @@ -1168,17 +1179,21 @@ sndPlayerInfo(cpli, pl); sndKills(kills, pl); + /* S_P2 new flag sampling */ + if (send_short > 1) { + u_int oldflags; #ifdef OBSERVERS - if(pl->p_status != POBSERV){ + /* Skip observers' flags, unless I am the observer. */ + if (pl->p_status != POBSERV || pl == me) { #endif - /* S_P2 new flag sampling */ - if(!(pl->p_flags & PFROBOT)) { /* No robos please */ switch(pl->p_status){ +#ifdef OBSERVERS + case POBSERV: +#endif case PALIVE: /* huh, we must work */ highest_active_player = i; if(pl->p_flags & PFCLOAK){ n_flags[i] = 1; - break; } else if(pl->p_flags & PFSHIELD){ n_flags[i] = 2; @@ -1197,10 +1212,16 @@ /* Is it ok to send the old value ? */ break; } - } /* robos out */ + /* Mark shield and cloak as updated, so they won't be resent + again with a flags packet. */ + oldflags = ntohl(flags->flags); + oldflags &= ~(PFSHIELD|PFCLOAK); + oldflags |= pl->p_flags&(PFSHIELD|PFCLOAK); + flags->flags = htonl(oldflags); #ifdef OBSERVERS - } + } #endif + } if (sndPStatus(pstatus, pl)) { update=1; Index: detonate.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/detonate.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- detonate.c 24 Apr 2006 10:12:18 -0000 1.3 +++ detonate.c 1 Jun 2006 03:17:25 -0000 1.4 @@ -28,7 +28,8 @@ } if (me->p_flags & PFWEP) { new_warning(UNDEF, "Weapons overheated"); - return; + if (!chaosmode) + return; } me->p_fuel -= myship->s_detcost; Index: main.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/main.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- main.c 12 May 2006 03:44:48 -0000 1.10 +++ main.c 1 Jun 2006 03:17:25 -0000 1.11 @@ -35,8 +35,7 @@ static void sendMotd(void); static void sendConfigMsg(void); static void printStats(void); -static int check_temporary_bans(char *ip); -static int check_permanent_bans(char *login, char *host); +static void bans_check(); extern int ignored[MAXPLAYER]; int indie = 0; /* always be indie 8/28/91 TC */ @@ -171,7 +170,7 @@ sendMotd(); /* wait for a slot to become free */ - pno = findslot(w_queue, host); + pno = findslot(w_queue, inet_ntoa(*(struct in_addr *)&remoteaddr)); if (pno < 0) { /* trigger client's "Sorry, but you cannot play xtrek now. Try again later." */ @@ -400,37 +399,7 @@ #endif me->p_status = PALIVE; /* Put player in game */ me->p_ghostbuster = 0; - - if (!bypassed) { - char *reason = NULL; - if (check_permanent_bans(login, host) == TRUE) { - reason = "banned by the administrator"; - } else if (check_permanent_bans(login, me->p_ip) == TRUE) { - reason = "banned by the administrator"; - } else if (check_temporary_bans(me->p_ip) == TRUE) { - reason = "banned by the players"; - } - if (reason != NULL) { - FILE *logfile; - time_t curtime; - - pmessage(0, MALL, "GOD->ALL","%s (%s@%s) is %s.", - me->p_name, me->p_login, me->p_ip, reason); - new_warning(UNDEF,"You are banned from the game."); - me->p_explode=100; - me->p_status=PEXPLODE; - me->p_whydead=KQUIT; /* make him self destruct */ - me->p_whodead=0; - logfile=fopen(LogFileName, "a"); - if (logfile) { - curtime=time(NULL); - fprintf(logfile, "Banned and exiting: %s (%s@%s), (%c), %s", - me->p_name, me->p_login, host, shipnos[me->p_no], ctime(&curtime) - ); - fclose(logfile); - } - } - } + bans_check(); /* Get input until the player quits or dies */ living++; @@ -818,7 +787,7 @@ } /* check temporary bans voted */ -static int check_temporary_bans(char *ip) +static int bans_check_temporary(char *ip) { int i; for(i=0; ip_name, me->p_login, host, shipnos[me->p_no], ctime(&curtime) + ); + fclose(logfile); + } +} + +static void bans_enforce_alive() +{ + new_warning(UNDEF,"You are banned from the game, goodbye."); + me->p_explode=100; + me->p_status=PEXPLODE; + me->p_whydead=KQUIT; /* make him self destruct */ + me->p_whodead=0; +} + +static void bans_enforce_observ() +{ + mute = 1; + new_warning(UNDEF,"You are banned from the game, you may not speak."); +} + +static void bans_enforce(char *reason) +{ + pmessage(0, MALL, "GOD->ALL","%s (%s@%s) is %s.", + me->p_name, me->p_login, me->p_ip, reason); + bans_log(); + if (me->p_status == PALIVE) { + bans_enforce_alive(); + } else if (me->p_status == POBSERV) { + bans_enforce_observ(); + } +} + +static void bans_check() +{ + if (!bypassed) { + char *reason = NULL; + if (bans_check_permanent(login, host) == TRUE) { + reason = "banned by the administrator"; + } else if (bans_check_permanent(login, me->p_ip) == TRUE) { + reason = "banned by the administrator"; + } else if (bans_check_temporary(me->p_ip) == TRUE) { + reason = "banned by the players"; + } + if (reason != NULL) { + bans_enforce(reason); + } + } +} + /* ARGSUSED */ void message_flag(struct message *cur, char *address) { Index: daemonII.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/daemonII.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- daemonII.c 12 May 2006 03:44:48 -0000 1.14 +++ daemonII.c 1 Jun 2006 03:17:25 -0000 1.15 @@ -276,10 +276,12 @@ exitDaemon(0); } - x = 0; - check_load(); + /* signal parent ntserv that daemon is ready */ + kill(getppid(), SIGUSR1); + + x = 0; for (;;) { PAUSE(SIGALRM); if (debug) { @@ -336,7 +338,6 @@ #define TERMINATOR (-2) /* Terminator */ #define STERMINATOR (-3) /* sticky Terminator */ -int nplayers = 0; /* isae - was missing int */ int dietime = -1; /* isae - was missing int */ static int tournamentMode(void) @@ -493,7 +494,8 @@ pmessage(0, MALL, "GOD->ALL","Diplomat insults foriegn emperor's mother and fighting breaks out!"); break; case 6: - pmessage(0, MALL, "GOD->ALL","Dan Quayle declares self as galactic emperor and chaos breaks out!"); + pmessage(0, MALL, "GOD->ALL","%s declares self as galactic emperor and chaos breaks out!", + WARMONGER); break; default: pmessage(0, MALL, "GOD->ALL","Peace parties have been demobilized, and fighting ensues."); @@ -523,7 +525,8 @@ pmessage(0, MALL, "GOD->ALL","Diplomat apologizes to foreign emperor's mother and invasion is stopped!"); break; case 6: - pmessage(0, MALL, "GOD->ALL","Dan Quayle is locked up and order returns to the galaxy!"); + pmessage(0, MALL, "GOD->ALL","%s is locked up and order returns to the galaxy!", + WARMONGER); break; default: pmessage(0, MALL, "GOD->ALL","The peace party has reformed, and is rallying for peace"); @@ -864,7 +867,7 @@ float dist; /* used by tractor beams */ int maxspeed; - nplayers = 0; + int nfree = 0; tcount[FED] = tcount[ROM] = tcount[KLI] = tcount[ORI] = 0; for (i = status->active = 0, j = &players[i]; i < MAXPLAYER; i++, j++) { int outfitdelay; @@ -907,7 +910,7 @@ } continue; case PFREE: - nplayers++; + nfree++; j->p_ghostbuster = 0; /* stop from hosing new players */ continue; #ifdef OBSERVERS @@ -1473,11 +1476,15 @@ break; } /* end switch */ } - if (nplayers == MAXPLAYER) { - if (dietime == -1) - dietime = ticks + 600 / PLAYERFUSE; - } - else { + if (nfree == MAXPLAYER) { + if (dietime == -1) { + if (status->gameup & GU_GAMEOK) { + dietime = ticks + 600 / PLAYERFUSE; + } else { + dietime = ticks + 10 / PLAYERFUSE; + } + } + } else { dietime = -1; } } @@ -2745,7 +2752,7 @@ arg[1] = j->p_no; arg[2] = l->pl_no; arg[3] = 0; - arg[4] = 0; + arg[4] = j->p_armies; #ifdef CHAIN_REACTION strcat(buf," [planet]"); arg[5] = KPLANET; Index: socket.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/socket.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- socket.c 6 May 2006 14:02:38 -0000 1.8 +++ socket.c 1 Jun 2006 03:17:25 -0000 1.9 @@ -1098,8 +1098,12 @@ packets_received ++; #endif if (handlers[(int)*bufptr].handler != NULL) { - if (((FD_ISSET(*bufptr, &inputMask)) && - (me==NULL || !(me->p_flags & (PFWAR|PFREFITTING + if (((FD_ISSET(*bufptr, &inputMask)) && + (me==NULL +#ifdef OBSERVERS + || (me->p_status == POBSERV) +#endif + || !(me->p_flags & (PFWAR|PFREFITTING #ifdef SB_TRANSWARP | PFTWARP #endif @@ -1325,7 +1329,7 @@ static void handleWarReq(struct war_cpacket *packet) { - declare_war(packet->newmask); + declare_war(packet->newmask, 1); } static void handlePlanlockReq(struct planlock_cpacket *packet) Index: interface.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ntserv/interface.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- interface.c 10 Apr 2006 10:56:32 -0000 1.4 +++ interface.c 1 Jun 2006 03:17:25 -0000 1.5 @@ -357,7 +357,7 @@ } -void declare_war(int mask) +void declare_war(int mask, int refitdelay) { int changes; int i; @@ -406,7 +406,7 @@ } } - if (mask & ~me->p_hostile) { + if (refitdelay && (mask & ~me->p_hostile)) { me->p_flags |= PFWAR; delay = me->p_updates + 100; new_warning(49,"Pausing ten seconds to re-program battle computers."); @@ -447,7 +447,7 @@ int i=0; struct ship_cap_spacket ShipFoo; - if (type<0 || type>=ATT) return; + if (type<0 || type>ATT) return; if (me->p_flags & PFORBIT) { if (!(planets[me->p_planet].pl_flags & PLHOME)) { new_warning(50,"You must orbit your HOME planet to apply for command reassignment!"); From quozl at users.sourceforge.net Wed May 31 22:17:27 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Thu, 01 Jun 2006 03:17:27 +0000 Subject: [netrek-cvs] server/Vanilla/res-rsa configure, 1.1, 1.2 configure.in, 1.2, 1.3 Message-ID: Update of /cvsroot/netrek/server/Vanilla/res-rsa In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28256/res-rsa Modified Files: configure configure.in Log Message: merge 2.11.1 from darcs Index: configure =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/res-rsa/configure,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- configure 21 Mar 2005 05:23:44 -0000 1.1 +++ configure 1 Jun 2006 03:17:25 -0000 1.2 @@ -944,64 +944,64 @@ # If GMP directory was specified, do some smart checking if test "$GMP_DIR" != ""; then - # prefix the search path with the provided path GMP_PATH="$GMP_DIR $GMP_PATH" + fi - # search for the header file - echo $ac_n "checking for local gmp.h""... $ac_c" 1>&6 + # search for the header file + echo $ac_n "checking for local gmp.h""... $ac_c" 1>&6 echo "configure:954: checking for local gmp.h" >&5 + for path in $GMP_PATH; do + if test -r $path/gmp.h; then + GMP_VER=1 + GMP_INC="-I$path" + break + fi + if test -r $path/include/gmp.h; then + GMP_VER=1 + GMP_INC="-I$path/include" + break + fi + done + + if test $GMP_VER = 1; then + echo "$ac_t""found in $GMP_INC" 1>&6 + else + echo "$ac_t""not found" 1>&6 + fi + + # search for the library file only if header was found + if test $GMP_VER = 1; then + + GMP_VER=0 + + echo $ac_n "checking for local libgmp.a""... $ac_c" 1>&6 +echo "configure:981: checking for local libgmp.a" >&5 + for path in $GMP_PATH; do - if test -r $path/gmp.h; then + if test -r $path/libgmp.a; then GMP_VER=1 - GMP_INC="-I$path" + GMP_LIB="-L$path" break fi - if test -r $path/include/gmp.h; then + if test -r $path/lib/libgmp.a; then GMP_VER=1 - GMP_INC="-I$path/include" + GMP_LIB="-L$path/lib" break fi done - if test $GMP_VER = 1; then - echo "$ac_t""found in $GMP_INC" 1>&6 + echo "$ac_t""found in $GMP_LIB" 1>&6 else echo "$ac_t""not found" 1>&6 fi - # search for the library file only if header was found + # Check for GMP2 if test $GMP_VER = 1; then - - GMP_VER=0 - - echo $ac_n "checking for local libgmp.a""... $ac_c" 1>&6 -echo "configure:981: checking for local libgmp.a" >&5 - - for path in $GMP_PATH; do - if test -r $path/libgmp.a; then - GMP_VER=1 - GMP_LIB="-L$path" - break - fi - if test -r $path/lib/libgmp.a; then - GMP_VER=1 - GMP_LIB="-L$path/lib" - break - fi - done - if test $GMP_VER = 1; then - echo "$ac_t""found in $GMP_LIB" 1>&6 - else - echo "$ac_t""not found" 1>&6 - fi - - # Check for GMP2 - if test $GMP_VER = 1; then - LDOLD="$LDFLAGS" - LDFLAGS="$GMP_LIB -lgmp" - echo $ac_n "checking for mpz_fdiv_q_ui in -lgmp""... $ac_c" 1>&6 + LDOLD="$LDFLAGS" + LDFLAGS="$GMP_LIB -lgmp" + echo $ac_n "checking for mpz_fdiv_q_ui in -lgmp""... $ac_c" 1>&6 echo "configure:1006: checking for mpz_fdiv_q_ui in -lgmp" >&5 ac_lib_var=`echo gmp'_'mpz_fdiv_q_ui | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then @@ -1044,9 +1044,52 @@ echo "$ac_t""no" 1>&6 fi - LDFLAGS="$LDOLD" - fi + if test $ac_cv_lib_gmp_mpz_fdiv_q_ui = no; then + echo $ac_n "checking for __gmpz_fdiv_q_ui in -lgmp""... $ac_c" 1>&6 +echo "configure:1050: checking for __gmpz_fdiv_q_ui in -lgmp" >&5 +ac_lib_var=`echo gmp'_'__gmpz_fdiv_q_ui | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lgmp $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_LIB_GMP2 1 +EOF + GMP_VER=2 +else + echo "$ac_t""no" 1>&6 +fi + + fi + LDFLAGS="$LDOLD" fi fi @@ -1058,17 +1101,17 @@ ac_safe=`echo "gmp.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for gmp.h""... $ac_c" 1>&6 -echo "configure:1062: checking for gmp.h" >&5 +echo "configure:1105: checking for gmp.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1072: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1115: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1095,7 +1138,7 @@ if test $GMP_VER = 1; then echo $ac_n "checking for mpz_init in -lgmp""... $ac_c" 1>&6 -echo "configure:1099: checking for mpz_init in -lgmp" >&5 +echo "configure:1142: checking for mpz_init in -lgmp" >&5 ac_lib_var=`echo gmp'_'mpz_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1103,7 +1146,7 @@ ac_save_LIBS="$LIBS" LIBS="-lgmp $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1138,12 +1181,57 @@ GMP_VER=0 fi + if test $ac_cv_lib_gmp_mpz_init = no; then + echo $ac_n "checking for __gmpz_init in -lgmp""... $ac_c" 1>&6 +echo "configure:1187: checking for __gmpz_init in -lgmp" >&5 +ac_lib_var=`echo gmp'_'__gmpz_init | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lgmp $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_LIB_GMP2 1 +EOF + GMP_VER=2 +else + echo "$ac_t""no" 1>&6 +fi + + fi fi # Check for GMP2 if test $GMP_VER = 1; then echo $ac_n "checking for mpz_fdiv_q_ui in -lgmp""... $ac_c" 1>&6 -echo "configure:1147: checking for mpz_fdiv_q_ui in -lgmp" >&5 +echo "configure:1235: checking for mpz_fdiv_q_ui in -lgmp" >&5 ac_lib_var=`echo gmp'_'mpz_fdiv_q_ui | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1151,7 +1239,7 @@ ac_save_LIBS="$LIBS" LIBS="-lgmp $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_LIB_GMP2 1 +EOF + GMP_VER=2 +else + echo "$ac_t""no" 1>&6 +fi + + if test $ac_cv_lib_gmp_mpz_fdiv_q_ui = no; then + echo $ac_n "checking for __gmpz_fdiv_q_ui in -lgmp""... $ac_c" 1>&6 +echo "configure:1279: checking for __gmpz_fdiv_q_ui in -lgmp" >&5 +ac_lib_var=`echo gmp'_'__gmpz_fdiv_q_ui | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lgmp $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1185,6 +1317,7 @@ echo "$ac_t""no" 1>&6 fi + fi fi fi Index: configure.in =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/res-rsa/configure.in,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- configure.in 12 May 2006 03:44:48 -0000 1.2 +++ configure.in 1 Jun 2006 03:17:25 -0000 1.3 @@ -109,6 +109,10 @@ LDOLD="$LDFLAGS" LDFLAGS="$GMP_LIB -lgmp" AC_CHECK_LIB(gmp, mpz_fdiv_q_ui, AC_DEFINE(HAVE_LIB_GMP2) GMP_VER=2) + if test $ac_cv_lib_gmp_mpz_fdiv_q_ui = no; then + dnl with gmp3 it's a #define, use real function name + AC_CHECK_LIB(gmp, __gmpz_fdiv_q_ui, AC_DEFINE(HAVE_LIB_GMP2) GMP_VER=2) + fi LDFLAGS="$LDOLD" fi @@ -123,11 +127,19 @@ if test $GMP_VER = 1; then AC_CHECK_LIB(gmp, mpz_init, AC_DEFINE(HAVE_LIB_GMP), GMP_VER=0) + if test $ac_cv_lib_gmp_mpz_init = no; then + dnl with gmp3 it's a #define, use real function name + AC_CHECK_LIB(gmp, __gmpz_init, AC_DEFINE(HAVE_LIB_GMP2) GMP_VER=2) + fi fi # Check for GMP2 if test $GMP_VER = 1; then AC_CHECK_LIB(gmp, mpz_fdiv_q_ui, AC_DEFINE(HAVE_LIB_GMP2) GMP_VER=2) + if test $ac_cv_lib_gmp_mpz_fdiv_q_ui = no; then + dnl with gmp3 it's a #define, use real function name + AC_CHECK_LIB(gmp, __gmpz_fdiv_q_ui, AC_DEFINE(HAVE_LIB_GMP2) GMP_VER=2) + fi fi fi From quozl at users.sourceforge.net Wed May 31 22:17:26 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Thu, 01 Jun 2006 03:17:26 +0000 Subject: [netrek-cvs] server/Vanilla/debian changelog,1.5,1.6 Message-ID: Update of /cvsroot/netrek/server/Vanilla/debian In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28256/debian Modified Files: changelog Log Message: merge 2.11.1 from darcs Index: changelog =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/debian/changelog,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- changelog 15 May 2006 09:13:18 -0000 1.5 +++ changelog 1 Jun 2006 03:17:24 -0000 1.6 @@ -1,3 +1,9 @@ +netrek-server-vanilla (2.11.1-0) unstable; urgency=low + + * release planned + + -- James Cameron Thu, 1 Jun 2006 12:46:46 +1000 + netrek-server-vanilla (2.11.0-0) unstable; urgency=low * release planned From quozl at users.sourceforge.net Wed May 31 22:17:26 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Thu, 01 Jun 2006 03:17:26 +0000 Subject: [netrek-cvs] server/Vanilla/docs sample_features,1.1,1.2 Message-ID: Update of /cvsroot/netrek/server/Vanilla/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28256/docs Modified Files: sample_features Log Message: merge 2.11.1 from darcs Index: sample_features =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/docs/sample_features,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- sample_features 21 Mar 2005 05:23:34 -0000 1.1 +++ sample_features 1 Jun 2006 03:17:24 -0000 1.2 @@ -36,11 +36,11 @@ # client macro switch (old clients) SMARTMACRO C ON # continuous mouse -CONTINUOUS_MOUSE C OFF +CONTINUOUS_MOUSE C ON # continuous steering CONTINUOUS_STEER C ON # info mode -INFO_MODE1 C OFF +INFO_MODE1 C ON # beeplite options. These get or'ed together to produce the BEEPLITE value. # LITE_PLAYERS_MAP 1 # LITE_PLAYERS_LOCAL 2 From quozl at users.sourceforge.net Wed May 31 22:17:28 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Thu, 01 Jun 2006 03:17:28 +0000 Subject: [netrek-cvs] server/Vanilla/tools/admin ban,1.2,1.3 Message-ID: Update of /cvsroot/netrek/server/Vanilla/tools/admin In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28256/tools/admin Modified Files: ban Log Message: merge 2.11.1 from darcs Index: ban =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/tools/admin/ban,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ban 12 May 2006 03:24:00 -0000 1.2 +++ ban 1 Jun 2006 03:17:26 -0000 1.3 @@ -8,3 +8,4 @@ echo "*@$2" >> .banned echo "# banned by admin command, `date`" >> .access echo "$2 n" >> .access + From quozl at users.sourceforge.net Wed May 31 22:17:27 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Thu, 01 Jun 2006 03:17:27 +0000 Subject: [netrek-cvs] server/Vanilla/newstartd newstartd.c,1.10,1.11 Message-ID: Update of /cvsroot/netrek/server/Vanilla/newstartd In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28256/newstartd Modified Files: newstartd.c Log Message: merge 2.11.1 from darcs From quozl at users.sourceforge.net Wed May 31 22:17:26 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Thu, 01 Jun 2006 03:17:26 +0000 Subject: [netrek-cvs] server/Vanilla/include config.h.in, 1.6, 1.7 data.h, 1.6, 1.7 defs.h, 1.7, 1.8 patchlevel.h, 1.7, 1.8 proto.h, 1.9, 1.10 struct.h, 1.9, 1.10 sysdefaults.h, 1.3, 1.4 warnings.h, 1.1, 1.2 Message-ID: Update of /cvsroot/netrek/server/Vanilla/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28256/include Modified Files: config.h.in data.h defs.h patchlevel.h proto.h struct.h sysdefaults.h warnings.h Log Message: merge 2.11.1 from darcs Index: config.h.in =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/include/config.h.in,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- config.h.in 26 Apr 2006 09:52:43 -0000 1.6 +++ config.h.in 1 Jun 2006 03:17:24 -0000 1.7 @@ -447,16 +447,6 @@ server. */ #define PLAYER_INDEX - /* NO_DUPLICATE_HOSTS - prevents two - pickup players from the same host, - prevents a player opening an observer - slot, but does not prevent a player - slot being opened by an existing - observer slot. The new client is - given a wait queue response of - MAXPLAYERS. Requires FULL_HOSTNAMES. */ -#undef NO_DUPLICATE_HOSTS - #endif /* SERVER */ @@ -482,7 +472,8 @@ #define STDC_HEADERS 1 /* 13/01/94 omit hosed index [007] */ #undef HAVE_WAIT3 #undef NEED_SYS_SELECT_H -#undef NO_FD_SET /* Guess we suck badly if that happens :( */ + /* Guess we suck badly if that happens :( */ +#undef NO_FD_SET #undef HAVE_UNISTD_H #undef HAVE_SYS_TIMEB_H #undef TM_IN_SYS_TIME @@ -496,7 +487,8 @@ #undef HAVE_SYS_RESOURCE_H #undef HAVE_SYS_WAIT_H #undef HAVE_NETINET_IN_H -#undef HAVE_SYS_FILIO_H /* Needed for Solaris 2.5.1 */ + /* Needed for Solaris 2.x */ +#undef HAVE_SYS_FILIO_H #undef HAVE_GMP2_H #undef NO_U_INT #undef SIZEOF_LONG Index: defs.h =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/include/defs.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- defs.h 26 Apr 2006 09:52:43 -0000 1.7 +++ defs.h 1 Jun 2006 03:17:24 -0000 1.8 @@ -481,4 +481,7 @@ /* #undef PUCK_FIRST 99 */ /* make sure puck runs before players do */ +/* for t-mode messaging, change this according to political environment */ +#define WARMONGER "George Bush" + #endif /* _h_defs */ Index: sysdefaults.h =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/include/sysdefaults.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- sysdefaults.h 26 Apr 2006 09:52:43 -0000 1.3 +++ sysdefaults.h 1 Jun 2006 03:17:24 -0000 1.4 @@ -210,6 +210,8 @@ "Only allow ejection if there is a queue of players" }, { "EJECT_VOTE_VICIOUS", SYSDEF_INT, &eject_vote_vicious, "Kill ntserv process to eject, causes some client problems" }, + { "DUPLICATES", SYSDEF_INT, &duplicates, + "Maximum number of duplicate connections from a single IP" }, { "", SYSDEF_END, NULL } }; Index: warnings.h =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/include/warnings.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- warnings.h 21 Mar 2005 05:23:36 -0000 1.1 +++ warnings.h 1 Jun 2006 03:17:24 -0000 1.2 @@ -137,7 +137,7 @@ /* beam_down() */ "Must be orbiting or docked to beam down.", /* 47 */ "Comm Officer: Starbase refuses permission to beam our troops over.", /* 48 */ -/* declare_war(mask) */ +/* declare_war(mask, refitdelay) */ "Pausing ten seconds to re-program battle computers.", /* 49 */ /* do_refit(type) */ "You must orbit your HOME planet to apply for command reassignment!", /* 50 */ Index: patchlevel.h =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/include/patchlevel.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- patchlevel.h 15 May 2006 09:13:18 -0000 1.7 +++ patchlevel.h 1 Jun 2006 03:17:24 -0000 1.8 @@ -12,7 +12,7 @@ * (a) reset this to zero before each major release, and; * (b) increment this number before each patch release. */ -#define PATCHLEVEL 0 +#define PATCHLEVEL 1 #if !defined(NULL) #define NULL 0 #endif Index: struct.h =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/include/struct.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- struct.h 12 May 2006 03:44:48 -0000 1.9 +++ struct.h 1 Jun 2006 03:17:24 -0000 1.10 @@ -89,7 +89,6 @@ /* The following defines are for gameup field */ #define GU_GAMEOK 1 -#define game_ok ((status->gameup) & GU_GAMEOK) #define GU_PRACTICE 2 #define practice_mode ((status->gameup) & GU_PRACTICE) #define GU_CHAOS 4 Index: proto.h =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/include/proto.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- proto.h 12 May 2006 03:44:48 -0000 1.9 +++ proto.h 1 Jun 2006 03:17:24 -0000 1.10 @@ -129,7 +129,7 @@ void lock_player(int player); void tractor_player(int player); void pressor_player(int player); -void declare_war(int mask); +void declare_war(int mask, int refitdelay); void do_refit(int type); int numPlanets(int owner); Index: data.h =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/include/data.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- data.h 12 May 2006 03:44:48 -0000 1.6 +++ data.h 1 Jun 2006 03:17:24 -0000 1.7 @@ -355,5 +355,6 @@ extern int eject_vote_enable; extern int eject_vote_only_if_queue; extern int eject_vote_vicious; +extern int duplicates; #endif /* _h_data */ From quozl at users.sourceforge.net Wed May 31 22:17:26 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Thu, 01 Jun 2006 03:17:26 +0000 Subject: [netrek-cvs] server/Vanilla BUGS, 1.6, 1.7 ChangeLog, 1.44, 1.45 INSTALL.Newbie, 1.2, 1.3 Makefile.in, 1.12, 1.13 NEWS, 1.23, 1.24 PROJECTS, 1.11, 1.12 README.releasing, 1.14, 1.15 STYLE, 1.2, 1.3 configure, 1.4, 1.5 configure.in, 1.6, 1.7 Message-ID: Update of /cvsroot/netrek/server/Vanilla In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28256 Modified Files: BUGS ChangeLog INSTALL.Newbie Makefile.in NEWS PROJECTS README.releasing STYLE configure configure.in Log Message: merge 2.11.1 from darcs Index: STYLE =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/STYLE,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- STYLE 23 Apr 2006 11:17:03 -0000 1.2 +++ STYLE 1 Jun 2006 03:17:24 -0000 1.3 @@ -1,11 +1,19 @@ -Coding style for patch acceptance on Vanilla project. +Coding Style +------------ - * for minor changes, do not change indentation, - * for major changes to a function, reindent the function, - * for major changes to a file, reindent the file. - * indent by either two or four spaces, or use tabs, just be consistent within a file, preferred is four spaces. +1. for minor changes, do not change indentation, keep it consistent + with the indentation in the file you are working on, + +2. for major changes to a file, reindent the file according to 4 + below, + +3. for new files, indent the file according to 4 below, + +4. indent by either two or four spaces, or use tabs, but be + consistent within a file, preferred is four spaces, no tabs. + +An example -{{{ static int foo(int a) { if (a) { @@ -16,4 +24,54 @@ jkl; } } -}}} + + +Darcs - Sending Patches +----------------------- + +1. if code is your own work, distribute it as a darcs patch, either +using "darcs send", "darcs send --output=somefile.dpatch" or by +publishing it on a repository accessible via HTTP. + +2. if you are unable to use darcs, and want your code to appear +in the upstream darcs repositories, send a unified diff privately to +another person who can use darcs. Don't send it to the list. That +person can create the patch (using --author "youremail at example.com") +in your name, and publish it as a dpatch. + +3. if you receive code via the mailing list that is in a non-darcs +format, please branch your repository to test the patch. If you feel +the need to use "darcs record" please do not publish the dpatch. Wait +until a dpatch is sent to the list before applying it to your main +working repository. + +The intention of these patch sending guidelines is to reduce the +effort required by developers in resolving conflicts. + + +Darcs - Patch Name and Long Comment +----------------------------------- + +1. the patch name should be the text that would normally be entered +into the NEWS file of the project. It is a user-visible description +of the change, less than about 60 characters, in plain english. + +http://www.gnu.org/prep/standards/html_node/NEWS-File.html + +2. the long comment should be the text that would normally be entered +into the ChangeLog file of the project, minus the date, who made the +change, and their e-mail address. It is the body of the ChangeLog +entry. + +http://www.gnu.org/prep/standards/html_node/Style-of-Change-Logs.html + + +Darcs - Signed-off-by +--------------------- + +Peer review is where another developer reviews a patch and agrees to +inclusion. Some developers may be responsible for certain components. +Their sign-off may be helpful. To sign off on a patch, reply to it +and add a line: + +Signed-off-by: Your Name Index: configure =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/configure,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- configure 30 Sep 2005 03:10:56 -0000 1.4 +++ configure 1 Jun 2006 03:17:24 -0000 1.5 @@ -1,37 +1,881 @@ #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# Generated by GNU Autoconf 2.59d. # +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. [...28138 lines suppressed...] - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir" + { echo "$as_me:$LINENO: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 +echo "$as_me: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} # The eval makes quoting arguments work. - if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir - then : - else - { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; } - fi + eval "$ac_sub_configure $ac_sub_configure_args \ + --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" || + { { echo "$as_me:$LINENO: error: $ac_sub_configure failed for $ac_dir" >&5 +echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;} + { (exit 1); exit 1; }; } fi cd "$ac_popdir" Index: configure.in =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/configure.in,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- configure.in 12 May 2006 03:44:47 -0000 1.6 +++ configure.in 1 Jun 2006 03:17:24 -0000 1.7 @@ -240,13 +240,24 @@ # Check for gmp and mp #-------------------------------------------------------------------- -AC_MSG_CHECKING(for mp.h) AC_ARG_WITH(gmp,[ --with-gmp GMP Dir], MPINC="-I$withval/include" MPLIB="-L$withval/lib -lgmp" search=false, MPINC=nope MPLIB=nope) if test "$MPINC" = nope; then -AC_EGREP_CPP( GNU_MP,[ + AC_MSG_CHECKING(for mp.h) + AC_EGREP_CPP(GNU_MP,[ #include __GNU_MP__ -], [MPINC=nope search=true AC_MSG_RESULT(no)], [MPINC="" search=false AC_MSG_RESULT(no)] ) +], + [gnu_mp_ok=yes], + [gnu_mp_ok=no]) + if test "x$gnu_mp_ok" = xyes; then + MPINC=nope + search=true + AC_MSG_RESULT(yes) + else + MPINC="" + search=false + AC_MSG_RESULT(no) + fi fi AC_MSG_CHECKING(for gmp.h) @@ -479,6 +490,20 @@ # Check for system dependend programs #-------------------------------------------------------------------- +AC_PROG_LIBTOOL + +AC_MSG_CHECKING(for OSX ranlib) +(eval $RANLIB -c) 2>&5 +if test $? -ne 0; then + RANLIB_FLAGS= + AC_MSG_RESULT(no) +else + RANLIB_FLAGS='-c' + AC_MSG_RESULT(drat - yes) +fi + +AC_SUBST(RANLIB_FLAGS) + if test "$code" = server; then AC_MSG_CHECKING(for netstat) Index: Makefile.in =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/Makefile.in,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Makefile.in 15 May 2006 09:13:17 -0000 1.12 +++ Makefile.in 1 Jun 2006 03:17:24 -0000 1.13 @@ -5,8 +5,9 @@ # PACKAGE=netrek-server-vanilla -VERSION=2.11.0 +VERSION=2.11.1 +RANLIB = @RANLIB@ VPATH = @srcdir@ srcdir = @srcdir@ @@ -186,6 +187,7 @@ NAME=$(PACKAGE)-$(VERSION) dist: + chmod +x debian/rules tools/mktrekon configure mkdir $(NAME) # what has changed cp -p ChangeLog NEWS $(NAME)/ Index: INSTALL.Newbie =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/INSTALL.Newbie,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- INSTALL.Newbie 28 Sep 2005 12:14:04 -0000 1.2 +++ INSTALL.Newbie 1 Jun 2006 03:17:24 -0000 1.3 @@ -2,9 +2,47 @@ Instructions for installing the Vanilla Netrek Server as a Newbie Server - install as described in INSTALL -- change .sysdef to include NEWBIE=1 -- change .ports (see docs/sample_ports) +- change etc/sysdef to include NEWBIE=1 +- change etc/syddef the following modes to 0 + INL=0 + DOGFIGHT=0 + TOPGUN=0 + BASEPRACTISE=0 + PRET=0 + HOCKEY=0 + These are exclusive to each other. +- change etc/sysdef to include NEWTURN=0 robots don't know how to fly w/ this. +- change etc/sysdef to include VECTOR=0 robots don't know how to shoot w/ this. +- change etc/sysdef to include TOURN=4 Merlin assumes this. +- change etc/sysdef to include CONFIRM=0 (or 2) Robots only have reserved.c + verification. +- change etc/sysdef to include CHECKSCUM=0 Or you will get lots of logs +- change etc/ports (see docs/sample_ports) - port 3592, enable with -q 10 for the practice robots - port 2592, use as normal but with -q 9 - consider blocking port 3592 inbound connections from offsite - restart netrekd with SIGHUP + +- create a file named "og" in lib/og +- this is the initial commands the newbie robots will read +- add the line "hm 9" into the og file. This will make the bots easy on you. + +- test that your "og" file works by adding the line "coff" and "woff" +- This will make the bots not cloak and not shoot weapons. + +- Remove coff and woff, as that makes the game too easy. +- hm 0 is tough and robots will default to this. + +Below is a sample robot command file named "og". Please remove anything in +comment lines /* */ + +---BEGIN SAMPLE lib/og/og file +hm 9 +randtorp +upd 2 /* 5 updates a second */ +human /* emulate a human */ +hcr /* toggle logic to on that assumes humans carry (hm_cr) */ +ogh /* logic that switches to ogg mode while bombing (ogg_happy) */ +coff /* use this for testing only, cloak OFF */ +woff /* use this for testing only, weapons OFF*/ +---END FILE Index: ChangeLog =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/ChangeLog,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- ChangeLog 15 May 2006 09:13:17 -0000 1.44 +++ ChangeLog 1 Jun 2006 03:17:24 -0000 1.45 @@ -1,3 +1,488 @@ +Thu Jun 1 12:47:18 2006 James Cameron + + * netrek-server-vanilla-2.11.1 released + +Tue May 30 09:49:50 2006 Stas Pirogov + + * autogen.sh: aclocal should be run first to avoid libtoolize + warning about missing aclocal.m4. Also added --copy to libtoolize + to make sure developer doesn't mess up system wide config.guess + and config.sub. + + * config.h.in: comments are not allowed to present in same line as + 'undef VARIABLE', otherwise the VARIABLE will never be set. This + patch fixes two such mistakes by moving the comments one line + above. + +Mon May 29 19:32:48 2006 Bill Balcerski + + * ntserv/detonate.c (detothers): the sysdef CHAOS option ignores + weapontemp, except for on torp detonation. Fix that + inconsistency. + +Mon May 29 14:24:44 2006 Jimmy Huang + + * robotd/update_players.c removed this check + (strcmp(j->p_login,"robot!") != 0) || !(j->p_flags&PFBPROBOT). + and placed it in a Notrobot(p,j) function. + + * robotd/update_players.c removed some unused variables in + army_check3(p,j) function. + + * robotd/update_players.c fixed indent on army_check3() function + and also army_check2() function. + +Sat May 27 18:55:49 2006 James Cameron + + * ntserv/openmem.c: experimental rework to support wait queue + dumping, and multiple server instances in separate shared memory + segments. Provide interface so findslot will be able to detach + from an active game segment and create and attach to a new game + segment. Accept NETREK_PKEY environment variable. + +Sat May 27 17:10:00 2006 James Cameron + + * ntserv/ntscmds.c (do_become): add experimental and not yet + functioning code to support change of slot number for a player. + Requires client-side support and further work. + +Sat May 27 11:57:00 2006 Jimmy Huang + + * INSTALL.Newbie updated INSTALL.Newbie to document newer switches. + Need to include all possible robot switches in the future. + + * robotd/data.c added initialization of global variables hm_cr and + ogg_happy + + * robotd/data.h added global variables hm_cr and ogg_happy + + * robotd/decide.c added check for ogg_happy mode before + check_ogg while bombing + + * robotd/dmessage.c added hcr and ogh message decoding. + + * robotd/update_players.c moved conservative assumptions that + humans carry into a new function called army_check3. + + * robotd/update_players.c added logic so army_check3 only + executes if (hm_cr) global variable is active. + +Fri May 26 15:45:00 2006 Jimmy Huang + + * INSTALL.Newbie updated documentation to show how to configure + the robots to be dumber + + * robotd/data.c changed default updates=2.0 instead of 1.0, decreases + CPU load by 50% and fights about the same. This is 5 updates + per second. + + * robotd/dmessage.c allow decoding of local messages and commandfile + messages even if robot is in INL mode. In INL mode, robots will + ignore other players and GOD's commands. + + * robots/newbie.c checkpos() returns 1, to avoid compiler warning + + * robots/newbie.c added a bunch of comments on what each option + does when Merlin forks a robot. + + * robots/newbie.c modified the command so robots now read a command + file on startup. +Thu May 25 14:33:37 2006 Trent Piepho + + * res-rsa/configure: this is a generated file and shouldn't be + kept in the repository. + + * ntserv/genspkt.c (sndPlasma): in Ping-Pong plasma mode, a plasma + changes teams when it is bounced. There is no way to send this + change to the client, so the client doesn't know. For example, if + a player at peace with us but who we are at war with bounces our + (or a teammate's) plasma back at us, it appears to the client that + the plasma is friendly. But really, it's not, since we are at war + with the plasma's new team. Fix this by setting the plasma's war + flag if the player is hostile to the plasma's team. + + In order to take advantage of this, clients will need to be sure + to: + + 1. Not assume that the player's own plasma is friendly. + 2. Not assume that plasma from the player's team is friendly. + 3. Make sure to check the plasma's war flags, and not the flags + of the player who fired it. + + * robotd/socket.c (handlePlasmaInfo): + * robotd/robot.c (phaser_plasmas): + * robotd/dodge.c (init_torps): + + The robot has code to deal with Ping-Pong plasma, but it's an old + version. It doesn't work properly with the current ping-pong + plasmas, written by Trent Piepho in 1995 (so the old ones are + really old!). Basically, the bots needs to allow for plasma fired + by a friendly player becoming hostile to it. + + Also sets the pl_team member of the plasma struct, which makes + getting the plasma's team easier. + +Thu May 25 14:12:16 2006 James Cameron + + * include/defs.h (WARMONGER): add customisation setting for + configuration of local warmonger, so that we are not caught by + change again so easily. + + * ntserv/daemonII.c (political_begin): deprecate Dan Quayle in + favour of George Bush, subject to mailing list discussion. Patch + by: William Balcerski with rework by James Cameron. + +Thu May 25 11:37:27 2006 James Cameron + + * autogen.sh: add res-rsa to autoconf re-run, + + * tests/build: test for correct directory, use darcs get instead + of put, use autogen.sh instead of running autotools here, add the + install target. + + "darcs put" is slow, the darcs manual recommends "darcs get" instead, + which is certainly faster. But "darcs get" must have the exact path to + a repo, not like "darcs put". So a test is added to check that we are + in the right directory first. + +Thu May 25 09:57:18 2006 Stas Pirogov + + * configure.in: configure.in: test for ranlib was failing on + Solaris. This is probably caused by different /bin/sh + interpreters. This fix should satisfy all of them. + +Mon May 22 14:31:58 2006 Trent Piepho + + * Makefile.in: remove calls to glib-config, they aren't needed + and fail if glib-config isn't present. + +Tue May 23 17:21:56 2006 Trent Piepho + + * ntserv/genspkt.c Fix SP_2 flags, for real. The sndFlags + function will not send flags of observers (except for PFOBSERV of + course). The SP_2 flag sampling code will sample the flags of + robots now. It will not sample observers' flags, except for an + observer's own flags. The SP_2 sampling code will update the last + sent flags data, so shield/cloak are not sent again via + sndFlags(). When sndFlags() does send flags, it will send the + correct shield/cloak and not zero. + +Wed May 24 11:18:31 2006 James Cameron + + * autogen.sh: add GNU standard autotools configuration sequence, + deprecating execution of README.darcs. Manual build process then + becomes "sh autogen.sh" followed by the usual configure, make, and + make install. + +Wed May 24 10:48:23 2006 James Cameron + + * robotd/util.c (mfprintf): fix a regression caused by conversion + to stdargs done on Fri Oct 31 09:15:42 2003. + +Wed May 24 00:34:00 2006 Jimmy Huang + + * robots/newbie.c changed some tabbing for better indent and + bracing consistency. + + * robots/newbie.c added #defines POSITIONX and POSITIONY so + there's only one place the change the desired x and y position of + Merlin. + + * robots/newbie.c added checkpos() function which checks for + changes in Merlin's position. Replaces him back into POSITIONX and + POSITIONY once it finds that Merlin has stopped moving for 15 + seconds. + + * robots/newbie.c corrected misspellings of various comments. + + * robots/newbie.c modified num_players() function to return the + correct *next_team based on 4 vs. 4 t-mode settings also. + +Tue May 23 23:36:00 2006 Jimmy Huang + + * robotd/input.c re-wrote the setflag() function. This function is + supposed to update the global variable _udcounter. _udcounter is + supposed to be a counter that starts at 0, and increments by 1 for + every 100 milliseconds. In the orignal code. _udcounter would do + this properly for an undetermined amount of time, + (anywhere between 30 minutees to 18 hours, depending on what time + of day it was!!!). When _udcounter breaks, usually for several + hours on an 18 hour cycle, robots report armies carried, but do + not report which planet it intends to take. This is because + instead of a positive incrementing number, udcounter counts with a + negative decrementing number. A whole bunch of other things + break, but they are not obvious unless you are playing the + game. Now, _udcounter should work for about 250 days, before + breaking. (It still breaks). + +Tue May 23 14:00:37 2006 James Cameron + + * ntserv/genspkt.c (sndFlags): for practice robots, terminators, + and hunter-killer, in conjunction with short packets version two, + shields were not being sent. Changed to send shields in SP_FLAGS. + See also "S_P2 new flag sampling" in updateShips(). Reported by + William Balcerski. + +Tue May 23 04:06:08 2006 Trent Piepho + + * ntserv/genspkt.c Hadley's bot expects to get torp direction + from the server, but the server only sends it for your own torps. + Changed to send it for other torps too. Without it, the bot + thinks all torps are going straight up, making it a very bad + dodger (unless you attack from below). Should be fixed to only + turn this on for the robot, so as not to help borgs. + +Tue May 23 03:05:55 2006 Trent Piepho + + * robotd/assault.c: check for res danger would make the robot + cloak when near _any_ home planet, so it would cloak even when + bombing it's own core. Fixed this, and made it faster too. + +Tue May 23 01:51:17 2006 Trent Piepho + + * robotd/assault.c, robotd/escort.c, robotd/getarmies.c, + robotd/robot.c: some calls to req_cloak_off() were missing the + function's argument (reason string). + +Tue May 23 01:07:02 2006 Trent Piepho + + * robotd/update_players.c: fix a warning about a uninitialized use + of pldist in update_players(). + +Tue May 23 00:57:29 2006 Trent Piepho + + * robotd/dmessage.c: code to generate the RCD message didn't + handle the case when there were no visible friendly and/or enemy + ships. In this case, _state.closest_{e,f} would be NULL. + +Tue May 23 00:52:55 2006 Trent Piepho + + * robotd/update_players.c: function closest_planet() would usually + return NULL every other time it was called. For speed, it would + check the previous closest planet first, then look for a _closer_ + planet. If it didn't find one, it returned NULL, rather than the + previous (and current) closest planet. + +Mon May 22 16:53:42 2006 Trent Piepho + + * robotd/decide.c: fix several bugs with check_take(). It didn't + handle the case when no enemy planets were left. It looked at the + last enemy planet in the list, rather than the target enemy planet + when deciding if it should take neut planets. It would skip + looking for neuts when it found an enemy agri and *didn't* have + enough armies to take it. + +Mon May 22 16:31:58 2006 Trent Piepho + + * robotd/assault.c: have robot check the planet status in assault + code, so that if a planet changes teams while it being assaulted + the robot will adapt. It will not try to drop on a planet it can + not drop on, and not try to bomb a planet it can not bomb. + + Also, the robot will not reinforce a planet past 4 armies after it + takes it. + +Mon May 22 15:39:35 2006 Trent Piepho + + * robotd/util.c: when mfprintf() was change from varargs to + stdarg, it wasn't done correctly. Fix this. + +Mon May 22 14:03:38 2006 Trent Piepho + + * res-rsa/configure.in: the check for gmp fails for gmp version 3, + fix it by adding a secondary check for the gmp3 symbol names. + +Mon May 22 10:53:03 2006 Jimmy Huang + + * robotd/assault.c: added extra check not to bomb your own armies. + Bots will try to bomb own armies when 2 carriers drop on same + planet. And planet ends up with >4 armies. + + * robotd/decide.c: changed some tabbing. + + * robotd/decide.c: corrected logic in check_take function. Robotd + now takes neutral planets. Before it had a tendency to ignore + neutral planets. Also used to crash out when no more enemy + planets. Both are fixed with this. + + * robotd/main.c, shmem.c, socket.c, update_players.c: removed + mfprintf function. replaced with fprintf function until such time + that mfprintf function is fixed so it doesn't crash. Bandaid. + + * robotd/update_players.c: changed some tabbing, added some + missing braces. + + * robotd/update_players.c: changed closest_planet() function to + return the current closest planet instead of NULL when it cannot + find a closer planet. + + * robotd/util.c: added comments to reflect that mfprintf causes + crashes for as yet unknown reasons. + +Sun May 21 22:22:41 2006 James Cameron + + Remove the two second delay experienced by clients that connect to + a server on which the daemon is not running. Also fix a cause of + initial connection failing, which happens if the daemon does not + start up within the hoped-for interval. + + Solution is implemented using the SIGUSR1 signal, but only during + the initialisation window between when ntserv forks the daemon and + the daemon completes initialisation. The signal is not used at + other times. + + * ntserv/daemonII.c (main): send a SIGUSR1 to parent process + (ntserv) once initialisation of shared memory is completed and + regular SIGALRMs are about to commence. + + * ntserv/openmem.c (openmem): remove two second delay that was + used to hope for daemon to initialise. + + * ntserv/openmem.c (startdaemon): add a wait for SIGUSR1. + +Sun May 21 21:48:15 2006 James Cameron + + * tools/setgame.c: add script utility for pausing, resuming, and + terminating the game. + + * tools/Makefile.in: add setgame target. + + * ntserv/input.c (input): send bad version packet to terminate + client as soon as a GU_GAMEOK termination is requested. + + * ntserv/daemonII.c (udplayers): terminate daemon as soon as + possible if a GU_GAMEOK termination is requested. Change nplayers + to nfree, to better explain what the variable is. + + * include/struct.h (game_ok): remove unused macro. + +Fri May 19 18:06:15 2006 James Cameron + + * config.h.in, data.h, sysdefaults.h, data.c, findslot.c, main.c: + adds a new etc/sysdef option DUPLICATES which is the maximum + number of pickup player slots allowed from the same IP address + before the next connection is given the Q32 response. + + This is a denial of service filtering feature. + + The default is 3. Set this above 16 to make it ineffective. + + Set this to less than half of the number of players per side, + otherwise abusers may not be ejected or banned by majority vote + because a majority would be impossible. + + Does not affect robots, unless they join via the pickup queue + ... which would be a misconfiguration. Robots normally join via a + special queue. + +Fri May 19 16:08:34 2006 James Cameron + + * ntserv/Makefile.in (install-ntserv): addition of a target so + that a server operator can do a live update of ntserv during a + running game. + + The target moves the existing in-use ntserv binary into an archive + tree before installing the new ntserv binary. This makes it + possible to manually back out of an installation if the new binary + breaks badly. + + Other methods to test a new ntserv binary include running it + manually for connection back to the client. See ntserv command + line options. + +Fri May 19 14:22:48 2006 James Cameron + + * ntserv/main.c: banned observers are allowed in and can speak, + which was a surprise, but the code has always allowed this since + observers were added. Change to prevent banned observers from + talking. Simplify ban logic further. + +Thu May 18 15:57:08 2006 James Cameron + + * tools/setteam.c, tools/Makefile.in: add utility to view and + manipulate starbase reconstruction and surrender timers. + +Thu May 18 12:25:36 2006 James Cameron + + * ntserv/input.c (input): slots may jam in POUTFIT after KWINNER + if the user terminates the client ungracefully ... such that the + TCP connection is gone but the ntserv lives on. + + During this time, daemon synchronisation still sends SIGALRM to + the ntserv, and ntserv's SIGALRM handler still resets the + p_ghostbust timer. + + Prototype solution is to move p_ghostbust watchdog timer reset + from within the SIGALRM handler to the section of main loop that + is executed when input arrives from the client. + + Monitoring the p_ghostbust timer with gdb shows it is now reset + for a dormant client on receipt of ping responses. + +Thu May 18 07:16:00 2006 Bill Balcerski + + * ntserv/transwarp.c: changed the transwarp failure message, in + the case of one or both of the ships not being at peace, to + something more ambiguous. Reason for change is to take into + account the fact that sometimes the base is peaceful but the + other ship isn't, making old error message inaccurate. + +Thu May 18 01:14:00 2006 Bill Balcerski + + * ntserv/getship.c, interface.c: fix to ATT size for matching + current bitmap sets, and allowing refit to ATT if the ship is + valid as per sysdef file (compared to not ever allowing refit to + ATT under old code). + +Thu May 18 02:05:53 2006 Stephen Thorne + + * aclocal.m4: Added aclocal.m4 + +Thu May 18 01:11:21 2006 Stephen Thorne + + * tests/build: Set the configure and mktrekon files executable, + just in case. + + * configure.in: Add AC_PROG_LIBTOOL macro. + + * ntserv/Makefile.in: Use the @RANLIB@ and @RANLIB_FLAGS@ macros. + +Wed May 17 11:12:04 2006 Stephen Thorne + + * ntserv/Makefile.in (libnetrek.a): Pass @RANLIB_FLAGS@ to the + ranlib command. + + * configure.in: Check for if ranlib exits with a non-zero exit + when run with a bare '-c' option. On debian, ranlib will exit with + a 0 exit code if passed a filename that doesen't exist. On OSX, + '-c' is a valid flag, and if passed alone, will exit with an exit + code of 1. A better way of detecting this would be nice. If using + the OSX version, then we pass -c to all ranlib calls. Fixes build + bug on OSX. + +Tue May 16 16:59:29 2006 Jimmy Huang + + * robots/newbie.c (start_a_robot): add -g option to send the OggV + packet to self ID themselves. + + * robots/newbie.c (killrobot): change how robots are detected. + + * robots/newbie.c (main): change merlin ship class to ATT, change + to overlooking position, allow ORI and KLI. + + * ntserv/genspkt.c (INVISOMASK): add PFBPROBOT so newbie bots can + see each other using OggV packet. + +Tue May 16 14:03:30 2006 Bill Balcerski + + * robotd/assault.c (risk_res_death): compilation fix gcc 4.0. + +Tue May 16 08:29:06 2006 James Cameron + + * docs/sample_features: enable CONTINUOUS_MOUSE as it is in common + use. Enable INFO_MODE1 so that the default configuration ships + with all features enabled. + Mon May 15 19:01:27 2006 James Cameron * netrek-server-vanilla-2.11.0 released @@ -45,6 +530,7 @@ * include/genspkt.h: add separate prototypes for genspkt.c since they cannot live in proto.h, due to the packet structures required. + * tools/cambot.c: fix compilation warnings with -Wall. Wed Apr 26 22:58:34 2006 James Cameron Index: BUGS =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/BUGS,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- BUGS 6 May 2006 12:28:20 -0000 1.6 +++ BUGS 1 Jun 2006 03:17:24 -0000 1.7 @@ -3,6 +3,13 @@ List of things that are defects + - cambot does not exit when daemon exits. + + - sending SIGSTOP to client for 35 seconds results in ghostbust, which + is good, but the client response after SIGCONT is not good ... it + presents team selection window and clicking on a team hangs the + client. + - find causes of jammed slots and expire them sooner. - Player "^%^" took a planet and it said "Planet taken by ^" Index: README.releasing =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/README.releasing,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- README.releasing 15 May 2006 09:13:17 -0000 1.14 +++ README.releasing 1 Jun 2006 03:17:24 -0000 1.15 @@ -1,14 +1,11 @@ - -$Id$ - Release Procedure -# be in local copy of the CVS repository +# be in local copy of the Darcs repository cd Vanilla # set variables -VS=2.11.0 -VL=v_2_11_0 +VS=2.11.1 +VL=v_2_11_1 PN=netrek-server-vanilla # check version numbers in files @@ -19,21 +16,23 @@ # rpm/netrek.spec # README.releasing # ChangeLog (add release date) +# NEWS -# crosscheck updates in CVS against ChangeLog +# crosscheck updates in Darcs against ChangeLog # crosscheck updates in ChangeLog against NEWS # make sure all changes committed -cvs diff -u > tmp +darcs diff -u > tmp # review uncommitted changes more tmp # commit changes -cvs commit -m "prerelease $VS" - -# reduce source tree to only CVS files, or fix .cvsignore -cvs update > tmp +darcs record --patch-name="prerelease $VS" +darcs send # tag the release +darcs tag $VS + +# temporary: propogate changes to CVS and tag in CVS cvs tag -F $VL cvs tag -F v_release @@ -88,32 +87,13 @@ cd ~/public_html/external/mine/netrek/ vi index-brief.html -# send .tar.gz and .rpm to ftp sites -ftp://ftp.netrek.org/pub/netrek/incoming/ (note 15 second login timer) -put Vanilla-2.10pl8.tar.gz -put Vanilla-2.10pl8.tar.gz.asc -put Vanilla-2.10pl8.tar.gz.md5sum -ftp://ftp.real-time.com/pub/Incoming/ - # notify mirror owners, include URL of incoming copy and md5sum. -mailto:vanilla-list at us.netrek.org +mailto:netrek-dev at us.netrek.org # build differences between this version and previous # update web page -http://vanilla.us.netrek.org/index.html -export CVSROOT=:pserver:cameron at cvs.us.netrek.org:/home/netrek/cvsroot -cvs checkout web [or] cvs update -# review differences and generate short change list in index.html -cvs commit - -# await mirror completion -# notify others -mailto:vanilla-announce at us.netrek.org -news:rec.games.netrek - -# update version number in files -# Makefile.in, debian/changelog, rpm/netrek.spec, rpm/tar2rpm, README.releasing +http://vanilla.netrek.org/ # sourceforge.net upload procedure (brief, yet to be retested) # - upload to ftp://upload.sourceforge.net/incoming/ Index: NEWS =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/NEWS,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- NEWS 15 May 2006 09:14:16 -0000 1.23 +++ NEWS 1 Jun 2006 03:17:24 -0000 1.24 @@ -1,3 +1,28 @@ +2.11.1: released 2006-06-01 + +- fix CHAOS torp detonation which was allowing wtemp [Balcerski} +- add experimental future support for slot number change [Cameron] +- added toggle switches to new ogging and carrier tracking logic [Huang] +- remove res-rsa/configure [Piepho] +- help bot deal with ping-pong plasma [Piepho] +- help client with plasma war in ping-pong mode [Piepho] +- deprecate dan quayle in t-mode messages [Balcerski] +- server sends torp direction, robots dodge better [Piepho] +- make robots cloak near enemy home planets due res danger [Piepho] +- make robots take neut planets once there are no enemy planets [Piepho] +- make robots recognise planet situational change while assaulting [Piepho] +- various robot fixes that triggered comprehensive work by others [Huang] +- fix lack of shields shown on practice robots and iggies [Cameron] +- fix two second delay on client connection if daemon not running [Cameron] +- add game pause/resume/terminate tool, setgame [Cameron] +- add max duplicate ip count for pickup play [Cameron] +- add install-ntserv target for live updates [Cameron] +- mute banned observers [Cameron] +- add team configuration tool, setteam [Cameron] +- prevent hung slots by changing ghostbust timer reset method [Cameron] +- newbie random games against any non-diagonal team combination [Huang] +- enable CONTINUOUS_MOUSE by default [Cameron] + 2.11.0: released 2006-05-15 - fix practice robots to cloak when bombing near home planet [Huang] Index: PROJECTS =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/PROJECTS,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- PROJECTS 12 May 2006 03:44:47 -0000 1.11 +++ PROJECTS 1 Jun 2006 03:17:24 -0000 1.12 @@ -79,11 +79,6 @@ netrekd forked HTTP responder, or scripts to send stuff to a web server? - - If you are observing a friendly player who is t-warping, you - can lock on to other players, but you will not swap to - their viewpoint. Only when twarping is over, you can swap - again [Shadow.Hunter at netrek.org] - - tools/update.c sa_sigaction not present on NetBSD. [Hietbrink] - 'transwarp 0 off' to prevent slot 0 from transwarping. [Swasey] From quozl at users.sourceforge.net Wed May 31 22:17:28 2006 From: quozl at users.sourceforge.net (James Cameron) Date: Thu, 01 Jun 2006 03:17:28 +0000 Subject: [netrek-cvs] server/Vanilla/robotd assault.c, 1.3, 1.4 data.c, 1.3, 1.4 data.h, 1.3, 1.4 decide.c, 1.4, 1.5 dmessage.c, 1.3, 1.4 dodge.c, 1.2, 1.3 escort.c, 1.1, 1.2 getarmies.c, 1.2, 1.3 input.c, 1.2, 1.3 main.c, 1.3, 1.4 robot.c, 1.4, 1.5 robot.h, 1.1, 1.2 socket.c, 1.3, 1.4 struct.h, 1.3, 1.4 update_players.c, 1.2, 1.3 util.c, 1.4, 1.5 Message-ID: Update of /cvsroot/netrek/server/Vanilla/robotd In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28256/robotd Modified Files: assault.c data.c data.h decide.c dmessage.c dodge.c escort.c getarmies.c input.c main.c robot.c robot.h socket.c struct.h update_players.c util.c Log Message: merge 2.11.1 from darcs Index: dmessage.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robotd/dmessage.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- dmessage.c 22 Apr 2006 02:16:46 -0000 1.3 +++ dmessage.c 1 Jun 2006 03:17:25 -0000 1.4 @@ -84,6 +84,8 @@ "wrap - toggle wrap-around galaxy", "woff - toggle no weapon", "coff - toggle no cloak", + "hcr - toggle logic that assumes humans carry", + "ogh (ogg happy) - switch logic to ogg carriers while bombing", "", "QUERY", @@ -229,12 +231,11 @@ return; } - /* Don't accept commands for newbie server. Allow showstate for - debugging. */ -/* if(strncmp(m, "showstate", 5)==0) - show_state(); - else */ - if (inl) return; + /* don't allow players to message bots. + But allow local admin to send directives through terminal + also allow bots to read commands file. + */ + if (inl && !std) return; if((flags & MINDIV) || std){ if(!strcmp(me->p_login, PRE_T_ROBOT_LOGIN) @@ -1150,6 +1151,16 @@ sprintf(buf, "random torps %s", randtorp?"on":"off"); response(buf); } + else if(strncmp(m, "hcr", 3)==0){ + hm_cr = !hm_cr; + sprintf(buf, "humans carry %s", hm_cr?"on":"off"); + response(buf); + } + else if(strncmp(m, "ogh", 3)==0){ + ogg_happy = !ogg_happy; + sprintf(buf, "ogg while bombing %s", ogg_happy?"on":"off"); + response(buf); + } else if(strncmp(m, "detall", 6)==0){ detall = !detall; sprintf(buf, "detall %s", detall?"on":"off"); @@ -1863,10 +1874,16 @@ dist.distype = i; dist.close_pl = me_p->closest_pl->pl_no; - dist.close_en = _state.closest_e->p->p_no; - dist.close_fr = _state.closest_f->p->p_no; - dist.close_j = (_state.closest_e->dist < _state.closest_f->dist) ? - dist.close_en : dist.close_fr; + dist.close_en = _state.closest_e ? _state.closest_e->p->p_no : me->p_no; + dist.close_fr = _state.closest_f ? _state.closest_f->p->p_no : me->p_no; + if(!_state.closest_f) { + dist.close_j = dist.close_en; + } else if(!_state.closest_e) { + dist.close_j = dist.close_fr; + } else { + dist.close_j = (_state.closest_e->dist < _state.closest_f->dist) ? + dist.close_en : dist.close_fr; + } /* These are just guesses.... */ dist.tclose_pl = 0; Index: robot.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robotd/robot.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- robot.c 12 May 2006 03:44:48 -0000 1.4 +++ robot.c 1 Jun 2006 03:17:25 -0000 1.5 @@ -719,7 +719,7 @@ } if((me->p_flags & PFCLOAK) && me->p_ship.s_type != ASSAULT && (!pl || !(pl->pl_flags & PLFUEL))){ - req_cloak_off(); + req_cloak_off("recharge: no fuel planet"); } if(_state.pl_danger){ @@ -1121,7 +1121,7 @@ for (i = 0, pt = &plasmatorps[0]; i < MAXPLASMA * MAXPLAYER; i++, pt++) { if (pt->pt_status != PTMOVE) continue; - if(_server == SERVER_GRIT){ + if(_server == SERVER_GRIT || _state.torp_bounce){ if(!(pt->pt_war & me->p_team)) continue; } Index: dodge.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robotd/dodge.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- dodge.c 22 Apr 2006 02:16:46 -0000 1.2 +++ dodge.c 1 Jun 2006 03:17:25 -0000 1.3 @@ -110,6 +110,10 @@ if(!WAR(j)){ /* friendly torps */ init_ftorps(i, j); + /* With ping-pong plasma, a friendly player's plasma can become + hostile, if an enemy has bounced it. */ + if(_state.torp_bounce) + goto check_plasma; continue; } @@ -220,6 +224,10 @@ /* plasma */ pt = &plasmatorps[i]; if(pt->pt_status == PTMOVE){ + /* Skip non-hostile plasmas */ + if( !(pt->pt_war & me->p_team) && + !((me->p_hostile|me->p_swar) & pt->pt_team)) + continue; ts = SH_PLASMASPEED(j); tx = pt->pt_x; ty = pt->pt_y; dx = tx - me->p_x; dy = ty - me->p_y; Index: update_players.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robotd/update_players.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- update_players.c 22 Apr 2006 02:16:46 -0000 1.2 +++ update_players.c 1 Jun 2006 03:17:25 -0000 1.3 @@ -141,12 +141,16 @@ orbit_check(p, j); army_check1(p, j); army_check2(p, j); + if (hm_cr) + army_check3(p, j); + } + + if(p->invisible) { + p->closest_pl = NULL; + } else { + p->closest_pl = closest_planet(j, &pldist, p->closest_pl); + p->closest_pl_dist = pldist; } - if(p->invisible) - p->closest_pl = NULL; - else - p->closest_pl = closest_planet(j, &pldist, p->closest_pl); - p->closest_pl_dist = pldist; if(j->p_flags & PFBOMB) p->bombing = _udcounter; @@ -404,6 +408,8 @@ struct planet *pl; bool ohostile = 0, opl = 0; int pa; + float ptrate; /* planet taking rate */ + static int count=0; if(!(j->p_flags & PFORBIT)) return; /* @@ -468,6 +474,58 @@ p->armies = troop_capacity(j); } + +/* A more intuitive way of figuring out who carries in + a pickup game. Only works with humans */ +army_check3(p, j) + + Player *p; + struct player *j; +{ + float ptrate; /* planet taking rate */ + + /* a human alive for long time with enough kills to drop */ + /* just assume he carries as he can trick a bot */ + if ( j->p_kills == 0 ) /* reset the fuse on death */ + p->killfuse = 0; + + if ( j->p_kills >= 0.51 ) /* increment the fuse tunable JKH */ + p->killfuse = p->killfuse + j->p_kills; + + if ( NotRobot(p,j) ) { + if (p->killfuse >= 3000) { /* about 5 min with 1 kill */ + p->armies = troop_capacity(j); + p->plcarry = 100.0; + } + } + + /* > 1.5 kill & high planet rating on player database */ + if ( j->p_kills >= 1.5 ) { + ptrate = (j->p_stats.st_tplanets * 100000) / j->p_stats.st_tticks; + if ( ptrate > 7.0 ) { /* about a planet rating of 4 */ + if ( NotRobot(p,j) ) { + p->armies = troop_capacity(j); + p->plcarry = 100.0; + } + } + } + +} + +NotRobot(p, j) + + Player *p; + struct player *j; +{ + + if ( (strcmp(j->p_login,"robot!") != 0) || !(j->p_flags&PFBPROBOT) ) { + return 1; + } else { + return 0; + } + +} + calc_speed(p, j) Player *p; @@ -1321,7 +1379,7 @@ { register k; - register struct planet *pl, *rp = NULL; + register struct planet *pl, *rp = opl; register d, mdist = INT_MAX; if(opl && (mdist = ihypot((double)(j->p_x - opl->pl_x), @@ -1330,8 +1388,6 @@ return opl; } - *dist = INT_MAX; - for(k=0, pl=planets; k < MAXPLANETS; k++, pl++){ d = ihypot((double)(j->p_x - pl->pl_x), (double)(j->p_y - pl->pl_y)); Index: input.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robotd/input.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- input.c 22 Apr 2006 02:16:46 -0000 1.2 +++ input.c 1 Jun 2006 03:17:25 -0000 1.3 @@ -22,18 +22,51 @@ int recflag = 0; + +/* setflag() + * + * Returns an incrementing number from 0 during start of program + * and stores it in global variable _udcounter. + * _udcounter increments by 1 for every 100ms of time that + * has passed using the mtime function, which returns + * gettimeofday information to the nearest millisecond. + * + * Function used to return negative numbers when mtime + * cycled (anywhere between 2 and 18 hours). Added code + * so udcounter is always incrementing + * + * Function may still break if unix super-user executes + * set-time-of-day function, via unix command. + */ setflag() { - static int start; + static int start=0; /* start of the robot program */ + static int cycle=0; /* how many times udtime cycles */ + static int cyclestarted=0; + int udtime; /* 100ms increments JKH */ + + udtime = mtime(1)/100; + if(!start){ - start = mtime(1)/100; + start = udtime; _udcounter = 0; } - else - _udcounter = mtime(1)/100 - start; - /* - printf("_udcounter %d\n", _udcounter); - */ + else { + _udcounter = udtime - start + + (cycle * ( (0x0000ffff*1000+999)/100 + 1 ) ); + } /* the max udtime could ever be + 1 */ + + /* increment cycle once when udtime flips */ + if ( (udtime < start) && (cyclestarted == 0) ) { + cyclestarted = 1; + cycle = cycle + 1; + } + + /* reset cyclestart when udtime is "normal" again */ + if ( udtime > start ) { + cyclestarted = 0; + } + } input() Index: data.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robotd/data.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- data.c 22 Apr 2006 02:16:46 -0000 1.3 +++ data.c 1 Jun 2006 03:17:25 -0000 1.4 @@ -83,7 +83,7 @@ int lastUpdate[MAXPLAYER]={0}; /* Last update of this player */ int timerDelay=200000; /* micro secs between updates */ int reportKills=1; /* report kill messages? */ -float updates=1.0; +float updates=2.0; int nopwd=0; int randtorp=0; @@ -156,4 +156,6 @@ int oggv_packet=0; int off=0,def=0; -int ignoreTMode = 0; +int ignoreTMode = 0; +int hm_cr = 0; /* assume humans carry if they have kills */ +int ogg_happy = 0; /* ogg carriers while bombing */ Index: robot.h =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robotd/robot.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- robot.h 21 Mar 2005 05:23:45 -0000 1.1 +++ robot.h 1 Jun 2006 03:17:25 -0000 1.2 @@ -35,6 +35,7 @@ int run_t; int fuel, subshield, shield, wpntemp, subdamage, damage; int armies, pl_armies, beam_fuse; + int killfuse; /* how long with kills */ float plcarry; int last_comm_beamup; /* last position */ Index: data.h =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robotd/data.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- data.h 22 Apr 2006 02:16:46 -0000 1.3 +++ data.h 1 Jun 2006 03:17:25 -0000 1.4 @@ -160,7 +160,9 @@ extern int oggv_packet; extern int off,def; -extern int ignoreTMode; +extern int ignoreTMode; +extern int hm_cr; /* assume a human carries mode */ +extern int ogg_happy; /* ogg close by carriers if bombing */ /*this is also defined in ../include/data.h*/ #define PRE_T_ROBOT_LOGIN "Pre_T_Robot!" Index: escort.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robotd/escort.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- escort.c 21 Mar 2005 05:23:45 -0000 1.1 +++ escort.c 1 Jun 2006 03:17:25 -0000 1.2 @@ -49,7 +49,7 @@ /* check internal state */ switch(_state.escort){ case 0: - req_cloak_off(); + req_cloak_off("escort: 0"); /* just got request, need to go to planet */ if(DEBUG & DEBUG_ESCORT) printf("goto escort planet %s\n", escpl->pl_name); @@ -58,7 +58,7 @@ case 1: /* close enough to escort planet .. wait for escortee */ - req_cloak_off(); + req_cloak_off("escort: 1"); if(DEBUG & DEBUG_ESCORT) printf("wait for escort %s\n", escp->p->p_mapchars); wait_for_escort(escp, escpl); @@ -82,7 +82,7 @@ break; case 5: - req_cloak_off(); + req_cloak_off("escort: 5"); /* do defenders */ if(DEBUG & DEBUG_ESCORT) printf("no defenders\n"); Index: util.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robotd/util.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- util.c 22 Apr 2006 02:16:46 -0000 1.4 +++ util.c 1 Jun 2006 03:17:25 -0000 1.5 @@ -442,19 +442,16 @@ } #endif - -mfprintf(char *format, ...) +mfprintf(FILE *fo, char *format, ...) { - FILE *fo; va_list ap; if(!read_stdin) return; va_start(ap, format); - fo = va_arg(ap, FILE *); (void)vfprintf(fo, format, ap); - fflush(stdout); + fflush(fo); va_end(ap); } Index: struct.h =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robotd/struct.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- struct.h 22 Apr 2006 02:16:46 -0000 1.3 +++ struct.h 1 Jun 2006 03:17:25 -0000 1.4 @@ -44,6 +44,7 @@ #define PFTRACT 0x400000 /* tractor beam activated */ #define PFPRESS 0x800000 /* pressor beam activated */ #define PFDOCKOK 0x1000000 /* docking permission */ +#define PFBPROBOT 0x80000000 /* OggV Packet to ID other bots */ #define KQUIT 0x01 /* Player quit */ #define KTORP 0x02 /* killed by torp */ Index: decide.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robotd/decide.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- decide.c 12 May 2006 03:44:48 -0000 1.4 +++ decide.c 1 Jun 2006 03:17:25 -0000 1.5 @@ -238,21 +238,24 @@ else if(!unknownpl(_state.assault_planet) && _state.assault_planet->pl_armies < 5){ unassault_c("already bombed."); - check_ogg(NULL,20000); /* test JKH */ + if (ogg_happy) + check_ogg(NULL,20000); /* test JKH */ check_bomb(NULL); return; } if(myteam_bombing(_state.assault_planet, _state.assault_planet->pl_mydist)){ unassault_c("somebody else bombing"); - check_ogg(NULL,20000); /* test JKH */ + if (ogg_happy) + check_ogg(NULL,20000); /* test JKH */ check_bomb(NULL); return; } if(_state.assault_planet->pl_mydist < 20000 && pl_defended(_state.assault_planet, 2)){ unassault_c("planet defended"); - check_ogg(NULL,20000); /* test JKH */ + if (ogg_happy) + check_ogg(NULL,20000); /* test JKH */ check_bomb(NULL); return; } @@ -683,6 +686,7 @@ if(pls->total_textra_armies == 0 && me->p_armies == 0) return 0; + /* Look for closest takeable enemy planet */ for(k=0; k< pls->num_warteamsp; k++){ pl = pls->warteam_planets[k]; @@ -697,20 +701,23 @@ min_dist = pl->pl_mydist; } } - if(!(pl->pl_flags & PLAGRI) || me->p_armies >= 5){ - min_dist = GWIDTH; /* ind overrides non-ind */ - for(k=0; k< pls->num_indsp; k++){ - pl = pls->ind_planets[k]; - /* - if(pl->pl_mydist < 20000 && pl_defended(pl,3)) continue; - */ + /* take indep planet first over regular planets */ + /* but take agris first if you have the armies */ + if (!tpl || !(tpl->pl_flags&PLAGRI && me->p_armies >= 5) ) { + min_dist = GWIDTH; /* ind overrides non-ind */ + for(k=0; k< pls->num_indsp; k++){ + pl = pls->ind_planets[k]; + + /* + if(pl->pl_mydist < 20000 && pl_defended(pl,3)) continue; + */ - if(pl->pl_mydist < min_dist){ - tpl = pl; - min_dist = pl->pl_mydist; - } - } + if(pl->pl_mydist < min_dist){ + tpl = pl; + min_dist = pl->pl_mydist; + } + } } if(tpl){ if(pls->total_textra_armies + me->p_armies < tpl->pl_armies) Index: assault.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robotd/assault.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- assault.c 12 May 2006 03:44:48 -0000 1.3 +++ assault.c 1 Jun 2006 03:17:25 -0000 1.4 @@ -46,25 +46,38 @@ /* determine if there is risk of death due to res of opponent */ static int risk_res_death(struct planet *pl) { - if (pl == NULL) return 0; - /* One of the home planets identified by server etc/sysdef PLANETS */ - if (pl->pl_flags & PLHOME) return 1; - /* Altair in standard position */ - if (pl->pl_no == 7 && pl->pl_x == 11000 && pl->pl_y == 75000) return 1; - /* Draconis in standard position */ - if (pl->pl_no == 16 && pl->pl_x == 28000 && pl->pl_y == 23000) return 1; - /* Scorpii in standard position */ - if (pl->pl_no == 26 && pl->pl_x == 70720 && pl->pl_y == 26320) return 1; - /* Within rectangular phaser distance of any home planet res point */ - int i; - for (i=0,pl=planets;ipl_flags & PLHOME) { - if(ABS(pl->pl_x - me->p_x) < 12000 && ABS(pl->pl_y - me->p_y) < 12000) { - return 1; + /* Home planet locations. This will not work if the HWs are not at + their normal indexes. This should always be the case, even for + non-standard planet layouts. */ + const static int hw[4] = {0, 10, 20, 30}; + int i; + +#if 0 + /* Code to find home planets by name, like the bot does to refit. */ + static int found_hw = 0; + if(!found_hw) { + extern struct planet *team_planet(int); + hw[0] = (team_planet(FED)?:&planets[0])->pl_no; + hw[1] = (team_planet(ROM)?:&planets[0])->pl_no; + hw[2] = (team_planet(KLI)?:&planets[0])->pl_no; + hw[3] = (team_planet(ORI)?:&planets[0])->pl_no; + found_hw = 1; + mfprintf(stderr, "planets at %d %d %d %d\n", hw[0], hw[1], hw[2], hw[3]); + } +#endif + + if(pl == NULL) return 0; + + for(i = 0; i < 4; i++){ + if((1<p_team) continue; /* No danger at MY homeworld */ + + pl = &planets[hw[i]]; + /* Inside rectangular phaser/tractor range of a ressing ship. */ + if(ABS(pl->pl_x - me->p_x) < 12200 && ABS(pl->pl_y - me->p_y) < 12200){ + return 1; } - } - } - return 0; + } + return 0; } goto_assault_planet() @@ -176,7 +189,7 @@ #ifdef nodef if(!do_cloak(0)) - req_cloak_off(); + req_cloak_off("no do cloak"); #endif cloak=0; /* start assuming you don't need to cloak */ @@ -195,7 +208,31 @@ else req_cloak_off("no cloak in assault_planet()"); - if(armies > 4){ + /* Planets that _can_ be dropped on: + 1. Planets owned by your team + 2. Planets that you are hostile to + 3. Independent planets (owned by team 0) + Everything else can't be dropped on. Planets in groups 1 and 3 _can't_ + be bombed, only group 2 can be bombed, ie. bombable planets is a + proper subset of droppable planets. */ + + /* Turn off assault for non-droppable (thus non-bombable too) planets. */ + if(!unknownpl(pl) && !( (pl->pl_owner == me->p_team) || + ((me->p_swar|me->p_hostile) & pl->pl_owner) || + (pl->pl_owner == 0) )){ + req_shields_up(); + unassault_c("planet not droppable"); + return; + } + + if(pl->pl_owner == me->p_team && pl->pl_armies >= 4){ + req_shields_up(); + unassault_c("planet fully reinforced"); + return; + } + + /* Only bomb bombable planets. */ + if(armies > 4 && ((me->p_swar|me->p_hostile) & pl->pl_owner)){ req_bomb(); return; } Index: main.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robotd/main.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- main.c 22 Apr 2006 02:16:46 -0000 1.3 +++ main.c 1 Jun 2006 03:17:25 -0000 1.4 @@ -430,9 +430,9 @@ if(team != _state.team && team != -1){ timer2 = 0; _state.team = team; - if(!teamRequest(team, s_type)){ - mfprintf(stderr, "team or ship rejected.\n"); - showteams(); + if (!teamRequest(team, s_type)){ + mfprintf(stderr, "team or ship rejected.\n"); + showteams(); } else break; Index: socket.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robotd/socket.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- socket.c 22 Apr 2006 02:16:46 -0000 1.3 +++ socket.c 1 Jun 2006 03:17:25 -0000 1.4 @@ -1708,6 +1708,7 @@ } thetorp->pt_status=packet->status; thetorp->pt_war=packet->war; + thetorp->pt_team=players[thetorp->pt_owner].p_team; if (thetorp->pt_status == PTEXPLODE) { do_plasmadamage(p, j, thetorp); j->p_nplasmatorp--; @@ -1919,8 +1920,8 @@ #ifdef ATM if (fd == udpSock) { mfprintf(stderr, "Tried to write %d, 0x%x, %d (error %d)\n", - fd, buf, bytes, errno); - perror("write"); + fd, buf, bytes, errno); + perror("write"); printUdpInfo(); } #endif @@ -2391,7 +2392,7 @@ break; default: mfprintf(stderr, "netrek: Got funny reply (%d) in UDP_REPLY packet\n", - packet->reply); + packet->reply); break; } Index: getarmies.c =================================================================== RCS file: /cvsroot/netrek/server/Vanilla/robotd/getarmies.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- getarmies.c 22 Apr 2006 02:16:46 -0000 1.2 +++ getarmies.c 1 Jun 2006 03:17:25 -0000 1.3 @@ -173,7 +173,7 @@ else{ _state.lock = 0; req_shields_up(); - req_cloak_off(); + req_cloak_off("no armies to beam"); _state.p_desspeed = me->p_speed; return; }