From modemhero at users.sourceforge.net Wed Jun 6 23:43:40 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 07 Jun 2007 04:43:40 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h, 1.88, 1.89 defs.h, 1.27, 1.28 packets.h, 1.10, 1.11 struct.h, 1.22, 1.23 Message-ID: <20070607044420.B81C21867CC@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25229/include Modified Files: data.h defs.h packets.h struct.h Log Message: Main change: 1) The way memory was set up for all the weapons/planets/player structs was changed. Instead of a static struct memory universe, it was changed to malloc calls during entry. A bunch of new functions (for paradise) were called to dealloc this memory and realloc if it a game parameter packet was received which indicated new array sizes. Currently there is only partial support for increasing torp/plasma array sizes, and no support for increasing number of phasers per ship. Maxplayer, while dynamic in paradise client, was too much a PITA to realloc on the fly without changing all the MAXPLAYER checks, so I'm keeping it constant at 257 for paradise, rather than trying to save some memory by downsizing it if the actual number of players is less. Paradise does something weird in that it has a max player value for what the server says, and a second max player value for what the client can actually handle. I'm not going to go that route, just keeping 1 maxplayer value thank you very much. Paradise only changes: 1) Add support for adjustable gwidth, it starts at 100000, but if a planet loc packet is sent beyond this range, it increases to 200000. Very stupid, but that's how paradise does it. Wouldn't seem to support galaxies with sizes other than these 2 values. 2) Increased paradise planet window size so it wasn't getting cut off. Bronco changes: 1) Support new server change from rank defense to rank offense. 2) Renamed view to viewboxview for drawing viewbox. 3) Removed unnecessary bounds check on drawing lockline. Index: defs.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/defs.h,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- defs.h 18 May 2007 19:54:36 -0000 1.27 +++ defs.h 7 Jun 2007 04:43:36 -0000 1.28 @@ -70,7 +70,8 @@ /* These are configuration definitions */ #ifdef PARADISE -#define GWIDTH 200000 +#define GWIDTH gwidth /* Paradise has variable galaxy + width, up to 200000 */ #else #define GWIDTH 100000 /* galaxy is 100000 spaces * on a side */ Index: packets.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/packets.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- packets.h 25 May 2007 03:36:44 -0000 1.10 +++ packets.h 7 Jun 2007 04:43:37 -0000 1.11 @@ -1084,7 +1084,8 @@ char pnum; /* How many kills in packet */ unsigned short kills; /* 6 bit player numer */ /* 10 bit kills*100 */ - unsigned short mkills[MAXPLAYER]; + unsigned short mkills[32]; + /* NOTE: this must be identical to MAXPLAYER in Vanilla server */ }; struct phaser_s_spacket Index: struct.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/struct.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- struct.h 25 May 2007 03:36:44 -0000 1.22 +++ struct.h 7 Jun 2007 04:43:37 -0000 1.23 @@ -756,7 +756,7 @@ struct rank { - float hours, ratings, defense; + float hours, ratings, offense; char *name, *cname; }; @@ -776,26 +776,6 @@ }; #endif -struct memory -{ - struct player players[MAXPLAYER]; - struct torp torps[MAXPLAYER * MAXTORP]; - struct plasmatorp plasmatorps[MAXPLAYER * MAXPLASMA]; -#ifdef PARADISE - struct thingy thingies[MAXPLAYER * 20]; // Arbitrary - struct rank2 ranks2[30]; // Arbitrary - struct teaminfo_s teaminfo[6]; // Arbitrary - struct royalty royal[5]; // Arbitrary - struct status2 status2[1]; // Arbitrary -#endif - struct status status[1]; - struct planet planets[MAXPLANETS]; - struct phaser phasers[MAXPLAYER]; - struct mctl mctl[1]; - struct message messages[MAXMESSAGE]; - struct ship shipvals[NUM_TYPES]; -}; - struct plupdate { int plu_update; Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.88 retrieving revision 1.89 diff -u -d -r1.88 -r1.89 --- data.h 25 May 2007 03:36:44 -0000 1.88 +++ data.h 7 Jun 2007 04:43:36 -0000 1.89 @@ -50,7 +50,6 @@ extern struct mctl *mctl; extern struct team *teams; extern struct ship shipvals[]; -extern struct memory universe; extern struct planet pdata[]; extern struct _star stars[MAXSECTORS][MAXSECTORS][MAXSTARS]; @@ -283,7 +282,8 @@ extern int received_terrain_info; extern int terrain_x; extern int terrain_y; -extern int gwidth; /* galaxy width, adjusted for zoom [BDyess] */ +extern int gwidth; /* Paradise version of GWIDTH */ +extern int gwidth_zoom; /* galaxy width, adjusted for zoom, unused */ extern int offsetx; extern int offsety; /* offsets when zooming [BDyess] */ extern int nplayers; @@ -810,6 +810,7 @@ extern int sortPlanets; /* sort planet list by team and army count */ extern int packetLights; /* show packet send/receive via dashboard */ extern int infoRange; /* show limit on info with large tactical windows */ -extern int scaleFactor; /* allows for scaling of graphics */ +extern int scaleFactor; /* allows for scaling of tactical window */ +extern int mapscaleFactor; /* allows for scaling of galactic window, unused */ extern int fullBitmapRotation; /* draw old bitmap sets to all angles */ #endif /* _h_data */ From modemhero at users.sourceforge.net Wed Jun 6 23:43:38 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 07 Jun 2007 04:43:38 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.149, 1.150 clientr.suo, 1.134, 1.135 clientr.vcproj, 1.12, 1.13 Message-ID: <20070607044418.633EEB3EB@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25229 Modified Files: NetrekXP to do list.C clientr.suo clientr.vcproj Log Message: Main change: 1) The way memory was set up for all the weapons/planets/player structs was changed. Instead of a static struct memory universe, it was changed to malloc calls during entry. A bunch of new functions (for paradise) were called to dealloc this memory and realloc if it a game parameter packet was received which indicated new array sizes. Currently there is only partial support for increasing torp/plasma array sizes, and no support for increasing number of phasers per ship. Maxplayer, while dynamic in paradise client, was too much a PITA to realloc on the fly without changing all the MAXPLAYER checks, so I'm keeping it constant at 257 for paradise, rather than trying to save some memory by downsizing it if the actual number of players is less. Paradise does something weird in that it has a max player value for what the server says, and a second max player value for what the client can actually handle. I'm not going to go that route, just keeping 1 maxplayer value thank you very much. Paradise only changes: 1) Add support for adjustable gwidth, it starts at 100000, but if a planet loc packet is sent beyond this range, it increases to 200000. Very stupid, but that's how paradise does it. Wouldn't seem to support galaxies with sizes other than these 2 values. 2) Increased paradise planet window size so it wasn't getting cut off. Bronco changes: 1) Support new server change from rank defense to rank offense. 2) Renamed view to viewboxview for drawing viewbox. 3) Removed unnecessary bounds check on drawing lockline. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.134 retrieving revision 1.135 diff -u -d -r1.134 -r1.135 Binary files /tmp/cvs0VsIvf and /tmp/cvsbOGUaY differ Index: clientr.vcproj =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.vcproj,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- clientr.vcproj 25 May 2007 03:36:43 -0000 1.12 +++ clientr.vcproj 7 Jun 2007 04:43:36 -0000 1.13 @@ -81,7 +81,6 @@ IgnoreAllDefaultLibraries="true" GenerateDebugInformation="true" ProgramDatabaseFile="\netrek_files\tmp\src\Debug/netrek.pdb" - MapFileName="" SubSystem="1" TargetMachine="1" /> Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.149 retrieving revision 1.150 diff -u -d -r1.149 -r1.150 --- NetrekXP to do list.C 25 May 2007 03:36:41 -0000 1.149 +++ NetrekXP to do list.C 7 Jun 2007 04:43:34 -0000 1.150 @@ -37,9 +37,13 @@ Paradise issues: Motd paging system gutted for sake of simplicity A bunch of gridline/zoom options should be made into netrekrc options. -The galactic zoom doesn't work, gwidth is not malleable -Some of the paradise packet types need work, especially gameconf. -Still missing wormholes, asteroids, fighters, warpbeacons, and warpflash functionality. +The galactic zoom doesn't work +Some of the paradise packet types may need some work +Many many places in code where things are based on MAXSOMETHING whether it be players +torps planets plasmas. Whereas paradise wants to use dynamic variables. It's a +mess. And paradise has nphasers, the entire concept of multiple phasers +per ship is not compliant with current code. +Still missing wormholes, asteroids, fighters, and (flashing) warpbeacons. Info window not working right with paradise. Need popup box that works, when connecting to wrong server type From modemhero at users.sourceforge.net Wed Jun 6 23:43:43 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 07 Jun 2007 04:43:43 +0000 Subject: [netrek-cvs] client/netrekxp/resources/paradise droneC.bmp, 1.2, 1.3 Message-ID: <20070607044352.CC9231867CC@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/paradise In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25229/resources/paradise Added Files: droneC.bmp Log Message: Main change: 1) The way memory was set up for all the weapons/planets/player structs was changed. Instead of a static struct memory universe, it was changed to malloc calls during entry. A bunch of new functions (for paradise) were called to dealloc this memory and realloc if it a game parameter packet was received which indicated new array sizes. Currently there is only partial support for increasing torp/plasma array sizes, and no support for increasing number of phasers per ship. Maxplayer, while dynamic in paradise client, was too much a PITA to realloc on the fly without changing all the MAXPLAYER checks, so I'm keeping it constant at 257 for paradise, rather than trying to save some memory by downsizing it if the actual number of players is less. Paradise does something weird in that it has a max player value for what the server says, and a second max player value for what the client can actually handle. I'm not going to go that route, just keeping 1 maxplayer value thank you very much. Paradise only changes: 1) Add support for adjustable gwidth, it starts at 100000, but if a planet loc packet is sent beyond this range, it increases to 200000. Very stupid, but that's how paradise does it. Wouldn't seem to support galaxies with sizes other than these 2 values. 2) Increased paradise planet window size so it wasn't getting cut off. Bronco changes: 1) Support new server change from rank defense to rank offense. 2) Renamed view to viewboxview for drawing viewbox. 3) Removed unnecessary bounds check on drawing lockline. --- NEW FILE: droneC.bmp --- (This appears to be a binary file; contents omitted.) From modemhero at users.sourceforge.net Wed Jun 6 23:43:42 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 07 Jun 2007 04:43:42 +0000 Subject: [netrek-cvs] client/netrekxp/src data.c, 1.95, 1.96 enter.c, 1.12, 1.13 map.c, 1.57, 1.58 newwin.c, 1.66, 1.67 ranklist.c, 1.4, 1.5 short.c, 1.23, 1.24 socket.c, 1.35, 1.36 Message-ID: <20070607044424.D1DDBB3EB@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25229/src Modified Files: data.c enter.c map.c newwin.c ranklist.c short.c socket.c Log Message: Main change: 1) The way memory was set up for all the weapons/planets/player structs was changed. Instead of a static struct memory universe, it was changed to malloc calls during entry. A bunch of new functions (for paradise) were called to dealloc this memory and realloc if it a game parameter packet was received which indicated new array sizes. Currently there is only partial support for increasing torp/plasma array sizes, and no support for increasing number of phasers per ship. Maxplayer, while dynamic in paradise client, was too much a PITA to realloc on the fly without changing all the MAXPLAYER checks, so I'm keeping it constant at 257 for paradise, rather than trying to save some memory by downsizing it if the actual number of players is less. Paradise does something weird in that it has a max player value for what the server says, and a second max player value for what the client can actually handle. I'm not going to go that route, just keeping 1 maxplayer value thank you very much. Paradise only changes: 1) Add support for adjustable gwidth, it starts at 100000, but if a planet loc packet is sent beyond this range, it increases to 200000. Very stupid, but that's how paradise does it. Wouldn't seem to support galaxies with sizes other than these 2 values. 2) Increased paradise planet window size so it wasn't getting cut off. Bronco changes: 1) Support new server change from rank defense to rank offense. 2) Renamed view to viewboxview for drawing viewbox. 3) Removed unnecessary bounds check on drawing lockline. Index: map.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/map.c,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- map.c 18 May 2007 19:54:38 -0000 1.57 +++ map.c 7 Jun 2007 04:43:39 -0000 1.58 @@ -40,7 +40,7 @@ #ifdef PARADISE int drawgrid = 1; /* goes to netrekrc eventually */ -int blk_zoom = 0; /* goes to netrekrc eventually */ +int blk_zoom = 0; /* goes to netrekrc eventually, doesn't work */ int sectorNums = 1; /* goes to netrekrc eventually */ #define DRAWGRID 4 #endif @@ -925,7 +925,8 @@ static char clearviewbox = 0; static char viewboxcleared = 0; int viewdist; - int view = TWINSIDE * scaleFactor / 2; + int view = TWINSIDE * mapscaleFactor / 2; /* view range for scaled galactic */ + int viewboxview = (TWINSIDE * scaleFactor / 2); /* view range for view box */ int mvx, mvy; #ifdef PARADISE static int osx = 0, osy = 0; /* old square */ @@ -941,7 +942,7 @@ if (GWINSIDE == 0) return; - viewdist = (TWINSIDE / 2 * scaleFactor) / (GWIDTH / GWINSIDE); + viewdist = (viewboxview) / (GWIDTH / GWINSIDE); dx = (me->p_x) / (GWIDTH / GWINSIDE); dy = (me->p_y) / (GWIDTH / GWINSIDE); @@ -1010,10 +1011,10 @@ /* redraw any planets they overwrote */ mvx = viewx * (GWIDTH / GWINSIDE); /* correct from view scale */ mvy = viewy * (GWIDTH / GWINSIDE); - checkRedraw(mvx + view, mvy + view); - checkRedraw(mvx + view, mvy - view); - checkRedraw(mvx - view, mvy + view); - checkRedraw(mvx - view, mvy - view); + checkRedraw(mvx + viewboxview, mvy + viewboxview); + checkRedraw(mvx + viewboxview, mvy - viewboxview); + checkRedraw(mvx - viewboxview, mvy + viewboxview); + checkRedraw(mvx - viewboxview, mvy - viewboxview); viewboxcleared = 1; } @@ -1609,7 +1610,7 @@ clearlmark[3] = 1; clearlock = 1; } - if (lockLine && (dx <= view && dx >= 0 && dy <= view && dy >= 0)) + if (lockLine) { int mydx, mydy; Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- newwin.c 25 May 2007 03:36:47 -0000 1.66 +++ newwin.c 7 Jun 2007 04:43:39 -0000 1.67 @@ -969,7 +969,7 @@ W_SetWindowKeyDownHandler (warnw, handleMessageWindowKeyDown); #ifdef PARADISE - planetw = W_MakeTextWindow ("planet", TWINSIDE + 2 * THICKBORDER + 10, 10, 70, MAXPLANETS + 8, baseWin, 2); + planetw = W_MakeTextWindow ("planet", TWINSIDE + 2 * THICKBORDER + 10, 10, 75, MAXPLANETS + 8, baseWin, 2); #else planetw = W_MakeTextWindow ("planet", TWINSIDE + 2 * THICKBORDER + 10, 10, 57, MAXPLANETS + 3, baseWin, 2); #endif Index: enter.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/enter.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- enter.c 25 May 2007 03:36:46 -0000 1.12 +++ enter.c 7 Jun 2007 04:43:38 -0000 1.13 @@ -48,27 +48,37 @@ { int i; - players = universe.players; - torps = universe.torps; - plasmatorps = universe.plasmatorps; + /* Used to be struct memory universe, but leaving room for flexible struct + sizes is better, and necessary for paradise - BB */ + players = (struct player *) malloc(sizeof(*players) * MAXPLAYER); + torps = (struct torp *) malloc(sizeof(*torps) * MAXPLAYER * MAXTORP); + plasmatorps = (struct plasmatorp *) malloc(sizeof(*plasmatorps) * MAXPLAYER * MAXPLASMA); #ifdef PARADISE - thingies = universe.thingies; - ranks2 = universe.ranks2; - teaminfo = universe.teaminfo; - royal = universe.royal; - status2 = universe.status2; + thingies = (struct thingy *) malloc(sizeof(*thingies) * (MAXPLAYER * npthingies + ngthingies)); + ranks2 = (struct rank2 *) malloc(sizeof(*ranks2) * nranks2); + for (i = 0; i < nranks2; i++) + ranks2[i].name = strdup("blank"); + /* independent is teaminfo[-1] */ + teaminfo = 1 + (struct teaminfo_s *) malloc(sizeof(*teaminfo) * (number_of_teams + 2)); + royal = (struct royalty *) malloc(sizeof(*royal) * nroyals); + for (i = 0; i < nroyals; i++) + royal[i].name = strdup("blank"); + status2 = (struct status2 *) malloc(sizeof(*status2)); #endif - status = universe.status; - planets = universe.planets; - phasers = universe.phasers; - mctl = universe.mctl; - messages = universe.messages; + status = (struct status *) malloc(sizeof(*status)); + planets = (struct planet *) malloc(sizeof(*planets) * MAXPLANETS); + phasers = (struct phaser *) malloc(sizeof(*phasers) * MAXPLAYER); + mctl = (struct mctl *) malloc(sizeof(*mctl)); + messages = (struct message *) malloc(sizeof(*messages) * MAXMESSAGE); for (i = 0; i < MAXPLAYER; i++) { players[i].p_status = PFREE; players[i].p_cloakphase = 0; players[i].p_no = i; players[i].p_ntorp = 0; +#ifdef PARADISE + players[i].p_ndrone = 0; +#endif players[i].p_explode = 1; players[i].p_stats.st_tticks = 1; } Index: short.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/short.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- short.c 12 Apr 2007 00:56:28 -0000 1.23 +++ short.c 7 Jun 2007 04:43:39 -0000 1.24 @@ -225,7 +225,11 @@ int spwinside = 500; /* WINSIDE from Server */ #define SPWINSIDE 500 /* To make it safe */ +#ifdef PARADISE +LONG spgwidth = 100000; +#else LONG spgwidth = GWIDTH; +#endif void sendThreshold (short unsigned int v) Index: ranklist.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/ranklist.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ranklist.c 25 May 2007 03:36:47 -0000 1.4 +++ ranklist.c 7 Jun 2007 04:43:39 -0000 1.5 @@ -118,14 +118,14 @@ char buf[100]; /* W_ClearWindow(rankw); */ - (void) strcpy (buf, " Rank Hours Defense Ratings DI"); + (void) strcpy (buf, " Rank Hours Offense Ratings DI"); W_WriteText (rankw, 1, 1, textColor, buf, strlen (buf), W_BoldFont); for (i = 0; i < NUMRANKS; i++) { sprintf (buf, "%-11.11s %5.0f %8.2f %8.2f %7.2f", ranks[i].name, ranks[i].hours, - ranks[i].defense, + ranks[i].offense, ranks[i].ratings, ranks[i].ratings * ranks[i].hours); if (mystats->st_rank == i) { Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.95 retrieving revision 1.96 diff -u -d -r1.95 -r1.96 --- data.c 25 May 2007 03:36:46 -0000 1.95 +++ data.c 7 Jun 2007 04:43:38 -0000 1.96 @@ -35,7 +35,6 @@ struct phaser *phasers; struct message *messages; struct mctl *mctl; -struct memory universe; struct _star stars[MAXSECTORS][MAXSECTORS][MAXSTARS]; int TWINSIDE = 500; /* Size of tactical window */ @@ -279,7 +278,8 @@ int received_terrain_info = 0; int terrain_x; int terrain_y; -int gwidth = GWIDTH; /* galaxy width, adjusted for zoom [BDyess] */ +int gwidth = 100000; /* Paradise version of GWIDTH */ +int gwidth_zoom = 100000; /* galaxy width, adjusted for zoom, unused */ int offsetx = 0; int offsety = 0; /* offsets when zooming [BDyess] */ int nplayers = 256; @@ -899,5 +899,6 @@ int sortPlanets = 1; /* sort planet list by team and army count */ int packetLights = 1; /* show packet send/receive via dashboard */ int infoRange = 1; /* show limit on info with large tactical windows */ -int scaleFactor = 40; /* allows for scaling of graphics */ +int scaleFactor = 40; /* allows for scaling of tactical window */ +int mapscaleFactor = 40; /* allows for scaling of galactic window, unused */ int fullBitmapRotation = 1; /* draw old bitmap sets to all angles */ Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- socket.c 25 May 2007 03:36:47 -0000 1.35 +++ socket.c 7 Jun 2007 04:43:39 -0000 1.36 @@ -2547,6 +2547,12 @@ pl->pl_flags |= PLREDRAW; reinitPlanets = 1; +#ifdef PARADISE + /* What a terrible hack, just copying paradise client code - BB */ + if (pl->pl_x > gwidth) + gwidth = 200000; +#endif + #ifdef ROTATERACE if (rotate) { @@ -3014,7 +3020,7 @@ struct thingy *thetorp; #ifdef CORRUPTED_PACKETS - if (packet->tnum >= npthingies*nplayers + ngthingies) + if (ntohs(packet->tnum) >= npthingies*nplayers + ngthingies) { LineToConsole ("handleThingy: bad index %d\n", packet->tnum); return; @@ -3044,7 +3050,7 @@ struct thingy *thetorp; #ifdef CORRUPTED_PACKETS - if (packet->tnum >= npthingies*nplayers + ngthingies) + if (ntohs(packet->tnum) >= npthingies*nplayers + ngthingies) { LineToConsole ("handleThingyInfo: bad index %d\n", packet->tnum); return; @@ -3115,9 +3121,217 @@ } } -void handleGPsizes (struct gp_sizes_spacket *pkt) +void +initialize_thingies(void) +{ + int i; + int n = (npthingies * MAXPLAYER + ngthingies); + thingies = (struct thingy *) malloc(sizeof(*thingies) * n); + for (i = 0; i < n; i++) { + thingies[i].t_shape = SHP_BLANK; + thingies[i].t_no = i; + thingies[i].t_owner = (i >= npthingies * MAXPLAYER) ? -1 : (i / npthingies); + } +} + +void +initialize_torps(void) +{ + int i; + + torps = (struct torp *) malloc(sizeof(*torps) * MAXPLAYER * ntorps); + + for (i = 0; i < nplayers * ntorps; i++) { + torps[i].t_status = TFREE; + torps[i].t_owner = (i / ntorps); + } +} + +void +initialize_plasmas(void) +{ + int i; + + plasmatorps = (struct plasmatorp *) malloc(sizeof(*plasmatorps) * MAXPLAYER * nplasmas); + for (i = 0; i < MAXPLAYER * nplasmas; i++) { + plasmatorps[i].pt_status = PTFREE; + plasmatorps[i].pt_owner = (i / nplasmas); + } +} + +static void +initialize_phasers(void) +{ + int i; + + phasers = (struct phaser *) malloc(sizeof(*phasers) * MAXPLAYER * nphasers); + + for (i = 0; i < MAXPLAYER * nphasers; i++) { + phasers[i].ph_status = PHFREE; + phasers[i].ph_fuse = 0; + } +} + +void +initialize_planets(void) +{ + int i; + + planets = (struct planet *)malloc(sizeof(*planets) * MAXPLANETS); + + for(i = 0; i < MAXPLANETS; i++) { + struct planet *curr = &planets[i]; + curr->pl_no = i; + curr->pl_flags = 0; + curr->pl_owner = 0; + curr->pl_x = curr->pl_y = -10000; + sprintf(curr->pl_name, "planet%d", i); + curr->pl_namelen = strlen(curr->pl_name); + curr->pl_armies = 0; + curr->pl_info = 0; + curr->pl_deadtime = 0; + curr->pl_couptime = 0; + curr->pl_timestamp = 0; + + /* initialize planet redraw for moving planets */ + pl_update[i].plu_update = -1; + } +} + +void +initialize_ranks(void) { + int i; + ranks2 = (struct rank2 *) malloc(sizeof(*ranks2) * nranks2); + + for (i = 0; i < nranks2; i++) { + ranks2[i].name = strdup("blank"); + } +} + +void +initialize_royal(void) +{ + int i; + royal = (struct royalty *) malloc(sizeof(*royal) * nroyals); + + for (i = 0; i < nroyals; i++) { + royal[i].name = strdup("blank"); + } +} + + +void +resize_players(void) +{ +/* For sake of simplicity, I'm leaving size of player struct constant at MAXPLAYER, + resizing just leads to too many problems. - BB */ /* + int me_no = 0; + + if (me) + me_no = me->p_no; + players = (struct player *) realloc(players, sizeof(*players) * nplayers); + if (me) { + me = &players[me_no]; + myship = &(me->p_ship); + } +*/ +} + +load_generic_teams(void) +{ +/* needs to be converted to xpm */ + /* + reserved letters: A G T + */ + int i; + + /* independent is teaminfo[-1] */ + teaminfo = 1 + (struct teaminfo_s *) malloc(sizeof(*teaminfo) * (number_of_teams + 2)); + + strcpy(teaminfo[-1].name, "Independant"); + teaminfo[-1].letter = 'I'; + strcpy(teaminfo[-1].shortname, "IND"); + +// load_default_teamlogos(); /* loads the first 4 team logos */ + + for (i = 0; i < number_of_teams; i++) { + sprintf(teaminfo[i].name, "Team #%d", i); + teaminfo[i].letter = 'J' + i; /* I, J through P */ + sprintf(teaminfo[i].shortname, "T%02d", i); + + /* we should draw something nifty here */ + if (i >= 4) /* the first 4 have been loaded already. */ + teaminfo[i].shield_logo = W_StoreBitmap(1, 1, (char*)&i, w); + /* XXX uh-oh if more than 4 teams */ + } +} + +void +free_teams(void) +{ + int i; + for (i = 0; i < number_of_teams; i++) { + free (teaminfo[i].shield_logo); + } + /* we offsetted by 1 to make room for IND */ + free(teaminfo - 1); + teaminfo = 0; +} + +void +free_torps(void) +{ + free(torps); + torps = 0; +} + +void +free_phasers(void) +{ + free(phasers); + phasers = 0; +} + +void +free_plasmas(void) +{ + free(plasmatorps); + plasmatorps = 0; +} + +void +free_thingies(void) +{ + free(thingies); + thingies = 0; +} + +void +free_ranks(void) +{ + int i; + for (i = 0; i < nranks2; i++) + if (ranks2[i].name) + free(ranks2[i].name); + free(ranks2); + ranks2 = 0; +} + +void +free_royal(void) +{ + int i; + for (i = 0; i < nroyals; i++) + if (royal[i].name) + free(royal[i].name); + + free(royal); + royal = 0; +} +void handleGPsizes (struct gp_sizes_spacket *pkt) +{ free_ranks(); free_royal(); @@ -3126,32 +3340,33 @@ free_phasers(); free_plasmas(); free_thingies(); -*/ + nplayers = pkt->nplayers; number_of_teams = pkt->nteams; // shiptypes nranks2 = pkt->nranks; nroyals = pkt->nroyal; + // Code doesn't support nphasers ntorps or plasmas changing - BB nphasers = pkt->nphasers; ntorps = pkt->ntorps; nplasmas = pkt->nplasmas; npthingies = pkt->nthingies; ngthingies = pkt->gthingies; -/* + // gwidth // flags load_generic_teams(); - reinit_ranks(); - reinit_royal(); + initialize_ranks(); + initialize_royal(); resize_players(); initialize_torps(); initialize_phasers(); initialize_plasmas(); initialize_thingies(); -*/ + } void handleGPteam (struct gp_team_spacket *pkt) From modemhero at users.sourceforge.net Thu Jun 7 01:29:09 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 07 Jun 2007 06:29:09 +0000 Subject: [netrek-cvs] client/netrekxp/win32 config.h,1.19,1.20 Message-ID: <20070607062921.3A29AB3EB@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/win32 In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25375/win32 Modified Files: config.h Log Message: Adds support for paradise wormholes. Fixes bug with local star draw clearzone. Index: config.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/win32/config.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- config.h 16 May 2007 00:05:16 -0000 1.19 +++ config.h 7 Jun 2007 06:29:06 -0000 1.20 @@ -115,7 +115,7 @@ #undef WARP_DEAD /* PARADISE - Support paradise servers */ -#undef PARADISE +#undef PARADISE /* RCM - Receiver configurable Server messages */ #define RCM From modemhero at users.sourceforge.net Thu Jun 7 01:29:12 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 07 Jun 2007 06:29:12 +0000 Subject: [netrek-cvs] client/netrekxp/resources/paradise wormhole.bmp, NONE, 1.1 wormholem.bmp, NONE, 1.1 Message-ID: <20070607062921.39D2D1867CC@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/paradise In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25375/resources/paradise Added Files: wormhole.bmp wormholem.bmp Log Message: Adds support for paradise wormholes. Fixes bug with local star draw clearzone. --- NEW FILE: wormhole.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: wormholem.bmp --- (This appears to be a binary file; contents omitted.) From modemhero at users.sourceforge.net Thu Jun 7 01:29:08 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 07 Jun 2007 06:29:08 +0000 Subject: [netrek-cvs] client/netrekxp/src data.c, 1.96, 1.97 local.c, 1.104, 1.105 map.c, 1.58, 1.59 mswindow.c, 1.85, 1.86 newwin.c, 1.67, 1.68 Message-ID: <20070607062948.B0C8E1867CC@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25375/src Modified Files: data.c local.c map.c mswindow.c newwin.c Log Message: Adds support for paradise wormholes. Fixes bug with local star draw clearzone. Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.96 retrieving revision 1.97 diff -u -d -r1.96 -r1.97 --- data.c 7 Jun 2007 04:43:38 -0000 1.96 +++ data.c 7 Jun 2007 06:29:05 -0000 1.97 @@ -356,6 +356,9 @@ W_Icon base_star_bitmap; W_Icon star_bitmap[STAR_VIEWS]; W_Icon star_mbitmap; +W_Icon base_wormhole_bitmap; +W_Icon wormhole_bitmap[WORMHOLE_VIEWS]; +W_Icon wormhole_mbitmap; W_Icon paradise_ship_bitmaps; W_Icon paradise_ships[NUM_PSHIP_TYPES][NUMTEAMS]; W_Icon paradise_cship_self_bitmaps; Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- newwin.c 7 Jun 2007 04:43:39 -0000 1.67 +++ newwin.c 7 Jun 2007 06:29:06 -0000 1.68 @@ -504,6 +504,18 @@ W_StoreBitmap3 ("bitmaps/paradise/starm.bmp", BMP_MSTAR_WIDTH, BMP_MSTAR_HEIGHT, BMP_MSTAR, mapw, LR_DEFAULTCOLOR); + base_wormhole_bitmap = + W_StoreBitmap3 ("bitmaps/paradise/wormhole.bmp", BMP_WORMHOLE_WIDTH, + BMP_WORMHOLE_HEIGHT * WORMHOLE_VIEWS, BMP_WORMHOLE, w, + LR_DEFAULTCOLOR); + for (i = 0; i < WORMHOLE_VIEWS; i++) + wormhole_bitmap[i] = + W_PointBitmap2 (base_wormhole_bitmap, 0, i, BMP_WORMHOLE_WIDTH, BMP_WORMHOLE_HEIGHT); + + wormhole_mbitmap = + W_StoreBitmap3 ("bitmaps/paradise/wormholem.bmp", BMP_MWORMHOLE_WIDTH, + BMP_MWORMHOLE_HEIGHT, BMP_MWORMHOLE, mapw, + LR_DEFAULTCOLOR); drone_bitmap = W_StoreBitmap3 ("bitmaps/paradise/drone.bmp", BMP_DRONE_WIDTH, Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.85 retrieving revision 1.86 diff -u -d -r1.85 -r1.86 --- mswindow.c 25 May 2007 03:36:46 -0000 1.85 +++ mswindow.c 7 Jun 2007 06:29:06 -0000 1.86 @@ -595,6 +595,10 @@ for (i = 0; i < STAR_VIEWS; i++) free (star_bitmap[i]); free (star_mbitmap); + free (base_wormhole_bitmap); + for (i = 0; i < WORMHOLE_VIEWS; i++) + free (wormhole_bitmap[i]); + free (wormhole_mbitmap); free (paradise_ship_bitmaps); free (paradise_cship_self_bitmaps); free (paradise_cship_bitmaps); Index: map.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/map.c,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- map.c 7 Jun 2007 04:43:39 -0000 1.58 +++ map.c 7 Jun 2007 06:29:06 -0000 1.59 @@ -583,6 +583,11 @@ dy - ( BMP_MSTAR_HEIGHT / 2), BMP_MSTAR_WIDTH, BMP_MSTAR_HEIGHT); + else if (PL_TYPE(*l) == PLWHOLE) + W_ClearArea (mapw, dx - ( BMP_MWORMHOLE_WIDTH / 2), + dy - ( BMP_MWORMHOLE_HEIGHT / 2), + BMP_MWORMHOLE_WIDTH, + BMP_MWORMHOLE_HEIGHT); else { #endif @@ -649,6 +654,17 @@ star_mbitmap, planetColor (l), mapw); + else if (PL_TYPE(*l) == PLWHOLE) + W_OverlayScaleBitmap (dx - (BMP_MWORMHOLE_WIDTH / 2), + dy - (BMP_MWORMHOLE_HEIGHT / 2), + BMP_MWORMHOLE_WIDTH, + BMP_MWORMHOLE_HEIGHT, + BMP_MWORMHOLE_WIDTH, + BMP_MWORMHOLE_HEIGHT, + 0, + wormhole_mbitmap, + planetColor (l), + mapw); else #endif #ifdef BEEPLITE Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.104 retrieving revision 1.105 diff -u -d -r1.104 -r1.105 --- local.c 25 May 2007 03:36:46 -0000 1.104 +++ local.c 7 Jun 2007 06:29:06 -0000 1.105 @@ -41,6 +41,7 @@ static int planet_frame = 0; #ifdef PARADISE static int star_frame = 0; +static int wormhole_frame = 0; #endif static int star_updates = 0; static int last_speed = 0; @@ -599,6 +600,25 @@ planetColor (l), w); } + else if (PL_TYPE(*l) == PLWHOLE) + { + int j = wormhole_frame * 10 / server_ups; + if ((j >= WORMHOLE_VIEWS - 1) || (j < 0)) + { + j = 0; + wormhole_frame = 0; + } + W_WriteScaleBitmap (dx - (BMP_WORMHOLE_WIDTH / 2) * SCALE / scaleFactor, + dy - (BMP_WORMHOLE_HEIGHT / 2) * SCALE / scaleFactor, + BMP_WORMHOLE_WIDTH * SCALE / scaleFactor, + BMP_WORMHOLE_HEIGHT * SCALE / scaleFactor, + BMP_WORMHOLE_WIDTH, + BMP_WORMHOLE_HEIGHT, + 0, + wormhole_bitmap[j], + planetColor (l), + w); + } else #endif if (planetBitmap == 3) @@ -652,7 +672,11 @@ W_White); } - if (showPlanetNames) + if (showPlanetNames +#ifdef PARADISE + && (PL_TYPE(*l) != PLWHOLE) +#endif + ) { /* Center name */ W_MaskText (w, dx - (W_Textwidth * l->pl_namelen / 2), @@ -710,6 +734,23 @@ clearzone[3][clearcount] = W_Textheight; clearcount++; } +#ifdef PARADISE + if (PL_TYPE(*l) == PLSTAR) + { + clearzone[0][clearcount] = dx - (BMP_STAR_WIDTH / 2) * SCALE / scaleFactor; + clearzone[1][clearcount] = dy - (BMP_STAR_HEIGHT / 2) * SCALE / scaleFactor; + clearzone[2][clearcount] = BMP_STAR_WIDTH * SCALE / scaleFactor; + clearzone[3][clearcount] = BMP_STAR_HEIGHT * SCALE / scaleFactor; + } + else if (PL_TYPE(*l) == PLWHOLE) + { + clearzone[0][clearcount] = dx - (BMP_WORMHOLE_WIDTH / 2) * SCALE / scaleFactor; + clearzone[1][clearcount] = dy - (BMP_WORMHOLE_HEIGHT / 2) * SCALE / scaleFactor; + clearzone[2][clearcount] = BMP_WORMHOLE_WIDTH * SCALE / scaleFactor; + clearzone[3][clearcount] = BMP_WORMHOLE_HEIGHT * SCALE / scaleFactor; + } + else +#endif if (planetBitmap == 3) { clearzone[0][clearcount] = dx - (5 * BMP_PLANET_WIDTH / 6 * SCALE / scaleFactor) - 1; @@ -729,6 +770,7 @@ planet_frame++; #ifdef PARADISE star_frame++; + wormhole_frame++; #endif } From modemhero at users.sourceforge.net Thu Jun 7 01:29:07 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 07 Jun 2007 06:29:07 +0000 Subject: [netrek-cvs] client/netrekxp/include bitmaps.h, 1.21, 1.22 data.h, 1.89, 1.90 Message-ID: <20070607062946.7D8B9B3EB@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25375/include Modified Files: bitmaps.h data.h Log Message: Adds support for paradise wormholes. Fixes bug with local star draw clearzone. Index: bitmaps.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/bitmaps.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- bitmaps.h 25 May 2007 03:36:44 -0000 1.21 +++ bitmaps.h 7 Jun 2007 06:29:04 -0000 1.22 @@ -209,6 +209,8 @@ #define BMP_STAR 12 #define BMP_MSTAR 13 #define BMP_GEARBMP 14 +#define BMP_WORMHOLE 15 +#define BMP_MWORMHOLE 16 #define BMP_GEAR_WIDTH 10 #define BMP_GEAR_HEIGHT 10 #define BMP_STAR_WIDTH 30 @@ -216,4 +218,9 @@ #define BMP_MSTAR_WIDTH 16 #define BMP_MSTAR_HEIGHT 16 #define STAR_VIEWS 5 +#define BMP_WORMHOLE_WIDTH 80 +#define BMP_WORMHOLE_HEIGHT 80 +#define BMP_MWORMHOLE_WIDTH 16 +#define BMP_MWORMHOLE_HEIGHT 16 +#define WORMHOLE_VIEWS 8 #endif Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.89 retrieving revision 1.90 diff -u -d -r1.89 -r1.90 --- data.h 7 Jun 2007 04:43:36 -0000 1.89 +++ data.h 7 Jun 2007 06:29:04 -0000 1.90 @@ -360,6 +360,9 @@ extern W_Icon base_star_bitmap; extern W_Icon star_bitmap[STAR_VIEWS]; extern W_Icon star_mbitmap; +extern W_Icon base_wormhole_bitmap; +extern W_Icon wormhole_bitmap[WORMHOLE_VIEWS]; +extern W_Icon wormhole_mbitmap; extern W_Icon paradise_ship_bitmaps; extern W_Icon paradise_ships[NUM_PSHIP_TYPES][NUMTEAMS]; extern W_Icon paradise_cship_self_bitmaps; From modemhero at users.sourceforge.net Thu Jun 7 01:29:06 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 07 Jun 2007 06:29:06 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.150, 1.151 build.cmd, 1.29, 1.30 Message-ID: <20070607062945.9C64A1867CC@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25375 Modified Files: NetrekXP to do list.C build.cmd Log Message: Adds support for paradise wormholes. Fixes bug with local star draw clearzone. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.150 retrieving revision 1.151 diff -u -d -r1.150 -r1.151 --- NetrekXP to do list.C 7 Jun 2007 04:43:34 -0000 1.150 +++ NetrekXP to do list.C 7 Jun 2007 06:29:03 -0000 1.151 @@ -43,7 +43,7 @@ torps planets plasmas. Whereas paradise wants to use dynamic variables. It's a mess. And paradise has nphasers, the entire concept of multiple phasers per ship is not compliant with current code. -Still missing wormholes, asteroids, fighters, and (flashing) warpbeacons. +Still missing asteroids, fighters, and (flashing) warpbeacons. Info window not working right with paradise. Need popup box that works, when connecting to wrong server type Index: build.cmd =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/build.cmd,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- build.cmd 18 May 2007 19:54:30 -0000 1.29 +++ build.cmd 7 Jun 2007 06:29:04 -0000 1.30 @@ -506,6 +506,7 @@ mkdir %InstCWD%\netrek\bitmaps\paradise copy resources\paradise\paradise_*.bmp %InstCWD%\netrek\bitmaps\paradise copy resources\paradise\star*.bmp %InstCWD%\netrek\bitmaps\paradise +copy resources\paradise\wormhole*.bmp %InstCWD%\netrek\bitmaps\paradise copy resources\paradise\mdroneC.bmp %InstCWD%\netrek\bitmaps\paradise copy resources\paradise\drone*.bmp %InstCWD%\netrek\bitmaps\paradise copy resources\paradise\gear.bmp %InstCWD%\netrek\bitmaps\paradise From modemhero at users.sourceforge.net Mon Jun 11 20:23:21 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 12 Jun 2007 01:23:21 +0000 Subject: [netrek-cvs] client/netrekxp/resources/paradise fighter.bmp, NONE, 1.1 fighterC.bmp, NONE, 1.1 fightercloud.bmp, NONE, 1.1 fightercloudC.bmp, NONE, 1.1 Message-ID: <20070612012332.A62A23B407F@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/paradise In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv28758/resources/paradise Added Files: fighter.bmp fighterC.bmp fightercloud.bmp fightercloudC.bmp Log Message: Adds support for paradise fighters, haven't been tested yet, no server available that has them. --- NEW FILE: fighterC.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: fighter.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: fightercloud.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: fightercloudC.bmp --- (This appears to be a binary file; contents omitted.) From modemhero at users.sourceforge.net Mon Jun 11 20:23:21 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 12 Jun 2007 01:23:21 +0000 Subject: [netrek-cvs] client/netrekxp/src data.c, 1.97, 1.98 local.c, 1.105, 1.106 map.c, 1.59, 1.60 mswindow.c, 1.86, 1.87 newwin.c, 1.68, 1.69 Message-ID: <20070612012332.A14713B407E@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv28758/src Modified Files: data.c local.c map.c mswindow.c newwin.c Log Message: Adds support for paradise fighters, haven't been tested yet, no server available that has them. Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.97 retrieving revision 1.98 diff -u -d -r1.97 -r1.98 --- data.c 7 Jun 2007 06:29:05 -0000 1.97 +++ data.c 12 Jun 2007 01:23:17 -0000 1.98 @@ -352,6 +352,13 @@ W_Icon drone_explosion_bitmap[BMP_DRONEDET_FRAMES]; W_Icon base_dronec_explosion_bitmap; W_Icon dronec_explosion_bitmap[BMP_DRONEDET_FRAMES]; +W_Icon fighter_bitmap; +W_Icon base_fighterc_bitmap; +W_Icon fighterc_bitmap[NUM_CTORP_TYPES]; +W_Icon base_fighter_explosion_bitmap; +W_Icon fighter_explosion_bitmap[BMP_FIGHTERDET_FRAMES]; +W_Icon base_fighterc_explosion_bitmap; +W_Icon fighterc_explosion_bitmap[BMP_FIGHTERDET_FRAMES]; W_Icon gear_bitmap, mgear_bitmap; W_Icon base_star_bitmap; W_Icon star_bitmap[STAR_VIEWS]; Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.68 retrieving revision 1.69 diff -u -d -r1.68 -r1.69 --- newwin.c 7 Jun 2007 06:29:06 -0000 1.68 +++ newwin.c 12 Jun 2007 01:23:18 -0000 1.69 @@ -542,6 +542,32 @@ for (i = 0; i < BMP_DRONEDET_FRAMES; i++) dronec_explosion_bitmap[i] = W_PointBitmap2 (base_dronec_explosion_bitmap, 0, i, BMP_DRONEDET_WIDTH, BMP_DRONEDET_HEIGHT); + + fighter_bitmap = + W_StoreBitmap3 ("bitmaps/paradise/fighter.bmp", BMP_FIGHTER_WIDTH, + BMP_FIGHTER_HEIGHT, BMP_FIGHTER, w, LR_MONOCHROME); + base_fighterc_bitmap = + W_StoreBitmap3 ("bitmaps/paradise/fighterC.bmp", BMP_FIGHTER_WIDTH * NUM_CTORP_TYPES, + BMP_FIGHTER_HEIGHT, BMP_FIGHTERC, w, LR_DEFAULTCOLOR); + for (i = 0; i < NUM_CTORP_TYPES; i++) + fighterc_bitmap[i] = + W_PointBitmap2 (base_fighterc_bitmap, i, 0, BMP_FIGHTER_WIDTH, BMP_FIGHTER_HEIGHT); + + base_fighter_explosion_bitmap = + W_StoreBitmap3 ("bitmaps/paradise/fightercloud.bmp", BMP_FIGHTERDET_WIDTH, + BMP_FIGHTERDET_HEIGHT * BMP_FIGHTERDET_FRAMES, BMP_FIGHTERCLOUD, w, + LR_MONOCHROME); + for (i = 0; i < BMP_FIGHTERDET_FRAMES; i++) + fighter_explosion_bitmap[i] = + W_PointBitmap2 (base_fighter_explosion_bitmap, 0, i, BMP_FIGHTERDET_WIDTH, BMP_FIGHTERDET_HEIGHT); + + base_fighterc_explosion_bitmap = + W_StoreBitmap3 ("bitmaps/paradise/fightercloudC.bmp", BMP_FIGHTERDET_WIDTH, + BMP_FIGHTERDET_HEIGHT * BMP_FIGHTERDET_FRAMES, BMP_FIGHTERCLOUD, w, + LR_DEFAULTCOLOR); + for (i = 0; i < BMP_FIGHTERDET_FRAMES; i++) + fighterc_explosion_bitmap[i] = + W_PointBitmap2 (base_fighterc_explosion_bitmap, 0, i, BMP_FIGHTERDET_WIDTH, BMP_FIGHTERDET_HEIGHT); } #endif Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.86 retrieving revision 1.87 diff -u -d -r1.86 -r1.87 --- mswindow.c 7 Jun 2007 06:29:06 -0000 1.86 +++ mswindow.c 12 Jun 2007 01:23:18 -0000 1.87 @@ -589,6 +589,16 @@ free (base_dronec_explosion_bitmap); for (i = 0; i < BMP_DRONEDET_FRAMES; i++) free (dronec_explosion_bitmap[i]); + free (fighter_bitmap); + free (base_fighterc_bitmap); + for (i = 0; i < NUM_CTORP_TYPES; i++) + free (fighterc_bitmap[i]); + free (base_fighter_explosion_bitmap); + for (i = 0; i < BMP_FIGHTERDET_FRAMES; i++) + free (fighter_explosion_bitmap[i]); + free (base_fighterc_explosion_bitmap); + for (i = 0; i < BMP_FIGHTERDET_FRAMES; i++) + free (fighterc_explosion_bitmap[i]); free (gear_bitmap); free (mgear_bitmap); free (base_star_bitmap); Index: map.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/map.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- map.c 7 Jun 2007 06:29:06 -0000 1.59 +++ map.c 12 Jun 2007 01:23:18 -0000 1.60 @@ -744,7 +744,11 @@ #ifdef BEEPLITE } #endif - if (planetHighlighting && (l->pl_info & me->p_team)) /* Draw halo */ + if (planetHighlighting && (l->pl_info & me->p_team) +#ifdef PARADISE + && PL_TYPE(*l) != PLSTAR && PL_TYPE(*l) != PLWHOLE +#endif + ) /* Draw halo */ W_WriteCircle(mapw, dx, dy, BMP_MPLANET_WIDTH / 2, l->pl_armies > 4 ? 1 : 0, 0, planetColor(l)); @@ -1580,7 +1584,7 @@ checkRedraw(pt->pt_x, pt->pt_y); } #ifdef PARADISE - /* missiles */ + /* missiles/fighters */ for (h = i * npthingies, th = &thingies[i * npthingies]; h < npthingies * (i + 1); h++, th++) { if (th->t_x < 0 || th->t_y < 0) Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.105 retrieving revision 1.106 diff -u -d -r1.105 -r1.106 --- local.c 7 Jun 2007 06:29:06 -0000 1.105 +++ local.c 12 Jun 2007 01:23:18 -0000 1.106 @@ -2572,7 +2572,7 @@ struct player *j; int dx, dy; int frame; - int droneTeam; + int droneTeam, fighterTeam; int view = scaleFactor * TWINSIDE / 2; if (k->t_shape == SHP_BLANK) @@ -2586,17 +2586,6 @@ dx = scaleLocal(dx); dy = scaleLocal(dy); switch (k->t_shape) { -/* case SHP_BOOM: - k->t_fuse--; - if (k->t_fuse <= 0) { - k->t_shape = SHP_BLANK; - return; - } - if (k->t_fuse > image->frames) - k->t_fuse = image->frames; - - frame = image->frames - k->t_fuse; - break;*/ case SHP_MISSILE: j = &players[k->t_owner]; #ifdef SOUND @@ -2665,40 +2654,48 @@ clearzone[3][clearcount] = BMP_DRONE_HEIGHT * SCALE / scaleFactor + 2; clearcount++; break; -/* case SHP_TORP: - image = getImage(friendlyThingy(k) ? I_MTORP : I_ETORP); - frame = udcounter + k->t_no; - break; - case SHP_PLASMA: - case SHP_MINE: // use plasma until I get a nifty bitmap - image = getImage(friendlyThingy(k) ? I_MPLASMATORP : I_EPLASMATORP); - frame = udcounter + k->t_no; - break; - case SHP_PBOOM: - image = getImage(friendlyThingy(k) ? I_MPLASMACLOUD : I_EPLASMACLOUD); - k->t_fuse--; - if (k->t_fuse < 0) { - k->t_shape = SHP_BLANK; - return; - } - if (k->t_fuse > image->frames) { - k->t_fuse = image->frames; - } - frame = image->frames - k->t_fuse; - break; case SHP_FBOOM: - image = getImage(friendlyThingy(k) ? I_MFIGHTERCLOUD : I_EFIGHTERCLOUD); - k->t_fuse--; - if (k->t_fuse < 0) { - k->t_shape = SHP_BLANK; - return; - } - if (k->t_fuse > image->frames) { - k->t_fuse = image->frames; - } - frame = image->frames - k->t_fuse; + k->t_fuse--; + frame = k->t_fuse * 10 / server_ups; + + if (k->t_fuse < 0) + { + k->t_shape = SHP_BLANK; + return; + } + + if (frame >= BMP_FIGHTERDET_FRAMES) + frame = BMP_FIGHTERDET_FRAMES - 1; + +#ifdef SOUND + if (k->t_fuse == (MAX(2, BMP_FIGHTERDET_FRAMES * server_ups / 10) - 1)) + { + SetDistAngle(dx, dy); + // At short distances, don't use angular sound + if (!soundAngles || distance < SCALE/2) + Play_Sound_Loc(PLASMA_HIT_WAV, SF_WEAPONS, -1, distance); + else + Play_Sound_Loc(PLASMA_HIT_WAV, SF_WEAPONS, angle, distance); + } +#endif + W_WriteScaleBitmap (dx - (BMP_FIGHTERDET_WIDTH / 2) * SCALE / scaleFactor, + dy - (BMP_FIGHTERDET_HEIGHT / 2) * SCALE / scaleFactor, + BMP_FIGHTERDET_WIDTH * SCALE / scaleFactor, + BMP_FIGHTERDET_HEIGHT * SCALE / scaleFactor, + BMP_FIGHTERDET_WIDTH, + BMP_FIGHTERDET_HEIGHT, + 0, + colorWeapons ? fighterc_explosion_bitmap[frame] : fighter_explosion_bitmap[frame], + playerColor (&players[k->t_owner]), + w); + clearzone[0][clearcount] = dx - (BMP_FIGHTERDET_WIDTH / 2) * SCALE / scaleFactor ; + clearzone[1][clearcount] = dy - (BMP_FIGHTERDET_HEIGHT / 2) * SCALE / scaleFactor; + clearzone[2][clearcount] = BMP_FIGHTERDET_WIDTH * SCALE / scaleFactor; + clearzone[3][clearcount] = BMP_FIGHTERDET_HEIGHT * SCALE / scaleFactor; + clearcount++; break; - */ + /* It appears all missile/fighter explosions are sent as SHP_PBOOM, oh well */ + case SHP_PBOOM: case SHP_DBOOM: k->t_fuse--; frame = k->t_fuse * 10 / server_ups; @@ -2713,7 +2710,7 @@ frame = BMP_DRONEDET_FRAMES - 1; #ifdef SOUND - if (k->t_fuse == (MAX(2, BMP_TORPDET_FRAMES * server_ups / 10) - 1)) + if (k->t_fuse == (MAX(2, BMP_DRONEDET_FRAMES * server_ups / 10) - 1)) { SetDistAngle(dx, dy); // At short distances, don't use angular sound @@ -2739,11 +2736,83 @@ clearzone[3][clearcount] = BMP_DRONEDET_HEIGHT * SCALE / scaleFactor; clearcount++; break; - /* case SHP_FIGHTER: - image = getImage(friendlyThingy(k) ? I_MFIGHTER : I_EFIGHTER); - frame = (int) (k->t_dir * image->frames + 128) / 256; - break; + j = &players[k->t_owner]; +#ifdef SOUND + if (k->t_owner != me->p_no) + { + num_other_missiles++; + SetDistAngle(dx, dy); + if (distance < other_missile_dist) + { + other_missile_dist = distance; + other_missile_angle = angle; + } + } +#endif + if (colorWeapons) + { + if (myPlayer(j)) + fighterTeam = 0; + else + { + switch (j->p_team) + { + case FED: + fighterTeam = 1; + break; + case KLI: + fighterTeam = 3; + break; + case ORI: + fighterTeam = 4; + break; + case ROM: + fighterTeam = 5; + break; + default: // IND + fighterTeam = 2; + } + } + W_WriteScaleBitmap (dx - (BMP_FIGHTER_WIDTH / 2) * SCALE / scaleFactor, + dy - (BMP_FIGHTER_HEIGHT / 2) * SCALE / scaleFactor, + BMP_FIGHTER_WIDTH * SCALE / scaleFactor, + BMP_FIGHTER_HEIGHT * SCALE / scaleFactor, + BMP_FIGHTER_WIDTH, + BMP_FIGHTER_HEIGHT, + (360 * k->t_dir/255), + fighterc_bitmap[fighterTeam], + playerColor (j), + w); + } + else + { + W_WriteScaleBitmap (dx - (BMP_FIGHTER_WIDTH / 2) * SCALE / scaleFactor, + dy - (BMP_FIGHTER_HEIGHT / 2) * SCALE / scaleFactor, + BMP_FIGHTER_WIDTH * SCALE / scaleFactor, + BMP_FIGHTER_HEIGHT * SCALE / scaleFactor, + BMP_FIGHTER_WIDTH, + BMP_FIGHTER_HEIGHT, + (360 * k->t_dir/255), + fighter_bitmap, + playerColor (j), + w); + } + clearzone[0][clearcount] = dx - (BMP_FIGHTER_WIDTH / 2) * SCALE / scaleFactor - 1; + clearzone[1][clearcount] = dy - (BMP_FIGHTER_HEIGHT / 2) * SCALE / scaleFactor - 1; + clearzone[2][clearcount] = BMP_FIGHTER_WIDTH * SCALE / scaleFactor + 2; + clearzone[3][clearcount] = BMP_FIGHTER_HEIGHT * SCALE / scaleFactor + 2; + clearcount++; + break; +/* + These 4 appear unused.... + + case SHP_TORP: + case SHP_PLASMA: + case SHP_MINE: + case SHP_BOOM: +*/ +/* case SHP_WARP_BEACON: image = getImage(I_WARPBEACON); frame = udcounter; From modemhero at users.sourceforge.net Mon Jun 11 20:23:19 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 12 Jun 2007 01:23:19 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.151, 1.152 build.cmd, 1.30, 1.31 clientr.suo, 1.135, 1.136 Message-ID: <20070612012357.3A0E9B409@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv28758 Modified Files: NetrekXP to do list.C build.cmd clientr.suo Log Message: Adds support for paradise fighters, haven't been tested yet, no server available that has them. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.151 retrieving revision 1.152 diff -u -d -r1.151 -r1.152 --- NetrekXP to do list.C 7 Jun 2007 06:29:03 -0000 1.151 +++ NetrekXP to do list.C 12 Jun 2007 01:23:14 -0000 1.152 @@ -43,7 +43,7 @@ torps planets plasmas. Whereas paradise wants to use dynamic variables. It's a mess. And paradise has nphasers, the entire concept of multiple phasers per ship is not compliant with current code. -Still missing asteroids, fighters, and (flashing) warpbeacons. +Still missing asteroids and (flashing) warpbeacons. Info window not working right with paradise. Need popup box that works, when connecting to wrong server type Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.135 retrieving revision 1.136 diff -u -d -r1.135 -r1.136 Binary files /tmp/cvsoHorTG and /tmp/cvs4OreVA differ Index: build.cmd =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/build.cmd,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- build.cmd 7 Jun 2007 06:29:04 -0000 1.30 +++ build.cmd 12 Jun 2007 01:23:14 -0000 1.31 @@ -507,8 +507,8 @@ copy resources\paradise\paradise_*.bmp %InstCWD%\netrek\bitmaps\paradise copy resources\paradise\star*.bmp %InstCWD%\netrek\bitmaps\paradise copy resources\paradise\wormhole*.bmp %InstCWD%\netrek\bitmaps\paradise -copy resources\paradise\mdroneC.bmp %InstCWD%\netrek\bitmaps\paradise copy resources\paradise\drone*.bmp %InstCWD%\netrek\bitmaps\paradise +copy resources\paradise\fighter*.bmp %InstCWD%\netrek\bitmaps\paradise copy resources\paradise\gear.bmp %InstCWD%\netrek\bitmaps\paradise copy resources\fonts\ntfonts2.fon %InstCWD%\netrek From modemhero at users.sourceforge.net Mon Jun 11 20:23:19 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 12 Jun 2007 01:23:19 +0000 Subject: [netrek-cvs] client/netrekxp/include bitmaps.h, 1.22, 1.23 data.h, 1.90, 1.91 Message-ID: <20070612012357.6E055B40B@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv28758/include Modified Files: bitmaps.h data.h Log Message: Adds support for paradise fighters, haven't been tested yet, no server available that has them. Index: bitmaps.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/bitmaps.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- bitmaps.h 7 Jun 2007 06:29:04 -0000 1.22 +++ bitmaps.h 12 Jun 2007 01:23:17 -0000 1.23 @@ -206,6 +206,15 @@ #define BMP_DRONEDET_FRAMES 5 #define BMP_DRONEDET_WIDTH 13 #define BMP_DRONEDET_HEIGHT 13 +#define BMP_FIGHTER 9 +#define BMP_FIGHTERC 10 +#define BMP_FIGHTER_WIDTH 5 +#define BMP_FIGHTER_HEIGHT 5 +#define BMP_FIGHTERCLOUD 12 +#define BMP_FIGHTERCLOUDC 13 +#define BMP_FIGHTERDET_FRAMES 5 +#define BMP_FIGHTERDET_WIDTH 13 +#define BMP_FIGHTERDET_HEIGHT 13 #define BMP_STAR 12 #define BMP_MSTAR 13 #define BMP_GEARBMP 14 Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.90 retrieving revision 1.91 diff -u -d -r1.90 -r1.91 --- data.h 7 Jun 2007 06:29:04 -0000 1.90 +++ data.h 12 Jun 2007 01:23:17 -0000 1.91 @@ -356,6 +356,13 @@ extern W_Icon drone_explosion_bitmap[BMP_DRONEDET_FRAMES]; extern W_Icon base_dronec_explosion_bitmap; extern W_Icon dronec_explosion_bitmap[BMP_DRONEDET_FRAMES]; +extern W_Icon fighter_bitmap; +extern W_Icon base_fighterc_bitmap; +extern W_Icon fighterc_bitmap[NUM_CTORP_TYPES]; +extern W_Icon base_fighter_explosion_bitmap; +extern W_Icon fighter_explosion_bitmap[BMP_FIGHTERDET_FRAMES]; +extern W_Icon base_fighterc_explosion_bitmap; +extern W_Icon fighterc_explosion_bitmap[BMP_FIGHTERDET_FRAMES]; extern W_Icon gear_bitmap, mgear_bitmap; extern W_Icon base_star_bitmap; extern W_Icon star_bitmap[STAR_VIEWS];