From modemhero at users.sourceforge.net Wed Feb 7 17:04:59 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 07 Feb 2007 23:04:59 +0000 Subject: [netrek-cvs] client/netrekxp clientr.suo,1.60,1.61 Message-ID: <20070207230508.2264D28EFC@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv14368 Modified Files: clientr.suo Log Message: Update release time. Fix netrekrc errors. Fix end music selection so it uses proper range of music files in the music array. Add debug check to frequent mix_playchannel error. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 Binary files /tmp/cvsbr7oc3 and /tmp/cvsEGpEIi differ From modemhero at users.sourceforge.net Wed Feb 7 17:04:59 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 07 Feb 2007 23:04:59 +0000 Subject: [netrek-cvs] client/netrekxp/src death.c, 1.12, 1.13 defaults.c, 1.39, 1.40 sound.c, 1.21, 1.22 Message-ID: <20070207230508.22139B400@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv14368/src Modified Files: death.c defaults.c sound.c Log Message: Update release time. Fix netrekrc errors. Fix end music selection so it uses proper range of music files in the music array. Add debug check to frequent mix_playchannel error. Index: death.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/death.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- death.c 31 Jan 2007 07:06:37 -0000 1.12 +++ death.c 7 Feb 2007 23:04:57 -0000 1.13 @@ -155,7 +155,7 @@ #ifdef SOUND if (newSound) { - i = MUSIC_OFFSET + (RANDOM() % MUSIC_OFFSET); // Play random end theme + i = MUSIC_OFFSET + (RANDOM() % (NUM_MUSIC - MUSIC_OFFSET)); // Play random end theme Play_Music(i); } #endif @@ -186,7 +186,7 @@ #ifdef SOUND if (newSound) { - i = MUSIC_OFFSET + (RANDOM() % MUSIC_OFFSET); // Play random end theme + i = MUSIC_OFFSET + (RANDOM() % (NUM_MUSIC - MUSIC_OFFSET)); // Play random end theme Play_Music(i); } #endif Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- defaults.c 1 Feb 2007 00:10:28 -0000 1.39 +++ defaults.c 7 Feb 2007 23:04:57 -0000 1.40 @@ -258,8 +258,8 @@ "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)", + "2 - as above + with nobody playing (default)", + "3 - as above + timed out servers", "4 - as above + servers that metaserver could not connect to", NULL } @@ -770,7 +770,7 @@ {"useFullShipInfo", &useFullShipInfo, RC_BOOL, { "Display other ships to 256 directions instead of 16", - "by using long ship packets instead of short ship packets", + "by using long ship packets instead of short ship packets,", "slight increase in bandwidth usage", NULL } Index: sound.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/sound.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- sound.c 1 Feb 2007 00:10:28 -0000 1.21 +++ sound.c 7 Feb 2007 23:04:57 -0000 1.22 @@ -324,7 +324,10 @@ if ((channel = Mix_PlayChannel(-1, newsounds[type], 0)) < 0) { +#if DEBUG + /* Frequent occurence is more than 16 channels playing sound */ LineToConsole("Mix_PlayChannel: %s\n", Mix_GetError()); +#endif return; } /* Make sure distance in boundary range that function accepts */ From modemhero at users.sourceforge.net Wed Feb 7 17:04:59 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 07 Feb 2007 23:04:59 +0000 Subject: [netrek-cvs] client/netrekxp/src/cursors curslib.suo,1.2,1.3 Message-ID: <20070207230508.24EE2B434@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src/cursors In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv14368/src/cursors Modified Files: curslib.suo Log Message: Update release time. Fix netrekrc errors. Fix end music selection so it uses proper range of music files in the music array. Add debug check to frequent mix_playchannel error. Index: curslib.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/cursors/curslib.suo,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvsGus1Rr and /tmp/cvs2B9z6H differ From modemhero at users.sourceforge.net Wed Feb 7 17:04:59 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 07 Feb 2007 23:04:59 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.102, 1.103 netrekrc, 1.17, 1.18 Message-ID: <20070207230508.261F728F03@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv14368/resources/docs Modified Files: changes.txt netrekrc Log Message: Update release time. Fix netrekrc errors. Fix end music selection so it uses proper range of music files in the music array. Add debug check to frequent mix_playchannel error. Index: netrekrc =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- netrekrc 31 Jan 2007 07:06:36 -0000 1.17 +++ netrekrc 7 Feb 2007 23:04:57 -0000 1.18 @@ -892,10 +892,10 @@ macro.).A:/* Join the netrek clue game mailing list today! At */ macro.).A:/* http://groups.google.com/group/netrek-clue-games */ macro.).A:/* INL-style timed bronco games are every Wednesday */ -macro.).A:/* 10pm EST/7pm PST on ports 4566/4577 at netrek.warped.us */ +macro.).A:/* 10pm EST/7pm PST on ports 4566/4577 */ macro.(.A: /* Get the latest version of Netrek XP 2006 today! */ -macro.(.A: /* Current version is 1.1, released June 26, 2006 */ +macro.(.A: /* Current version is 1.2, released February 2007 */ macro.(.A: /* Download it at http://www.netrek.org/files/NetrekXP_2006/ */ macro.(.A: /* or */ macro.(.A: /* http://www.playnetrek.org/ */ @@ -939,10 +939,10 @@ # Beeplite macros lite.take: /c/l/3 lite.base_ogg: /g/m/1/|OGG THE BASE!| +lite.escorting: /c/p/4 lite.pickup: /p -lite.help: %?%S=SB%{/c%}%?%a>0%{/c%} lite.carrying: /c -lite.escorting: /c/p/4 +lite.help: %?%S=SB%{/c%}%?%a>0%{/c%} # Receiver configurable messages Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.102 retrieving revision 1.103 diff -u -d -r1.102 -r1.103 --- changes.txt 1 Feb 2007 00:10:28 -0000 1.102 +++ changes.txt 7 Feb 2007 23:04:57 -0000 1.103 @@ -1,4 +1,4 @@ -Netrek XP 2006, Version 1.2: (Released Jan-2007) +Netrek XP 2006, Version 1.2: (Released Feb-2007) - three new netrekrc options, which are newSoundEffects, newSoundMusic, and newSoundMusicBkgd. The first toggles sound effects on/off, the second toggles music on/off, the third plays a mix of star trek theme music continually in the background. Thus, if you wish to play From modemhero at users.sourceforge.net Wed Feb 7 18:39:21 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 08 Feb 2007 00:39:21 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.92, 1.93 clientr.suo, 1.61, 1.62 Message-ID: <20070208003930.910E928EFC@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25791 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Update todo list, email reference, fix macro. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.92 retrieving revision 1.93 diff -u -d -r1.92 -r1.93 --- NetrekXP to do list.C 29 Jan 2007 10:34:20 -0000 1.92 +++ NetrekXP to do list.C 8 Feb 2007 00:39:16 -0000 1.93 @@ -41,8 +41,7 @@ awkward to resize window if user going to click on a server. However if cache is working properly, after the first connect, all servers should be stored and the metaserver window should not resize due to differences between the metaservers. -5b) Metaping on a Unknown server is causing unseemly delay due to threading. -6) Fix generic_32 size check +5a) Metaping on a Unknown server is causing unseemly delay due to threading. 7) Some sort of click action on player list brings up a menu with settings for that player's candock, cantranswarp, ban, ignore, etc. 8) Maybe fix galactic new planet bitmap redraw sequence, caused incredible lag on a P166 Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 Binary files /tmp/cvsF5c6Fn and /tmp/cvs30WCov differ From modemhero at users.sourceforge.net Wed Feb 7 18:39:21 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 08 Feb 2007 00:39:21 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs netrekrc, 1.18, 1.19 netrekxp.doc, 1.11, 1.12 Message-ID: <20070208003930.80222B432@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25791/resources/docs Modified Files: netrekrc netrekxp.doc Log Message: Update todo list, email reference, fix macro. Index: netrekrc =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- netrekrc 7 Feb 2007 23:04:57 -0000 1.18 +++ netrekrc 8 Feb 2007 00:39:19 -0000 1.19 @@ -892,7 +892,7 @@ macro.).A:/* Join the netrek clue game mailing list today! At */ macro.).A:/* http://groups.google.com/group/netrek-clue-games */ macro.).A:/* INL-style timed bronco games are every Wednesday */ -macro.).A:/* 10pm EST/7pm PST on ports 4566/4577 */ +macro.).A:/* 10pm EST/7pm PST */ macro.(.A: /* Get the latest version of Netrek XP 2006 today! */ macro.(.A: /* Current version is 1.2, released February 2007 */ Index: netrekxp.doc =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekxp.doc,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- netrekxp.doc 29 Nov 2006 12:06:34 -0000 1.11 +++ netrekxp.doc 8 Feb 2007 00:39:19 -0000 1.12 @@ -5,7 +5,7 @@ * * * * * Comments, suggestion and bug reports to * -* keyos at keyos.org * +* billbalcerski at hotmail.com * * * * * * This is a modified version of COW.DOC which was * From modemhero at users.sourceforge.net Thu Feb 8 02:34:45 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 08 Feb 2007 08:34:45 +0000 Subject: [netrek-cvs] client/netrekxp/src local.c,1.50,1.51 Message-ID: <20070208083459.7A716B429@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29197/src Modified Files: local.c Log Message: Fix atan2 checks for playing sound by distance, to not compute angle is distance is 0. Fix atan2 checks to change sign of y-coord (since y in netrek coords is opposite cartesian), and to properly translate between atan and SDL coordinate systems. Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- local.c 13 Dec 2006 09:03:01 -0000 1.50 +++ local.c 8 Feb 2007 08:34:43 -0000 1.51 @@ -731,8 +731,13 @@ // Reason for normalization is Mix_SetDistance requires that range distance = (int)((255 * distance)/CORNER_DIST); // Calculate angle, then adjust as necessary for Mix_SetDistance - angle = (int)(atan2(newdy, newdx)*180/XPI); - angle = 270 - angle; + if (distance != 0) + { + angle = (int)(atan2(-newdy, newdx)*180/XPI); + angle = 90 - angle; + } + else + angle = 0; // At short distances, don't use angular sound if (distance < SCALE/2) Play_Sound(CLOAKED_WAV); @@ -763,7 +768,7 @@ if (newSound) { if (j->p_cloakphase == CLOAK_PHASES - 1) - { + { newdx = dx - WINSIDE/2; newdy = dy - WINSIDE/2; @@ -773,8 +778,13 @@ // Reason for normalization is Mix_SetDistance requires that range distance = (int)((255 * distance)/CORNER_DIST); // Calculate angle, then adjust as necessary for Mix_SetDistance - angle = (int)(atan2(newdy, newdx)*180/XPI); - angle = 270 - angle; + if (distance != 0) + { + angle = (int)(atan2(-newdy, newdx)*180/XPI); + angle = 90 - angle; + } + else + angle = 0; // At short distances, don't use angular sound if (distance < SCALE/2) Play_Sound(UNCLOAK_WAV); @@ -1334,8 +1344,13 @@ // Reason for normalization is Mix_SetDistance requires that range distance = (int)((255 * distance)/CORNER_DIST); // Calculate angle, then adjust as necessary for Mix_SetDistance - angle = (int)(atan2(newdy, newdx)*180/XPI); - angle = 270 - angle; + if (distance != 0) + { + angle = (int)(atan2(-newdy, newdx)*180/XPI); + angle = 90 - angle; + } + else + angle = 0; // At short distances, don't use angular sound if (distance < SCALE/2) { @@ -1427,8 +1442,13 @@ // Reason for normalization is Mix_SetDistance requires that range distance = (int)((255 * distance)/CORNER_DIST); // Calculate angle, then adjust as necessary for Mix_SetDistance - angle = (int)(atan2(newdy, newdx)*180/XPI); - angle = 270 - angle; + if (distance != 0) + { + angle = (int)(atan2(-newdy, newdx)*180/XPI); + angle = 90 - angle; + } + else + angle = 0; // At short distances, don't use angular sound if (distance < SCALE/2) Play_Sound(PHASER_OTHER_WAV); @@ -1858,8 +1878,13 @@ new_other_torp_dist = (int)((255 * new_other_torp_dist)/CORNER_DIST); // Find how long till torp expires...BROKEN! // Calculate angle, then adjust as necessary for Mix_SetDistance - new_angle = (int)(atan2(newdy, newdx)*180/XPI); - new_angle = 270 - new_angle; + if (new_other_torp_dist != 0) + { + new_angle = (int)(atan2(-newdy, newdx)*180/XPI); + new_angle = 90 - new_angle; + } + else + new_angle = 0; // Choose closest torp - yes this sucks sometimes, but better than nothing if (new_other_torp_dist < other_torp_dist) { @@ -1903,8 +1928,13 @@ // Reason for normalization is Mix_SetDistance requires that range distance = (int)((255 * distance)/CORNER_DIST); // Calculate angle, then adjust as necessary for Mix_SetDistance - angle = (int)(atan2(newdy, newdx)*180/XPI); - angle = 270 - angle; + if (distance != 0) + { + angle = (int)(atan2(-newdy, newdx)*180/XPI); + angle = 90 - angle; + } + else + angle = 0; // At short distances, don't use angular sound if (distance < SCALE/2) Play_Sound(TORP_HIT_WAV); @@ -2109,8 +2139,13 @@ new_other_plasma_dist = (int)((255 * new_other_plasma_dist)/CORNER_DIST); // Find how long till torp expires...BROKEN! // Calculate angle, then adjust as necessary for Mix_SetDistance - new_angle = (int)(atan2(newdy, newdx)*180/XPI); - new_angle = 270 - new_angle; + if (new_other_plasma_dist != 0) + { + new_angle = (int)(atan2(-newdy, newdx)*180/XPI); + new_angle = 90 - new_angle; + } + else + new_angle = 0; // Choose closest plasma - yes this sucks sometimes, but better than nothing if (new_other_plasma_dist < other_plasma_dist) { @@ -2154,8 +2189,13 @@ // Reason for normalization is Mix_SetDistance requires that range distance = (int)((255 * distance)/CORNER_DIST); // Calculate angle, then adjust as necessary for Mix_SetDistance - angle = (int)(atan2(newdy, newdx)*180/XPI); - angle = 270 - angle; + if (distance != 0) + { + angle = (int)(atan2(-newdy, newdx)*180/XPI); + angle = 90 - angle; + } + else + angle = 0; // At short distances, don't use angular sound if (distance < SCALE/2) Play_Sound(PLASMA_HIT_WAV); From modemhero at users.sourceforge.net Thu Feb 8 02:34:45 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 08 Feb 2007 08:34:45 +0000 Subject: [netrek-cvs] client/netrekxp clientr.suo,1.62,1.63 Message-ID: <20070208083459.B13D9B432@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29197 Modified Files: clientr.suo Log Message: Fix atan2 checks for playing sound by distance, to not compute angle is distance is 0. Fix atan2 checks to change sign of y-coord (since y in netrek coords is opposite cartesian), and to properly translate between atan and SDL coordinate systems. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 Binary files /tmp/cvsMFZuQi and /tmp/cvs3ZZRqw differ From modemhero at users.sourceforge.net Sat Feb 10 21:21:00 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 11 Feb 2007 03:21:00 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.103, 1.104 Message-ID: <20070211032108.F17E7186825@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv9923/resources/docs Modified Files: changes.txt Log Message: Remove unused music_toggle, instead use sound_toggle for music playback, fixes bug where geno music would still play with sound turned off. New volume raise/lower function for SDL sound, which changes sound playback volume without changing Windows WAV volume. Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.103 retrieving revision 1.104 diff -u -d -r1.103 -r1.104 --- changes.txt 7 Feb 2007 23:04:57 -0000 1.103 +++ changes.txt 11 Feb 2007 03:20:58 -0000 1.104 @@ -1,13 +1,17 @@ Netrek XP 2006, Version 1.2: (Released Feb-2007) +- sound and music volume are now independent of Windows sound volume, i.e. changing + game volume with the in game raise/lower volume keys does not change system WAV volume + (newSound only). - three new netrekrc options, which are newSoundEffects, newSoundMusic, and newSoundMusicBkgd. The first toggles sound effects on/off, the second toggles music on/off, the third plays a mix of star trek theme music continually in the background. Thus, if you wish to play with only music, you can. If you want to play with only sound effects, you can. Or both. - Or neither. Defaults are on for sound effects and music, and off for background music. + Or neither. Defaults are on for sound effects and music, and off for background music + (newSound only). - the client can now play music files, 10 star trek themed music files from the various star trek series and movies have been added. Random intro themes will play on client connect, - and random end credits themes will play on genocide. Music is only available with the newSound - option on, as it uses SDL. These new music files are in the .ogg format. + and random end credits themes will play on genocide. These new music files are in the .ogg + format (newSound only). - servers that don't respond to metaping are not saved in the UDPcache, as they are likely defunct - fixed some bugs relating to message windows, most noticeably, messages that are @@ -19,7 +23,7 @@ not used in normal gameplay though - changed default beeplite settings to include highlighting and sound effects for carrying, take and escorting RCDs. -- sound now fades out over 1 second upon quitting +- sound now fades out over 1 second upon quitting (newSound only) - support for new server feature packet SP_GENERIC_32. This is a great upgrade to the server as it allows for future data to be sent in this packet (lots of empty room). Currently it sends your ship's repair time..removing the need for the client side repair time From modemhero at users.sourceforge.net Sat Feb 10 21:21:00 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 11 Feb 2007 03:21:00 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.93, 1.94 clientr.suo, 1.63, 1.64 Message-ID: <20070211032108.DE354186824@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv9923 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Remove unused music_toggle, instead use sound_toggle for music playback, fixes bug where geno music would still play with sound turned off. New volume raise/lower function for SDL sound, which changes sound playback volume without changing Windows WAV volume. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.93 retrieving revision 1.94 diff -u -d -r1.93 -r1.94 --- NetrekXP to do list.C 8 Feb 2007 00:39:16 -0000 1.93 +++ NetrekXP to do list.C 11 Feb 2007 03:20:56 -0000 1.94 @@ -48,6 +48,7 @@ Win98 xp computer 9) Out of bounds message window calcs don't work with taskbar or menu bar, basewin rect doesn't take these into account. +10) Make sure all ping related fields are switched correctly via metasort. Stas's list: - color coded playerlist. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 Binary files /tmp/cvssj7FeD and /tmp/cvs6zh8yC differ From modemhero at users.sourceforge.net Sat Feb 10 21:21:00 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 11 Feb 2007 03:21:00 +0000 Subject: [netrek-cvs] client/netrekxp/include sound.h,1.12,1.13 Message-ID: <20070211032108.D5CAD186820@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv9923/include Modified Files: sound.h Log Message: Remove unused music_toggle, instead use sound_toggle for music playback, fixes bug where geno music would still play with sound turned off. New volume raise/lower function for SDL sound, which changes sound playback volume without changing Windows WAV volume. Index: sound.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/sound.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- sound.h 1 Feb 2007 00:10:27 -0000 1.12 +++ sound.h 11 Feb 2007 03:20:58 -0000 1.13 @@ -61,6 +61,7 @@ extern void Play_Sound_Loc (int type, int angle, int distance); extern void Play_Music (int type); extern void Play_Music_Bkgd (void); +extern void ChangeNewsoundVolume (int vol); extern void Abort_Sound (int type); extern void Init_Sound (void); extern void Exit_Sound (void); From modemhero at users.sourceforge.net Sat Feb 10 21:21:00 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 11 Feb 2007 03:21:00 +0000 Subject: [netrek-cvs] client/netrekxp/src input.c, 1.19, 1.20 sound.c, 1.22, 1.23 Message-ID: <20070211032109.0D51B186826@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv9923/src Modified Files: input.c sound.c Log Message: Remove unused music_toggle, instead use sound_toggle for music playback, fixes bug where geno music would still play with sound turned off. New volume raise/lower function for SDL sound, which changes sound playback volume without changing Windows WAV volume. Index: input.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/input.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- input.c 13 Dec 2006 00:00:00 -0000 1.19 +++ input.c 11 Feb 2007 03:20:58 -0000 1.20 @@ -2847,7 +2847,10 @@ Key86 (void) { #ifdef SOUND - ChangeVolume (1); + if (newSound) + ChangeNewsoundVolume (1); + else + ChangeVolume (1); #else emptyKey (); #endif @@ -3322,7 +3325,10 @@ Key118 (W_Event * data) { #ifdef SOUND - ChangeVolume (-1); + if (newSound) + ChangeNewsoundVolume (-1); + else + ChangeVolume (-1); #else emptyKey (); #endif Index: sound.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/sound.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- sound.c 7 Feb 2007 23:04:57 -0000 1.22 +++ sound.c 11 Feb 2007 03:20:58 -0000 1.23 @@ -222,8 +222,7 @@ sound_toggle = 1; loadSounds(); - /* Toggle on music, load music files, and play random intro music */ - music_toggle = 1; + /* Load music files, and play random intro music */ loadMusic(); i = RANDOM() % MUSIC_OFFSET; Play_Music(i); @@ -361,7 +360,7 @@ /* Only works with SDL, i.e. newSound */ extern void Play_Music (int type) { - if (!sound_init || !newSound || !newSoundMusic || !music_toggle) + if (!sound_init || !sound_toggle || !newSound || !newSoundMusic) return; if ((type >= NUM_MUSIC) || (type < 0)) @@ -382,7 +381,7 @@ { int i; - if (!sound_init || !newSound || !newSoundMusic || !newSoundMusicBkgd|| !music_toggle) + if (!sound_init || !sound_toggle || !newSound || !newSoundMusic || !newSoundMusicBkgd) return; if (Mix_PlayingMusic()) @@ -437,6 +436,28 @@ } } +/* Only works with SDL, i.e. newSound */ +extern void ChangeNewsoundVolume (int vol) +{ + int mvolume, volume; + + // Get current average sound volume and music volume + volume = Mix_Volume(-1, -1); + mvolume = Mix_VolumeMusic(-1); + + // Change sound volume for all channels, range is 0 to 128 + volume = volume + 10*vol; + if (volume < 0) + volume = 0; + Mix_Volume(-1,volume); + + // Change music volume, range is 0 to 128 + mvolume = mvolume + 10*vol; + if (mvolume < 0) + mvolume = 0; + Mix_VolumeMusic(mvolume); +} + extern void Abort_Sound (int type) { if ((current_sound != NO_SOUND) && (type == current_sound)) From modemhero at users.sourceforge.net Mon Feb 12 00:49:48 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 12 Feb 2007 06:49:48 +0000 Subject: [netrek-cvs] client/netrekxp clientr.suo,1.64,1.65 Message-ID: <20070212064957.2474BB448@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv12303 Modified Files: clientr.suo Log Message: Macro fix. Bug fix for default server (TCP only option). Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 Binary files /tmp/cvsYhSnWd and /tmp/cvsXS9c5L differ From modemhero at users.sourceforge.net Mon Feb 12 00:49:48 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 12 Feb 2007 06:49:48 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs netrekrc, 1.19, 1.20 netrekrc_options.txt, 1.21, 1.22 Message-ID: <20070212064957.2744C18682A@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv12303/resources/docs Modified Files: netrekrc netrekrc_options.txt Log Message: Macro fix. Bug fix for default server (TCP only option). Index: netrekrc =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- netrekrc 8 Feb 2007 00:39:19 -0000 1.19 +++ netrekrc 12 Feb 2007 06:49:46 -0000 1.20 @@ -722,7 +722,7 @@ macro.0.A:% __ __ ______ __ Want to see some better graphics? macro.0.A:% / \ / /__/_ __/______ / /__ Want a better sounding client? macro.0.A:% / /\ \/ / -_)/ / / __/ -_) '_/ -macro.0.A:% /_/ \__/\__//_/ /_/ \__/_/\_\ XP 2006, v1.1 +macro.0.A:% /_/ \__/\__//_/ /_/ \__/_/\_\ XP 2006, v1.2 macro.0.A:% Get it today at http://www.netrek.org macro.a.A:. o Just | Squeal boy... Index: netrekrc_options.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc_options.txt,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- netrekrc_options.txt 31 Jan 2007 07:06:36 -0000 1.21 +++ netrekrc_options.txt 12 Feb 2007 06:49:46 -0000 1.22 @@ -225,7 +225,7 @@ 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) default server (only listed on TCP metaserver) 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) From modemhero at users.sourceforge.net Mon Feb 12 00:49:48 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 12 Feb 2007 06:49:48 +0000 Subject: [netrek-cvs] client/netrekxp/src parsemeta.c,1.29,1.30 Message-ID: <20070212064957.33BA618682C@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv12303/src Modified Files: parsemeta.c Log Message: Macro fix. Bug fix for default server (TCP only option). Index: parsemeta.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/parsemeta.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- parsemeta.c 31 Jan 2007 07:06:37 -0000 1.29 +++ parsemeta.c 12 Feb 2007 06:49:46 -0000 1.30 @@ -238,6 +238,7 @@ serverlist[num_servers].status = statusDefault; serverlist[num_servers].players = 0; serverlist[num_servers].typeflag = ' '; + strcpy (serverlist[num_servers].comment, ""); num_servers++; } From modemhero at users.sourceforge.net Mon Feb 12 20:17:13 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 13 Feb 2007 02:17:13 +0000 Subject: [netrek-cvs] client/netrekxp clientr.suo,1.65,1.66 Message-ID: <20070213021726.A9401B43D@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv9127 Modified Files: clientr.suo Log Message: Fix ping times > 1 second, prevent overflow. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 Binary files /tmp/cvsmVyGBw and /tmp/cvsuDmrJ8 differ From modemhero at users.sourceforge.net Mon Feb 12 20:17:13 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 13 Feb 2007 02:17:13 +0000 Subject: [netrek-cvs] client/netrekxp/src pingstats.c,1.2,1.3 Message-ID: <20070213021726.A518B186804@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv9127/src Modified Files: pingstats.c Log Message: Fix ping times > 1 second, prevent overflow. Index: pingstats.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/pingstats.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- pingstats.c 7 May 2006 16:59:27 -0000 1.2 +++ pingstats.c 13 Feb 2007 02:17:11 -0000 1.3 @@ -138,7 +138,8 @@ { char buf[6]; - sprintf (buf, "(%3d)", value); /* fix */ + if (value < 1000) sprintf (buf, "(%3d)", value); + else sprintf (buf, ">1sec"); W_WriteText (pStats, STAT_WIDTH - TEXT_WIDTH, y, textColor, buf, 5, W_RegularFont); From modemhero at users.sourceforge.net Mon Feb 12 22:34:34 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 13 Feb 2007 04:34:34 +0000 Subject: [netrek-cvs] client/netrekxp/src pingstats.c,1.3,1.4 Message-ID: <20070213043443.8C1F3186804@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28587/src Modified Files: pingstats.c Log Message: Support for lag up to 10 sec. Index: pingstats.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/pingstats.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- pingstats.c 13 Feb 2007 02:17:11 -0000 1.3 +++ pingstats.c 13 Feb 2007 04:34:32 -0000 1.4 @@ -139,7 +139,8 @@ char buf[6]; if (value < 1000) sprintf (buf, "(%3d)", value); - else sprintf (buf, ">1sec"); + else if (value < 10000) sprintf (buf, " %4d", value); + else sprintf (buf, "> 10s"); W_WriteText (pStats, STAT_WIDTH - TEXT_WIDTH, y, textColor, buf, 5, W_RegularFont); From modemhero at users.sourceforge.net Mon Feb 12 22:34:34 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 13 Feb 2007 04:34:34 +0000 Subject: [netrek-cvs] client/netrekxp clientr.suo,1.66,1.67 Message-ID: <20070213043443.8C99EB432@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28587 Modified Files: clientr.suo Log Message: Support for lag up to 10 sec. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 Binary files /tmp/cvsz3Bvjp and /tmp/cvsiE69jO differ From modemhero at users.sourceforge.net Fri Feb 16 19:58:52 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 17 Feb 2007 01:58:52 +0000 Subject: [netrek-cvs] client/netrekxp clientr.suo,1.67,1.68 Message-ID: <20070217015901.C4E05186811@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv8212 Modified Files: clientr.suo Log Message: Remove Enterprise theme (non-instrumental, jars with other themes). Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 Binary files /tmp/cvsssXung and /tmp/cvsa6eaTh differ From modemhero at users.sourceforge.net Fri Feb 16 19:58:53 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 17 Feb 2007 01:58:53 +0000 Subject: [netrek-cvs] client/netrekxp/resources/sounds intro_theme_ENT.ogg, 1.1, NONE Message-ID: <20070217015902.0A275B451@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/sounds In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv8212/resources/sounds Removed Files: intro_theme_ENT.ogg Log Message: Remove Enterprise theme (non-instrumental, jars with other themes). --- intro_theme_ENT.ogg DELETED --- From modemhero at users.sourceforge.net Fri Feb 16 19:58:52 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 17 Feb 2007 01:58:52 +0000 Subject: [netrek-cvs] client/netrekxp/include sound.h,1.13,1.14 Message-ID: <20070217015901.CEAB6B449@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv8212/include Modified Files: sound.h Log Message: Remove Enterprise theme (non-instrumental, jars with other themes). Index: sound.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/sound.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- sound.h 11 Feb 2007 03:20:58 -0000 1.13 +++ sound.h 17 Feb 2007 01:58:50 -0000 1.14 @@ -110,7 +110,6 @@ INTRO3_MUSIC, INTRO4_MUSIC, INTRO5_MUSIC, - INTRO6_MUSIC, END1_MUSIC, END2_MUSIC, END3_MUSIC, From modemhero at users.sourceforge.net Fri Feb 16 19:58:53 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 17 Feb 2007 01:58:53 +0000 Subject: [netrek-cvs] client/netrekxp/src sound.c,1.23,1.24 Message-ID: <20070217015901.E6FBBB450@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv8212/src Modified Files: sound.c Log Message: Remove Enterprise theme (non-instrumental, jars with other themes). Index: sound.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/sound.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- sound.c 11 Feb 2007 03:20:58 -0000 1.23 +++ sound.c 17 Feb 2007 01:58:50 -0000 1.24 @@ -155,8 +155,7 @@ newmusic[INTRO2_MUSIC] = Mix_LoadMUS(DATAFILE("intro_theme_TNG.ogg")); newmusic[INTRO3_MUSIC] = Mix_LoadMUS(DATAFILE("intro_theme_VOY.ogg")); newmusic[INTRO4_MUSIC] = Mix_LoadMUS(DATAFILE("intro_theme_DS9.ogg")); - newmusic[INTRO5_MUSIC] = Mix_LoadMUS(DATAFILE("intro_theme_ENT.ogg")); - newmusic[INTRO6_MUSIC] = Mix_LoadMUS(DATAFILE("intro_theme_ST2.ogg")); + newmusic[INTRO5_MUSIC] = Mix_LoadMUS(DATAFILE("intro_theme_ST2.ogg")); newmusic[END1_MUSIC] = Mix_LoadMUS(DATAFILE("end_theme_TOS.ogg")); newmusic[END2_MUSIC] = Mix_LoadMUS(DATAFILE("end_theme_TNG.ogg")); newmusic[END3_MUSIC] = Mix_LoadMUS(DATAFILE("end_theme_VOY.ogg")); From modemhero at users.sourceforge.net Wed Feb 21 05:43:40 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 21 Feb 2007 11:43:40 +0000 Subject: [netrek-cvs] client/netrekxp/resources/htmlhelp/html generalconfig.html, 1.23, 1.24 Message-ID: <20070221114350.1BD691867F3@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv17472/resources/htmlhelp/html Modified Files: generalconfig.html Log Message: Added torp to middle mouse button on keymap. Fixed cloak phases to match 10 updates/second that is now the standard for servers. Fixed planet rotate option menu line that was too long. Netrekrc option playerListBlankZeroKills to not display kills for ships with 0.00 kills. Removal of some fixed server issues from todo list. Ping fix (following Quozl). Index: generalconfig.html =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html/generalconfig.html,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- generalconfig.html 31 Jan 2007 07:06:37 -0000 1.23 +++ generalconfig.html 21 Feb 2007 11:43:38 -0000 1.24 @@ -789,6 +789,16 @@ string +playerListBlankZeroKills +Don't display player's kills if they have zero kills + + + + + playerListHack Suppose that players from 'f' and further in playerlist are observers From modemhero at users.sourceforge.net Wed Feb 21 05:43:40 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 21 Feb 2007 11:43:40 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.94, 1.95 clientr.suo, 1.68, 1.69 Message-ID: <20070221114350.1DCC31867FA@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv17472 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Added torp to middle mouse button on keymap. Fixed cloak phases to match 10 updates/second that is now the standard for servers. Fixed planet rotate option menu line that was too long. Netrekrc option playerListBlankZeroKills to not display kills for ships with 0.00 kills. Removal of some fixed server issues from todo list. Ping fix (following Quozl). Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- NetrekXP to do list.C 11 Feb 2007 03:20:56 -0000 1.94 +++ NetrekXP to do list.C 21 Feb 2007 11:43:38 -0000 1.95 @@ -15,9 +15,7 @@ 8) newbie/pret: monitor vs full_hostname 9) on daemon exit in newbie/pret, kill any hosed bot slots 10) end game bots are stupid, and on timericide don't act right -11) if obs in game when merlin quits, queues still open..should be closed dammit 12) final planet count and cscore would be nice in pw_stats -13) add auto guest# name generation for INL server 14) sysdef option for base orbit enemy planets 15) phaser misses have the client computer phaser length, but with phaser upgrades, this causes a mismatch in the actual phaser length for other players. Server needs Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.68 retrieving revision 1.69 diff -u -d -r1.68 -r1.69 Binary files /tmp/cvsjoRxU5 and /tmp/cvsKVLw25 differ From modemhero at users.sourceforge.net Wed Feb 21 05:43:40 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 21 Feb 2007 11:43:40 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h, 1.44, 1.45 defs.h, 1.10, 1.11 Message-ID: <20070221114350.092F7B402@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv17472/include Modified Files: data.h defs.h Log Message: Added torp to middle mouse button on keymap. Fixed cloak phases to match 10 updates/second that is now the standard for servers. Fixed planet rotate option menu line that was too long. Netrekrc option playerListBlankZeroKills to not display kills for ships with 0.00 kills. Removal of some fixed server issues from todo list. Ping fix (following Quozl). Index: defs.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/defs.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- defs.h 25 Jun 2006 08:19:40 -0000 1.10 +++ defs.h 21 Feb 2007 11:43:38 -0000 1.11 @@ -41,7 +41,7 @@ * windows */ #define THICKBORDER 3 /* Thicker border for windows */ #define PSEUDOSIZE 16 -#define CLOAK_PHASES 7 /* number of drawing phases +#define CLOAK_PHASES 12 /* number of drawing phases * in a cloak * engage/disengage */ #define NUMRANKS 9 Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- data.h 31 Jan 2007 07:06:36 -0000 1.44 +++ data.h 21 Feb 2007 11:43:38 -0000 1.45 @@ -404,6 +404,7 @@ extern int showIND; extern int newPlist; +extern int playerListBlankZeroKills; extern int playerListHack; From modemhero at users.sourceforge.net Wed Feb 21 05:43:41 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 21 Feb 2007 11:43:41 +0000 Subject: [netrek-cvs] client/netrekxp/src/winkey winkey.suo,1.1,1.2 Message-ID: <20070221114350.4518F186804@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src/winkey In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv17472/src/winkey Modified Files: winkey.suo Log Message: Added torp to middle mouse button on keymap. Fixed cloak phases to match 10 updates/second that is now the standard for servers. Fixed planet rotate option menu line that was too long. Netrekrc option playerListBlankZeroKills to not display kills for ships with 0.00 kills. Removal of some fixed server issues from todo list. Ping fix (following Quozl). Index: winkey.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/winkey/winkey.suo,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsPUb0UU and /tmp/cvsYJDFIW differ From modemhero at users.sourceforge.net Wed Feb 21 05:43:41 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 21 Feb 2007 11:43:41 +0000 Subject: [netrek-cvs] client/netrekxp/src data.c, 1.48, 1.49 defaults.c, 1.40, 1.41 option.c, 1.24, 1.25 ping.c, 1.3, 1.4 playerlist.c, 1.8, 1.9 Message-ID: <20070221114350.5887618680D@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv17472/src Modified Files: data.c defaults.c option.c ping.c playerlist.c Log Message: Added torp to middle mouse button on keymap. Fixed cloak phases to match 10 updates/second that is now the standard for servers. Fixed planet rotate option menu line that was too long. Netrekrc option playerListBlankZeroKills to not display kills for ships with 0.00 kills. Removal of some fixed server issues from todo list. Ping fix (following Quozl). Index: ping.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/ping.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ping.c 7 May 2006 16:59:27 -0000 1.3 +++ ping.c 21 Feb 2007 11:43:38 -0000 1.4 @@ -120,8 +120,15 @@ if (gwrite (s, (char *) &packet, sizeof (struct ping_cpacket)) != sizeof (struct ping_cpacket)) { - LineToConsole ("gwrite failed.\n"); - serverDead = 1; + if (s == udpSock) { + s = sock; + if (gwrite(s, (char *) &packet, sizeof(struct ping_cpacket)) != + sizeof (struct ping_cpacket)) + { + serverDead = 1; + LineToConsole("gwrite failed again.\n"); + } + } } } Index: playerlist.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/playerlist.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- playerlist.c 7 May 2006 21:10:52 -0000 1.8 +++ playerlist.c 21 Feb 2007 11:43:38 -0000 1.9 @@ -1141,7 +1141,16 @@ case 'K': /* Kills */ if (*(ptr + 1) >= '0' && *(ptr + 1) <= '2') { - if (j->p_kills > 100.0) + if (j->p_kills == 0.00 && playerListBlankZeroKills) + { + if (*(ptr + 1) == '0') + format (buffPoint, " ", 3, 0); + else if (*(ptr + 1) == '1') + format (buffPoint, " ", 4, 0); + else + format (buffPoint, " ", 5, 0); + } + else if (j->p_kills >= 100.0) /* Cheat a bit */ ftoa (j->p_kills, buffPoint - 1, 0, 3, (*(ptr + 1) - '0')); else @@ -1151,7 +1160,9 @@ } else { - if (j->p_kills > 100.0) + if (j->p_kills == 0.00 && playerListBlankZeroKills) + format (buffPoint, " ", 5, 0); + else if (j->p_kills >= 100.0) /* Cheat a bit */ ftoa (j->p_kills, buffPoint - 1, 0, 3, 2); else Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- defaults.c 7 Feb 2007 23:04:57 -0000 1.40 +++ defaults.c 21 Feb 2007 11:43:38 -0000 1.41 @@ -431,6 +431,12 @@ NULL } }, + {"playerListBlankZeroKills", &playerListBlankZeroKills, RC_BOOL, + { + "Don't display player's kills if they have zero kills", + NULL + } + }, {"playerListHack", &playerListHack, RC_BOOL, { "Suppose that players with letter greater than \'f\' are observers", @@ -1545,6 +1551,8 @@ saveRCM = booleanDefault ("saveRCM", saveRCM); #endif + playerListBlankZeroKills = + booleanDefault ("playerListBlankZeroKills", playerListBlankZeroKills); playerListHack = booleanDefault ("playerListHack", playerListHack); keepInfo = intDefault ("keepInfo", keepInfo); showPlanetOwner = booleanDefault ("showPlanetOwner", showPlanetOwner); Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- data.c 31 Jan 2007 07:06:37 -0000 1.48 +++ data.c 21 Feb 2007 11:43:38 -0000 1.49 @@ -423,6 +423,7 @@ int showIND = 0; int newPlist = 0; +int playerListBlankZeroKills = 1; int playerListHack = 0; int playerListMessaging = 1; Index: option.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/option.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- option.c 25 Jun 2006 08:19:40 -0000 1.24 +++ option.c 21 Feb 2007 11:43:38 -0000 1.25 @@ -284,7 +284,7 @@ {1, "", &planetBitmap, 0, 0, 0, planetbitmapmess, &planetbitmaprange}, {1, "", &planetBitmapGalaxy, 0, 0, 0, planetbitmapgalaxymess, &planetbitmapgalaxyrange}, {1, "highlight planets", &planetHighlighting, 0, 0, 0, NULL, NULL}, - {1, "rotate planets (new planets only)", &rotatePlanets, 0, 0, 0, NULL, NULL}, + {1, "rotate new planets", &rotatePlanets, 0, 0, 0, NULL, NULL}, {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}, @@ -365,6 +365,7 @@ {1, "put my team first in the list", &sortMyTeamFirst, 0, 0, 0, NULL, 0}, {1, "partition the playerlist", &partitionPlist, 0, 0, 0, NULL, 0}, {1, "", &playerListObserver, 0, 0, 0, playerlistobservermess, &playerlistobserver_range}, + {1, "blank zero kills", &playerListBlankZeroKills, 0, 0, 0, NULL, 0}, {1, "hack player list", &playerListHack, 0, 0, 0, NULL, 0}, {1, "done", ¬done, 0, 0, 0, NULL, NULL}, {-1, NULL, 0, 0, 0, 0, NULL, NULL} From modemhero at users.sourceforge.net Wed Feb 21 05:43:40 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 21 Feb 2007 11:43:40 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.104, 1.105 netrekrc, 1.20, 1.21 netrekrc_options.txt, 1.22, 1.23 Message-ID: <20070221114350.1F6471867FB@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv17472/resources/docs Modified Files: changes.txt netrekrc netrekrc_options.txt Log Message: Added torp to middle mouse button on keymap. Fixed cloak phases to match 10 updates/second that is now the standard for servers. Fixed planet rotate option menu line that was too long. Netrekrc option playerListBlankZeroKills to not display kills for ships with 0.00 kills. Removal of some fixed server issues from todo list. Ping fix (following Quozl). Index: netrekrc =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- netrekrc 12 Feb 2007 06:49:46 -0000 1.20 +++ netrekrc 21 Feb 2007 11:43:38 -0000 1.21 @@ -5,7 +5,7 @@ login: netrek_player # Mouse button mapping -buttonmap: 1P2k +buttonmap: 1P2f3k # Key mapping keymap: PpW Zva%d_eyftg^jmnrpPrls3tfuwvDwsye d @@ -224,6 +224,9 @@ # Highlight galactic planets by race and army status planetHighlighting: on +# Don't display player's kills if they have zero kills +playerListBlankZeroKills: on + # Suppose that players with letter greater than 'f' are observers playerListHack: off Index: netrekrc_options.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc_options.txt,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- netrekrc_options.txt 12 Feb 2007 06:49:46 -0000 1.22 +++ netrekrc_options.txt 21 Feb 2007 11:43:38 -0000 1.23 @@ -187,6 +187,7 @@ # 'W' - Wins playerList2: (string) custom layout for alternate player list window (same as playerlist) +playerListBlankZeroKills: (on/off) don't display player's kills if they have zero kills playerListHack: (on/off) if player's letter is greater than 'f' suppose that the player is observer. playerListMessaging: (on/off) allow messages to be sent to players by clicking player Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.104 retrieving revision 1.105 diff -u -d -r1.104 -r1.105 --- changes.txt 11 Feb 2007 03:20:58 -0000 1.104 +++ changes.txt 21 Feb 2007 11:43:38 -0000 1.105 @@ -1,4 +1,7 @@ Netrek XP 2006, Version 1.2: (Released Feb-2007) +- added "playerListBlankZeroKills: (on)/off" to choose whether or not to display 0.00 kills + in the player list. +- fixed cloak/decloak cycling so that it animates properly at 10 updates/second. - sound and music volume are now independent of Windows sound volume, i.e. changing game volume with the in game raise/lower volume keys does not change system WAV volume (newSound only). From modemhero at users.sourceforge.net Wed Feb 21 09:17:10 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 21 Feb 2007 15:17:10 +0000 Subject: [netrek-cvs] client/netrekxp/src data.c, 1.49, 1.50 defaults.c, 1.41, 1.42 enter.c, 1.3, 1.4 newwin.c, 1.46, 1.47 option.c, 1.25, 1.26 playerlist.c, 1.9, 1.10 rotate.c, 1.2, 1.3 Message-ID: <20070221151730.B49D7B402@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23891/src Modified Files: data.c defaults.c enter.c newwin.c option.c playerlist.c rotate.c Log Message: New option autoRotate to make it so teams are always on left hand side of galaxy. Upon entering game, a new function, rotateTeams(), is called if autoRotate is set. It aligns the teams so they are on the left side of map, then calls a new function, rotateGalaxy(), to perform the galactic rotation. This function is placed in rotate.c and is the code formerly in option.c to perform galaxy rotations via the options menu (this method still works). Fix so geno bitmap doesn't get overwritten by MOTD if window is minimized/moved. Index: rotate.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/rotate.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- rotate.c 7 May 2006 16:59:27 -0000 1.2 +++ rotate.c 21 Feb 2007 15:17:08 -0000 1.3 @@ -13,6 +13,7 @@ #include "struct.h" #include "data.h" #include "packets.h" +#include "map.h" #include "proto.h" #ifdef ROTATERACE @@ -85,4 +86,61 @@ } } +void +rotateGalaxy (void) +{ + register i; + register struct planet *l; + register struct player *j; + + redrawall = 1; + reinitPlanets = 1; + + for (i = 0, l = planets; i < MAXPLANETS; i++, l++) + { + if (rotate) + { + rotate_deg = -old_rotate_deg + rotate * 64; + rotate_coord (&l->pl_x, &l->pl_y, rotate_deg, GWIDTH / 2, + GWIDTH / 2); + rotate_deg = rotate * 64; + } + else + { + rotate_deg = -old_rotate_deg; + rotate_coord (&l->pl_x, &l->pl_y, rotate_deg, GWIDTH / 2, + GWIDTH / 2); + rotate_deg = 0; + } + } + + /* we could wait for the server to do this but looks better if we + * do it now. */ + for (i = 0, j = players; i < MAXPLAYER; i++, j++) + { + if (j->p_status != PALIVE) + continue; + if (rotate) + { + rotate_deg = -old_rotate_deg + rotate * 64; + rotate_coord (&j->p_x, &j->p_y, rotate_deg, + GWIDTH / 2, GWIDTH / 2); + rotate_dir (&j->p_dir, rotate_deg); + + rotate_deg = rotate * 64; + } + else + { + rotate_deg = -old_rotate_deg; + rotate_coord (&j->p_x, &j->p_y, rotate_deg, + GWIDTH / 2, GWIDTH / 2); + rotate_dir (&j->p_dir, rotate_deg); + rotate_deg = 0; + } + } + /* phasers/torps/etc .. wait for server */ + + old_rotate = rotate; + old_rotate_deg = rotate_deg; +} #endif Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- newwin.c 31 Jan 2007 07:06:37 -0000 1.46 +++ newwin.c 21 Feb 2007 15:17:06 -0000 1.47 @@ -1659,7 +1659,8 @@ } else if (event.Window == w) { - showMotdWin (w, line); + if (me->p_whydead != KWINNER && me->p_whydead != KGENOCIDE) + showMotdWin (w, line); } else if (event.Window == helpWin) #ifdef RECORDGAME Index: enter.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/enter.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- enter.c 7 May 2006 16:59:27 -0000 1.3 +++ enter.c 21 Feb 2007 15:17:06 -0000 1.4 @@ -31,6 +31,10 @@ void enter (void) { +#ifdef ROTATERACE + if (autoRotate) + rotateTeams(); +#endif drawTstats (); delay = 0; } @@ -98,6 +102,81 @@ } } +#ifdef ROTATERACE +/******************************************************************************/ +/*** rotateTeams() ***/ +/*** Place 2 largest teams on left hand side of galaxy ***/ +/******************************************************************************/ +void +rotateTeams (void) +{ + int i; + int playercount = 0; + int largestteam = -1, nextlargestteam= -1; + int largestteamcount = 0, nextlargestteamcount = 0; + + /* Find the 2 largest teams (hopefully) */ + for (i = 0; i < 4; i++) + { + if ((playercount = realNumShips(1 << i)) == 0) + continue; + if (playercount > largestteamcount) + { + nextlargestteam = largestteam; + nextlargestteamcount = largestteamcount; + largestteam = i; + largestteamcount = playercount; + } + else if (playercount > nextlargestteamcount) + { + nextlargestteam = i; + nextlargestteamcount = playercount; + } + } + /* Server empty or only 1 team? Don't rotate. */ + if (largestteam < 0 || nextlargestteam < 0) + return; + + /* 2 largest teams are diagonal (possible before T mode), i.e. FED-KLI + or ROM-ORI? Don't rotate. Team order is FED ROM KLI ORI */ + if ((largestteam - nextlargestteam) == 2 || (largestteam - nextlargestteam) == -2) + return; + + /* Determine how many degrees needed to rotate galaxy so both teams + on left side of the map, and set global rotate value accordingly */ + switch (largestteam) + { + case 0: /* FED */ + if (nextlargestteam == 3) /* FED-ORI */ + rotate = 1; + break; + case 1: /* ROM */ + if (nextlargestteam == 2) /* ROM-KLI */ + rotate = 3; + break; + case 2: /* KLI */ + if (nextlargestteam == 1) /* KLI-ROM */ + rotate = 3; + else if (nextlargestteam == 3) /* KLI-ORI */ + rotate = 2; + break; + case 3: /* ORI */ + if (nextlargestteam == 1) /* ORI-FED */ + rotate = 1; + else if (nextlargestteam == 2) /* ORI-KLI */ + rotate = 2; + break; + default: + break; + } + + /* Perform rotation if necessary */ + if (rotate != old_rotate) + rotateGalaxy(); + return; +} +#endif + /******************************************************************************/ /*** drawTstats() ***/ /******************************************************************************/ Index: playerlist.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/playerlist.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- playerlist.c 21 Feb 2007 11:43:38 -0000 1.9 +++ playerlist.c 21 Feb 2007 15:17:07 -0000 1.10 @@ -1141,7 +1141,7 @@ case 'K': /* Kills */ if (*(ptr + 1) >= '0' && *(ptr + 1) <= '2') { - if (j->p_kills == 0.00 && playerListBlankZeroKills) + if (j->p_kills == 0.00 && playerListBlankZeroKills) { if (*(ptr + 1) == '0') format (buffPoint, " ", 3, 0); Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- defaults.c 21 Feb 2007 11:43:38 -0000 1.41 +++ defaults.c 21 Feb 2007 15:17:05 -0000 1.42 @@ -66,6 +66,14 @@ NULL } }, +#ifdef ROTATERACE + {"autoRotate", &autoRotate, RC_BOOL, + { + "Automatically rotate galaxy so teams are on left side of map", + NULL + } + }, +#endif {"baseUdpLocalPort", &baseUdpLocalPort, RC_INT, { "Base UDP local port", @@ -1564,6 +1572,7 @@ redrawDelay = intDefault ("redrawDelay", redrawDelay); planetHighlighting = booleanDefault ("planetHighlighting", planetHighlighting); rotatePlanets = booleanDefault ("rotatePlanets", rotatePlanets); + autoRotate = booleanDefault ("autoRotate", autoRotate); logging = booleanDefault ("logging", logging); maxScrollLines = intDefault ("maxScrollLines", maxScrollLines); if (maxScrollLines > 500) Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- data.c 21 Feb 2007 11:43:38 -0000 1.49 +++ data.c 21 Feb 2007 15:17:05 -0000 1.50 @@ -128,9 +128,11 @@ int promoted = 0; #ifdef ROTATERACE +int autoRotate = 0; int rotate = 0; int rotate_deg = 0; - +int old_rotate = 0; +int old_rotate_deg = 0; #endif int loginAccept = -1; Index: option.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/option.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- option.c 21 Feb 2007 11:43:38 -0000 1.25 +++ option.c 21 Feb 2007 15:17:07 -0000 1.26 @@ -25,10 +25,6 @@ int notdone; /* not done flag */ -#ifdef ROTATERACE -static int old_rotate, old_rotate_deg; -#endif - static int lastUpdateSpeed = 10; static char newkeys[14]; @@ -293,6 +289,7 @@ {1, "", &agriColor, 0, 0, 0, agricolormess, NULL}, {1, "", &showLock, 0, 0, 0, lockoptions, NULL}, #ifdef ROTATERACE + {1, "autorotate galaxy", &autoRotate, 0, 0, 0, NULL, NULL}, {1, "", &rotate, 0, 0, 0, rotatemess, NULL}, #endif {1, "done", ¬done, 0, 0, 0, NULL, NULL}, @@ -788,63 +785,8 @@ } #ifdef ROTATERACE else if (rotate != old_rotate) - { - register i; - register struct planet *l; - register struct player *j; - - redrawall = 1; - reinitPlanets = 1; - - for (i = 0, l = planets; i < MAXPLANETS; i++, l++) - { - if (rotate) - { - rotate_deg = -old_rotate_deg + rotate * 64; - rotate_coord (&l->pl_x, &l->pl_y, rotate_deg, GWIDTH / 2, - GWIDTH / 2); - rotate_deg = rotate * 64; - } - else - { - rotate_deg = -old_rotate_deg; - rotate_coord (&l->pl_x, &l->pl_y, rotate_deg, GWIDTH / 2, - GWIDTH / 2); - rotate_deg = 0; - } - } - - /* we could wait for the server to do this but looks better if we - * do it now. */ - for (i = 0, j = players; i < MAXPLAYER; i++, j++) - { - if (j->p_status != PALIVE) - continue; - if (rotate) - { - rotate_deg = -old_rotate_deg + rotate * 64; - rotate_coord (&j->p_x, &j->p_y, rotate_deg, - GWIDTH / 2, GWIDTH / 2); - rotate_dir (&j->p_dir, rotate_deg); - - rotate_deg = rotate * 64; - } - else - { - rotate_deg = -old_rotate_deg; - rotate_coord (&j->p_x, &j->p_y, rotate_deg, - GWIDTH / 2, GWIDTH / 2); - rotate_dir (&j->p_dir, rotate_deg); - rotate_deg = 0; - } - } - /* phasers/torps/etc .. wait for server */ - - old_rotate = rotate; - old_rotate_deg = rotate_deg; - } + rotateGalaxy(); #endif - } From modemhero at users.sourceforge.net Wed Feb 21 09:17:07 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 21 Feb 2007 15:17:07 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.105, 1.106 netrekrc, 1.21, 1.22 netrekrc_options.txt, 1.23, 1.24 Message-ID: <20070221151750.1BA141867FA@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23891/resources/docs Modified Files: changes.txt netrekrc netrekrc_options.txt Log Message: New option autoRotate to make it so teams are always on left hand side of galaxy. Upon entering game, a new function, rotateTeams(), is called if autoRotate is set. It aligns the teams so they are on the left side of map, then calls a new function, rotateGalaxy(), to perform the galactic rotation. This function is placed in rotate.c and is the code formerly in option.c to perform galaxy rotations via the options menu (this method still works). Fix so geno bitmap doesn't get overwritten by MOTD if window is minimized/moved. Index: netrekrc =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- netrekrc 21 Feb 2007 11:43:38 -0000 1.21 +++ netrekrc 21 Feb 2007 15:17:03 -0000 1.22 @@ -29,6 +29,9 @@ # Autoquit timer (default 60) autoQuit: 60 +# Automatically rotate galaxy so teams are on left side of map +autoRotate: off + # Base UDP local port baseUdpLocalPort: 0 Index: netrekrc_options.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc_options.txt,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- netrekrc_options.txt 21 Feb 2007 11:43:38 -0000 1.23 +++ netrekrc_options.txt 21 Feb 2007 15:17:04 -0000 1.24 @@ -9,6 +9,7 @@ allowWheelActions: (on/off) allow mouse wheel to work in non-scrolling windows autoQuit: (int) autoquit time after death +autoRotate: (on/off) automatically rotate galaxy so teams are on left side of map b1keymap: (string) keymap for mouse button 1 (mouseAsShift=on) b2keymap: (string) keymap for mouse button 2 (mouseAsShift=on) b3keymap: (string) keymap for mouse button 3 (mouseAsShift=on) Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.105 retrieving revision 1.106 diff -u -d -r1.105 -r1.106 --- changes.txt 21 Feb 2007 11:43:38 -0000 1.105 +++ changes.txt 21 Feb 2007 15:17:03 -0000 1.106 @@ -1,4 +1,6 @@ Netrek XP 2006, Version 1.2: (Released Feb-2007) +- added "autoRotate: on/(off)" to automatically rotate the galaxy when you enter so that + your team and largest other team are on the left hand side of the galaxy, if possible. - added "playerListBlankZeroKills: (on)/off" to choose whether or not to display 0.00 kills in the player list. - fixed cloak/decloak cycling so that it animates properly at 10 updates/second. From modemhero at users.sourceforge.net Wed Feb 21 09:17:07 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 21 Feb 2007 15:17:07 +0000 Subject: [netrek-cvs] client/netrekxp/resources/htmlhelp/html generalconfig.html, 1.24, 1.25 Message-ID: <20070221151753.C00A41867F3@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23891/resources/htmlhelp/html Modified Files: generalconfig.html Log Message: New option autoRotate to make it so teams are always on left hand side of galaxy. Upon entering game, a new function, rotateTeams(), is called if autoRotate is set. It aligns the teams so they are on the left side of map, then calls a new function, rotateGalaxy(), to perform the galactic rotation. This function is placed in rotate.c and is the code formerly in option.c to perform galaxy rotations via the options menu (this method still works). Fix so geno bitmap doesn't get overwritten by MOTD if window is minimized/moved. Index: generalconfig.html =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html/generalconfig.html,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- generalconfig.html 21 Feb 2007 11:43:38 -0000 1.24 +++ generalconfig.html 21 Feb 2007 15:17:05 -0000 1.25 @@ -51,6 +51,16 @@ integer
default: 60 +autoRotate +Automatically rotate galaxy so teams are on left side of map + + + + + baseUdpLocalPort Base port for UDP connections integer
default: 0 From modemhero at users.sourceforge.net Wed Feb 21 09:17:05 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 21 Feb 2007 15:17:05 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h, 1.45, 1.46 proto.h, 1.29, 1.30 Message-ID: <20070221151749.941761867F3@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23891/include Modified Files: data.h proto.h Log Message: New option autoRotate to make it so teams are always on left hand side of galaxy. Upon entering game, a new function, rotateTeams(), is called if autoRotate is set. It aligns the teams so they are on the left side of map, then calls a new function, rotateGalaxy(), to perform the galactic rotation. This function is placed in rotate.c and is the code formerly in option.c to perform galaxy rotations via the options menu (this method still works). Fix so geno bitmap doesn't get overwritten by MOTD if window is minimized/moved. Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- data.h 21 Feb 2007 11:43:38 -0000 1.45 +++ data.h 21 Feb 2007 15:17:02 -0000 1.46 @@ -130,9 +130,11 @@ #endif #ifdef ROTATERACE +extern int autoRotate; extern int rotate; extern int rotate_deg; - +extern int old_rotate; +extern int old_rotate_deg; #endif extern int updatesPerSec; Index: proto.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- proto.h 1 Feb 2007 00:10:27 -0000 1.29 +++ proto.h 21 Feb 2007 15:17:02 -0000 1.30 @@ -160,6 +160,7 @@ /******************************************************************************/ void enter (void); void openmem (void); +void rotateTeams (void); void drawTstats (void); #ifdef HOCKEY_LINES int hockey_mode (void); @@ -937,6 +938,7 @@ int d, int cx, int cy); +void rotateGalaxy (void); /******************************************************************************/ /*** rsa_box.c From modemhero at users.sourceforge.net Wed Feb 21 09:17:04 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 21 Feb 2007 15:17:04 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.95, 1.96 clientr.suo, 1.69, 1.70 Message-ID: <20070221151752.3B322B42C@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23891 Modified Files: NetrekXP to do list.C clientr.suo Log Message: New option autoRotate to make it so teams are always on left hand side of galaxy. Upon entering game, a new function, rotateTeams(), is called if autoRotate is set. It aligns the teams so they are on the left side of map, then calls a new function, rotateGalaxy(), to perform the galactic rotation. This function is placed in rotate.c and is the code formerly in option.c to perform galaxy rotations via the options menu (this method still works). Fix so geno bitmap doesn't get overwritten by MOTD if window is minimized/moved. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.95 retrieving revision 1.96 diff -u -d -r1.95 -r1.96 --- NetrekXP to do list.C 21 Feb 2007 11:43:38 -0000 1.95 +++ NetrekXP to do list.C 21 Feb 2007 15:16:59 -0000 1.96 @@ -47,6 +47,8 @@ 9) Out of bounds message window calcs don't work with taskbar or menu bar, basewin rect doesn't take these into account. 10) Make sure all ping related fields are switched correctly via metasort. +11) if galaxy is rotated, have your ship spawn facing your t mode (or most populated enemy) +homeworld, not just facing the same degree of galaxy rotation Stas's list: - color coded playerlist. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.69 retrieving revision 1.70 diff -u -d -r1.69 -r1.70 Binary files /tmp/cvs91UbiB and /tmp/cvsSgy5gr differ From modemhero at users.sourceforge.net Wed Feb 21 11:27:03 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 21 Feb 2007 17:27:03 +0000 Subject: [netrek-cvs] client/netrekxp clientr.suo,1.70,1.71 Message-ID: <20070221172716.785841867F1@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv6371 Modified Files: clientr.suo Log Message: Cut starting sound and music volume from max volume to half volume. Was too loud. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.70 retrieving revision 1.71 diff -u -d -r1.70 -r1.71 Binary files /tmp/cvs1Q3KFo and /tmp/cvstJRP5T differ From modemhero at users.sourceforge.net Wed Feb 21 11:27:04 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 21 Feb 2007 17:27:04 +0000 Subject: [netrek-cvs] client/netrekxp/src sound.c,1.24,1.25 Message-ID: <20070221172716.72691B402@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv6371/src Modified Files: sound.c Log Message: Cut starting sound and music volume from max volume to half volume. Was too loud. Index: sound.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/sound.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- sound.c 17 Feb 2007 01:58:50 -0000 1.24 +++ sound.c 21 Feb 2007 17:27:01 -0000 1.25 @@ -217,6 +217,10 @@ if (Mix_OpenAudio(22050, AUDIO_S16SYS, 2, 1024) < 0) LineToConsole("Mix_OpenAudio: %s\n", Mix_GetError()); + /* Set sound and music volume to half (128 is MAXVOLUME) */ + Mix_Volume(-1, 64); + Mix_VolumeMusic(64); + /* Toggle on sound, and load sound files */ sound_toggle = 1; loadSounds(); From modemhero at users.sourceforge.net Wed Feb 21 23:18:20 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 22 Feb 2007 05:18:20 +0000 Subject: [netrek-cvs] client/netrekxp clientr.suo,1.71,1.72 Message-ID: <20070222051831.1CA1DB435@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv2898 Modified Files: clientr.suo Log Message: Remove sound_init if open audio device fails, and break out of sound initiliazation, as some SDL function like Mix_Volume and Mix_PlayMusic will cause a client crash if no audio device. Oddly, other SDL functions like Mix_PlayChannel seemed to just spit an error message but not cause a crash. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.71 retrieving revision 1.72 diff -u -d -r1.71 -r1.72 Binary files /tmp/cvsgjHCHT and /tmp/cvsVcTKf3 differ From modemhero at users.sourceforge.net Wed Feb 21 23:18:20 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 22 Feb 2007 05:18:20 +0000 Subject: [netrek-cvs] client/netrekxp/src sound.c,1.25,1.26 Message-ID: <20070222051831.201EE1867E0@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv2898/src Modified Files: sound.c Log Message: Remove sound_init if open audio device fails, and break out of sound initiliazation, as some SDL function like Mix_Volume and Mix_PlayMusic will cause a client crash if no audio device. Oddly, other SDL functions like Mix_PlayChannel seemed to just spit an error message but not cause a crash. Index: sound.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/sound.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- sound.c 21 Feb 2007 17:27:01 -0000 1.25 +++ sound.c 22 Feb 2007 05:18:18 -0000 1.26 @@ -214,8 +214,12 @@ atexit(SDL_Quit); /* Open the audio device at 22050 Hz 8 bit Microsoft PCM with stereo */ - if (Mix_OpenAudio(22050, AUDIO_S16SYS, 2, 1024) < 0) + if (Mix_OpenAudio(22050, AUDIO_S16SYS, 2, 1024) < 0) + { LineToConsole("Mix_OpenAudio: %s\n", Mix_GetError()); + sound_init = 0; + return; + } /* Set sound and music volume to half (128 is MAXVOLUME) */ Mix_Volume(-1, 64); From modemhero at users.sourceforge.net Thu Feb 22 10:22:15 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 22 Feb 2007 16:22:15 +0000 Subject: [netrek-cvs] client/netrekxp/src/cursors curslib.suo,1.3,1.4 Message-ID: <20070222162224.B84CBB435@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src/cursors In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv15029/src/cursors Modified Files: curslib.suo Log Message: Following COW changes, added fps feature packet support, still needs some work. data.c, data.h, feature.c: add support for FPS server-only feature, not a client requested feature. local.c: use the new fps variable to correct animation time for cloak and explosion. local.c: change explosion sound to trigger off p_explode rather than the counter variable i, which now increments more slowly at higher fps. Was causing explosion sound to be played 5 times in a row. Index: curslib.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/cursors/curslib.suo,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 Binary files /tmp/cvsqRCoRY and /tmp/cvsGVXgSw differ From modemhero at users.sourceforge.net Thu Feb 22 10:22:15 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 22 Feb 2007 16:22:15 +0000 Subject: [netrek-cvs] client/netrekxp/src data.c, 1.50, 1.51 feature.c, 1.4, 1.5 local.c, 1.51, 1.52 Message-ID: <20070222162225.A8A55B436@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv15029/src Modified Files: data.c feature.c local.c Log Message: Following COW changes, added fps feature packet support, still needs some work. data.c, data.h, feature.c: add support for FPS server-only feature, not a client requested feature. local.c: use the new fps variable to correct animation time for cloak and explosion. local.c: change explosion sound to trigger off p_explode rather than the counter variable i, which now increments more slowly at higher fps. Was causing explosion sound to be played 5 times in a row. Index: feature.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/feature.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- feature.c 12 Dec 2006 04:47:08 -0000 1.4 +++ feature.c 22 Feb 2007 16:22:13 -0000 1.5 @@ -171,6 +171,12 @@ /* special cases: */ if (strcmpi (packet->name, "FEATURE_PACKETS") == 0) reportFeatures (); + if (strcmpi (packet->name, "FPS") == 0 && value != -1) + { + fps = value; + LineToConsole("Receiving %d frames per second from the server.\n", fps); + } + if ((strcmpi (packet->name, "RC_DISTRESS") == 0) && gen_distress) distmacro = dist_prefered; Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- local.c 8 Feb 2007 08:34:43 -0000 1.51 +++ local.c 22 Feb 2007 16:22:13 -0000 1.52 @@ -53,7 +53,8 @@ static int new_other_plasma_dist = 0; static int other_plasma_angle = 0; static int warpchange = 0; -static unsigned int twarpflag = 0; +static unsigned int twarpflag = 0; +static int cloak_phases = 0; #endif /* Background Stars Definitions */ @@ -708,10 +709,11 @@ dx = dx / SCALE + WINSIDE / 2; dy = dy / SCALE + WINSIDE / 2; - + + cloak_phases = CLOAK_PHASES * fps / 10; if (j->p_flags & PFCLOAK) { - if (j->p_cloakphase < (CLOAK_PHASES - 1)) + if (j->p_cloakphase < (cloak_phases - 1)) { #ifdef SOUND @@ -767,7 +769,7 @@ { if (newSound) { - if (j->p_cloakphase == CLOAK_PHASES - 1) + if (j->p_cloakphase == cloak_phases - 1) { newdx = dx - WINSIDE/2; newdy = dy - WINSIDE/2; @@ -798,7 +800,7 @@ { if (myPlayer(j) || isObsLockPlayer(j)) { - if (j->p_cloakphase == CLOAK_PHASES - 1) + if (j->p_cloakphase == cloak_phases - 1) Play_Sound(UNCLOAK_SOUND); else Abort_Sound(CLOAK_SOUND); @@ -813,7 +815,7 @@ /* If cloaking cycle is complete, just draw the cloak icon, and skip over the ship drawing code with the goto statement */ - if (j->p_flags & PFCLOAK && (j->p_cloakphase == (CLOAK_PHASES - 1))) + if (j->p_flags & PFCLOAK && (j->p_cloakphase == (cloak_phases - 1))) { if (myPlayer (j) #ifdef RECORDGAME @@ -1317,10 +1319,10 @@ { int i; - i = j->p_explode; + i = j->p_explode * 10 / fps; #ifdef SOUND - if (i == 1) + if (j->p_explode == 1) { if (newSound) { @@ -1710,7 +1712,7 @@ if (tractee->p_status != PALIVE || ((tractee->p_flags & PFCLOAK) && - (tractee->p_cloakphase == (CLOAK_PHASES - 1)))) + (tractee->p_cloakphase == (cloak_phases - 1)))) { continue; } Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- data.c 21 Feb 2007 15:17:05 -0000 1.50 +++ data.c 22 Feb 2007 16:22:13 -0000 1.51 @@ -680,6 +680,8 @@ int portSwap = 0; #endif +int fps = 10; + // Load Ship Bitmaps from .BMP files char *fed_ship_bmp; char *rom_ship_bmp; From modemhero at users.sourceforge.net Thu Feb 22 10:22:14 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 22 Feb 2007 16:22:14 +0000 Subject: [netrek-cvs] client/netrekxp clientr.suo,1.72,1.73 Message-ID: <20070222162224.C6AD51867E9@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv15029 Modified Files: clientr.suo Log Message: Following COW changes, added fps feature packet support, still needs some work. data.c, data.h, feature.c: add support for FPS server-only feature, not a client requested feature. local.c: use the new fps variable to correct animation time for cloak and explosion. local.c: change explosion sound to trigger off p_explode rather than the counter variable i, which now increments more slowly at higher fps. Was causing explosion sound to be played 5 times in a row. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.72 retrieving revision 1.73 diff -u -d -r1.72 -r1.73 Binary files /tmp/cvs4mSLaP and /tmp/cvsSNLiCm differ From modemhero at users.sourceforge.net Thu Feb 22 10:22:14 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 22 Feb 2007 16:22:14 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h,1.46,1.47 Message-ID: <20070222162224.C5AEE1867E6@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv15029/include Modified Files: data.h Log Message: Following COW changes, added fps feature packet support, still needs some work. data.c, data.h, feature.c: add support for FPS server-only feature, not a client requested feature. local.c: use the new fps variable to correct animation time for cloak and explosion. local.c: change explosion sound to trigger off p_explode rather than the counter variable i, which now increments more slowly at higher fps. Was causing explosion sound to be played 5 times in a row. Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- data.h 21 Feb 2007 15:17:02 -0000 1.46 +++ data.h 22 Feb 2007 16:22:12 -0000 1.47 @@ -575,6 +575,8 @@ extern int portSwap; #endif +extern int fps; + // Load Ship Bitmaps from .BMP files extern char *fed_ship_bmp; extern char *rom_ship_bmp; From modemhero at users.sourceforge.net Thu Feb 22 11:44:37 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 22 Feb 2007 17:44:37 +0000 Subject: [netrek-cvs] client/netrekxp/src local.c, 1.52, 1.53 short.c, 1.10, 1.11 socket.c, 1.14, 1.15 Message-ID: <20070222174447.2FA2FB435@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19922/src Modified Files: local.c short.c socket.c Log Message: FPS support for planet rotation, torp and plasma explosions, and torp and plasma rotations. Fix for varyShields option to display shields in 3 colors rather than just red/green. Index: short.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/short.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- short.c 10 Dec 2006 02:49:14 -0000 1.10 +++ short.c 22 Feb 2007 17:44:34 -0000 1.11 @@ -1094,7 +1094,7 @@ thetorp->t_status = status; if (thetorp->t_status == TEXPLODE) { - thetorp->t_fuse = BMP_TORPDET_FRAMES; + thetorp->t_fuse = BMP_TORPDET_FRAMES * fps / 10; } } } /* if */ Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- local.c 22 Feb 2007 16:22:13 -0000 1.52 +++ local.c 22 Feb 2007 17:44:34 -0000 1.53 @@ -55,6 +55,8 @@ static int warpchange = 0; static unsigned int twarpflag = 0; static int cloak_phases = 0; +static int bmp_torpdet_frames = 0; +static int bmp_torp_frames = 0; #endif /* Background Stars Definitions */ @@ -335,7 +337,7 @@ * Choose the color bitmap for a planet. */ { - int i; + int i, j; W_Icon (*planet_bits); if ((p->pl_info & me->p_team) @@ -399,10 +401,14 @@ } else // Unknown planet { - if ((planet_frame >= CPLANET_VIEWS - 1) || (planet_frame < 0)) + j = planet_frame * 10 / fps; + if ((j >= CPLANET_VIEWS - 1) || (j < 0)) + { + j = 0; planet_frame = 0; + } if (rotatePlanets) - return planet_unknown[planet_frame]; + return planet_unknown[j]; else return planet_unknown_NR; } @@ -1080,19 +1086,19 @@ if (j == me && varyShields) { + int value; + shieldnum = SHIELD_FRAMES * me->p_shield / me->p_ship.s_maxshield; if (shieldnum >= SHIELD_FRAMES) shieldnum = SHIELD_FRAMES - 1; - color = gColor; - if (shieldnum < SHIELD_FRAMES * 2 / 3) - { + value = (100 * me->p_shield) / me->p_ship.s_maxshield; + if (value <= 33) + color = rColor; + else if (value <= 66) color = yColor; - if (shieldnum < SHIELD_FRAMES * 2 / 3) - { - color = rColor; - } - } + else + color = gColor; } else { @@ -1804,6 +1810,7 @@ struct player *j; int torpCount; int torpTeam; + int frame; const int view = SCALE * WINSIDE / 2; for (t = torps, j = players; j != players + MAXPLAYER; t += MAXTORP, ++j) @@ -1901,21 +1908,23 @@ if (k->t_status == TEXPLODE) { - k->t_fuse--; + bmp_torpdet_frames = BMP_TORPDET_FRAMES * fps / 10; + frame = k->t_fuse * 10 / fps; if (k->t_fuse <= 0) { k->t_status = TFREE; j->p_ntorp--; continue; } - if (k->t_fuse >= BMP_TORPDET_FRAMES) + + if (k->t_fuse >= bmp_torpdet_frames) { - k->t_fuse = BMP_TORPDET_FRAMES - 1; + k->t_fuse = bmp_torpdet_frames - 1; } #ifdef SOUND - if (k->t_fuse == BMP_TORPDET_FRAMES - 1) + if (k->t_fuse == bmp_torpdet_frames - 1) { if (newSound) { @@ -1974,7 +1983,7 @@ } W_WriteBitmap (dx - (BMP_CTORPDET_WIDTH / 2), dy - (BMP_CTORPDET_HEIGHT / 2), - cloudC[torpTeam][k->t_fuse], torpColor (k), w); + cloudC[torpTeam][frame], 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; @@ -1985,7 +1994,7 @@ { W_WriteBitmap (dx - (BMP_TORPDET_WIDTH / 2), dy - (BMP_TORPDET_HEIGHT / 2), - cloud[k->t_fuse], torpColor (k), w); + cloud[frame], 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; @@ -1997,7 +2006,12 @@ { if (colorWeapons) { - if ((k->t_fuse++ >= BMP_TORP_FRAMES - 1) || (k->t_fuse < 0)) + k->t_fuse++; + + bmp_torp_frames = BMP_TORP_FRAMES * fps / 10; + frame = k->t_fuse * 10 / fps; + + if ((k->t_fuse >= bmp_torp_frames - 1) || (k->t_fuse < 0)) k->t_fuse = 0; if (myPlayer(j)) @@ -2028,13 +2042,13 @@ { W_WriteBitmap (dx - (BMP_CTORP_WIDTH / 2), dy - (BMP_CTORP_HEIGHT / 2), - torpC[torpTeam][k->t_fuse], torpColor (k), w); + torpC[torpTeam][frame], torpColor (k), w); } else { W_WriteBitmap (dx - (BMP_CTORP_WIDTH / 2), dy - (BMP_CTORP_HEIGHT / 2), - mtorpC[torpTeam][k->t_fuse], torpColor (k), w); + mtorpC[torpTeam][frame], torpColor (k), w); } clearzone[0][clearcount] = dx - (BMP_CTORP_WIDTH / 2); @@ -2085,6 +2099,7 @@ register int dx, dy; const int view = SCALE * WINSIDE / 2; int ptorpTeam; + int frame; /* MAXPLASMA is small so work through all the plasmas rather than look at the number of outstanding plasma torps for each player. */ @@ -2163,6 +2178,8 @@ if (pt->pt_status == PTEXPLODE) { pt->pt_fuse--; + bmp_torpdet_frames = BMP_TORPDET_FRAMES * fps / 10; + frame = pt->pt_fuse * 10 / fps; if (pt->pt_fuse <= 0) { pt->pt_status = PTFREE; @@ -2170,13 +2187,13 @@ continue; } - if (pt->pt_fuse >= BMP_TORPDET_FRAMES) + if (pt->pt_fuse >= bmp_torpdet_frames) { - pt->pt_fuse = BMP_TORPDET_FRAMES - 1; + pt->pt_fuse = bmp_torpdet_frames - 1; } #ifdef SOUND - if (pt->pt_fuse == BMP_TORPDET_FRAMES - 1) + if (pt->pt_fuse == bmp_torpdet_frames - 1) { if (newSound) { @@ -2235,7 +2252,7 @@ } W_WriteBitmap (dx - (BMP_CPLASMATORPDET_WIDTH / 2), dy - (BMP_CPLASMATORPDET_HEIGHT / 2), - plcloudC[ptorpTeam][pt->pt_fuse], + plcloudC[ptorpTeam][frame], plasmatorpColor (pt), w); clearzone[0][clearcount] = dx - (BMP_CPLASMATORPDET_WIDTH / 2); clearzone[1][clearcount] = dy - (BMP_CPLASMATORPDET_HEIGHT / 2); @@ -2247,7 +2264,7 @@ { W_WriteBitmap (dx - (BMP_PLASMATORPDET_WIDTH / 2), dy - (BMP_PLASMATORPDET_HEIGHT / 2), - plasmacloud[pt->pt_fuse], plasmatorpColor (pt), w); + plasmacloud[frame], 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; @@ -2259,7 +2276,12 @@ { if (colorWeapons) { - if ((pt->pt_fuse++ >= BMP_TORP_FRAMES - 1) || (pt->pt_fuse < 0)) + pt->pt_fuse++; + + bmp_torp_frames = BMP_TORP_FRAMES * fps / 10; + frame = pt->pt_fuse * 10 / fps; + + if ((pt->pt_fuse >= bmp_torp_frames - 1) || (pt->pt_fuse < 0)) pt->pt_fuse = 0; if (pt->pt_owner == me->p_no) @@ -2288,14 +2310,14 @@ { W_WriteBitmap (dx - (BMP_CPLASMATORP_WIDTH / 2), dy - (BMP_CPLASMATORP_HEIGHT / 2), - plasmaC[ptorpTeam][pt->pt_fuse], + plasmaC[ptorpTeam][frame], plasmatorpColor (pt), w); } else { W_WriteBitmap (dx - (BMP_CPLASMATORP_WIDTH / 2), dy - (BMP_CPLASMATORP_HEIGHT / 2), - mplasmaC[ptorpTeam][pt->pt_fuse], + mplasmaC[ptorpTeam][frame], plasmatorpColor (pt), w); } clearzone[0][clearcount] = dx - (BMP_CPLASMATORP_WIDTH / 2); Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- socket.c 13 Dec 2006 23:47:15 -0000 1.14 +++ socket.c 22 Feb 2007 17:44:35 -0000 1.15 @@ -1158,7 +1158,7 @@ thetorp->t_status = packet->status; if (thetorp->t_status == TEXPLODE) { - thetorp->t_fuse = BMP_TORPDET_FRAMES; + thetorp->t_fuse = BMP_TORPDET_FRAMES * fps / 10; } } } @@ -1778,7 +1778,7 @@ thetorp->pt_status = packet->status; if (thetorp->pt_status == PTEXPLODE) { - thetorp->pt_fuse = BMP_TORPDET_FRAMES; + thetorp->pt_fuse = BMP_TORPDET_FRAMES * fps / 10; } } } From modemhero at users.sourceforge.net Thu Feb 22 11:44:36 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 22 Feb 2007 17:44:36 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.106, 1.107 Message-ID: <20070222174446.16410B42F@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19922/resources/docs Modified Files: changes.txt Log Message: FPS support for planet rotation, torp and plasma explosions, and torp and plasma rotations. Fix for varyShields option to display shields in 3 colors rather than just red/green. Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.106 retrieving revision 1.107 diff -u -d -r1.106 -r1.107 --- changes.txt 21 Feb 2007 15:17:03 -0000 1.106 +++ changes.txt 22 Feb 2007 17:44:34 -0000 1.107 @@ -1,4 +1,7 @@ Netrek XP 2006, Version 1.2: (Released Feb-2007) +- the varyShields option now scales shield damage properly, previously it would go straight + from green to red shields, now there is an intermediate yellow state as well. Damage threshholds + are the somewhat standard 33%/66% for transition between green-yellow and yellow-red. - added "autoRotate: on/(off)" to automatically rotate the galaxy when you enter so that your team and largest other team are on the left hand side of the galaxy, if possible. - added "playerListBlankZeroKills: (on)/off" to choose whether or not to display 0.00 kills From modemhero at users.sourceforge.net Thu Feb 22 11:44:36 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 22 Feb 2007 17:44:36 +0000 Subject: [netrek-cvs] client/netrekxp clientr.suo,1.73,1.74 Message-ID: <20070222174446.1C4281867E0@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19922 Modified Files: clientr.suo Log Message: FPS support for planet rotation, torp and plasma explosions, and torp and plasma rotations. Fix for varyShields option to display shields in 3 colors rather than just red/green. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.73 retrieving revision 1.74 diff -u -d -r1.73 -r1.74 Binary files /tmp/cvslBnlef and /tmp/cvsw1CK0K differ From modemhero at users.sourceforge.net Thu Feb 22 11:59:02 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 22 Feb 2007 17:59:02 +0000 Subject: [netrek-cvs] client/netrekxp/src beeplite.c, 1.11, 1.12 local.c, 1.53, 1.54 map.c, 1.22, 1.23 Message-ID: <20070222175912.0573E1867E0@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25805/src Modified Files: beeplite.c local.c map.c Log Message: FPS support for beeplite and TTS messaging. Index: beeplite.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/beeplite.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- beeplite.c 11 Jun 2006 09:36:25 -0000 1.11 +++ beeplite.c 22 Feb 2007 17:59:00 -0000 1.12 @@ -58,6 +58,7 @@ void liteplanet(struct planet *l) { + beep_lite_cycle_time_planet = 10 * fps / 10; emph_planet_seq_n[l->pl_no] = beep_lite_cycle_time_planet; l->pl_flags |= PLREDRAW; /* Leave redraw on until * * * done highlighting */ @@ -72,6 +73,7 @@ redrawPlayer[j->p_no] = 1; + beep_lite_cycle_time_player = 10 * fps / 10; emph_player_seq_n[j->p_no] = beep_lite_cycle_time_player; } @@ -296,7 +298,7 @@ for (tts_len = 0; (*pm != '|' && tts_len < tts_max_len); tts_len++) lastIn[tts_len] = *pm++; lastIn[tts_len] = '\0'; - tts_timer = tts_time; + tts_timer = tts_time * fps / 10; } break; Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- local.c 22 Feb 2007 17:44:34 -0000 1.53 +++ local.c 22 Feb 2007 17:59:00 -0000 1.54 @@ -1036,7 +1036,7 @@ if ((useLite && emph_player_seq_n[j->p_no] > 0) && (liteflag & LITE_PLAYERS_LOCAL)) { - int seq_n = emph_player_seq_n[j->p_no] % emph_player_seql_frames; + int seq_n = (emph_player_seq_n[j->p_no] * 10 / fps) % emph_player_seql_frames; W_WriteBitmap (dx - (emph_player_seql_width / 2), dy - (emph_player_seql_height / 2), emph_player_seql[seq_n], Index: map.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/map.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- map.c 20 Sep 2006 17:08:31 -0000 1.22 +++ map.c 22 Feb 2007 17:59:00 -0000 1.23 @@ -484,7 +484,7 @@ #ifdef BEEPLITE if (useLite && emph_planet_seq_n[l->pl_no] > 0) { - int seq_n = emph_planet_seq_n[l->pl_no] % emph_planet_seq_frames; + int seq_n = (emph_planet_seq_n[l->pl_no] * 10 / fps) % emph_planet_seq_frames; if (planetBitmapGalaxy == 3) { @@ -903,7 +903,7 @@ if ((useLite && emph_player_seq_n[i] > 0) && (liteflag & LITE_PLAYERS_MAP)) { - int seq_n = emph_player_seq_n[i] % emph_player_seq_frames; + int seq_n = (emph_player_seq_n[i] * 10 / fps) % emph_player_seq_frames; W_WriteBitmap(dx - (emph_player_seq_width / 2 - 1), dy - (emph_player_seq_height / 2 + 1), From modemhero at users.sourceforge.net Thu Feb 22 13:34:47 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Thu, 22 Feb 2007 19:34:47 +0000 Subject: [netrek-cvs] client/netrekxp/src local.c, 1.54, 1.55 short.c, 1.11, 1.12 socket.c, 1.15, 1.16 Message-ID: <20070222193456.8AE99B437@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv1588/src Modified Files: local.c short.c socket.c Log Message: FPS support for weapon fuses (fixes phaser draw time). FPS support for jubilee phasers. Index: short.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/short.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- short.c 22 Feb 2007 17:44:34 -0000 1.11 +++ short.c 22 Feb 2007 19:34:44 -0000 1.12 @@ -273,7 +273,7 @@ thetorp = &torps[((unsigned char) *which * 8)]; for (shift = 0, i = 0; i < 8; i++, thetorp++, bitset >>= 1) { - thetorp->t_updateFuse = TORP_UPDATE_FUSE; + thetorp->t_updateFuse = TORP_UPDATE_FUSE * fps / 10; if (bitset & 01) { @@ -998,7 +998,7 @@ for (shift = 0, i = 0; i < 8; thetorp++, *bitset >>= 1, *infobitset >>= 1, i++) { - thetorp->t_updateFuse = TORP_UPDATE_FUSE; + thetorp->t_updateFuse = TORP_UPDATE_FUSE * fps / 10; if (*bitset & 01) { @@ -2003,7 +2003,7 @@ phas->ph_y = y; phas->ph_target = (short) target; phas->ph_fuse = 0; - phas->ph_updateFuse = PHASER_UPDATE_FUSE; + phas->ph_updateFuse = PHASER_UPDATE_FUSE * fps / 10; phas->ph_maxfuse = (players[pnum].p_ship.s_phaserfuse * updatesPerSec) / 10; #ifdef ROTATERACE Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- local.c 22 Feb 2007 17:59:00 -0000 1.54 +++ local.c 22 Feb 2007 19:34:44 -0000 1.55 @@ -632,6 +632,7 @@ char idbuf[10]; int buflen = 1; static int ph_col = 0; + static int scaled_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; @@ -1556,7 +1557,7 @@ { int col; - switch (ph_col) + switch (scaled_ph_col) { case 1: case 2: @@ -1576,10 +1577,10 @@ break; default: col = shipCol[remap[j->p_team]]; - ph_col = 0; break; } ph_col += (100/j->p_ship.s_phaserfuse/updatesPerSec); + scaled_ph_col = ph_col * 10 / fps; if (phaserShrinkStyle == 1) { get_shrink_phaser_coords(&new_dx, &new_dy, Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- socket.c 22 Feb 2007 17:44:35 -0000 1.15 +++ socket.c 22 Feb 2007 19:34:44 -0000 1.16 @@ -1098,7 +1098,7 @@ thetorp->t_x = ntohl (packet->x); thetorp->t_y = ntohl (packet->y); thetorp->t_dir = packet->dir; - thetorp->t_updateFuse = TORP_UPDATE_FUSE; + thetorp->t_updateFuse = TORP_UPDATE_FUSE * fps / 10; #ifdef ROTATERACE @@ -1126,7 +1126,7 @@ weaponUpdate = 1; thetorp = &torps[ntohs (packet->tnum)]; - thetorp->t_updateFuse = TORP_UPDATE_FUSE; + thetorp->t_updateFuse = TORP_UPDATE_FUSE * fps / 10; if (packet->status == TEXPLODE && thetorp->t_status == TFREE) { @@ -1608,7 +1608,7 @@ phas->ph_y = ntohl (packet->y); phas->ph_target = (short) (ntohl (packet->target)); phas->ph_fuse = 0; /* NEW */ - phas->ph_updateFuse = PHASER_UPDATE_FUSE; + phas->ph_updateFuse = PHASER_UPDATE_FUSE * fps / 10; /* normalized maxfuse */ phas->ph_maxfuse = (players[packet->pnum].p_ship.s_phaserfuse * updatesPerSec) / 10; @@ -1757,7 +1757,7 @@ weaponUpdate = 1; thetorp = &plasmatorps[ntohs (packet->pnum)]; - thetorp->pt_updateFuse = PLASMA_UPDATE_FUSE; + thetorp->pt_updateFuse = PLASMA_UPDATE_FUSE * fps / 10; if (packet->status == PTEXPLODE && thetorp->pt_status == PTFREE) { /* FAT: redundant explosion; don't update p_nplasmatorp */ @@ -1800,7 +1800,7 @@ thetorp = &plasmatorps[ntohs (packet->pnum)]; thetorp->pt_x = ntohl (packet->x); thetorp->pt_y = ntohl (packet->y); - thetorp->pt_updateFuse = PLASMA_UPDATE_FUSE; + thetorp->pt_updateFuse = PLASMA_UPDATE_FUSE * fps / 10; #ifdef ROTATERACE if (rotate) From quozl at users.sourceforge.net Thu Feb 22 20:03:33 2007 From: quozl at users.sourceforge.net (James Cameron) Date: Fri, 23 Feb 2007 02:03:33 +0000 Subject: [netrek-cvs] client/netrekxp/src feature.c,1.5,1.6 Message-ID: <20070223020342.A71D9B439@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv5179 Modified Files: feature.c Log Message: The FPS server-side feature packet is not an actual rate, but an intended rate, so change the wording of the message accordingly. Index: feature.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/feature.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- feature.c 22 Feb 2007 16:22:13 -0000 1.5 +++ feature.c 23 Feb 2007 02:03:30 -0000 1.6 @@ -174,7 +174,7 @@ if (strcmpi (packet->name, "FPS") == 0 && value != -1) { fps = value; - LineToConsole("Receiving %d frames per second from the server.\n", fps); + LineToConsole("Server plans to send at %d frames per second.\n", fps); } if ((strcmpi (packet->name, "RC_DISTRESS") == 0) && gen_distress) From modemhero at users.sourceforge.net Fri Feb 23 07:43:59 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 23 Feb 2007 13:43:59 +0000 Subject: [netrek-cvs] client/netrekxp/src makecyg, NONE, 1.1 beeplite.c, 1.12, 1.13 data.c, 1.51, 1.52 defaults.c, 1.42, 1.43 feature.c, 1.6, 1.7 getname.c, 1.7, 1.8 input.c, 1.20, 1.21 local.c, 1.55, 1.56 makefile, 1.11, 1.12 map.c, 1.23, 1.24 option.c, 1.26, 1.27 parsemeta.c, 1.30, 1.31 reserved.c, 1.3, 1.4 short.c, 1.12, 1.13 socket.c, 1.16, 1.17 sound.c, 1.26, 1.27 winmain.c, 1.3, 1.4 Message-ID: <20070223134410.A51721867E0@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29199/src Modified Files: beeplite.c data.c defaults.c feature.c getname.c input.c local.c makefile map.c option.c parsemeta.c reserved.c short.c socket.c sound.c winmain.c Added Files: makecyg Log Message: Following COW patch "50 fps, accept new UPS feature packet", client and server now negotiate a update rate. Default is 50, but it still works with older servers running at 10 fps. Preliminary work on compiling with cygwin - added some headers for compile purposes, a few new Cygwin #ifdefs, 3 new cygwin makefiles that don't work yet (and probably never will without outside help). Index: getname.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/getname.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- getname.c 13 Jan 2007 02:53:27 -0000 1.7 +++ getname.c 23 Feb 2007 13:43:56 -0000 1.8 @@ -30,6 +30,10 @@ #include "data.h" #include "proto.h" +#ifdef CYGWIN +#include +#endif + static char tempname[16]; static char password1[16]; static char password2[16]; --- NEW FILE: makecyg --- # # This makefile is written for Cygwin # #DEBUG = 1 RSA = 1 # Cygwin cc = gcc rc = gcc link = gcc compileandlink = gcc # Compiler and linker flags ifndef DEBUG cflags = -O2 -v -DWIN32 -DBorland -mwindows ccompileonly = -c ldebug = -v DEBUGDEFS = -DDEBUG else cflags = -O2 -DWIN32 -DBorland -mwindows ccompileonly = -c ldebug = -w-dup endif # Libs LIBOPTS = -L/cygdrive/c/netrekxp/win32/lib/VCC LIBS = /cygdrive/c/netrekxp/win32/lib/VCC/SDL.LIB \ /cygdrive/c/netrekxp/win32/lib/VCC/SDL_mixer.LIB \ /cygdrive/c/netrekxp/win32/lib/VCC/SDLmain.LIB \ # "/cygdrive/c/Program Files/Microsoft Platform SDK/Lib/LibCW32mt.LIB" \ # "/cygdrive/c/Program Files/Microsoft Platform SDK/Lib/IMPORT32.LIB" \ "/cygdrive/c/Program Files/Microsoft Platform SDK/Lib/User32.lib" \ "/cygdrive/c/Program Files/Microsoft Platform SDK/Lib/Gdi32.lib" \ "/cygdrive/c/Program Files/Microsoft Platform SDK/Lib/Wsock32.lib" \ "/cygdrive/c/Program Files/Microsoft Platform SDK/Lib/Kernel32.lib" \ "/cygdrive/c/Program Files/Microsoft Platform SDK/Lib/Shell32.lib" \ "/cygdrive/c/Program Files/Microsoft Platform SDK/Lib/Winmm.lib" \ "/cygdrive/c/Program Files/Microsoft Platform SDK/Lib/Mpr.lib" \ "/cygdrive/c/Program Files/Microsoft Platform SDK/Lib/Msimg32.lib" \ $(GMPLIB) INCS = -I/cygdrive/c/netrekxp/include -I/cygdrive/c/netrekxp/win32 -I/cygdrive/c/netrekxp/win32/h -I/cygdrive/c/netrekxp/win32/SDL/ ROBJ = beeplite.o check.o colors.o console.o data.o death.o defaults.o dmessage.o\ enter.o findslot.o getname.o getship.o helpwin.o hintwin.o inform.o\ interface.o newwin.o option.o planetlist.o macrowin.o\ map.o playerlist.o ranklist.o reserved.o sintab.o\ smessage.o socket.o stats.o util.o war.o warning.o\ udpopt.o ping.o pingstats.o rotate.o parsemeta.o\ spopt.o dashboard.o dashboard3.o\ short.o distress.o senddist.o defwin.o tools.o sound.o\ docwin.o feature.o\ string_util.o local.o cowmain.o playback.o RSRC = beeplite.c check.c colors.c console.c data.c death.c defaults.c dmessage.c\ enter.c findslot.c getname.c getship.c helpwin.c hintwin.c inform.c\ input.c interface.c newwin.c option.c planetlist.c\ macrowin.c map.c playerlist.c ranklist.c redraw.c\ smessage.c parsemeta.c socket.c stats.c util.c war.c\ warning.c udpopt.c sintab.c ping.c pingstats.c rotate.c\ spopt.c dashboard.c dashboard3.c\ short.c distress.c senddist.c defwin.c tools.c sound.c\ docwin.c feature.c reserved.c\ string_util.c local.c cowmain.c playback.c INPUTOBJ = input.o redraw.o MAINOBJ = main.o MAINSRC = main.c ifndef 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 RSAOBJ = rsa_box.o rsa_box_0.o rsa_box_1.o rsa_box_2.o\ rsa_box_3.o rsa_box_4.o endif WIN32_SRCS = winmain.c mswindow.c winsndlib.c WIN32_OBJS = winmain.o mswindow.o winsndlib.o 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 all: netrek.exe OBJS = $(ROBJ) $(MAINOBJ) $(RSAOBJ) $(INPUTOBJ) $(WIN32_OBJS) .c.o: $(cc) $(cflags) $(ccompileonly) $(cdebug) $(DEFS) $(RSADEFS) $(DEBUGDEFS) $(INCS) $< #RESOURCES = bccnetrek.res #$(RESOURCES): bccnetrek.rc # $(rc) bccnetrek.rc netrek.exe: $(OBJS) $(RESOURCES) main.ico $(link) $(ldebug) $(LIBOPTS) $(OBJS) $(LIBS) $(RESOURCES) clean: rm *.o rm netrek.exe netrek.ilc netrek.ild netrek.ild netrek.ilf netrek.ils netrek.map bccnetrek.res netrek.tds Index: sound.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/sound.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- sound.c 22 Feb 2007 05:18:18 -0000 1.26 +++ sound.c 23 Feb 2007 13:43:57 -0000 1.27 @@ -283,7 +283,7 @@ if ((channel = Mix_PlayChannel(-1, newsounds[type], 0)) < 0) { -#if DEBUG +#ifdef DEBUG /* Frequent occurence is more than 16 channels playing sound */ LineToConsole("Mix_PlayChannel: %s\n", Mix_GetError()); #endif @@ -330,7 +330,7 @@ if ((channel = Mix_PlayChannel(-1, newsounds[type], 0)) < 0) { -#if DEBUG +#ifdef DEBUG /* Frequent occurence is more than 16 channels playing sound */ LineToConsole("Mix_PlayChannel: %s\n", Mix_GetError()); #endif Index: map.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/map.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- map.c 22 Feb 2007 17:59:00 -0000 1.23 +++ map.c 23 Feb 2007 13:43:56 -0000 1.24 @@ -484,7 +484,7 @@ #ifdef BEEPLITE if (useLite && emph_planet_seq_n[l->pl_no] > 0) { - int seq_n = (emph_planet_seq_n[l->pl_no] * 10 / fps) % emph_planet_seq_frames; + int seq_n = (emph_planet_seq_n[l->pl_no] * 10 / server_ups) % emph_planet_seq_frames; if (planetBitmapGalaxy == 3) { @@ -903,7 +903,7 @@ if ((useLite && emph_player_seq_n[i] > 0) && (liteflag & LITE_PLAYERS_MAP)) { - int seq_n = (emph_player_seq_n[i] * 10 / fps) % emph_player_seq_frames; + int seq_n = (emph_player_seq_n[i] * 10 / server_ups) % emph_player_seq_frames; W_WriteBitmap(dx - (emph_player_seq_width / 2 - 1), dy - (emph_player_seq_height / 2 + 1), Index: input.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/input.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- input.c 11 Feb 2007 03:20:58 -0000 1.20 +++ input.c 23 Feb 2007 13:43:56 -0000 1.21 @@ -33,9 +33,11 @@ #endif #ifdef __BORLANDC__ +#ifndef CYGWIN // #pragma warn -rvl //Turon off "parameter never used..." warning // #pragma warn -pro //Turon off "parameter never used..." warning #endif +#endif int detallow = 1; /* flag used to figure out * if we're allowing det */ Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- local.c 22 Feb 2007 19:34:44 -0000 1.55 +++ local.c 23 Feb 2007 13:43:56 -0000 1.56 @@ -401,7 +401,7 @@ } else // Unknown planet { - j = planet_frame * 10 / fps; + j = planet_frame * 10 / server_ups; if ((j >= CPLANET_VIEWS - 1) || (j < 0)) { j = 0; @@ -717,7 +717,7 @@ dx = dx / SCALE + WINSIDE / 2; dy = dy / SCALE + WINSIDE / 2; - cloak_phases = CLOAK_PHASES * fps / 10; + cloak_phases = CLOAK_PHASES * server_ups / 10; if (j->p_flags & PFCLOAK) { if (j->p_cloakphase < (cloak_phases - 1)) @@ -1037,7 +1037,7 @@ if ((useLite && emph_player_seq_n[j->p_no] > 0) && (liteflag & LITE_PLAYERS_LOCAL)) { - int seq_n = (emph_player_seq_n[j->p_no] * 10 / fps) % emph_player_seql_frames; + int seq_n = (emph_player_seq_n[j->p_no] * 10 / server_ups) % emph_player_seql_frames; W_WriteBitmap (dx - (emph_player_seql_width / 2), dy - (emph_player_seql_height / 2), emph_player_seql[seq_n], @@ -1326,7 +1326,7 @@ { int i; - i = j->p_explode * 10 / fps; + i = j->p_explode * 10 / server_ups; #ifdef SOUND if (j->p_explode == 1) @@ -1580,7 +1580,7 @@ break; } ph_col += (100/j->p_ship.s_phaserfuse/updatesPerSec); - scaled_ph_col = ph_col * 10 / fps; + scaled_ph_col = ph_col * 10 / server_ups; if (phaserShrinkStyle == 1) { get_shrink_phaser_coords(&new_dx, &new_dy, @@ -1910,8 +1910,8 @@ if (k->t_status == TEXPLODE) { k->t_fuse--; - bmp_torpdet_frames = BMP_TORPDET_FRAMES * fps / 10; - frame = k->t_fuse * 10 / fps; + bmp_torpdet_frames = BMP_TORPDET_FRAMES * server_ups / 10; + frame = k->t_fuse * 10 / server_ups; if (k->t_fuse <= 0) { k->t_status = TFREE; @@ -2009,8 +2009,8 @@ { k->t_fuse++; - bmp_torp_frames = BMP_TORP_FRAMES * fps / 10; - frame = k->t_fuse * 10 / fps; + bmp_torp_frames = BMP_TORP_FRAMES * server_ups / 10; + frame = k->t_fuse * 10 / server_ups; if ((k->t_fuse >= bmp_torp_frames - 1) || (k->t_fuse < 0)) k->t_fuse = 0; @@ -2179,8 +2179,8 @@ if (pt->pt_status == PTEXPLODE) { pt->pt_fuse--; - bmp_torpdet_frames = BMP_TORPDET_FRAMES * fps / 10; - frame = pt->pt_fuse * 10 / fps; + bmp_torpdet_frames = BMP_TORPDET_FRAMES * server_ups / 10; + frame = pt->pt_fuse * 10 / server_ups; if (pt->pt_fuse <= 0) { pt->pt_status = PTFREE; @@ -2279,8 +2279,8 @@ { pt->pt_fuse++; - bmp_torp_frames = BMP_TORP_FRAMES * fps / 10; - frame = pt->pt_fuse * 10 / fps; + bmp_torp_frames = BMP_TORP_FRAMES * server_ups / 10; + frame = pt->pt_fuse * 10 / server_ups; if ((pt->pt_fuse >= bmp_torp_frames - 1) || (pt->pt_fuse < 0)) pt->pt_fuse = 0; Index: makefile =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/makefile,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- makefile 12 Jun 2006 14:10:31 -0000 1.11 +++ makefile 23 Feb 2007 13:43:56 -0000 1.12 @@ -2,7 +2,7 @@ # This makefile is written for Borland C++ 5.5 # -#DEBUG = 1 +DEBUG = 1 RSA = 1 # Borland C++ 5.5 Index: short.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/short.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- short.c 22 Feb 2007 19:34:44 -0000 1.12 +++ short.c 23 Feb 2007 13:43:57 -0000 1.13 @@ -273,7 +273,7 @@ thetorp = &torps[((unsigned char) *which * 8)]; for (shift = 0, i = 0; i < 8; i++, thetorp++, bitset >>= 1) { - thetorp->t_updateFuse = TORP_UPDATE_FUSE * fps / 10; + thetorp->t_updateFuse = TORP_UPDATE_FUSE * server_ups / 10; if (bitset & 01) { @@ -998,7 +998,7 @@ for (shift = 0, i = 0; i < 8; thetorp++, *bitset >>= 1, *infobitset >>= 1, i++) { - thetorp->t_updateFuse = TORP_UPDATE_FUSE * fps / 10; + thetorp->t_updateFuse = TORP_UPDATE_FUSE * server_ups / 10; if (*bitset & 01) { @@ -1094,7 +1094,7 @@ thetorp->t_status = status; if (thetorp->t_status == TEXPLODE) { - thetorp->t_fuse = BMP_TORPDET_FRAMES * fps / 10; + thetorp->t_fuse = BMP_TORPDET_FRAMES * server_ups / 10; } } } /* if */ @@ -2003,7 +2003,7 @@ phas->ph_y = y; phas->ph_target = (short) target; phas->ph_fuse = 0; - phas->ph_updateFuse = PHASER_UPDATE_FUSE * fps / 10; + phas->ph_updateFuse = PHASER_UPDATE_FUSE * server_ups / 10; phas->ph_maxfuse = (players[pnum].p_ship.s_phaserfuse * updatesPerSec) / 10; #ifdef ROTATERACE Index: winmain.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/winmain.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- winmain.c 21 Apr 2006 12:00:07 -0000 1.3 +++ winmain.c 23 Feb 2007 13:43:57 -0000 1.4 @@ -22,6 +22,7 @@ #include #include #include +#include #include "Wlib.h" #include "defs.h" Index: option.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/option.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- option.c 21 Feb 2007 15:17:07 -0000 1.26 +++ option.c 23 Feb 2007 13:43:56 -0000 1.27 @@ -214,7 +214,7 @@ /* updates: use of the int range thing... */ -struct int_range updates_range = { 1, 10, 1 }; +struct int_range updates_range = { 1, 50, 1 }; struct int_range redraw_updates_range = { 0, 5, 1 }; struct int_range phaserShrinkRng = { 0, 16, 1 }; Index: reserved.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/reserved.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- reserved.c 7 May 2006 16:59:27 -0000 1.3 +++ reserved.c 23 Feb 2007 13:43:57 -0000 1.4 @@ -5,6 +5,7 @@ #include "copyright2.h" #include #include +#include #include "Wlib.h" #include "defs.h" #include "struct.h" Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- data.c 22 Feb 2007 16:22:13 -0000 1.51 +++ data.c 23 Feb 2007 13:43:56 -0000 1.52 @@ -228,7 +228,9 @@ #endif -int updatesPerSec = 10; +int updatesPerSec = 50; /* client requested updates per second */ +int server_ups = 50; /* server responded updates per second */ +int server_fps = 50; /* server configured frames per second */ #ifdef META /* Metaservers list - comma delimited */ @@ -680,8 +682,6 @@ int portSwap = 0; #endif -int fps = 10; - // Load Ship Bitmaps from .BMP files char *fed_ship_bmp; char *rom_ship_bmp; Index: feature.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/feature.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- feature.c 23 Feb 2007 02:03:30 -0000 1.6 +++ feature.c 23 Feb 2007 13:43:56 -0000 1.7 @@ -164,6 +164,18 @@ break; } } + if (strcmpi (packet->name, "FPS") == 0 && value != -1) + { + server_fps = updatesPerSec = server_ups = value; + LineToConsole("Server capable of computing %d frames per second.\n", value); + return; + } + if (strcmpi(packet->name, "UPS") == 0 && value != -1) { + updatesPerSec = server_ups = value; + LineToConsole("Server actually sending %d updates per second.\n", value); + return; + } + if (features[i].name == 0) { LineToConsole ("Feature %s from server unknown to client!\n", packet->name); @@ -171,11 +183,6 @@ /* special cases: */ if (strcmpi (packet->name, "FEATURE_PACKETS") == 0) reportFeatures (); - if (strcmpi (packet->name, "FPS") == 0 && value != -1) - { - fps = value; - LineToConsole("Server plans to send at %d frames per second.\n", fps); - } if ((strcmpi (packet->name, "RC_DISTRESS") == 0) && gen_distress) distmacro = dist_prefered; Index: beeplite.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/beeplite.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- beeplite.c 22 Feb 2007 17:59:00 -0000 1.12 +++ beeplite.c 23 Feb 2007 13:43:56 -0000 1.13 @@ -58,7 +58,7 @@ void liteplanet(struct planet *l) { - beep_lite_cycle_time_planet = 10 * fps / 10; + beep_lite_cycle_time_planet = 10 * server_ups / 10; emph_planet_seq_n[l->pl_no] = beep_lite_cycle_time_planet; l->pl_flags |= PLREDRAW; /* Leave redraw on until * * * done highlighting */ @@ -73,7 +73,7 @@ redrawPlayer[j->p_no] = 1; - beep_lite_cycle_time_player = 10 * fps / 10; + beep_lite_cycle_time_player = 10 * server_ups / 10; emph_player_seq_n[j->p_no] = beep_lite_cycle_time_player; } @@ -81,7 +81,7 @@ /* small permutation on makedistress. Searches for the highliting * * arguments, ignores everything else. */ -makelite(struct distress * dist, char *pm) +int makelite(struct distress * dist, char *pm) /* the info */ /* macro to parse, used for distress and macro */ { @@ -298,7 +298,7 @@ for (tts_len = 0; (*pm != '|' && tts_len < tts_max_len); tts_len++) lastIn[tts_len] = *pm++; lastIn[tts_len] = '\0'; - tts_timer = tts_time * fps / 10; + tts_timer = tts_time * server_ups / 10; } break; Index: parsemeta.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/parsemeta.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- parsemeta.c 12 Feb 2007 06:49:46 -0000 1.30 +++ parsemeta.c 23 Feb 2007 13:43:56 -0000 1.31 @@ -1977,8 +1977,10 @@ // wait in periods of maximum 250ms. Better for menu responsiveness ;-) if (waittime > 250) waittime = 250; +#ifndef CYGWIN readfds.fd_count = 1; readfds.fd_array[0] = s; +#endif Timeout.tv_sec = waittime / 1000; Timeout.tv_usec = waittime % 1000; Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- socket.c 22 Feb 2007 19:34:44 -0000 1.16 +++ socket.c 23 Feb 2007 13:43:57 -0000 1.17 @@ -1098,7 +1098,7 @@ thetorp->t_x = ntohl (packet->x); thetorp->t_y = ntohl (packet->y); thetorp->t_dir = packet->dir; - thetorp->t_updateFuse = TORP_UPDATE_FUSE * fps / 10; + thetorp->t_updateFuse = TORP_UPDATE_FUSE * server_ups / 10; #ifdef ROTATERACE @@ -1126,7 +1126,7 @@ weaponUpdate = 1; thetorp = &torps[ntohs (packet->tnum)]; - thetorp->t_updateFuse = TORP_UPDATE_FUSE * fps / 10; + thetorp->t_updateFuse = TORP_UPDATE_FUSE * server_ups / 10; if (packet->status == TEXPLODE && thetorp->t_status == TFREE) { @@ -1158,7 +1158,7 @@ thetorp->t_status = packet->status; if (thetorp->t_status == TEXPLODE) { - thetorp->t_fuse = BMP_TORPDET_FRAMES * fps / 10; + thetorp->t_fuse = BMP_TORPDET_FRAMES * server_ups / 10; } } } @@ -1608,7 +1608,7 @@ phas->ph_y = ntohl (packet->y); phas->ph_target = (short) (ntohl (packet->target)); phas->ph_fuse = 0; /* NEW */ - phas->ph_updateFuse = PHASER_UPDATE_FUSE * fps / 10; + phas->ph_updateFuse = PHASER_UPDATE_FUSE * server_ups / 10; /* normalized maxfuse */ phas->ph_maxfuse = (players[packet->pnum].p_ship.s_phaserfuse * updatesPerSec) / 10; @@ -1757,7 +1757,7 @@ weaponUpdate = 1; thetorp = &plasmatorps[ntohs (packet->pnum)]; - thetorp->pt_updateFuse = PLASMA_UPDATE_FUSE * fps / 10; + thetorp->pt_updateFuse = PLASMA_UPDATE_FUSE * server_ups / 10; if (packet->status == PTEXPLODE && thetorp->pt_status == PTFREE) { /* FAT: redundant explosion; don't update p_nplasmatorp */ @@ -1778,7 +1778,7 @@ thetorp->pt_status = packet->status; if (thetorp->pt_status == PTEXPLODE) { - thetorp->pt_fuse = BMP_TORPDET_FRAMES * fps / 10; + thetorp->pt_fuse = BMP_TORPDET_FRAMES * server_ups / 10; } } } @@ -1800,7 +1800,7 @@ thetorp = &plasmatorps[ntohs (packet->pnum)]; thetorp->pt_x = ntohl (packet->x); thetorp->pt_y = ntohl (packet->y); - thetorp->pt_updateFuse = PLASMA_UPDATE_FUSE * fps / 10; + thetorp->pt_updateFuse = PLASMA_UPDATE_FUSE * server_ups / 10; #ifdef ROTATERACE if (rotate) Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- defaults.c 21 Feb 2007 15:17:05 -0000 1.42 +++ defaults.c 23 Feb 2007 13:43:56 -0000 1.43 @@ -776,8 +776,8 @@ }, {"updatesPerSec", &updatesPerSec, RC_INT, { - "How much updates to send/receive", - "1-10 range", + "How many updates per second to request", + "1-50 range", NULL } }, @@ -1372,6 +1372,7 @@ } #ifndef __BORLANDC__ +#ifndef CYGWIN /******************************************************************************/ /*** strncmpi() ***/ /*** grr... are you telling me this sort of function isn't in the std ***/ @@ -1410,6 +1411,7 @@ return (0); } #endif +#endif /******************************************************************************/ /*** stringDefault() ***/ From modemhero at users.sourceforge.net Fri Feb 23 07:43:59 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 23 Feb 2007 13:43:59 +0000 Subject: [netrek-cvs] client/netrekxp/src/winkey makecyg, NONE, 1.1 makefile, 1.3, 1.4 Message-ID: <20070223134410.E97111867F5@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src/winkey In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29199/src/winkey Modified Files: makefile Added Files: makecyg Log Message: Following COW patch "50 fps, accept new UPS feature packet", client and server now negotiate a update rate. Default is 50, but it still works with older servers running at 10 fps. Preliminary work on compiling with cygwin - added some headers for compile purposes, a few new Cygwin #ifdefs, 3 new cygwin makefiles that don't work yet (and probably never will without outside help). Index: makefile =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/winkey/makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- makefile 30 Nov 2006 01:25:05 -0000 1.3 +++ makefile 23 Feb 2007 13:43:57 -0000 1.4 @@ -2,7 +2,7 @@ # This makefile is written for Borland C++ 5.5 # -#DEBUG = 1 +DEBUG = 1 # Borland C++ 5.5 cc = bcc32 --- NEW FILE: makecyg --- # # This makefile is written for Cygwin # #DEBUG = 1 # Cygwin 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 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 From modemhero at users.sourceforge.net Fri Feb 23 07:43:58 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 23 Feb 2007 13:43:58 +0000 Subject: [netrek-cvs] client/netrekxp/resources/htmlhelp/html generalconfig.html, 1.25, 1.26 Message-ID: <20070223134410.CB1191867E9@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29199/resources/htmlhelp/html Modified Files: generalconfig.html Log Message: Following COW patch "50 fps, accept new UPS feature packet", client and server now negotiate a update rate. Default is 50, but it still works with older servers running at 10 fps. Preliminary work on compiling with cygwin - added some headers for compile purposes, a few new Cygwin #ifdefs, 3 new cygwin makefiles that don't work yet (and probably never will without outside help). Index: generalconfig.html =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html/generalconfig.html,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- generalconfig.html 21 Feb 2007 15:17:05 -0000 1.25 +++ generalconfig.html 23 Feb 2007 13:43:56 -0000 1.26 @@ -1310,8 +1310,8 @@ updatesPerSec -Number of updates per second -1-10
default: 10 +Number of requested updates per second +1-50
default: 50 useFullShipInfo From modemhero at users.sourceforge.net Fri Feb 23 07:43:59 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 23 Feb 2007 13:43:59 +0000 Subject: [netrek-cvs] client/netrekxp/src/cursors makecyg,NONE,1.1 Message-ID: <20070223134410.A3F1BB439@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src/cursors In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29199/src/cursors Added Files: makecyg Log Message: Following COW patch "50 fps, accept new UPS feature packet", client and server now negotiate a update rate. Default is 50, but it still works with older servers running at 10 fps. Preliminary work on compiling with cygwin - added some headers for compile purposes, a few new Cygwin #ifdefs, 3 new cygwin makefiles that don't work yet (and probably never will without outside help). --- NEW FILE: makecyg --- # # This makefile is written for Cygwin # # Cygwin cc = bcc32 rc = brcc32 link = ilink32 compileandlink = bcc32 all: curslib.dll RESOURCES = curslib.res $(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 From modemhero at users.sourceforge.net Fri Feb 23 07:43:59 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 23 Feb 2007 13:43:59 +0000 Subject: [netrek-cvs] client/netrekxp/win32 config.h,1.12,1.13 Message-ID: <20070223134410.99407B437@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/win32 In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29199/win32 Modified Files: config.h Log Message: Following COW patch "50 fps, accept new UPS feature packet", client and server now negotiate a update rate. Default is 50, but it still works with older servers running at 10 fps. Preliminary work on compiling with cygwin - added some headers for compile purposes, a few new Cygwin #ifdefs, 3 new cygwin makefiles that don't work yet (and probably never will without outside help). Index: config.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/win32/config.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- config.h 13 Jan 2007 02:53:27 -0000 1.12 +++ config.h 23 Feb 2007 13:43:57 -0000 1.13 @@ -21,6 +21,7 @@ */ #define CBUGS "Send bugs/suggestion to: billbalcerski at hotmail.com" +//#define CYGWIN /* For compiling with Cygwin */ /* ################################################################################ @@ -435,6 +436,5 @@ #define unlink _unlink #endif - #endif /* __CONFIG_H */ From modemhero at users.sourceforge.net Fri Feb 23 07:43:58 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 23 Feb 2007 13:43:58 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs netrekrc, 1.22, 1.23 netrekrc_options.txt, 1.24, 1.25 Message-ID: <20070223134410.A80C51867E6@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29199/resources/docs Modified Files: netrekrc netrekrc_options.txt Log Message: Following COW patch "50 fps, accept new UPS feature packet", client and server now negotiate a update rate. Default is 50, but it still works with older servers running at 10 fps. Preliminary work on compiling with cygwin - added some headers for compile purposes, a few new Cygwin #ifdefs, 3 new cygwin makefiles that don't work yet (and probably never will without outside help). Index: netrekrc =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- netrekrc 21 Feb 2007 15:17:03 -0000 1.22 +++ netrekrc 23 Feb 2007 13:43:55 -0000 1.23 @@ -399,9 +399,9 @@ # Check sequence of UDP traffic udpSequenceCheck: on -# How much updates to send/receive -# 1-10 range -updatesPerSec: 10 +# How many updates per second to request +# 1-50 range +updatesPerSec: 50 # Display other ships to 256 directions instead of 16 # by using long ship packets instead of short ship packets, Index: netrekrc_options.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc_options.txt,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- netrekrc_options.txt 21 Feb 2007 15:17:04 -0000 1.24 +++ netrekrc_options.txt 23 Feb 2007 13:43:56 -0000 1.25 @@ -280,7 +280,7 @@ udpDebug: (0/1) debug UDP traffic udpSequenceCheck: (on/off) check UDP sequence -updatesPerSec: (0-10) how much data updates per second to request from server +updatesPerSec: (0-50) how many data updates per second to request from server useFullShipInfo: (on/off) display other ships to 256 directions instead of 16 useLite: (on/off) use beeplite defLite: (on/off) use default beeplite settings From modemhero at users.sourceforge.net Fri Feb 23 07:43:57 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 23 Feb 2007 13:43:57 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h, 1.47, 1.48 proto.h, 1.30, 1.31 Message-ID: <20070223134445.12B1FB439@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29199/include Modified Files: data.h proto.h Log Message: Following COW patch "50 fps, accept new UPS feature packet", client and server now negotiate a update rate. Default is 50, but it still works with older servers running at 10 fps. Preliminary work on compiling with cygwin - added some headers for compile purposes, a few new Cygwin #ifdefs, 3 new cygwin makefiles that don't work yet (and probably never will without outside help). Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- data.h 22 Feb 2007 16:22:12 -0000 1.47 +++ data.h 23 Feb 2007 13:43:55 -0000 1.48 @@ -137,7 +137,9 @@ extern int old_rotate_deg; #endif -extern int updatesPerSec; +extern int updatesPerSec; /* client requested updates per second */ +extern int server_ups; /* server responded updates per second */ +extern int server_fps; /* server configured frames per second */ extern int SBhours; @@ -575,8 +577,6 @@ extern int portSwap; #endif -extern int fps; - // Load Ship Bitmaps from .BMP files extern char *fed_ship_bmp; extern char *rom_ship_bmp; Index: proto.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- proto.h 21 Feb 2007 15:17:02 -0000 1.30 +++ proto.h 23 Feb 2007 13:43:55 -0000 1.31 @@ -27,7 +27,7 @@ void litedefaults (void); void liteplanet (struct planet *l); void liteplayer (struct player *j); -makelite (struct distress * dist, char *pm); +int makelite (struct distress * dist, char *pm); /******************************************************************************/ /*** check.c ***/ @@ -95,8 +95,10 @@ char *getServerNick (char *srvName); int getServerType (char *srvName); #ifndef __BORLANDC__ +#ifndef CYGWIN int strncmpi (char *str1, char *str2, int max); #endif +#endif int booleanDefault (char *def, int preferred); int intDefault (char *def, int preferred); char *stringDefault (char *str); From modemhero at users.sourceforge.net Fri Feb 23 07:43:57 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Fri, 23 Feb 2007 13:43:57 +0000 Subject: [netrek-cvs] client/netrekxp build.cmd, 1.21, 1.22 clientr.suo, 1.74, 1.75 Message-ID: <20070223134444.BFDECB437@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29199 Modified Files: build.cmd clientr.suo Log Message: Following COW patch "50 fps, accept new UPS feature packet", client and server now negotiate a update rate. Default is 50, but it still works with older servers running at 10 fps. Preliminary work on compiling with cygwin - added some headers for compile purposes, a few new Cygwin #ifdefs, 3 new cygwin makefiles that don't work yet (and probably never will without outside help). Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.74 retrieving revision 1.75 diff -u -d -r1.74 -r1.75 Binary files /tmp/cvsyEeNio and /tmp/cvsA0IxIQ differ Index: build.cmd =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/build.cmd,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- build.cmd 31 Jan 2007 07:31:01 -0000 1.21 +++ build.cmd 23 Feb 2007 13:43:48 -0000 1.22 @@ -3,6 +3,7 @@ set HelpCompiler="C:\Program Files\HTML Help Workshop\hhc.exe" rem set Compiler=VCC set Compiler=BCC +rem set Compiler=CYGWIN @echo off Set MyCWD=%cd% @@ -363,6 +364,7 @@ if /I "%Compiler%" == "BCC" goto :CompilerBCC if /I "%Compiler%" == "VCC" goto :CompilerVCC +if /I "%Compiler%" == "CYGWIN" goto :CompilerCYGWIN echo You must set which compiler you have at the top of this batch file. goto :end @@ -398,6 +400,20 @@ goto :dist +:CompilerCYGWIN +pushd src +pushd cursors +make --makefile=makecyg +popd +pushd winkey +make --makefile=makecyg +popd +make --makefile=makecyg +%MyCWD%\tools\stampver -v%MyCWD%\src\stampver.inf netrek.exe +popd + +goto :dist + :dist copy resources\htmlhelp\netrek.chm %InstCWD%\netrek @@ -498,6 +514,10 @@ if /I "%Compiler%" == "BCC" copy src\winkey\winkey.dll %InstCWD%\netrek\bitmaps if /I "%Compiler%" == "BCC" copy src\netrek.exe %InstCWD%\netrek +if /I "%Compiler%" == "CYGWIN" copy src\cursors\curslib.dll %InstCWD%\netrek\bitmaps +if /I "%Compiler%" == "CYGWIN" copy src\winkey\winkey.dll %InstCWD%\netrek\bitmaps +if /I "%Compiler%" == "CYGWIN" copy src\netrek.exe %InstCWD%\netrek + goto end :clean @@ -548,6 +568,7 @@ if /I "%Compiler%" == "BCC" goto :CleanBCC if /I "%Compiler%" == "VCC" goto :CleanVCC +if /I "%Compiler%" == "CYGWIN" goto :CleanCYGWIN echo You must set which compiler you have at the top of this batch file. @@ -582,6 +603,19 @@ goto :end +:CleanCYGWIN +pushd src +make clean --makefile=makecyg +pushd cursors +make clean --makefile=makecyg +popd +pushd winkey +make clean --makefile=makecyg +popd +popd + +goto :end + :cleanrsa pushd src del rsa*.c From modemhero at users.sourceforge.net Sat Feb 24 04:19:56 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 24 Feb 2007 10:19:56 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.107, 1.108 netrekrc, 1.23, 1.24 netrekrc_options.txt, 1.25, 1.26 Message-ID: <20070224102005.A60021867E6@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11912/resources/docs Modified Files: changes.txt netrekrc netrekrc_options.txt Log Message: Cygwin makefile changes: fixed up a bunch of problems to get build to work, still not perfect as libdir not resolving correctly. Also removed CYGWIN define from code and placed it as a compiler runtime define. Progress of Cygwin build is that client runs, but select() is broken. Most likely related to struct fd_set definition. Added observer support for shrink phasers, color phaser, warn and vary shields, and removed observer support for detcircle. Fixed detcircle so turning it off really does turn it off (oops). Fixed color phaser with regards to FPS changes, so it works at all framerates. Added observer support for showArmy for locking onto planets. Split varyShields into 2 netrekrc options, varyShields and varyShieldsColor, to be able to vary either/neither/both shield graphic and shield color with damage. Changed defaults for FPS client/server values back to 10 from 50. Let the user have it in netrekrc if they want to request a higher rate, and don't assume servers are running at 50 FPS. Require that feature packet to be sent to increase the update rate. Index: netrekrc =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- netrekrc 23 Feb 2007 13:43:55 -0000 1.23 +++ netrekrc 24 Feb 2007 10:19:54 -0000 1.24 @@ -298,7 +298,7 @@ # Server god decides whether to enable it on server showAllTractorPressor: on -# Show army count of planet you are orbiting +# Show army count of planet you are orbiting (or locked on as observer) showArmy: on # Show hints window @@ -417,16 +417,19 @@ # Use RSA verification useRsa: on -# Change shields color on ship damage +# Change shields graphic on shield damage varyShields: on +# Change shields color on shield damage +varyShieldsColor: on + # Show limits of tactical display on galaxy viewBox: on # Warn hull state based on damage warnHull: off -# Change shields color on enemy approach +# Change shields color on enemy approach, overrides varyShieldsColor warnShields: off # Draw warp streaks while transwarping to starbase Index: netrekrc_options.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc_options.txt,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- netrekrc_options.txt 23 Feb 2007 13:43:56 -0000 1.25 +++ netrekrc_options.txt 24 Feb 2007 10:19:54 -0000 1.26 @@ -231,7 +231,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 +showArmy: (on/off) show army count of planet you are orbiting (or locked on as observer) showHints: (on/off) show hints window showHockeyLinesLocal: (on/off) show hockey lines on tactical showHockeyLinesMap: (on/off) show hockey lines on galactic @@ -286,7 +286,8 @@ defLite: (on/off) use default beeplite settings useRSA: (on/off) use RSA client verification useRSA. (on/off) user RSA for -varyShields: (on/off) change shields color on shields damage +varyShields: (on/off) change shields graphic on shield damage +varyShieldsColor: (on/off) change shields color on shield damage viewBox: (on/off) show tactical window boundaries on map warnHull: (on/off) warn hull state based on damage warnShields: (on/off) change shields color on enemy approach Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.107 retrieving revision 1.108 diff -u -d -r1.107 -r1.108 --- changes.txt 22 Feb 2007 17:44:34 -0000 1.107 +++ changes.txt 24 Feb 2007 10:19:54 -0000 1.108 @@ -1,7 +1,12 @@ Netrek XP 2006, Version 1.2: (Released Feb-2007) -- the varyShields option now scales shield damage properly, previously it would go straight - from green to red shields, now there is an intermediate yellow state as well. Damage threshholds - are the somewhat standard 33%/66% for transition between green-yellow and yellow-red. +- the showArmy option now allows observers to lock onto a planet and see the army count +- the varyShields option now only controls shield graphic, not shield color +- new netrekrc option "varyShieldsColor: (on)/off" which colors shield based on damage, + and fixes a previous problem where shield color would go straight from green to red. + Now there is an intermediate yellow state as well. Damage threshholds are the somewhat + standard 33%/66% for transition between green-yellow and yellow-red. +- observer support for vary shields, vary shields color, warn shields, shrink phasers and + colorful (jubilee) phasers - added "autoRotate: on/(off)" to automatically rotate the galaxy when you enter so that your team and largest other team are on the left hand side of the galaxy, if possible. - added "playerListBlankZeroKills: (on)/off" to choose whether or not to display 0.00 kills From modemhero at users.sourceforge.net Sat Feb 24 04:19:56 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 24 Feb 2007 10:19:56 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.96, 1.97 build.cmd, 1.22, 1.23 clientr.suo, 1.75, 1.76 clientr.vcproj, 1.6, 1.7 Message-ID: <20070224102005.A0477B439@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11912 Modified Files: NetrekXP to do list.C build.cmd clientr.suo clientr.vcproj Log Message: Cygwin makefile changes: fixed up a bunch of problems to get build to work, still not perfect as libdir not resolving correctly. Also removed CYGWIN define from code and placed it as a compiler runtime define. Progress of Cygwin build is that client runs, but select() is broken. Most likely related to struct fd_set definition. Added observer support for shrink phasers, color phaser, warn and vary shields, and removed observer support for detcircle. Fixed detcircle so turning it off really does turn it off (oops). Fixed color phaser with regards to FPS changes, so it works at all framerates. Added observer support for showArmy for locking onto planets. Split varyShields into 2 netrekrc options, varyShields and varyShieldsColor, to be able to vary either/neither/both shield graphic and shield color with damage. Changed defaults for FPS client/server values back to 10 from 50. Let the user have it in netrekrc if they want to request a higher rate, and don't assume servers are running at 50 FPS. Require that feature packet to be sent to increase the update rate. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.75 retrieving revision 1.76 diff -u -d -r1.75 -r1.76 Binary files /tmp/cvs2LznnW and /tmp/cvsTWqDy7 differ Index: clientr.vcproj =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.vcproj,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- clientr.vcproj 19 Jun 2006 04:46:02 -0000 1.6 +++ clientr.vcproj 24 Feb 2007 10:19:54 -0000 1.7 @@ -22,6 +22,7 @@ UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" CharacterSet="2" + WholeProgramOptimization="0" > Update of /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11912/resources/htmlhelp/html Modified Files: generalconfig.html Log Message: Cygwin makefile changes: fixed up a bunch of problems to get build to work, still not perfect as libdir not resolving correctly. Also removed CYGWIN define from code and placed it as a compiler runtime define. Progress of Cygwin build is that client runs, but select() is broken. Most likely related to struct fd_set definition. Added observer support for shrink phasers, color phaser, warn and vary shields, and removed observer support for detcircle. Fixed detcircle so turning it off really does turn it off (oops). Fixed color phaser with regards to FPS changes, so it works at all framerates. Added observer support for showArmy for locking onto planets. Split varyShields into 2 netrekrc options, varyShields and varyShieldsColor, to be able to vary either/neither/both shield graphic and shield color with damage. Changed defaults for FPS client/server values back to 10 from 50. Let the user have it in netrekrc if they want to request a higher rate, and don't assume servers are running at 50 FPS. Require that feature packet to be sent to increase the update rate. Index: generalconfig.html =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html/generalconfig.html,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- generalconfig.html 23 Feb 2007 13:43:56 -0000 1.26 +++ generalconfig.html 24 Feb 2007 10:19:54 -0000 1.27 @@ -1033,7 +1033,7 @@ showArmy -Show army count of planet you are orbiting +Show army count of planet you are orbiting (or locked on as observer)
  • on (default)
  • @@ -1355,7 +1355,17 @@ varyShields -Vary shields color by damage +Vary shields graphic by damage + +
      +
    • on (default)
    • +
    • off
    • +
    + + + +varyShieldsColor +Vary shields color by damage
    • on (default)
    • From modemhero at users.sourceforge.net Sat Feb 24 04:19:57 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 24 Feb 2007 10:19:57 +0000 Subject: [netrek-cvs] client/netrekxp/src data.c, 1.52, 1.53 defaults.c, 1.43, 1.44 defwin.c, 1.5, 1.6 local.c, 1.56, 1.57 makecyg, 1.1, 1.2 option.c, 1.27, 1.28 Message-ID: <20070224102006.38E18B43E@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11912/src Modified Files: data.c defaults.c defwin.c local.c makecyg option.c Log Message: Cygwin makefile changes: fixed up a bunch of problems to get build to work, still not perfect as libdir not resolving correctly. Also removed CYGWIN define from code and placed it as a compiler runtime define. Progress of Cygwin build is that client runs, but select() is broken. Most likely related to struct fd_set definition. Added observer support for shrink phasers, color phaser, warn and vary shields, and removed observer support for detcircle. Fixed detcircle so turning it off really does turn it off (oops). Fixed color phaser with regards to FPS changes, so it works at all framerates. Added observer support for showArmy for locking onto planets. Split varyShields into 2 netrekrc options, varyShields and varyShieldsColor, to be able to vary either/neither/both shield graphic and shield color with damage. Changed defaults for FPS client/server values back to 10 from 50. Let the user have it in netrekrc if they want to request a higher rate, and don't assume servers are running at 50 FPS. Require that feature packet to be sent to increase the update rate. Index: makecyg =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/makecyg,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- makecyg 23 Feb 2007 13:43:57 -0000 1.1 +++ makecyg 24 Feb 2007 10:19:55 -0000 1.2 @@ -7,18 +7,18 @@ # Cygwin cc = gcc -rc = gcc +rc = windres link = gcc compileandlink = gcc # Compiler and linker flags ifndef DEBUG -cflags = -O2 -v -DWIN32 -DBorland -mwindows +cflags = -O2 -g -v -DWIN32 -DCYGWIN -mwindows ccompileonly = -c ldebug = -v DEBUGDEFS = -DDEBUG else -cflags = -O2 -DWIN32 -DBorland -mwindows +cflags = -O2 -g -DWIN32 -DCYGWIN -mwindows ccompileonly = -c ldebug = -w-dup endif @@ -29,16 +29,14 @@ LIBS = /cygdrive/c/netrekxp/win32/lib/VCC/SDL.LIB \ /cygdrive/c/netrekxp/win32/lib/VCC/SDL_mixer.LIB \ /cygdrive/c/netrekxp/win32/lib/VCC/SDLmain.LIB \ -# "/cygdrive/c/Program Files/Microsoft Platform SDK/Lib/LibCW32mt.LIB" \ -# "/cygdrive/c/Program Files/Microsoft Platform SDK/Lib/IMPORT32.LIB" \ - "/cygdrive/c/Program Files/Microsoft Platform SDK/Lib/User32.lib" \ - "/cygdrive/c/Program Files/Microsoft Platform SDK/Lib/Gdi32.lib" \ - "/cygdrive/c/Program Files/Microsoft Platform SDK/Lib/Wsock32.lib" \ - "/cygdrive/c/Program Files/Microsoft Platform SDK/Lib/Kernel32.lib" \ - "/cygdrive/c/Program Files/Microsoft Platform SDK/Lib/Shell32.lib" \ - "/cygdrive/c/Program Files/Microsoft Platform SDK/Lib/Winmm.lib" \ - "/cygdrive/c/Program Files/Microsoft Platform SDK/Lib/Mpr.lib" \ - "/cygdrive/c/Program Files/Microsoft Platform SDK/Lib/Msimg32.lib" \ + /cygdrive/c/netrekxp/win32/lib/VCC/User32.lib \ + /cygdrive/c/netrekxp/win32/lib/VCC/Gdi32.lib \ + /cygdrive/c/netrekxp/win32/lib/VCC/Wsock32.lib \ + /cygdrive/c/netrekxp/win32/lib/VCC/Kernel32.lib \ + /cygdrive/c/netrekxp/win32/lib/VCC/Shell32.lib \ + /cygdrive/c/netrekxp/win32/lib/VCC/Winmm.lib \ + /cygdrive/c/netrekxp/win32/lib/VCC/Mpr.lib \ + /cygdrive/c/netrekxp/win32/lib/VCC/Msimg32.lib \ $(GMPLIB) INCS = -I/cygdrive/c/netrekxp/include -I/cygdrive/c/netrekxp/win32 -I/cygdrive/c/netrekxp/win32/h -I/cygdrive/c/netrekxp/win32/SDL/ @@ -70,7 +68,7 @@ MAINSRC = main.c ifndef RSA -GMPLIB = ..\Win32\lib\BCC\libgmpbcc.lib +GMPLIB = ..\Win32\lib\libgmp.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 @@ -93,10 +91,10 @@ .c.o: $(cc) $(cflags) $(ccompileonly) $(cdebug) $(DEFS) $(RSADEFS) $(DEBUGDEFS) $(INCS) $< -#RESOURCES = bccnetrek.res +RESOURCES = vccnetrek.o -#$(RESOURCES): bccnetrek.rc -# $(rc) bccnetrek.rc +$(RESOURCES): vccnetrek.rc + $(rc) -o vccnetrek.o vccnetrek.rc netrek.exe: $(OBJS) $(RESOURCES) main.ico $(link) $(ldebug) $(LIBOPTS) $(OBJS) $(LIBS) $(RESOURCES) Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- local.c 23 Feb 2007 13:43:56 -0000 1.56 +++ local.c 24 Feb 2007 10:19:55 -0000 1.57 @@ -533,9 +533,12 @@ clearzone[3][clearcount] = W_Textheight; clearcount++; } - - if (showArmy && (me->p_flags & PFORBIT) - && (F_sp_generic_32 ? me->pl_orbit : get_closest_planet(me->p_x, me->p_y)) == l->pl_no) + + /* Allow army display if player/observer is orbitting a planet, or alternatively + if observer is locked onto a planet */ + if (showArmy && + ( (me->p_flags & PFORBIT) && (F_sp_generic_32 ? me->pl_orbit : get_closest_planet(me->p_x, me->p_y)) == l->pl_no) + || ((me->p_flags & PFPLLOCK) && (me->p_flags & PFOBSERV) && (me->p_planet == l->pl_no)) ) { char armbuf[4]; int armbuflen; @@ -1085,14 +1088,19 @@ #ifdef VSHIELD_BITMAPS int shieldnum; - if (j == me && varyShields) + if ((myPlayer(j) || isObsLockPlayer(j)) && varyShields) { - int value; - shieldnum = SHIELD_FRAMES * me->p_shield / me->p_ship.s_maxshield; if (shieldnum >= SHIELD_FRAMES) shieldnum = SHIELD_FRAMES - 1; + } + else + shieldnum = 2; + + if ((myPlayer(j) || isObsLockPlayer(j)) && varyShieldsColor) + { + int value; value = (100 * me->p_shield) / me->p_ship.s_maxshield; if (value <= 33) color = rColor; @@ -1102,13 +1110,10 @@ color = gColor; } else - { color = playerColor (j); - shieldnum = 2; - } #endif - if (warnShields && j == me) + if (warnShields && (myPlayer(j) || isObsLockPlayer(j))) { switch (me->p_flags & (PFGREEN | PFYELLOW | PFRED)) { @@ -1193,9 +1198,9 @@ } } /* Det circle */ - if (showdetCircle) + if (detCircle && showdetCircle) { - if (myPlayer(j) || isObsLockPlayer(j)) + if (myPlayer(j)) { W_WriteCircle(w, WINSIDE/2, WINSIDE/2, DETDIST/SCALE, 0, W_Red); clearzone[0][clearcount] = WINSIDE/2 - (DETDIST/SCALE); @@ -1517,7 +1522,7 @@ if (shrinkPhaserOnMiss || php->ph_status != PHMISS) { - if (j == me) + if (myPlayer(j) || isObsLockPlayer(j)) { if (phaserShrinkStyle == 1) { @@ -1553,7 +1558,7 @@ if (friendlyPlayer (j)) { #ifdef JUBILEE_PHASERS - if (j == me && php->ph_status == PHHIT && colorfulPhasers) + if ((myPlayer(j) || isObsLockPlayer(j)) && php->ph_status == PHHIT && colorfulPhasers) { int col; @@ -1579,7 +1584,7 @@ col = shipCol[remap[j->p_team]]; break; } - ph_col += (100/j->p_ship.s_phaserfuse/updatesPerSec); + ph_col += (10/j->p_ship.s_phaserfuse); scaled_ph_col = ph_col * 10 / server_ups; if (phaserShrinkStyle == 1) { @@ -1595,7 +1600,7 @@ { if (php->ph_status != PHMISS) { - if (phaserShrinkStyle == 1 && j == me) + if (phaserShrinkStyle == 1 && (myPlayer(j) || isObsLockPlayer(j))) { get_shrink_phaser_coords(&new_dx, &new_dy, px, py, tx, ty, Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- defaults.c 23 Feb 2007 13:43:56 -0000 1.43 +++ defaults.c 24 Feb 2007 10:19:54 -0000 1.44 @@ -588,7 +588,7 @@ }, {"showArmy", &showArmy, RC_BOOL, { - "Show army count of planet you are orbiting", + "Show army count of planet you are orbiting (or locked on as observer)", NULL } }, @@ -814,7 +814,13 @@ #ifdef VSHIELD_BITMAPS {"varyShields", &varyShields, RC_BOOL, { - "Change shields color on ship damage", + "Change shields graphic on shield damage", + NULL + } + }, + {"varyShieldsColor", &varyShieldsColor, RC_BOOL, + { + "Change shields color on shield damage", NULL } }, @@ -833,7 +839,7 @@ }, {"warnShields", &warnShields, RC_BOOL, { - "Change shields color on enemy approach", + "Change shields color on enemy approach, overrides varyShieldsColor", NULL } }, @@ -1599,6 +1605,7 @@ #ifdef VSHIELD_BITMAPS varyShields = booleanDefault ("varyShields", varyShields); + varyShieldsColor = booleanDefault ("varyShieldsColor", varyShieldsColor); #endif warnShields = booleanDefault ("warnShields", warnShields); Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- data.c 23 Feb 2007 13:43:56 -0000 1.52 +++ data.c 24 Feb 2007 10:19:54 -0000 1.53 @@ -228,9 +228,9 @@ #endif -int updatesPerSec = 50; /* client requested updates per second */ -int server_ups = 50; /* server responded updates per second */ -int server_fps = 50; /* server configured frames per second */ +int updatesPerSec = 10; /* client requested updates per second */ +int server_ups = 10; /* server responded updates per second */ +int server_fps = 10; /* server configured frames per second */ #ifdef META /* Metaservers list - comma delimited */ @@ -286,6 +286,7 @@ W_Icon base_vshield; W_Icon shield[SHIELD_FRAMES], cloakicon; int varyShields = 1; +int varyShieldsColor = 1; #else W_Icon shield, cloakicon; Index: defwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defwin.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- defwin.c 14 May 2006 02:14:54 -0000 1.5 +++ defwin.c 24 Feb 2007 10:19:55 -0000 1.6 @@ -18,6 +18,23 @@ * the use of it.) * * $Log$ + * Revision 1.6 2007/02/24 10:19:55 modemhero + * Cygwin makefile changes: fixed up a bunch of problems to get build to work, still not + * perfect as libdir not resolving correctly. Also removed CYGWIN define from code and + * placed it as a compiler runtime define. Progress of Cygwin build is that client runs, but + * select() is broken. Most likely related to struct fd_set definition. + * Added observer support for shrink phasers, color phaser, warn and vary shields, and + * removed observer support for detcircle. + * Fixed detcircle so turning it off really does turn it off (oops). + * Fixed color phaser with regards to FPS changes, so it works at all framerates. + * Added observer support for showArmy for locking onto planets. + * Split varyShields into 2 netrekrc options, varyShields and varyShieldsColor, to be + * able to vary either/neither/both shield graphic and shield color with damage. + * Changed defaults for FPS client/server values back to 10 from 50. Let the user + * have it in netrekrc if they want to request a higher rate, and don't assume servers + * are running at 50 FPS. Require that feature packet to be sent to increase the + * update rate. + * * 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 @@ -105,6 +122,8 @@ values[10]; } +/* This structure is for XTREKRC_HELP, which is OFF by default. + Netrekrc options are now processed by save_options in defaults.c */ def_messages[] = { { @@ -398,7 +417,7 @@ #endif #ifdef VSHIELD_BITMAPS { - "varyShields", BOOL_DEF, "Vary shields base on damage", + "varyShields", BOOL_DEF, "Vary shields based on damage", &varyShields, { {0, NULL, ""}, Index: option.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/option.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- option.c 23 Feb 2007 13:43:56 -0000 1.27 +++ option.c 24 Feb 2007 10:19:55 -0000 1.28 @@ -187,7 +187,7 @@ * (optional) */ char **op_array; /* array of strings to * switch between */ - struct int_range *op_range; /* struct definint an + struct int_range *op_range; /* struct defining an * integer range option */ }; @@ -248,7 +248,8 @@ {1, "", &colorClient, 0, 0, 0, bitmaptypemess, &bitmap_range}, {1, "use color weapon bitmaps", &colorWeapons, 0, 0, 0, NULL, NULL}, #ifdef VSHIELD_BITMAPS - {1, "vary shields bitmap", &varyShields, 0, 0, 0, NULL, NULL}, + {1, "vary shields bitmap w/ dam", &varyShields, 0, 0, 0, NULL, NULL}, + {1, "vary shields color w/ dam", &varyShieldsColor, 0, 0, 0, NULL, NULL}, #endif {1, "use warning shields", &warnShields, 0, 0, 0, NULL, NULL}, {1, "use warning hull", &vary_hull, 0, 0, 0, NULL, NULL}, From modemhero at users.sourceforge.net Sat Feb 24 04:19:57 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 24 Feb 2007 10:19:57 +0000 Subject: [netrek-cvs] client/netrekxp/win32 config.h,1.13,1.14 Message-ID: <20070224102005.DB387B43D@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/win32 In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11912/win32 Modified Files: config.h Log Message: Cygwin makefile changes: fixed up a bunch of problems to get build to work, still not perfect as libdir not resolving correctly. Also removed CYGWIN define from code and placed it as a compiler runtime define. Progress of Cygwin build is that client runs, but select() is broken. Most likely related to struct fd_set definition. Added observer support for shrink phasers, color phaser, warn and vary shields, and removed observer support for detcircle. Fixed detcircle so turning it off really does turn it off (oops). Fixed color phaser with regards to FPS changes, so it works at all framerates. Added observer support for showArmy for locking onto planets. Split varyShields into 2 netrekrc options, varyShields and varyShieldsColor, to be able to vary either/neither/both shield graphic and shield color with damage. Changed defaults for FPS client/server values back to 10 from 50. Let the user have it in netrekrc if they want to request a higher rate, and don't assume servers are running at 50 FPS. Require that feature packet to be sent to increase the update rate. Index: config.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/win32/config.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- config.h 23 Feb 2007 13:43:57 -0000 1.13 +++ config.h 24 Feb 2007 10:19:55 -0000 1.14 @@ -21,7 +21,6 @@ */ #define CBUGS "Send bugs/suggestion to: billbalcerski at hotmail.com" -//#define CYGWIN /* For compiling with Cygwin */ /* ################################################################################ From modemhero at users.sourceforge.net Sat Feb 24 04:19:56 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 24 Feb 2007 10:19:56 +0000 Subject: [netrek-cvs] client/netrekxp/src/cursors makecyg,1.1,1.2 Message-ID: <20070224102005.AB67DB43A@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src/cursors In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11912/src/cursors Modified Files: makecyg Log Message: Cygwin makefile changes: fixed up a bunch of problems to get build to work, still not perfect as libdir not resolving correctly. Also removed CYGWIN define from code and placed it as a compiler runtime define. Progress of Cygwin build is that client runs, but select() is broken. Most likely related to struct fd_set definition. Added observer support for shrink phasers, color phaser, warn and vary shields, and removed observer support for detcircle. Fixed detcircle so turning it off really does turn it off (oops). Fixed color phaser with regards to FPS changes, so it works at all framerates. Added observer support for showArmy for locking onto planets. Split varyShields into 2 netrekrc options, varyShields and varyShieldsColor, to be able to vary either/neither/both shield graphic and shield color with damage. Changed defaults for FPS client/server values back to 10 from 50. Let the user have it in netrekrc if they want to request a higher rate, and don't assume servers are running at 50 FPS. Require that feature packet to be sent to increase the update rate. Index: makecyg =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/cursors/makecyg,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- makecyg 23 Feb 2007 13:43:57 -0000 1.1 +++ makecyg 24 Feb 2007 10:19:54 -0000 1.2 @@ -3,20 +3,19 @@ # # Cygwin -cc = bcc32 -rc = brcc32 -link = ilink32 -compileandlink = bcc32 +cc = gcc +rc = windres +link = gcc all: curslib.dll -RESOURCES = curslib.res +RESOURCES = curslib.o $(RESOURCES): curslib.rc - $(rc) -FOcurslib.res curslib.rc + $(rc) -o curslib.o curslib.rc curslib.dll: $(RESOURCES) - $(link) -Tpd -aa -V4.0 -c -x C0d32.OBJ, curslib.dll,, import32.lib cw32i.lib, , $(RESOURCES) + $(link) -shared -o curslib.dll $(RESOURCES) clean: - del curslib \ No newline at end of file + rm curslib.dll curslib.ilc curslib.ild curslib.ilf curslib.ils curslib.o curslib.tds \ No newline at end of file From modemhero at users.sourceforge.net Sat Feb 24 04:19:57 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 24 Feb 2007 10:19:57 +0000 Subject: [netrek-cvs] client/netrekxp/src/winkey makecyg,1.1,1.2 Message-ID: <20070224102005.CA1581867E9@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src/winkey In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11912/src/winkey Modified Files: makecyg Log Message: Cygwin makefile changes: fixed up a bunch of problems to get build to work, still not perfect as libdir not resolving correctly. Also removed CYGWIN define from code and placed it as a compiler runtime define. Progress of Cygwin build is that client runs, but select() is broken. Most likely related to struct fd_set definition. Added observer support for shrink phasers, color phaser, warn and vary shields, and removed observer support for detcircle. Fixed detcircle so turning it off really does turn it off (oops). Fixed color phaser with regards to FPS changes, so it works at all framerates. Added observer support for showArmy for locking onto planets. Split varyShields into 2 netrekrc options, varyShields and varyShieldsColor, to be able to vary either/neither/both shield graphic and shield color with damage. Changed defaults for FPS client/server values back to 10 from 50. Let the user have it in netrekrc if they want to request a higher rate, and don't assume servers are running at 50 FPS. Require that feature packet to be sent to increase the update rate. Index: makecyg =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/winkey/makecyg,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- makecyg 23 Feb 2007 13:43:57 -0000 1.1 +++ makecyg 24 Feb 2007 10:19:55 -0000 1.2 @@ -5,10 +5,10 @@ #DEBUG = 1 # Cygwin -cc = bcc32 -rc = brcc32 -link = ilink32 -compileandlink = bcc32 +cc = gcc +rc = gcc +link = gcc +compileandlink = gcc !IFDEF DEBUG cflags = -O2 -5 -v -pr -DWIN32 -DBorland -tW -tWM @@ -27,4 +27,4 @@ $(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 \ No newline at end of file + rm winkey.dll *.obj *.ilc *.ild *.ilf *.ils *.tds \ No newline at end of file From modemhero at users.sourceforge.net Sat Feb 24 04:19:56 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sat, 24 Feb 2007 10:19:56 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h,1.48,1.49 Message-ID: <20070224102005.D07A7B43B@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11912/include Modified Files: data.h Log Message: Cygwin makefile changes: fixed up a bunch of problems to get build to work, still not perfect as libdir not resolving correctly. Also removed CYGWIN define from code and placed it as a compiler runtime define. Progress of Cygwin build is that client runs, but select() is broken. Most likely related to struct fd_set definition. Added observer support for shrink phasers, color phaser, warn and vary shields, and removed observer support for detcircle. Fixed detcircle so turning it off really does turn it off (oops). Fixed color phaser with regards to FPS changes, so it works at all framerates. Added observer support for showArmy for locking onto planets. Split varyShields into 2 netrekrc options, varyShields and varyShieldsColor, to be able to vary either/neither/both shield graphic and shield color with damage. Changed defaults for FPS client/server values back to 10 from 50. Let the user have it in netrekrc if they want to request a higher rate, and don't assume servers are running at 50 FPS. Require that feature packet to be sent to increase the update rate. Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- data.h 23 Feb 2007 13:43:55 -0000 1.48 +++ data.h 24 Feb 2007 10:19:54 -0000 1.49 @@ -285,6 +285,7 @@ extern W_Icon base_vshield; extern W_Icon shield[SHIELD_FRAMES], cloakicon; extern int varyShields; +extern int varyShieldsColor; #else extern W_Icon shield, cloakicon; From modemhero at users.sourceforge.net Sat Feb 24 18:19:02 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 25 Feb 2007 00:19:02 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.108, 1.109 Message-ID: <20070225001912.07688B429@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv16522/resources/docs Modified Files: changes.txt Log Message: Proper solution to longstanding issue of how to handle phaser sounds. New variable in struct phaser that toggles on when phaser packet is received, to indicate that phaser needs to have the sound played. Prior methods of phaser sounds had issues with cloakers, observers, etc. Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.108 retrieving revision 1.109 diff -u -d -r1.108 -r1.109 --- changes.txt 24 Feb 2007 10:19:54 -0000 1.108 +++ changes.txt 25 Feb 2007 00:18:59 -0000 1.109 @@ -1,4 +1,6 @@ Netrek XP 2006, Version 1.2: (Released Feb-2007) +- fixed bug with phaser sounds that were causing others' phasers to play repeatedly + during the duration of their phaser cycle - the showArmy option now allows observers to lock onto a planet and see the army count - the varyShields option now only controls shield graphic, not shield color - new netrekrc option "varyShieldsColor: (on)/off" which colors shield based on damage, From modemhero at users.sourceforge.net Sat Feb 24 18:19:02 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 25 Feb 2007 00:19:02 +0000 Subject: [netrek-cvs] client/netrekxp/src cowmain.c, 1.21, 1.22 enter.c, 1.4, 1.5 local.c, 1.57, 1.58 short.c, 1.13, 1.14 socket.c, 1.17, 1.18 Message-ID: <20070225001912.B5774B42A@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv16522/src Modified Files: cowmain.c enter.c local.c short.c socket.c Log Message: Proper solution to longstanding issue of how to handle phaser sounds. New variable in struct phaser that toggles on when phaser packet is received, to indicate that phaser needs to have the sound played. Prior methods of phaser sounds had issues with cloakers, observers, etc. Index: cowmain.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/cowmain.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- cowmain.c 1 Feb 2007 00:10:28 -0000 1.21 +++ cowmain.c 25 Feb 2007 00:19:00 -0000 1.22 @@ -1073,7 +1073,7 @@ /* `=' style update to get the kills in the playerlist right */ sendUdpReq (COMM_UPDATE); #endif - /* Send request for updatesPerSec. New servers now support 10 u/s */ + /* Send request for updatesPerSec. New servers now support 50 u/s */ sendUpdatePacket (1000000 / updatesPerSec); isFirstEntry = 0; Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- local.c 24 Feb 2007 10:19:55 -0000 1.57 +++ local.c 25 Feb 2007 00:19:00 -0000 1.58 @@ -37,8 +37,6 @@ #endif static int planet_frame = 0; #ifdef SOUND -static int sound_phaser = 0; -static int sound_other_phaser = 0; static int sound_torps = 0; static int sound_other_torps = 0; static int num_other_torps = 0; @@ -1249,17 +1247,9 @@ } #endif - /* When cloaked, stop here. But need to reset the sound_phaser counter - to 0, otherwise other people's phaser sounds don't play while you are - cloaked. Not necessary to check against phaser PHFREE status.*/ + /* When cloaked, stop here. */ if (j->p_flags & PFCLOAK) - { -#ifdef SOUND - if (myPlayer(j) || isObsLockPlayer(j)) - sound_phaser = 0; -#endif continue; - } { int color = playerColor (j); @@ -1437,7 +1427,7 @@ { #ifdef SOUND - if (!sound_phaser) + if (php->sound_phaser) { if (newSound) { @@ -1474,7 +1464,7 @@ Play_Sound((myPlayer(j) || isObsLockPlayer(j)) ? PHASER_SOUND : OTHER_PHASER_SOUND); - sound_phaser++; + php->sound_phaser = 0; } #endif @@ -1482,6 +1472,9 @@ { /* Expire the phaser */ php->ph_status = PHFREE; +#ifdef SOUND + php->sound_phaser = 0; +#endif } else { @@ -1699,11 +1692,6 @@ } } -#ifdef SOUND - else if (myPlayer(j) || isObsLockPlayer(j)) - sound_phaser = 0; -#endif - /* ATM - show tractor/pressor beams (modified by James Collins) */ /* showTractorPressor is a variable set by xtrekrc. */ Index: enter.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/enter.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- enter.c 21 Feb 2007 15:17:06 -0000 1.4 +++ enter.c 25 Feb 2007 00:19:00 -0000 1.5 @@ -78,7 +78,12 @@ torps[i].t_owner = (short) (i / MAXTORP); } for (i = 0; i < MAXPLAYER; i++) + { phasers[i].ph_status = PHFREE; +#ifdef SOUND + phasers[i].sound_phaser = 0; +#endif + } for (i = 0; i < MAXPLAYER * MAXPLASMA; i++) { Index: short.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/short.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- short.c 23 Feb 2007 13:43:57 -0000 1.13 +++ short.c 25 Feb 2007 00:19:00 -0000 1.14 @@ -2003,8 +2003,12 @@ phas->ph_y = y; phas->ph_target = (short) target; phas->ph_fuse = 0; +#ifdef SOUND + phas->sound_phaser = 1; +#endif + /* normalized fuses */ phas->ph_updateFuse = PHASER_UPDATE_FUSE * server_ups / 10; - phas->ph_maxfuse = (players[pnum].p_ship.s_phaserfuse * updatesPerSec) / 10; + phas->ph_maxfuse = (players[pnum].p_ship.s_phaserfuse * server_ups) / 10; #ifdef ROTATERACE if (rotate) Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- socket.c 23 Feb 2007 13:43:57 -0000 1.17 +++ socket.c 25 Feb 2007 00:19:00 -0000 1.18 @@ -1607,10 +1607,13 @@ phas->ph_x = ntohl (packet->x); phas->ph_y = ntohl (packet->y); phas->ph_target = (short) (ntohl (packet->target)); - phas->ph_fuse = 0; /* NEW */ + phas->ph_fuse = 0; +#ifdef SOUND + phas->sound_phaser = 1; +#endif + /* normalized fuses */ phas->ph_updateFuse = PHASER_UPDATE_FUSE * server_ups / 10; - /* normalized maxfuse */ - phas->ph_maxfuse = (players[packet->pnum].p_ship.s_phaserfuse * updatesPerSec) / 10; + phas->ph_maxfuse = (players[packet->pnum].p_ship.s_phaserfuse * server_ups) / 10; #ifdef ROTATERACE if (rotate) From modemhero at users.sourceforge.net Sat Feb 24 18:19:01 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 25 Feb 2007 00:19:01 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.97, 1.98 clientr.suo, 1.76, 1.77 Message-ID: <20070225001911.21A06B40A@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv16522 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Proper solution to longstanding issue of how to handle phaser sounds. New variable in struct phaser that toggles on when phaser packet is received, to indicate that phaser needs to have the sound played. Prior methods of phaser sounds had issues with cloakers, observers, etc. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.97 retrieving revision 1.98 diff -u -d -r1.97 -r1.98 --- NetrekXP to do list.C 24 Feb 2007 10:19:52 -0000 1.97 +++ NetrekXP to do list.C 25 Feb 2007 00:18:54 -0000 1.98 @@ -47,8 +47,6 @@ 9) Out of bounds message window calcs don't work with taskbar or menu bar, basewin rect doesn't take these into account. 10) Make sure all ping related fields are switched correctly via metasort. -11) Problem with enemy phaser sounds in general..they play repeatedly ever -local redraw. Most noticeable at 50 fps. Stas's list: - color coded playerlist. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.76 retrieving revision 1.77 diff -u -d -r1.76 -r1.77 Binary files /tmp/cvsuLQxM2 and /tmp/cvspP4z5v differ From modemhero at users.sourceforge.net Sat Feb 24 18:19:02 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 25 Feb 2007 00:19:02 +0000 Subject: [netrek-cvs] client/netrekxp/include struct.h,1.13,1.14 Message-ID: <20070225001911.1D3F51867DF@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv16522/include Modified Files: struct.h Log Message: Proper solution to longstanding issue of how to handle phaser sounds. New variable in struct phaser that toggles on when phaser packet is received, to indicate that phaser needs to have the sound played. Prior methods of phaser sounds had issues with cloakers, observers, etc. Index: struct.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/struct.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- struct.h 13 Dec 2006 09:03:00 -0000 1.13 +++ struct.h 25 Feb 2007 00:18:59 -0000 1.14 @@ -354,6 +354,9 @@ short ph_fuse; /* Life left for drawing */ int ph_x, ph_y; /* For when it hits a torp */ int ph_maxfuse; /* maxfuse normalized for updates per sec */ +#ifdef SOUND + int sound_phaser; /* If phaser sound should be played or not */ +#endif }; From modemhero at users.sourceforge.net Sun Feb 25 02:01:35 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 25 Feb 2007 08:01:35 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.98, 1.99 clientr.suo, 1.77, 1.78 Message-ID: <20070225080147.614A5B439@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23423 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Warpstreaks fixed to work with variable update rates. Changes notes that FPS changes are now fully integrated into client Typo fix on base orbit warn message. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.98 retrieving revision 1.99 diff -u -d -r1.98 -r1.99 --- NetrekXP to do list.C 25 Feb 2007 00:18:54 -0000 1.98 +++ NetrekXP to do list.C 25 Feb 2007 08:01:31 -0000 1.99 @@ -15,8 +15,8 @@ 8) newbie/pret: monitor vs full_hostname 9) on daemon exit in newbie/pret, kill any hosed bot slots 10) end game bots are stupid, and on timericide don't act right +11) feature packet for rank names and requirements 12) final planet count and cscore would be nice in pw_stats -14) sysdef option for base orbit enemy planets 15) phaser misses have the client computer phaser length, but with phaser upgrades, this causes a mismatch in the actual phaser length for other players. Server needs to somehow relay phaser damage values for other ships, perhaps in generic_32? Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.77 retrieving revision 1.78 diff -u -d -r1.77 -r1.78 Binary files /tmp/cvsIwli8A and /tmp/cvsW49wOH differ From modemhero at users.sourceforge.net Sun Feb 25 02:01:35 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 25 Feb 2007 08:01:35 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.109, 1.110 Message-ID: <20070225080147.5E2061867D4@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23423/resources/docs Modified Files: changes.txt Log Message: Warpstreaks fixed to work with variable update rates. Changes notes that FPS changes are now fully integrated into client Typo fix on base orbit warn message. Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.109 retrieving revision 1.110 diff -u -d -r1.109 -r1.110 --- changes.txt 25 Feb 2007 00:18:59 -0000 1.109 +++ changes.txt 25 Feb 2007 08:01:33 -0000 1.110 @@ -1,4 +1,8 @@ Netrek XP 2006, Version 1.2: (Released Feb-2007) +- full support for server FPS feature, allowing client to receive up to 50 updates/second! + In specific, all redraw animations (phaser cycling, torp/plasma spin, torp/plasma det, + explosions, cloaking, beeplite, warpstreaks, planet rotation) had to be modified so that + they all properly redraw no matter what update rate the client is running at. - fixed bug with phaser sounds that were causing others' phasers to play repeatedly during the duration of their phaser cycle - the showArmy option now allows observers to lock onto a planet and see the army count From modemhero at users.sourceforge.net Sun Feb 25 02:01:36 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 25 Feb 2007 08:01:36 +0000 Subject: [netrek-cvs] client/netrekxp/src local.c, 1.58, 1.59 short.c, 1.14, 1.15 Message-ID: <20070225080147.69B81B43B@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23423/src Modified Files: local.c short.c Log Message: Warpstreaks fixed to work with variable update rates. Changes notes that FPS changes are now fully integrated into client Typo fix on base orbit warn message. Index: short.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/short.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- short.c 25 Feb 2007 00:19:00 -0000 1.14 +++ short.c 25 Feb 2007 08:01:34 -0000 1.15 @@ -162,7 +162,7 @@ /* orbit.c */ /* orbit() */ "Helmsman: Captain, the maximum safe speed for docking or orbiting is warp 2!", /* 79 */ - "Central Command regulations prohibits you from orbiting foreign planets", /* 80 */ + "Central Command regulations prohibit you from orbiting foreign planets", /* 80 */ "Helmsman: Sensors read no valid targets in range to dock or orbit sir!", /* 81 */ /* redraw.c */ "No more room on board for armies", /* 82 */ Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- local.c 25 Feb 2007 00:19:00 -0000 1.58 +++ local.c 25 Feb 2007 08:01:33 -0000 1.59 @@ -36,6 +36,9 @@ static int clearline[4][MAXPLAYER + 2 * MAXPLAYER]; #endif static int planet_frame = 0; +static int star_updates = 0; +static int last_speed = 0; +static int streaks_on = 0; #ifdef SOUND static int sound_torps = 0; static int sound_other_torps = 0; @@ -120,7 +123,16 @@ int sector_offx = me->p_x - sectorx * (fullview); int sector_offy = me->p_y - sectory * (fullview); int l = 0, r = 0, t = 0, b = 0; - + + if (warpStreaks && streaks_on) + /* Streaks_on is toggled on by redrawStarSector with a change in warp state, + and toggled off after certain conditions are met. Only need to track + count of DrawStars() calls and ship's previous speed during this time. */ + { + star_updates++; + last_speed = me->p_speed; + } + if (sector_offx < 0) { /* goddamn rounding towards 0 */ sectorx--; @@ -197,7 +209,6 @@ register int ybase = sectory * fullview; register struct _star *s; static unsigned int warpflag = 0; /* assume starting out not in warp */ - static int streaksOn = 0, lastspeed = 0, lastsubspeed = 0, updates = 0; static int streaklength = 1; static int mydir = -1; struct _star *star_sector = stars[sectorx][sectory]; @@ -206,57 +217,52 @@ { if (warpflag != (me->p_flags & PFTWARP)) { /* change in warp state */ - streaksOn = 1; + streaks_on = 1; warpflag = (me->p_flags & PFTWARP); } if (warpflag) mydir = me->p_dir; - if (streaksOn) + if (streaks_on) { - if (warpflag && (me->p_speed < lastspeed || - (me->p_speed == lastspeed && me->p_subspeed <= lastsubspeed))) + if (warpflag && me->p_speed <= last_speed) { - /* finished accelerating */ - updates++; - if (updates > 5) + /* finished accelerating, normalize # of frames to keep drawing streaks */ + if ((star_updates * 10 / server_ups)> 5) { - lastspeed = me->p_speed; - lastsubspeed = me->p_subspeed; - updates = 0; - streaksOn = 0; + star_updates = 0; + streaks_on = 0; redrawStarSector (sectorx, sectory); return; } } - else if (streaklength == 1 || (!warpflag && ((me->p_speed > lastspeed) || - (me->p_speed == lastspeed && me->p_subspeed >= lastsubspeed)))) + else if (streaklength == 1 || (!warpflag && (me->p_speed >= last_speed))) { - /* finished decelerating */ - updates++; - if (updates > 5) + /* finished decelerating, normalize # of frames to keep drawing streaks */ + if ((star_updates * 10 / server_ups) > 5) { - lastspeed = me->p_speed; - lastsubspeed = me->p_subspeed; - updates = 0; - streaksOn = 0; + star_updates = 0; + streaks_on = 0; streaklength = 1; redrawStarSector (sectorx, sectory); return; } } else - updates = 0; - lastspeed = me->p_speed; - lastsubspeed = me->p_subspeed; + star_updates = 0; + /* draw the streaks */ if (warpflag) - streaklength += 3; + streaklength += 30 * 10 / server_ups; else - streaklength--; - dxx = (int) (Cos[mydir] * streaklength); - dyy = (int) (Sin[mydir] * streaklength); + { + streaklength -= 10 * 10 / server_ups; + if (streaklength < 1) + streaklength = 1; + } + dxx = (int) (Cos[mydir] * streaklength / 10); + dyy = (int) (Sin[mydir] * streaklength / 10); for (i = 0, s = star_sector; i < 16; i++, s++) { dx = (s->s_x + xbase) - (me->p_x - (me->p_x % SCALE)); From modemhero at users.sourceforge.net Sun Feb 25 08:12:11 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 25 Feb 2007 14:12:11 +0000 Subject: [netrek-cvs] client/netrekxp clientr.suo,1.78,1.79 Message-ID: <20070225141220.C1BFB1867D9@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv12858 Modified Files: clientr.suo Log Message: Changed keepInfo option from updates/sec to 1/10 second intervals, to support variable update rates. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.78 retrieving revision 1.79 diff -u -d -r1.78 -r1.79 Binary files /tmp/cvsTzBQbD and /tmp/cvsjk7Cc5 differ From modemhero at users.sourceforge.net Sun Feb 25 08:12:12 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 25 Feb 2007 14:12:12 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.110, 1.111 netrekrc, 1.24, 1.25 netrekrc_options.txt, 1.26, 1.27 Message-ID: <20070225141220.C2BF81867DD@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv12858/resources/docs Modified Files: changes.txt netrekrc netrekrc_options.txt Log Message: Changed keepInfo option from updates/sec to 1/10 second intervals, to support variable update rates. Index: netrekrc =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- netrekrc 24 Feb 2007 10:19:54 -0000 1.24 +++ netrekrc 25 Feb 2007 14:12:10 -0000 1.25 @@ -101,7 +101,7 @@ # Ignore Caps Lock key state ignoreCaps: on -# How many updates to keep info window on (default 15) +# How many tenths of seconds to keep info window on (default 15) keepInfo: 15 # Keep peace with enemy team after death Index: netrekrc_options.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc_options.txt,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- netrekrc_options.txt 24 Feb 2007 10:19:54 -0000 1.26 +++ netrekrc_options.txt 25 Feb 2007 14:12:10 -0000 1.27 @@ -65,7 +65,7 @@ indshipGbmpfile: (path) - your own ship's grayscale bitmaps indshipTbmpfile: (path) - shaded color bitmaps indshipMbmpfile: (path) - mono bitmaps -keepInfo: (0-100) number of updates to keep info (default 15) +keepInfo: (0-100) number of tenths of seconds to keep info (default 15) keepPeace: (on/off) stays in peace after being killed keymap: (string) change keymap keymap-: (string) use this keymap for ship (sc,dd,ca,bb,as,sb,ga,att) Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.110 retrieving revision 1.111 diff -u -d -r1.110 -r1.111 --- changes.txt 25 Feb 2007 08:01:33 -0000 1.110 +++ changes.txt 25 Feb 2007 14:12:09 -0000 1.111 @@ -1,4 +1,6 @@ Netrek XP 2006, Version 1.2: (Released Feb-2007) +- changed keepInfo netrekrc option from updates to tenths of seconds, so info wins + remain up at a controllable time regardless of server update rate - full support for server FPS feature, allowing client to receive up to 50 updates/second! In specific, all redraw animations (phaser cycling, torp/plasma spin, torp/plasma det, explosions, cloaking, beeplite, warpstreaks, planet rotation) had to be modified so that From modemhero at users.sourceforge.net Sun Feb 25 08:12:12 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 25 Feb 2007 14:12:12 +0000 Subject: [netrek-cvs] client/netrekxp/resources/htmlhelp/html generalconfig.html, 1.27, 1.28 Message-ID: <20070225141223.44EF91867DF@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv12858/resources/htmlhelp/html Modified Files: generalconfig.html Log Message: Changed keepInfo option from updates/sec to 1/10 second intervals, to support variable update rates. Index: generalconfig.html =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html/generalconfig.html,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- generalconfig.html 24 Feb 2007 10:19:54 -0000 1.27 +++ generalconfig.html 25 Feb 2007 14:12:10 -0000 1.28 @@ -362,7 +362,7 @@ keepInfo -Number of updates to keep Info window +Number of tenths of seconds to keep Info window integer
      default: 15
      to disable: 0 From modemhero at users.sourceforge.net Sun Feb 25 08:12:12 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Sun, 25 Feb 2007 14:12:12 +0000 Subject: [netrek-cvs] client/netrekxp/src data.c, 1.53, 1.54 defaults.c, 1.44, 1.45 input.c, 1.21, 1.22 option.c, 1.28, 1.29 Message-ID: <20070225141223.7B9D9B40A@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv12858/src Modified Files: data.c defaults.c input.c option.c Log Message: Changed keepInfo option from updates/sec to 1/10 second intervals, to support variable update rates. Index: input.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/input.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- input.c 23 Feb 2007 13:43:56 -0000 1.21 +++ input.c 25 Feb 2007 14:12:10 -0000 1.22 @@ -1700,7 +1700,7 @@ if (!infomapped) { inform (data->Window, data->x, data->y, 'i'); - opened_info = keepInfo; /* 5/31/93 LAB */ + opened_info = keepInfo * server_ups / 10; /* 5/31/93 LAB */ } else { @@ -2635,7 +2635,7 @@ if (!infomapped) { inform (data->Window, data->x, data->y, key); - opened_info = keepInfo; /* 5/31/93 LAB */ + opened_info = keepInfo * server_ups / 10; } else { @@ -3113,7 +3113,7 @@ if (!infomapped) { inform (data->Window, data->x, data->y, key); - opened_info = keepInfo; /* 5/31/93 LAB */ + opened_info = keepInfo * server_ups / 10; } else { Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- defaults.c 24 Feb 2007 10:19:54 -0000 1.44 +++ defaults.c 25 Feb 2007 14:12:10 -0000 1.45 @@ -203,7 +203,7 @@ }, {"keepInfo", &keepInfo, RC_INT, { - "How many updates to keep info window on (default 15)", + "How many tenths of seconds to keep info window on (default 15)", NULL } }, Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- data.c 24 Feb 2007 10:19:54 -0000 1.53 +++ data.c 25 Feb 2007 14:12:10 -0000 1.54 @@ -38,8 +38,7 @@ * restart? */ int ghost_pno = 0; /* is this a ghostbust * restart? */ -int keepInfo = 15; /* how many updates to keep - * infowins 6/1/93 LAB */ +int keepInfo = 15; /* how many tenths of seconds to keep infowins */ int showPlanetOwner = 0; int phaserShrink = 0; Index: option.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/option.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- option.c 24 Feb 2007 10:19:55 -0000 1.28 +++ option.c 25 Feb 2007 14:12:10 -0000 1.29 @@ -374,7 +374,7 @@ {1, "Page %d (click to change)", &MenuPage, 0, 0, 0, NULL, &Menus_Range}, {1, "", &newDashboard, 0, 0, 0, dashboardoptions, NULL}, {1, "", &timerType, 0, 0, 0, timermess, NULL}, - {1, "keep info %d upds (0=don't remove)", &keepInfo, 0, 0, 0, 0, &keepInfo_range}, + {1, "keep info on for %d x .1s (0=perm)", &keepInfo, 0, 0, 0, 0, &keepInfo_range}, #ifdef BEEPLITE {1, "use beeplite", &useLite, 0, 0, 0, NULL, NULL}, #endif From modemhero at users.sourceforge.net Mon Feb 26 00:54:50 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 26 Feb 2007 06:54:50 +0000 Subject: [netrek-cvs] client/netrekxp/include defs.h, 1.11, 1.12 proto.h, 1.31, 1.32 Message-ID: <20070226065502.0204BB400@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv9974/include Modified Files: defs.h proto.h Log Message: Change from Multithreaded to Multithreaded DLL runtime library, involved adding a few headers, and commenting out the perror() and getpid() function definitions as they seem to be built in now. Also removed libcmt.lib from import libs. Removed unused UPDATE define. Changed WARNTIME and MESSTIME to use tenths of seconds rather than updates/sec, so warning messages don't disappear too fast at higher FPS rates. Moved j->p_explode out of draw if check, so that explosion counter updates even at low update rates. Reworked logic for phaser, torp and plasma fuses. Sets a minimum fuse and updatefuse length so even at low update rates, these weapons draw on screen. Also changed sound logic so that sound events play proper at all update rates. Also fixes a bug where frame could fall outside range of bitmaps, causing errors. Frame is now reset within the bounds of the bitmap definition number of frames. Showed up as a problem at low updates/sec rates. Index: defs.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/defs.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- defs.h 21 Feb 2007 11:43:38 -0000 1.11 +++ defs.h 26 Feb 2007 06:54:48 -0000 1.12 @@ -71,8 +71,6 @@ * person can go into orbit */ #define PFIREDIST 1500 /* At this range a planet * will shoot at a player */ -#define UPDATE 100000 /* Update time is 100000 - * micro-seconds */ /* 6 minutes is maximum for autoquit -- anything more causes problems in the * server. (?) */ @@ -132,9 +130,9 @@ /* * These are random configuration variables */ #define VICTORY 3 /* Number of systems needed * to conquer the galaxy */ -#define WARNTIME 30 /* Number of updates to have +#define WARNTIME 30 /* Number of 1/10th seconds to have * a warning on the screen */ -#define MESSTIME 30 /* Number of updates to have +#define MESSTIME 30 /* Number of 1/10th seconds to have * a message on the screen */ /* These are server defined times */ Index: proto.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- proto.h 23 Feb 2007 13:43:55 -0000 1.31 +++ proto.h 26 Feb 2007 06:54:48 -0000 1.32 @@ -1250,11 +1250,11 @@ int main (int argc, char *argv[]); void WinMainCleanup (void); -int getpid (); +//int getpid (); struct passwd *getpwuid (); void sleep (int seconds); double rint (double r); -void perror (const char *str); +//void perror (const char *str); #ifdef NEW_SELECT int PASCAL select (int nfds, fd_set * readfds, From modemhero at users.sourceforge.net Mon Feb 26 00:54:51 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 26 Feb 2007 06:54:51 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.111, 1.112 Message-ID: <20070226065502.00525B3FF@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv9974/resources/docs Modified Files: changes.txt Log Message: Change from Multithreaded to Multithreaded DLL runtime library, involved adding a few headers, and commenting out the perror() and getpid() function definitions as they seem to be built in now. Also removed libcmt.lib from import libs. Removed unused UPDATE define. Changed WARNTIME and MESSTIME to use tenths of seconds rather than updates/sec, so warning messages don't disappear too fast at higher FPS rates. Moved j->p_explode out of draw if check, so that explosion counter updates even at low update rates. Reworked logic for phaser, torp and plasma fuses. Sets a minimum fuse and updatefuse length so even at low update rates, these weapons draw on screen. Also changed sound logic so that sound events play proper at all update rates. Also fixes a bug where frame could fall outside range of bitmaps, causing errors. Frame is now reset within the bounds of the bitmap definition number of frames. Showed up as a problem at low updates/sec rates. Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.111 retrieving revision 1.112 diff -u -d -r1.111 -r1.112 --- changes.txt 25 Feb 2007 14:12:09 -0000 1.111 +++ changes.txt 26 Feb 2007 06:54:48 -0000 1.112 @@ -1,4 +1,5 @@ Netrek XP 2006, Version 1.2: (Released Feb-2007) +- changed warning message timer to be in tenths of seconds rather than updates/sec - changed keepInfo netrekrc option from updates to tenths of seconds, so info wins remain up at a controllable time regardless of server update rate - full support for server FPS feature, allowing client to receive up to 50 updates/second! From modemhero at users.sourceforge.net Mon Feb 26 00:54:50 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 26 Feb 2007 06:54:50 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.99, 1.100 clientr.suo, 1.79, 1.80 clientr.vcproj, 1.7, 1.8 Message-ID: <20070226065501.D82631867D7@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv9974 Modified Files: NetrekXP to do list.C clientr.suo clientr.vcproj Log Message: Change from Multithreaded to Multithreaded DLL runtime library, involved adding a few headers, and commenting out the perror() and getpid() function definitions as they seem to be built in now. Also removed libcmt.lib from import libs. Removed unused UPDATE define. Changed WARNTIME and MESSTIME to use tenths of seconds rather than updates/sec, so warning messages don't disappear too fast at higher FPS rates. Moved j->p_explode out of draw if check, so that explosion counter updates even at low update rates. Reworked logic for phaser, torp and plasma fuses. Sets a minimum fuse and updatefuse length so even at low update rates, these weapons draw on screen. Also changed sound logic so that sound events play proper at all update rates. Also fixes a bug where frame could fall outside range of bitmaps, causing errors. Frame is now reset within the bounds of the bitmap definition number of frames. Showed up as a problem at low updates/sec rates. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.79 retrieving revision 1.80 diff -u -d -r1.79 -r1.80 Binary files /tmp/cvsneVpEC and /tmp/cvsGYmJv5 differ Index: clientr.vcproj =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.vcproj,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- clientr.vcproj 24 Feb 2007 10:19:54 -0000 1.7 +++ clientr.vcproj 26 Feb 2007 06:54:47 -0000 1.8 @@ -48,7 +48,7 @@ AdditionalIncludeDirectories="win32;win32\h;win32\SDL;include" PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;RSA;_CONSOLE" MinimalRebuild="true" - RuntimeLibrary="0" + RuntimeLibrary="3" PrecompiledHeaderFile="\netrek_files\tmp\src\Debug/clientr.pch" AssemblerListingLocation="\netrek_files\tmp\src\Debug/" ObjectFile="\netrek_files\tmp\src\Debug/" @@ -72,7 +72,7 @@ Update of /cvsroot/netrek/client/netrekxp/win32 In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv9974/win32 Modified Files: config.h Log Message: Change from Multithreaded to Multithreaded DLL runtime library, involved adding a few headers, and commenting out the perror() and getpid() function definitions as they seem to be built in now. Also removed libcmt.lib from import libs. Removed unused UPDATE define. Changed WARNTIME and MESSTIME to use tenths of seconds rather than updates/sec, so warning messages don't disappear too fast at higher FPS rates. Moved j->p_explode out of draw if check, so that explosion counter updates even at low update rates. Reworked logic for phaser, torp and plasma fuses. Sets a minimum fuse and updatefuse length so even at low update rates, these weapons draw on screen. Also changed sound logic so that sound events play proper at all update rates. Also fixes a bug where frame could fall outside range of bitmaps, causing errors. Frame is now reset within the bounds of the bitmap definition number of frames. Showed up as a problem at low updates/sec rates. Index: config.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/win32/config.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- config.h 24 Feb 2007 10:19:55 -0000 1.14 +++ config.h 26 Feb 2007 06:54:50 -0000 1.15 @@ -426,6 +426,10 @@ #define stricmp _stricmp #endif +#ifndef getpid +#define getpid _getpid +#endif + /* For math.h, really */ #define hypot _hypot /* for io.h */ From modemhero at users.sourceforge.net Mon Feb 26 00:54:52 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 26 Feb 2007 06:54:52 +0000 Subject: [netrek-cvs] client/netrekxp/src cowmain.c, 1.22, 1.23 local.c, 1.59, 1.60 playback.c, 1.15, 1.16 short.c, 1.15, 1.16 socket.c, 1.18, 1.19 warning.c, 1.10, 1.11 winmain.c, 1.4, 1.5 Message-ID: <20070226065502.C30051867D9@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv9974/src Modified Files: cowmain.c local.c playback.c short.c socket.c warning.c winmain.c Log Message: Change from Multithreaded to Multithreaded DLL runtime library, involved adding a few headers, and commenting out the perror() and getpid() function definitions as they seem to be built in now. Also removed libcmt.lib from import libs. Removed unused UPDATE define. Changed WARNTIME and MESSTIME to use tenths of seconds rather than updates/sec, so warning messages don't disappear too fast at higher FPS rates. Moved j->p_explode out of draw if check, so that explosion counter updates even at low update rates. Reworked logic for phaser, torp and plasma fuses. Sets a minimum fuse and updatefuse length so even at low update rates, these weapons draw on screen. Also changed sound logic so that sound events play proper at all update rates. Also fixes a bug where frame could fall outside range of bitmaps, causing errors. Frame is now reset within the bounds of the bitmap definition number of frames. Showed up as a problem at low updates/sec rates. Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- local.c 25 Feb 2007 08:01:33 -0000 1.59 +++ local.c 26 Feb 2007 06:54:49 -0000 1.60 @@ -56,8 +56,6 @@ static int warpchange = 0; static unsigned int twarpflag = 0; static int cloak_phases = 0; -static int bmp_torpdet_frames = 0; -static int bmp_torp_frames = 0; #endif /* Background Stars Definitions */ @@ -1415,8 +1413,8 @@ clearzone[3][clearcount] = BMP_SHIPEXPL_HEIGHT; } clearcount++; - j->p_explode++; } + j->p_explode++; } /* Now draw his phaser (if it exists) */ @@ -1909,8 +1907,8 @@ if (k->t_status == TEXPLODE) { k->t_fuse--; - bmp_torpdet_frames = BMP_TORPDET_FRAMES * server_ups / 10; frame = k->t_fuse * 10 / server_ups; + if (k->t_fuse <= 0) { k->t_status = TFREE; @@ -1918,13 +1916,11 @@ continue; } - if (k->t_fuse >= bmp_torpdet_frames) - { - k->t_fuse = bmp_torpdet_frames - 1; - } + if (frame >= BMP_TORPDET_FRAMES) + frame = BMP_TORPDET_FRAMES - 1; #ifdef SOUND - if (k->t_fuse == bmp_torpdet_frames - 1) + if (k->t_fuse == (MAX(2, BMP_TORPDET_FRAMES * server_ups / 10) - 1)) { if (newSound) { @@ -1956,7 +1952,6 @@ Play_Sound(TORP_HIT_SOUND); } #endif - if (colorWeapons) { if (myPlayer(j)) @@ -2008,12 +2003,13 @@ { k->t_fuse++; - bmp_torp_frames = BMP_TORP_FRAMES * server_ups / 10; frame = k->t_fuse * 10 / server_ups; - if ((k->t_fuse >= bmp_torp_frames - 1) || (k->t_fuse < 0)) - k->t_fuse = 0; - + if ((frame > BMP_TORP_FRAMES - 1) || (frame < 0)) + { + k->t_fuse = 0; + frame = 0; + } if (myPlayer(j)) torpTeam = 0; else @@ -2178,22 +2174,20 @@ if (pt->pt_status == PTEXPLODE) { pt->pt_fuse--; - bmp_torpdet_frames = BMP_TORPDET_FRAMES * server_ups / 10; + frame = pt->pt_fuse * 10 / server_ups; + if (pt->pt_fuse <= 0) { pt->pt_status = PTFREE; players[pt->pt_owner].p_nplasmatorp--; continue; } - - if (pt->pt_fuse >= bmp_torpdet_frames) - { - pt->pt_fuse = bmp_torpdet_frames - 1; - } + if (frame >= BMP_TORPDET_FRAMES) + frame = BMP_TORPDET_FRAMES - 1; #ifdef SOUND - if (pt->pt_fuse == bmp_torpdet_frames - 1) + if (pt->pt_fuse == (MAX(2, BMP_TORPDET_FRAMES * server_ups / 10) - 1)) { if (newSound) { @@ -2278,12 +2272,13 @@ { pt->pt_fuse++; - bmp_torp_frames = BMP_TORP_FRAMES * server_ups / 10; frame = pt->pt_fuse * 10 / server_ups; - if ((pt->pt_fuse >= bmp_torp_frames - 1) || (pt->pt_fuse < 0)) + if ((frame > BMP_TORP_FRAMES - 1) || (frame < 0)) + { + frame = 0; pt->pt_fuse = 0; - + } if (pt->pt_owner == me->p_no) ptorpTeam = 0; else @@ -2728,7 +2723,7 @@ weaponUpdate = 0; DrawMisc (); - + #ifdef RECORDGAME if (doubleBuffering && !inplayback) W_Mem2Win (localSDB); Index: short.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/short.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- short.c 25 Feb 2007 08:01:34 -0000 1.15 +++ short.c 26 Feb 2007 06:54:49 -0000 1.16 @@ -273,7 +273,9 @@ thetorp = &torps[((unsigned char) *which * 8)]; for (shift = 0, i = 0; i < 8; i++, thetorp++, bitset >>= 1) { - thetorp->t_updateFuse = TORP_UPDATE_FUSE * server_ups / 10; + /* Updatefuse requires minimum value of 2 to ensure a redraw, updateFuse decremented + before drawing torp in local.c */ + thetorp->t_updateFuse = MAX(2, TORP_UPDATE_FUSE * server_ups / 10); if (bitset & 01) { @@ -998,7 +1000,9 @@ for (shift = 0, i = 0; i < 8; thetorp++, *bitset >>= 1, *infobitset >>= 1, i++) { - thetorp->t_updateFuse = TORP_UPDATE_FUSE * server_ups / 10; + /* Updatefuse requires minimum value of 2 to ensure a redraw, updateFuse decremented + before drawing torp in local.c */ + thetorp->t_updateFuse = MAX(2, TORP_UPDATE_FUSE * server_ups / 10); if (*bitset & 01) { @@ -1094,7 +1098,9 @@ thetorp->t_status = status; if (thetorp->t_status == TEXPLODE) { - thetorp->t_fuse = BMP_TORPDET_FRAMES * server_ups / 10; + /* Fuse requires minimum value of 2 to ensure a redraw, fuse decremented + before drawing torp in local.c */ + thetorp->t_fuse = MAX(2, BMP_TORPDET_FRAMES * server_ups / 10); } } } /* if */ @@ -2007,8 +2013,10 @@ phas->sound_phaser = 1; #endif /* normalized fuses */ - phas->ph_updateFuse = PHASER_UPDATE_FUSE * server_ups / 10; - phas->ph_maxfuse = (players[pnum].p_ship.s_phaserfuse * server_ups) / 10; + /* Updatefuse requires minimum value of 2 to ensure a redraw, updateFuse decremented + before drawing phaser in local.c */ + phas->ph_updateFuse = MAX(2, PHASER_UPDATE_FUSE * server_ups / 10); + phas->ph_maxfuse = MAX(1, (players[pnum].p_ship.s_phaserfuse * server_ups) / 10); #ifdef ROTATERACE if (rotate) Index: winmain.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/winmain.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- winmain.c 23 Feb 2007 13:43:57 -0000 1.4 +++ winmain.c 26 Feb 2007 06:54:50 -0000 1.5 @@ -207,12 +207,13 @@ //***************************************************************************// //Get process ID +/* int getpid () { return (int) GetCurrentProcessId (); } - +*/ //getpwuid() function - does it for real under NT. Just copies the given string... struct passwd * @@ -261,12 +262,13 @@ //A more useful perror(), reports last winsock error as well +/* void perror (const char *str) { LineToConsole ("%s: errno = %d, WSALast = %d\n", str, errno, WSAGetLastError ()); } - +*/ #ifdef NEW_SELECT // ********************************* select ******************************** Index: playback.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/playback.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- playback.c 12 Dec 2006 04:47:08 -0000 1.15 +++ playback.c 26 Feb 2007 06:54:49 -0000 1.16 @@ -19,6 +19,7 @@ #include #include #include +#include #include "Wlib.h" #include "defs.h" Index: warning.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/warning.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- warning.c 11 Jun 2006 09:36:25 -0000 1.10 +++ warning.c 26 Feb 2007 06:54:50 -0000 1.11 @@ -116,7 +116,7 @@ else #endif W_WriteText (warnw, 5, 5, textColor, text, warncount, W_RegularFont); - warntimer = udcounter + WARNTIME; /* set the line to be + warntimer = udcounter + WARNTIME * server_ups / 10; /* set the line to be * cleared */ Index: cowmain.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/cowmain.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- cowmain.c 25 Feb 2007 00:19:00 -0000 1.22 +++ cowmain.c 26 Feb 2007 06:54:49 -0000 1.23 @@ -16,6 +16,7 @@ #include #include #include +#include #include "copyright.h" #include "config.h" Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- socket.c 25 Feb 2007 00:19:00 -0000 1.18 +++ socket.c 26 Feb 2007 06:54:49 -0000 1.19 @@ -18,6 +18,7 @@ #include #include #include +#include #include "Wlib.h" #include "defs.h" @@ -1098,7 +1099,9 @@ thetorp->t_x = ntohl (packet->x); thetorp->t_y = ntohl (packet->y); thetorp->t_dir = packet->dir; - thetorp->t_updateFuse = TORP_UPDATE_FUSE * server_ups / 10; + /* Updatefuse requires minimum value of 2 to ensure a redraw, updateFuse decremented + before drawing torp in local.c */ + thetorp->t_updateFuse = MAX(2, TORP_UPDATE_FUSE * server_ups / 10); #ifdef ROTATERACE @@ -1126,7 +1129,9 @@ weaponUpdate = 1; thetorp = &torps[ntohs (packet->tnum)]; - thetorp->t_updateFuse = TORP_UPDATE_FUSE * server_ups / 10; + /* Updatefuse requires minimum value of 2 to ensure a redraw, updateFuse decremented + before drawing torp in local.c */ + thetorp->t_updateFuse = MAX(2, TORP_UPDATE_FUSE * server_ups / 10); if (packet->status == TEXPLODE && thetorp->t_status == TFREE) { @@ -1158,7 +1163,9 @@ thetorp->t_status = packet->status; if (thetorp->t_status == TEXPLODE) { - thetorp->t_fuse = BMP_TORPDET_FRAMES * server_ups / 10; + /* Fuse requires minimum value of 2 to ensure a redraw, fuse decremented + before drawing torp in local.c */ + thetorp->t_fuse = MAX(2, BMP_TORPDET_FRAMES * server_ups / 10); } } } @@ -1612,8 +1619,10 @@ phas->sound_phaser = 1; #endif /* normalized fuses */ - phas->ph_updateFuse = PHASER_UPDATE_FUSE * server_ups / 10; - phas->ph_maxfuse = (players[packet->pnum].p_ship.s_phaserfuse * server_ups) / 10; + /* Updatefuse requires minimum value of 2 to ensure a redraw, updateFuse decremented + before drawing phaser in local.c */ + phas->ph_updateFuse = MAX(2, PHASER_UPDATE_FUSE * server_ups / 10); + phas->ph_maxfuse = MAX(1, (players[packet->pnum].p_ship.s_phaserfuse * server_ups) / 10); #ifdef ROTATERACE if (rotate) @@ -1760,7 +1769,9 @@ weaponUpdate = 1; thetorp = &plasmatorps[ntohs (packet->pnum)]; - thetorp->pt_updateFuse = PLASMA_UPDATE_FUSE * server_ups / 10; + /* Updatefuse requires minimum value of 2 to ensure a redraw, updateFuse decremented + before drawing torp in local.c */ + thetorp->pt_updateFuse = MAX(2, PLASMA_UPDATE_FUSE * server_ups / 10); if (packet->status == PTEXPLODE && thetorp->pt_status == PTFREE) { /* FAT: redundant explosion; don't update p_nplasmatorp */ @@ -1781,7 +1792,9 @@ thetorp->pt_status = packet->status; if (thetorp->pt_status == PTEXPLODE) { - thetorp->pt_fuse = BMP_TORPDET_FRAMES * server_ups / 10; + /* Fuse requires minimum value of 2 to ensure a redraw, fuse decremented + before drawing torp in local.c */ + thetorp->pt_fuse = MAX(2, BMP_TORPDET_FRAMES * server_ups / 10); } } } @@ -1803,7 +1816,9 @@ thetorp = &plasmatorps[ntohs (packet->pnum)]; thetorp->pt_x = ntohl (packet->x); thetorp->pt_y = ntohl (packet->y); - thetorp->pt_updateFuse = PLASMA_UPDATE_FUSE * server_ups / 10; + /* Updatefuse requires minimum value of 2 to ensure a redraw, updateFuse decremented + before drawing torp in local.c */ + thetorp->pt_updateFuse = MAX(2, PLASMA_UPDATE_FUSE * server_ups / 10); #ifdef ROTATERACE if (rotate) From modemhero at users.sourceforge.net Mon Feb 26 01:53:05 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 26 Feb 2007 07:53:05 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.112, 1.113 Message-ID: <20070226075318.514B8B3FF@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv2257/resources/docs Modified Files: changes.txt Log Message: Changed back to multithreaded from multithread DLL. Was causing error message on closing the netrek.exe DOS window, and don't want to deal with that. Kept the headers and the commented out getpid and perror though. Fix to bug with observers who try to move, where they would unflag their lock flags and not get them back from server. Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.112 retrieving revision 1.113 diff -u -d -r1.112 -r1.113 --- changes.txt 26 Feb 2007 06:54:48 -0000 1.112 +++ changes.txt 26 Feb 2007 07:53:03 -0000 1.113 @@ -1,4 +1,5 @@ Netrek XP 2006, Version 1.2: (Released Feb-2007) +- fixed bug where observers who right-mouse click lose their lock icon - changed warning message timer to be in tenths of seconds rather than updates/sec - changed keepInfo netrekrc option from updates to tenths of seconds, so info wins remain up at a controllable time regardless of server update rate From modemhero at users.sourceforge.net Mon Feb 26 01:53:05 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 26 Feb 2007 07:53:05 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.100, 1.101 clientr.suo, 1.80, 1.81 clientr.vcproj, 1.8, 1.9 Message-ID: <20070226075318.5B5791867D7@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv2257 Modified Files: NetrekXP to do list.C clientr.suo clientr.vcproj Log Message: Changed back to multithreaded from multithread DLL. Was causing error message on closing the netrek.exe DOS window, and don't want to deal with that. Kept the headers and the commented out getpid and perror though. Fix to bug with observers who try to move, where they would unflag their lock flags and not get them back from server. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.80 retrieving revision 1.81 diff -u -d -r1.80 -r1.81 Binary files /tmp/cvsQbR1eO and /tmp/cvsSK8qXi differ Index: clientr.vcproj =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.vcproj,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- clientr.vcproj 26 Feb 2007 06:54:47 -0000 1.8 +++ clientr.vcproj 26 Feb 2007 07:53:02 -0000 1.9 @@ -48,7 +48,7 @@ AdditionalIncludeDirectories="win32;win32\h;win32\SDL;include" PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;RSA;_CONSOLE" MinimalRebuild="true" - RuntimeLibrary="3" + RuntimeLibrary="1" PrecompiledHeaderFile="\netrek_files\tmp\src\Debug/clientr.pch" AssemblerListingLocation="\netrek_files\tmp\src\Debug/" ObjectFile="\netrek_files\tmp\src\Debug/" @@ -72,7 +72,7 @@ Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv2257/src Modified Files: input.c Log Message: Changed back to multithreaded from multithread DLL. Was causing error message on closing the netrek.exe DOS window, and don't want to deal with that. Kept the headers and the commented out getpid and perror though. Fix to bug with observers who try to move, where they would unflag their lock flags and not get them back from server. Index: input.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/input.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- input.c 25 Feb 2007 14:12:10 -0000 1.22 +++ input.c 26 Feb 2007 07:53:03 -0000 1.23 @@ -3139,9 +3139,14 @@ { unsigned char course; - course = (unsigned char) (getcourse (data->Window, data->x, data->y)); - set_course (course); - me->p_flags &= ~(PFPLOCK | PFPLLOCK); + /* Observers can't move. Also incorrectly removes the lock flag even though + you are still locked */ + if (!(me->p_flags & PFOBSERV)) + { + course = (unsigned char) (getcourse (data->Window, data->x, data->y)); + set_course (course); + me->p_flags &= ~(PFPLOCK | PFPLLOCK); + } } /******************************************************************************/ From modemhero at users.sourceforge.net Mon Feb 26 07:20:36 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 26 Feb 2007 13:20:36 +0000 Subject: [netrek-cvs] client/netrekxp/src/cursors curslib.suo,1.4,1.5 Message-ID: <20070226132115.ECE381867D4@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src/cursors In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv15643/src/cursors Modified Files: curslib.suo Log Message: Clean up sound resources on exit. COW should adopt this as well. Index: curslib.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/cursors/curslib.suo,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 Binary files /tmp/cvsM23qMq and /tmp/cvs6lAT07 differ From modemhero at users.sourceforge.net Mon Feb 26 07:20:41 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 26 Feb 2007 13:20:41 +0000 Subject: [netrek-cvs] client/netrekxp/win32/SDL SDL.dll,1.1,1.2 Message-ID: <20070226132120.3FCE11867D7@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/win32/SDL In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv15643/win32/SDL Modified Files: SDL.dll Log Message: Clean up sound resources on exit. COW should adopt this as well. Index: SDL.dll =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/win32/SDL/SDL.dll,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs9ZMBAW and /tmp/cvsaH0tmM differ From modemhero at users.sourceforge.net Mon Feb 26 07:20:34 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 26 Feb 2007 13:20:34 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.101, 1.102 clientr.suo, 1.81, 1.82 Message-ID: <20070226132120.037241867D4@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv15643 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Clean up sound resources on exit. COW should adopt this as well. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.101 retrieving revision 1.102 diff -u -d -r1.101 -r1.102 --- NetrekXP to do list.C 26 Feb 2007 07:53:01 -0000 1.101 +++ NetrekXP to do list.C 26 Feb 2007 13:20:23 -0000 1.102 @@ -47,7 +47,6 @@ 9) Out of bounds message window calcs don't work with taskbar or menu bar, basewin rect doesn't take these into account. 10) Make sure all ping related fields are switched correctly via metasort. -11) server resets update rate to max/default on death and doesn't tell you Stas's list: - color coded playerlist. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.81 retrieving revision 1.82 diff -u -d -r1.81 -r1.82 Binary files /tmp/cvsbAwEt9 and /tmp/cvszcgU9R differ From modemhero at users.sourceforge.net Mon Feb 26 07:20:41 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Mon, 26 Feb 2007 13:20:41 +0000 Subject: [netrek-cvs] client/netrekxp/src sound.c,1.27,1.28 Message-ID: <20070226132053.C4C5A1867D4@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv15643/src Modified Files: sound.c Log Message: Clean up sound resources on exit. COW should adopt this as well. Index: sound.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/sound.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- sound.c 23 Feb 2007 13:43:57 -0000 1.27 +++ sound.c 26 Feb 2007 13:20:37 -0000 1.28 @@ -171,6 +171,25 @@ return(1); } +extern void sound_cleanup (void) +{ + int i; + + //Free the sound effects + for (i = 0; i < NUM_WAVES; i++) + Mix_FreeChunk(newsounds[i]); + + //Free the music + for (i = 0; i < NUM_MUSIC; i++) + Mix_FreeMusic(newmusic[i]); + + //Quit SDL_mixer + Mix_CloseAudio(); + + //Quit SDL + SDL_Quit(); +} + extern void Exit_Sound (void) { if (sound_init) @@ -211,7 +230,7 @@ if (SDL_Init(SDL_INIT_AUDIO) < 0) LineToConsole("Couldn't initialize SDL: %s\n",SDL_GetError()); - atexit(SDL_Quit); + atexit(sound_cleanup); /* Open the audio device at 22050 Hz 8 bit Microsoft PCM with stereo */ if (Mix_OpenAudio(22050, AUDIO_S16SYS, 2, 1024) < 0) From modemhero at users.sourceforge.net Tue Feb 27 02:37:08 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 27 Feb 2007 08:37:08 +0000 Subject: [netrek-cvs] client/netrekxp clientr.sln, 1.1, 1.2 clientr.suo, 1.82, 1.83 clientr.vcproj, 1.9, 1.10 Message-ID: <20070227083719.C3A131867D9@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv21032 Modified Files: clientr.sln clientr.suo clientr.vcproj Log Message: Fix 2 problems found by profiling, both repeated strcmp calls, one in the hockey_mode check and one in the SDB lookup function. Added new set of flags to window structure, sdb_flags, that are set on window creation to flag a window as "local" or "map", rather than having to string compare the name. A few changes in compiler settings from moving to VS 2005 PE, also some flags that were changed to work for profiling. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.82 retrieving revision 1.83 diff -u -d -r1.82 -r1.83 Binary files /tmp/cvspTbGMA and /tmp/cvsYhVJ9B differ Index: clientr.vcproj =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.vcproj,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- clientr.vcproj 26 Feb 2007 07:53:02 -0000 1.9 +++ clientr.vcproj 27 Feb 2007 08:37:05 -0000 1.10 @@ -45,9 +45,10 @@ Name="VCCLCompilerTool" AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_NONSTDC_NO_DEPRECATE"" Optimization="0" + WholeProgramOptimization="false" AdditionalIncludeDirectories="win32;win32\h;win32\SDL;include" PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;RSA;_CONSOLE" - MinimalRebuild="true" + MinimalRebuild="false" RuntimeLibrary="1" PrecompiledHeaderFile="\netrek_files\tmp\src\Debug/clientr.pch" AssemblerListingLocation="\netrek_files\tmp\src\Debug/" @@ -80,6 +81,7 @@ IgnoreAllDefaultLibraries="true" GenerateDebugInformation="true" ProgramDatabaseFile="\netrek_files\tmp\src\Debug/netrek.pdb" + GenerateMapFile="false" SubSystem="1" TargetMachine="1" /> @@ -150,6 +152,7 @@ AdditionalIncludeDirectories="win32;win32\h;include;win32\SDL" PreprocessorDefinitions="WIN32;NDEBUG;RSA;_CONSOLE" StringPooling="true" + MinimalRebuild="false" RuntimeLibrary="0" EnableFunctionLevelLinking="true" PrecompiledHeaderFile="\netrek_files\tmp\src\Release/clientr.pch" @@ -159,6 +162,7 @@ BrowseInformation="1" WarningLevel="3" SuppressStartupBanner="true" + DebugInformationFormat="0" /> Index: clientr.sln =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.sln,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- clientr.sln 12 May 2006 02:27:46 -0000 1.1 +++ clientr.sln 27 Feb 2007 08:37:05 -0000 1.2 @@ -3,10 +3,6 @@ # Visual C++ Express 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clientr", "clientr.vcproj", "{AF2EDB01-9BF0-463A-96EF-046B5845BAE8}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winkey", "src\winkey\winkey.vcproj", "{DEBF4D2E-001E-47DA-A88C-8FF90C55C6ED}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curslib", "src\cursors\curslib.vcproj", "{74EFAF4D-D9A0-421D-8A94-08DBB03D533C}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -17,14 +13,6 @@ {AF2EDB01-9BF0-463A-96EF-046B5845BAE8}.Debug|Win32.Build.0 = Debug|Win32 {AF2EDB01-9BF0-463A-96EF-046B5845BAE8}.Release|Win32.ActiveCfg = Release|Win32 {AF2EDB01-9BF0-463A-96EF-046B5845BAE8}.Release|Win32.Build.0 = Release|Win32 - {DEBF4D2E-001E-47DA-A88C-8FF90C55C6ED}.Debug|Win32.ActiveCfg = Debug|Win32 - {DEBF4D2E-001E-47DA-A88C-8FF90C55C6ED}.Debug|Win32.Build.0 = Debug|Win32 - {DEBF4D2E-001E-47DA-A88C-8FF90C55C6ED}.Release|Win32.ActiveCfg = Release|Win32 - {DEBF4D2E-001E-47DA-A88C-8FF90C55C6ED}.Release|Win32.Build.0 = Release|Win32 - {74EFAF4D-D9A0-421D-8A94-08DBB03D533C}.Debug|Win32.ActiveCfg = Debug|Win32 - {74EFAF4D-D9A0-421D-8A94-08DBB03D533C}.Debug|Win32.Build.0 = Debug|Win32 - {74EFAF4D-D9A0-421D-8A94-08DBB03D533C}.Release|Win32.ActiveCfg = Release|Win32 - {74EFAF4D-D9A0-421D-8A94-08DBB03D533C}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From modemhero at users.sourceforge.net Tue Feb 27 02:37:09 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 27 Feb 2007 08:37:09 +0000 Subject: [netrek-cvs] client/netrekxp/include struct.h,1.14,1.15 Message-ID: <20070227083719.C4F76B3EE@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv21032/include Modified Files: struct.h Log Message: Fix 2 problems found by profiling, both repeated strcmp calls, one in the hockey_mode check and one in the SDB lookup function. Added new set of flags to window structure, sdb_flags, that are set on window creation to flag a window as "local" or "map", rather than having to string compare the name. A few changes in compiler settings from moving to VS 2005 PE, also some flags that were changed to work for profiling. Index: struct.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/struct.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- struct.h 25 Feb 2007 00:18:59 -0000 1.14 +++ struct.h 27 Feb 2007 08:37:06 -0000 1.15 @@ -616,6 +616,11 @@ #define WAM_ALL 0x08 #define WAM_PHASER 0x10 +/* SDB flags for windows that use double buffering */ +#define SDB_FLAG_NONE 0x00 +#define SDB_FLAG_LOCAL 0x01 +#define SDB_FLAG_MAP 0x02 + typedef struct tagWindow { HWND hwnd; @@ -644,6 +649,7 @@ int orig_width; int orig_height; int wam; /* Window Allowed Messages */ + int sdb_flags; /* SDB flags */ } Window; From modemhero at users.sourceforge.net Tue Feb 27 02:37:09 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 27 Feb 2007 08:37:09 +0000 Subject: [netrek-cvs] client/netrekxp/src enter.c, 1.5, 1.6 local.c, 1.60, 1.61 mswindow.c, 1.42, 1.43 Message-ID: <20070227083719.CED8FB3F6@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv21032/src Modified Files: enter.c local.c mswindow.c Log Message: Fix 2 problems found by profiling, both repeated strcmp calls, one in the hockey_mode check and one in the SDB lookup function. Added new set of flags to window structure, sdb_flags, that are set on window creation to flag a window as "local" or "map", rather than having to string compare the name. A few changes in compiler settings from moving to VS 2005 PE, also some flags that were changed to work for profiling. Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- mswindow.c 23 Jan 2007 11:12:04 -0000 1.42 +++ mswindow.c 27 Feb 2007 08:37:07 -0000 1.43 @@ -5609,6 +5609,10 @@ if (win->hwnd == NULL) return NULL; + if (strcmpi (win->name, "local") == 0) + win->sdb_flags = SDB_FLAG_LOCAL; + else if (strcmpi (win->name, "map") == 0) + win->sdb_flags = SDB_FLAG_MAP; sdb = (SDBUFFER *) malloc (sizeof (SDBUFFER)); sdb->window = (W_Window) malloc (sizeof (Window)); @@ -5643,9 +5647,9 @@ if (win->hwnd == NULL) return NULL; - if (strcmpi (win->name, "local") == 0) + if (win->sdb_flags == SDB_FLAG_LOCAL) return localSDB; - else if (strcmpi (win->name, "map") == 0) + else if (win->sdb_flags == SDB_FLAG_MAP) return mapSDB; else return NULL; Index: enter.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/enter.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- enter.c 25 Feb 2007 00:19:00 -0000 1.5 +++ enter.c 27 Feb 2007 08:37:07 -0000 1.6 @@ -215,6 +215,7 @@ static int first_run = 1; if (first_run) + { for (i = 0; i < MAXPLAYER; i++) { if (strcmp(players[i].p_name, "Puck") == 0 && @@ -223,9 +224,10 @@ players[i].p_ship.s_type == SCOUT) { playing_hockey = 1; - first_run = 0; } } + first_run = 0; + } return playing_hockey; } Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- local.c 26 Feb 2007 06:54:49 -0000 1.60 +++ local.c 27 Feb 2007 08:37:07 -0000 1.61 @@ -1215,7 +1215,7 @@ } #ifdef HOCKEY_LINES /* Puck circle */ - if (puckCircle && hockey_mode) + if (puckCircle && hockey_mode ()) { if (myPlayer(j) || isObsLockPlayer(j)) { From modemhero at users.sourceforge.net Tue Feb 27 04:16:35 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 27 Feb 2007 10:16:35 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.113, 1.114 Message-ID: <20070227101652.A84DEB3FA@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv16522/resources/docs Modified Files: changes.txt Log Message: Change to border refresh rate. Doesn't needlessly redraw unless using the new ship bitmaps, and even with those, it redraws at most 10 times/sec, as this is a CPU intensive function. Added bonus that ships can now be seen in the border region, increasing tactical viewable range. Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.113 retrieving revision 1.114 diff -u -d -r1.113 -r1.114 --- changes.txt 26 Feb 2007 07:53:03 -0000 1.113 +++ changes.txt 27 Feb 2007 10:16:33 -0000 1.114 @@ -1,4 +1,7 @@ Netrek XP 2006, Version 1.2: (Released Feb-2007) +- border refresh now works slightly differently for those using the new color bitmaps + (colorClient = 4), ships can now be seen along the border edges that were normally + not drawn, allowing players to get a slightly increased viewable tactical range. - fixed bug where observers who right-mouse click lose their lock icon - changed warning message timer to be in tenths of seconds rather than updates/sec - changed keepInfo netrekrc option from updates to tenths of seconds, so info wins From modemhero at users.sourceforge.net Tue Feb 27 04:16:35 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 27 Feb 2007 10:16:35 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.102, 1.103 clientr.suo, 1.83, 1.84 Message-ID: <20070227101652.8BD93B3F9@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv16522 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Change to border refresh rate. Doesn't needlessly redraw unless using the new ship bitmaps, and even with those, it redraws at most 10 times/sec, as this is a CPU intensive function. Added bonus that ships can now be seen in the border region, increasing tactical viewable range. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.102 retrieving revision 1.103 diff -u -d -r1.102 -r1.103 --- NetrekXP to do list.C 26 Feb 2007 13:20:23 -0000 1.102 +++ NetrekXP to do list.C 27 Feb 2007 10:16:29 -0000 1.103 @@ -23,7 +23,7 @@ Things that are sorta fixed, but could use improvement: 1) 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. +is rotated. Only solution so far is to moderate border refresh with scaled bitmaps. 2) AddFontResourceEx caused problems with win 98 machines. Commented out, and using old AddFontResource function. 3) planet resource placement and refresh (for new planet bitmaps) will need adjusting if Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.83 retrieving revision 1.84 diff -u -d -r1.83 -r1.84 Binary files /tmp/cvsYxNT83 and /tmp/cvsNSvL4K differ From modemhero at users.sourceforge.net Tue Feb 27 04:16:36 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Tue, 27 Feb 2007 10:16:36 +0000 Subject: [netrek-cvs] client/netrekxp/src local.c,1.61,1.62 Message-ID: <20070227101652.88D2BB3F6@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv16522/src Modified Files: local.c Log Message: Change to border refresh rate. Doesn't needlessly redraw unless using the new ship bitmaps, and even with those, it redraws at most 10 times/sec, as this is a CPU intensive function. Added bonus that ships can now be seen in the border region, increasing tactical viewable range. Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- local.c 27 Feb 2007 08:37:07 -0000 1.61 +++ local.c 27 Feb 2007 10:16:33 -0000 1.62 @@ -2580,11 +2580,21 @@ break; } } - /* Force a border redraw */ - else + /* Force a border redraw? Only needed for bitmaps rotated realtime, due + to the overwriting border issue. Also, very CPU expensive to write + rectangles (drawborder function) to the active window, especially if double + buffering is off, so let's slow down redraws to at most 10 per second */ + else if (colorClient == 4) { - W_ChangeBorder (w, alertBorderColor); - W_ChangeBorder (mapw, alertBorderColor); + static int border_refresh = 0; + + border_refresh++; + if ((border_refresh * 10 / server_ups) >= 1) + { + W_ChangeBorder (w, alertBorderColor); + W_ChangeBorder (mapw, alertBorderColor); + border_refresh = 0; + } } #if defined(SOUND) From modemhero at users.sourceforge.net Wed Feb 28 01:44:02 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 28 Feb 2007 07:44:02 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h, 1.49, 1.50 defs.h, 1.12, 1.13 proto.h, 1.32, 1.33 Message-ID: <20070228074411.782F5B3EE@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25543/include Modified Files: data.h defs.h proto.h Log Message: Remove constant hockey_mode() calls with a single check on initial client connect, setting new global bool playing_hockey. Minor changes inspired by COW implementation of XP 2006 patches. Map window, player redraw: cleared up some confusing references to lastUpdate, renamed it a more fitting lastRedraw. Still needs testing once server is fixed regarding orbit/stationary ship position updates. Inlined SDB_lookup as it gets called more than any other function. Made music and sound arrays static. Index: defs.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/defs.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- defs.h 26 Feb 2007 06:54:48 -0000 1.12 +++ defs.h 28 Feb 2007 07:44:00 -0000 1.13 @@ -132,8 +132,6 @@ * to conquer the galaxy */ #define WARNTIME 30 /* Number of 1/10th seconds to have * a warning on the screen */ -#define MESSTIME 30 /* Number of 1/10th seconds to have - * a message on the screen */ /* These are server defined times */ #define REFITTIME 5 /* Number of seconds it takes Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- data.h 24 Feb 2007 10:19:54 -0000 1.49 +++ data.h 28 Feb 2007 07:44:00 -0000 1.50 @@ -544,7 +544,7 @@ extern struct s_line map_hockey_lines[NUM_HOCKEY_LINES + 1]; extern int showHockeyLinesLocal; extern int showHockeyLinesMap; - +extern int playing_hockey; #endif #ifdef MULTILINE_MACROS Index: proto.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- proto.h 26 Feb 2007 06:54:48 -0000 1.32 +++ proto.h 28 Feb 2007 07:44:00 -0000 1.33 @@ -165,7 +165,7 @@ void rotateTeams (void); void drawTstats (void); #ifdef HOCKEY_LINES -int hockey_mode (void); +void check_hockey_mode (void); void init_hockey_lines (void); #endif From modemhero at users.sourceforge.net Wed Feb 28 01:44:03 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 28 Feb 2007 07:44:03 +0000 Subject: [netrek-cvs] client/netrekxp/src cowmain.c, 1.23, 1.24 data.c, 1.54, 1.55 enter.c, 1.6, 1.7 input.c, 1.23, 1.24 local.c, 1.62, 1.63 map.c, 1.24, 1.25 mswindow.c, 1.43, 1.44 option.c, 1.29, 1.30 sound.c, 1.28, 1.29 Message-ID: <20070228074412.D4CC6B3F0@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25543/src Modified Files: cowmain.c data.c enter.c input.c local.c map.c mswindow.c option.c sound.c Log Message: Remove constant hockey_mode() calls with a single check on initial client connect, setting new global bool playing_hockey. Minor changes inspired by COW implementation of XP 2006 patches. Map window, player redraw: cleared up some confusing references to lastUpdate, renamed it a more fitting lastRedraw. Still needs testing once server is fixed regarding orbit/stationary ship position updates. Inlined SDB_lookup as it gets called more than any other function. Made music and sound arrays static. Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- mswindow.c 27 Feb 2007 08:37:07 -0000 1.43 +++ mswindow.c 28 Feb 2007 07:44:00 -0000 1.44 @@ -5639,7 +5639,7 @@ return sdb; } -SDBUFFER * +inline SDBUFFER * SDB_lookup (W_Window window) { Window * win; Index: sound.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/sound.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- sound.c 26 Feb 2007 13:20:37 -0000 1.28 +++ sound.c 28 Feb 2007 07:44:01 -0000 1.29 @@ -28,8 +28,8 @@ #include "audio.h" #include "proto.h" -Mix_Chunk *newsounds[NUM_WAVES]; -Mix_Music *newmusic[NUM_MUSIC]; +static Mix_Chunk *newsounds[NUM_WAVES]; +static Mix_Music *newmusic[NUM_MUSIC]; /* Each sound has a priority which controls what can override what Currently these are set as follows: Index: input.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/input.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- input.c 26 Feb 2007 07:53:03 -0000 1.23 +++ input.c 28 Feb 2007 07:44:00 -0000 1.24 @@ -2592,7 +2592,7 @@ Key71 (W_Event * data) { #ifdef HOCKEY_LINES - if (!hockey_mode ()) + if (!playing_hockey) return; showHockeyLinesMap = !showHockeyLinesMap; @@ -2613,7 +2613,7 @@ Key72 (W_Event * data) { #ifdef HOCKEY_LINES - if (!hockey_mode ()) + if (!playing_hockey) return; showHockeyLinesLocal = !showHockeyLinesLocal; @@ -3141,12 +3141,11 @@ /* Observers can't move. Also incorrectly removes the lock flag even though you are still locked */ - if (!(me->p_flags & PFOBSERV)) - { - course = (unsigned char) (getcourse (data->Window, data->x, data->y)); - set_course (course); - me->p_flags &= ~(PFPLOCK | PFPLLOCK); - } + if (me->p_flags & PFOBSERV) return; + + course = (unsigned char) (getcourse (data->Window, data->x, data->y)); + set_course (course); + me->p_flags &= ~(PFPLOCK | PFPLLOCK); } /******************************************************************************/ Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- local.c 27 Feb 2007 10:16:33 -0000 1.62 +++ local.c 28 Feb 2007 07:44:00 -0000 1.63 @@ -1215,7 +1215,7 @@ } #ifdef HOCKEY_LINES /* Puck circle */ - if (puckCircle && hockey_mode ()) + if (puckCircle && playing_hockey) { if (myPlayer(j) || isObsLockPlayer(j)) { @@ -1260,7 +1260,7 @@ #ifdef HOCKEY_LINES /* Do we want to see puck's letter ? Nah. */ - if (hockey_mode () && + if (playing_hockey && strcmp(j->p_name, "Puck") == 0 && strcmp(j->p_login, "Robot") == 0 && j->p_team == NOBODY && @@ -2365,7 +2365,7 @@ #endif #ifdef HOCKEY_LINES - if (showHockeyLinesLocal && hockey_mode ()) + if (showHockeyLinesLocal && playing_hockey) for (sl = local_hockey_lines + NUM_HOCKEY_LINES - 1; sl >= local_hockey_lines; --sl) { Index: enter.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/enter.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- enter.c 27 Feb 2007 08:37:07 -0000 1.6 +++ enter.c 28 Feb 2007 07:44:00 -0000 1.7 @@ -206,30 +206,22 @@ #ifdef HOCKEY_LINES /******************************************************************************/ -/*** hockey_mode() ***/ +/*** check_hockey_mode() - checked on initial entry into game ***/ /******************************************************************************/ -int hockey_mode (void) +void check_hockey_mode (void) { int i; - static int playing_hockey = 0; - static int first_run = 1; - if (first_run) + for (i = 0; i < MAXPLAYER; i++) { - for (i = 0; i < MAXPLAYER; i++) + if (strcmp(players[i].p_name, "Puck") == 0 && + strcmp(players[i].p_login, "Robot") == 0 && + players[i].p_team == NOBODY && + players[i].p_ship.s_type == SCOUT) { - if (strcmp(players[i].p_name, "Puck") == 0 && - strcmp(players[i].p_login, "Robot") == 0 && - players[i].p_team == NOBODY && - players[i].p_ship.s_type == SCOUT) - { - playing_hockey = 1; - } + playing_hockey = 1; } - first_run = 0; } - - return playing_hockey; } /******************************************************************************/ Index: option.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/option.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- option.c 25 Feb 2007 14:12:10 -0000 1.29 +++ option.c 28 Feb 2007 07:44:01 -0000 1.30 @@ -831,25 +831,25 @@ { // We definitely don't want to be able to // change this option on non hockey server - if (showHockeyLinesMap && !hockey_mode ()) + if (showHockeyLinesMap && !playing_hockey) showHockeyLinesMap = 0; } else if (op->op_option == &showHockeyLinesLocal) { // same as above - if (showHockeyLinesLocal && !hockey_mode ()) + if (showHockeyLinesLocal && !playing_hockey) showHockeyLinesLocal = 0; } else if (op->op_option == &showHockeyScore) { // same as above - if (showHockeyScore && !hockey_mode ()) + if (showHockeyScore && !playing_hockey) showHockeyScore = 0; } else if (op->op_option == &puckCircle) { // same as above - if (puckCircle && !hockey_mode ()) + if (puckCircle && !playing_hockey) puckCircle = 0; } #endif Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- data.c 25 Feb 2007 14:12:10 -0000 1.54 +++ data.c 28 Feb 2007 07:44:00 -0000 1.55 @@ -648,7 +648,7 @@ struct s_line local_hockey_lines[NUM_HOCKEY_LINES + 1]; int showHockeyLinesMap = 0; struct s_line map_hockey_lines[NUM_HOCKEY_LINES + 1]; - +int playing_hockey = 0; #endif #ifdef MULTILINE_MACROS Index: cowmain.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/cowmain.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- cowmain.c 26 Feb 2007 06:54:49 -0000 1.23 +++ cowmain.c 28 Feb 2007 07:44:00 -0000 1.24 @@ -1077,6 +1077,10 @@ /* Send request for updatesPerSec. New servers now support 50 u/s */ sendUpdatePacket (1000000 / updatesPerSec); +#ifdef HOCKEY_LINES + /* Playing hockey? */ + check_hockey_mode(); +#endif isFirstEntry = 0; } Index: map.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/map.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- map.c 23 Feb 2007 13:43:56 -0000 1.24 +++ map.c 28 Feb 2007 07:44:00 -0000 1.25 @@ -695,7 +695,6 @@ */ { register int i; - register unsigned char *update; register struct player *j; register struct planet *l; register int dx, dy; @@ -703,7 +702,7 @@ static char clearlock = 0; static int mclearzone[6][MAXPLAYER]; static int clearlmark[4]; - static unsigned char lastUpdate[MAXPLAYER]; + static unsigned int lastRedraw[MAXPLAYER]; static int viewx = 0, viewy = 0; static char clearviewbox = 0; @@ -744,7 +743,7 @@ for (i = 0; i < MAXPLAYER; i++) { - lastUpdate[i] = 0; + lastRedraw[i] = 0; mclearzone[2][i] = 0; redrawPlayer[i] = 1; } @@ -786,15 +785,14 @@ } /* Erase the ships */ - for (i = 0, update = lastUpdate; i < MAXPLAYER; i++, update++) + for (i = 0; i < MAXPLAYER; i++) { + /* Erase the player if redrawPlayer[i] is set and there + is an active clearzone */ if (redrawPlayer[i]) { - /* Erase the player if redrawPlayer[i] is set - or lastUpdate allows it. */ if (mclearzone[2][i]) { - /* XFIX */ W_ClearArea (mapw, mclearzone[0][i], mclearzone[1][i], mclearzone[2][i], mclearzone[3][i]); /* Redraw the hole just left next update */ @@ -802,16 +800,22 @@ mclearzone[2][i] = 0; } /* Reset the last redrawn counter */ - *update = 0; + lastRedraw[i] = 0; } - else if (*update == 10) + + if (lastRedraw[i] == 10) { /* Redraw stationary ships every update so that these ships are not hidden by planet updates. */ redrawPlayer[i] = 1; } else - ++(*update); + { + /* Just increment the counter instead */ + lastRedraw[i]++; + } + if (&players[i] == me) + LineToConsole("Last redraw %d ", lastRedraw[i]); } } @@ -842,7 +846,7 @@ } #ifdef HOCKEY_LINES - if (hockey_mode ()) + if (playing_hockey) { /* Draw Hockey Lines */ if (showHockeyLinesMap) @@ -858,7 +862,7 @@ for (i = 0, j = &players[i]; i < MAXPLAYER; i++, j++) { - /* lastUpdate[i] has been set to 0 if redrawall or the ship has + /* redrawPlayer[i] has been set to 1 if redrawall or the ship has * been erased or a redraw has not taken place for a while. These * decisions are made at the top of the file. */ From modemhero at users.sourceforge.net Wed Feb 28 01:44:02 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 28 Feb 2007 07:44:02 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.103, 1.104 clientr.suo, 1.84, 1.85 Message-ID: <20070228074411.740C41867D0@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv25543 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Remove constant hockey_mode() calls with a single check on initial client connect, setting new global bool playing_hockey. Minor changes inspired by COW implementation of XP 2006 patches. Map window, player redraw: cleared up some confusing references to lastUpdate, renamed it a more fitting lastRedraw. Still needs testing once server is fixed regarding orbit/stationary ship position updates. Inlined SDB_lookup as it gets called more than any other function. Made music and sound arrays static. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.103 retrieving revision 1.104 diff -u -d -r1.103 -r1.104 --- NetrekXP to do list.C 27 Feb 2007 10:16:29 -0000 1.103 +++ NetrekXP to do list.C 28 Feb 2007 07:43:59 -0000 1.104 @@ -47,6 +47,11 @@ 9) Out of bounds message window calcs don't work with taskbar or menu bar, basewin rect doesn't take these into account. 10) Make sure all ping related fields are switched correctly via metasort. +11) ships orbiting and galactip map refresh..blinking..server not sending orbiters +until every 4th packet? at 50 fps? and every other packet at 20 fps. Where's the +code that makes vplayer not get sent if not moving/in orbit? +12) remove old sound, all new sound..add sound menu options to turn off sounds +by category (cloak, weapons, explosions), add rc option for those settings Stas's list: - color coded playerlist. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.84 retrieving revision 1.85 diff -u -d -r1.84 -r1.85 Binary files /tmp/cvsiDDN6s and /tmp/cvspXPVjT differ From modemhero at users.sourceforge.net Wed Feb 28 03:35:28 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 28 Feb 2007 09:35:28 +0000 Subject: [netrek-cvs] client/netrekxp/resources/sounds nt_intro.wav, 1.3, NONE Message-ID: <20070228093537.DC9701867D0@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/sounds In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11631/resources/sounds Removed Files: nt_intro.wav Log Message: Completely gutted the old windows sound system. Resulting in removal of nt_intro.wav (yay!), audio.h and winsndlib.c (bigger yay!). All the clunky old windows code for loading sound, checking if sound is enabled, and changing volume is now handled by 20x less code using SDL. And it's done better, too. All references to "newSound" have been renamed to "sound". No longer support the old sound menu/loading of sounds, so that got gutted too. Still todo: menu option for removing other ship's sounds, ability to toggle certain sound categories on/off, and to control starting volume. All to be netrekrc entries. --- nt_intro.wav DELETED --- From modemhero at users.sourceforge.net Wed Feb 28 03:35:23 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 28 Feb 2007 09:35:23 +0000 Subject: [netrek-cvs] client/netrekxp/src beeplite.c, 1.13, 1.14 cowmain.c, 1.24, 1.25 data.c, 1.55, 1.56 death.c, 1.13, 1.14 defaults.c, 1.45, 1.46 dmessage.c, 1.6, 1.7 findslot.c, 1.6, 1.7 input.c, 1.24, 1.25 local.c, 1.63, 1.64 map.c, 1.25, 1.26 newwin.c, 1.47, 1.48 playback.c, 1.16, 1.17 socket.c, 1.19, 1.20 sound.c, 1.29, 1.30 warning.c, 1.11, 1.12 winsndlib.c, 1.5, NONE Message-ID: <20070228093602.BEDAF1867D3@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11631/src Modified Files: beeplite.c cowmain.c data.c death.c defaults.c dmessage.c findslot.c input.c local.c map.c newwin.c playback.c socket.c sound.c warning.c Removed Files: winsndlib.c Log Message: Completely gutted the old windows sound system. Resulting in removal of nt_intro.wav (yay!), audio.h and winsndlib.c (bigger yay!). All the clunky old windows code for loading sound, checking if sound is enabled, and changing volume is now handled by 20x less code using SDL. And it's done better, too. All references to "newSound" have been renamed to "sound". No longer support the old sound menu/loading of sounds, so that got gutted too. Still todo: menu option for removing other ship's sounds, ability to toggle certain sound categories on/off, and to control starting volume. All to be netrekrc entries. Index: findslot.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/findslot.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- findslot.c 7 May 2006 16:59:27 -0000 1.6 +++ findslot.c 28 Feb 2007 09:35:20 -0000 1.7 @@ -113,14 +113,6 @@ socketPause (); if (isServerDead ()) { - -#if defined(SOUND) - if (!newSound) - Exit_Sound(); - else - Mix_CloseAudio(); -#endif - LineToConsole ("Shit! Ghostbusted!\n"); terminate (0); } @@ -162,14 +154,6 @@ readFromServer (NULL); if (isServerDead ()) { - -#if defined(SOUND) - if (!newSound) - Exit_Sound(); - else - Mix_CloseAudio(); -#endif - LineToConsole ("Damn, We've been ghostbusted!\n"); terminate (0); } @@ -224,14 +208,6 @@ } else if (event.Window == waitqWin) { - -#if defined(SOUND) - if (!newSound) - Exit_Sound(); - else - Mix_CloseAudio(); -#endif - LineToConsole ("OK, bye!\n"); terminate (0); } Index: dmessage.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/dmessage.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- dmessage.c 1 May 2006 00:55:11 -0000 1.6 +++ dmessage.c 28 Feb 2007 09:35:20 -0000 1.7 @@ -217,12 +217,7 @@ #ifdef SOUND if (why_dead && (instr (message, "[plasma]") || instr (message, "[zapped plasma]"))) - { - if (newSound) - Play_Sound(PLASMA_KILL_WAV); - else - Play_Sound(PLASMA_KILL_SOUND); - } + Play_Sound(PLASMA_KILL_WAV); #endif } @@ -279,12 +274,7 @@ #ifdef SOUND if (why_dead && (instr (message, "[plasma]") || instr (message, "[zapped plasma]"))) - { - if (newSound) - Play_Sound(PLASMA_KILL_WAV); - else - Play_Sound(PLASMA_KILL_SOUND); - } + Play_Sound(PLASMA_KILL_WAV); #endif if (logging) Index: sound.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/sound.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- sound.c 28 Feb 2007 07:44:01 -0000 1.29 +++ sound.c 28 Feb 2007 09:35:20 -0000 1.30 @@ -25,64 +25,13 @@ #include "defs.h" #include "struct.h" #include "data.h" -#include "audio.h" #include "proto.h" -static Mix_Chunk *newsounds[NUM_WAVES]; -static Mix_Music *newmusic[NUM_MUSIC]; -/* Each sound has a priority which controls what can override what - Currently these are set as follows: +static void soundrefresh (int i); - 11: death sounds - 10: explosion - 9: phaser,plasma - 8: torp/plasma hit - 7: torp fire, cloak - 6: alert - 4: "informational" sounds (self destruct, enter ship, message, etc.) - 3: shield up/down, other people's sounds (phaser, torp, plasma, explode) - 0: background or ambient (engine?) -*/ -static struct Sound sounds[NUM_SOUNDS + 1] = { - {"", 0, 0}, - {"nt_fire_torp", 7, 1}, - {"nt_phaser", 9, 1}, - {"nt_fire_plasma", 9, 1}, - {"nt_explosion", 10, 1}, - {"nt_base_explosion", 10, 1}, - {"nt_cloaked", 7, 1}, - {"nt_uncloak", 7, 1}, - {"nt_shield_down", 3, 1}, - {"nt_shield_up", 3, 1}, - {"nt_torp_hit", 8, 1}, - {"nt_warning", 5, 1}, - {"nt_red_alert", 5, 1}, - {"nt_engine", 0, 0}, - {"nt_enter_ship", 4, 1}, - {"nt_self_destruct", 6, 1}, - {"nt_plasma_hit", 8, 1}, - {"nt_plasma_kill", 11, 1}, - {"nt_enter_warp", 4, 1}, - {"nt_exit_warp", 4, 1}, - {"nt_start_tmode", 6, 1}, - {"nt_stop_tmode", 6, 1}, - {"nt_message", 4, 1}, - {"nt_message1", 4, 1}, - {"nt_message2", 4, 1}, - {"nt_message3", 4, 1}, - {"nt_message4", 4, 1}, - {"nt_message5", 4, 1}, - {"nt_message6", 4, 1}, - {"nt_message7", 4, 1}, - {"nt_message8", 4, 1}, - {"nt_message9", 4, 1}, - {"nt_fire_torp_other", 3, 1}, - {"nt_phaser_other", 3, 1}, - {"nt_fire_plasma_other", 3, 1}, - {"nt_explosion_other", 10, 1} -}; +static Mix_Chunk *sounds[NUM_WAVES]; +static Mix_Music *music[NUM_MUSIC]; -static int current_sound = NO_SOUND; static int sound_other = 1; /* Play other ship's sounds? */ static char sound_prefix[PATH_MAX]; @@ -100,44 +49,44 @@ int loadSounds(void) { int i; - newsounds[CLOAKED_WAV] = Mix_LoadWAV(DATAFILE("nt_cloaked.wav")); - newsounds[ENGINE_WAV] = Mix_LoadWAV(DATAFILE("nt_engine.wav")); - newsounds[ENTER_SHIP_WAV] = Mix_LoadWAV(DATAFILE("nt_enter_ship.wav")); - newsounds[ENTER_WARP_WAV] = Mix_LoadWAV(DATAFILE("nt_enter_warp.wav")); - newsounds[EXIT_WARP_WAV] = Mix_LoadWAV(DATAFILE("nt_exit_warp.wav")); - newsounds[EXPLOSION_WAV] = Mix_LoadWAV(DATAFILE("nt_explosion.wav")); - newsounds[BASE_EXPLOSION_WAV] = Mix_LoadWAV(DATAFILE("nt_base_explosion.wav")); - newsounds[EXPLOSION_OTHER_WAV] = Mix_LoadWAV(DATAFILE("nt_explosion_other.wav")); - newsounds[FIRE_PLASMA_WAV] = Mix_LoadWAV(DATAFILE("nt_fire_plasma.wav")); - newsounds[OTHER_FIRE_PLASMA_WAV] = Mix_LoadWAV(DATAFILE("nt_fire_plasma_other.wav")); - newsounds[FIRE_TORP_WAV] = Mix_LoadWAV(DATAFILE("nt_fire_torp.wav")); - newsounds[OTHER_FIRE_TORP_WAV] = Mix_LoadWAV(DATAFILE("nt_fire_torp_other.wav")); - newsounds[INTRO_WAV] = Mix_LoadWAV(DATAFILE("nt_intro.wav")); - newsounds[MESSAGE_WAV] = Mix_LoadWAV(DATAFILE("nt_message.wav")); - newsounds[MESSAGE1_WAV] = Mix_LoadWAV(DATAFILE("nt_message1.wav")); - newsounds[MESSAGE2_WAV] = Mix_LoadWAV(DATAFILE("nt_message2.wav")); - newsounds[MESSAGE3_WAV] = Mix_LoadWAV(DATAFILE("nt_message3.wav")); - newsounds[MESSAGE4_WAV] = Mix_LoadWAV(DATAFILE("nt_message4.wav")); - newsounds[MESSAGE5_WAV] = Mix_LoadWAV(DATAFILE("nt_message5.wav")); - newsounds[MESSAGE6_WAV] = Mix_LoadWAV(DATAFILE("nt_message6.wav")); - newsounds[MESSAGE7_WAV] = Mix_LoadWAV(DATAFILE("nt_message7.wav")); - newsounds[PHASER_WAV] = Mix_LoadWAV(DATAFILE("nt_phaser.wav")); - newsounds[PHASER_OTHER_WAV] = Mix_LoadWAV(DATAFILE("nt_phaser_other.wav")); - newsounds[PLASMA_HIT_WAV] = Mix_LoadWAV(DATAFILE("nt_plasma_hit.wav")); - newsounds[PLASMA_KILL_WAV] = Mix_LoadWAV(DATAFILE("nt_plasma_kill.wav")); - newsounds[RED_ALERT_WAV] = Mix_LoadWAV(DATAFILE("nt_red_alert.wav")); - newsounds[SELF_DESTRUCT_WAV] = Mix_LoadWAV(DATAFILE("nt_self_destruct.wav")); - newsounds[SHIELD_DOWN_WAV] = Mix_LoadWAV(DATAFILE("nt_shield_down.wav")); - newsounds[SHIELD_UP_WAV] = Mix_LoadWAV(DATAFILE("nt_shield_up.wav")); - newsounds[START_TMODE_WAV] = Mix_LoadWAV(DATAFILE("nt_start_tmode.wav")); - newsounds[STOP_TMODE_WAV] = Mix_LoadWAV(DATAFILE("nt_stop_tmode.wav")); - newsounds[TORP_HIT_WAV] = Mix_LoadWAV(DATAFILE("nt_torp_hit.wav")); - newsounds[UNCLOAK_WAV] = Mix_LoadWAV(DATAFILE("nt_uncloak.wav")); - newsounds[WARNING_WAV] = Mix_LoadWAV(DATAFILE("nt_warning.wav")); + sounds[CLOAKED_WAV] = Mix_LoadWAV(DATAFILE("nt_cloaked.wav")); + sounds[ENGINE_WAV] = Mix_LoadWAV(DATAFILE("nt_engine.wav")); + sounds[ENTER_SHIP_WAV] = Mix_LoadWAV(DATAFILE("nt_enter_ship.wav")); + sounds[ENTER_WARP_WAV] = Mix_LoadWAV(DATAFILE("nt_enter_warp.wav")); + sounds[EXIT_WARP_WAV] = Mix_LoadWAV(DATAFILE("nt_exit_warp.wav")); + sounds[EXPLOSION_WAV] = Mix_LoadWAV(DATAFILE("nt_explosion.wav")); + sounds[BASE_EXPLOSION_WAV] = Mix_LoadWAV(DATAFILE("nt_base_explosion.wav")); + sounds[EXPLOSION_OTHER_WAV] = Mix_LoadWAV(DATAFILE("nt_explosion_other.wav")); + sounds[FIRE_PLASMA_WAV] = Mix_LoadWAV(DATAFILE("nt_fire_plasma.wav")); + sounds[OTHER_FIRE_PLASMA_WAV] = Mix_LoadWAV(DATAFILE("nt_fire_plasma_other.wav")); + sounds[FIRE_TORP_WAV] = Mix_LoadWAV(DATAFILE("nt_fire_torp.wav")); + sounds[OTHER_FIRE_TORP_WAV] = Mix_LoadWAV(DATAFILE("nt_fire_torp_other.wav")); + sounds[INTRO_WAV] = Mix_LoadWAV(DATAFILE("nt_intro.wav")); + sounds[MESSAGE_WAV] = Mix_LoadWAV(DATAFILE("nt_message.wav")); + sounds[MESSAGE1_WAV] = Mix_LoadWAV(DATAFILE("nt_message1.wav")); + sounds[MESSAGE2_WAV] = Mix_LoadWAV(DATAFILE("nt_message2.wav")); + sounds[MESSAGE3_WAV] = Mix_LoadWAV(DATAFILE("nt_message3.wav")); + sounds[MESSAGE4_WAV] = Mix_LoadWAV(DATAFILE("nt_message4.wav")); + sounds[MESSAGE5_WAV] = Mix_LoadWAV(DATAFILE("nt_message5.wav")); + sounds[MESSAGE6_WAV] = Mix_LoadWAV(DATAFILE("nt_message6.wav")); + sounds[MESSAGE7_WAV] = Mix_LoadWAV(DATAFILE("nt_message7.wav")); + sounds[PHASER_WAV] = Mix_LoadWAV(DATAFILE("nt_phaser.wav")); + sounds[PHASER_OTHER_WAV] = Mix_LoadWAV(DATAFILE("nt_phaser_other.wav")); + sounds[PLASMA_HIT_WAV] = Mix_LoadWAV(DATAFILE("nt_plasma_hit.wav")); + sounds[PLASMA_KILL_WAV] = Mix_LoadWAV(DATAFILE("nt_plasma_kill.wav")); + sounds[RED_ALERT_WAV] = Mix_LoadWAV(DATAFILE("nt_red_alert.wav")); + sounds[SELF_DESTRUCT_WAV] = Mix_LoadWAV(DATAFILE("nt_self_destruct.wav")); + sounds[SHIELD_DOWN_WAV] = Mix_LoadWAV(DATAFILE("nt_shield_down.wav")); + sounds[SHIELD_UP_WAV] = Mix_LoadWAV(DATAFILE("nt_shield_up.wav")); + sounds[START_TMODE_WAV] = Mix_LoadWAV(DATAFILE("nt_start_tmode.wav")); + sounds[STOP_TMODE_WAV] = Mix_LoadWAV(DATAFILE("nt_stop_tmode.wav")); + sounds[TORP_HIT_WAV] = Mix_LoadWAV(DATAFILE("nt_torp_hit.wav")); + sounds[UNCLOAK_WAV] = Mix_LoadWAV(DATAFILE("nt_uncloak.wav")); + sounds[WARNING_WAV] = Mix_LoadWAV(DATAFILE("nt_warning.wav")); for (i=0; i < NUM_WAVES; i++) { - if (!newsounds[i]) { - LineToConsole("Mix_LoadWAV newsound[%d] could not be loaded. Check soundDir in your .netrekrc: %s\n", i, Mix_GetError()); + if (!sounds[i]) { + LineToConsole("Mix_LoadWAV sounds[%d] could not be loaded. Check soundDir in your .netrekrc: %s\n", i, Mix_GetError()); return(-1); } } @@ -151,19 +100,19 @@ int loadMusic(void) { int i; - newmusic[INTRO1_MUSIC] = Mix_LoadMUS(DATAFILE("intro_theme_TOS.ogg")); - newmusic[INTRO2_MUSIC] = Mix_LoadMUS(DATAFILE("intro_theme_TNG.ogg")); - newmusic[INTRO3_MUSIC] = Mix_LoadMUS(DATAFILE("intro_theme_VOY.ogg")); - newmusic[INTRO4_MUSIC] = Mix_LoadMUS(DATAFILE("intro_theme_DS9.ogg")); - newmusic[INTRO5_MUSIC] = Mix_LoadMUS(DATAFILE("intro_theme_ST2.ogg")); - newmusic[END1_MUSIC] = Mix_LoadMUS(DATAFILE("end_theme_TOS.ogg")); - newmusic[END2_MUSIC] = Mix_LoadMUS(DATAFILE("end_theme_TNG.ogg")); - newmusic[END3_MUSIC] = Mix_LoadMUS(DATAFILE("end_theme_VOY.ogg")); - newmusic[END4_MUSIC] = Mix_LoadMUS(DATAFILE("end_theme_DS9.ogg")); + music[INTRO1_MUSIC] = Mix_LoadMUS(DATAFILE("intro_theme_TOS.ogg")); + music[INTRO2_MUSIC] = Mix_LoadMUS(DATAFILE("intro_theme_TNG.ogg")); + music[INTRO3_MUSIC] = Mix_LoadMUS(DATAFILE("intro_theme_VOY.ogg")); + music[INTRO4_MUSIC] = Mix_LoadMUS(DATAFILE("intro_theme_DS9.ogg")); + music[INTRO5_MUSIC] = Mix_LoadMUS(DATAFILE("intro_theme_ST2.ogg")); + music[END1_MUSIC] = Mix_LoadMUS(DATAFILE("end_theme_TOS.ogg")); + music[END2_MUSIC] = Mix_LoadMUS(DATAFILE("end_theme_TNG.ogg")); + music[END3_MUSIC] = Mix_LoadMUS(DATAFILE("end_theme_VOY.ogg")); + music[END4_MUSIC] = Mix_LoadMUS(DATAFILE("end_theme_DS9.ogg")); for (i=0; i < NUM_MUSIC; i++) { - if (!newmusic[i]) { - LineToConsole("Mix_LoadMUS newmusic[%d] could not be loaded. Check soundDir in your .netrekrc: %s\n", i, Mix_GetError()); + if (!music[i]) { + LineToConsole("Mix_LoadMUS music[%d] could not be loaded. Check soundDir in your .netrekrc: %s\n", i, Mix_GetError()); return(-1); } } @@ -177,11 +126,11 @@ //Free the sound effects for (i = 0; i < NUM_WAVES; i++) - Mix_FreeChunk(newsounds[i]); + Mix_FreeChunk(sounds[i]); //Free the music for (i = 0; i < NUM_MUSIC; i++) - Mix_FreeMusic(newmusic[i]); + Mix_FreeMusic(music[i]); //Quit SDL_mixer Mix_CloseAudio(); @@ -190,18 +139,9 @@ SDL_Quit(); } -extern void Exit_Sound (void) -{ - if (sound_init) - ExitSound (); - sound_init = 0; - sound_toggle = 0; -} - - extern void Init_Sound (void) { - char buf[PATH_MAX]; + int i; #ifdef DEBUG LineToConsole ("Init_Sound\n"); @@ -216,129 +156,78 @@ } else sounddir = "./sounds"; - } - - if (newSound) - { - int i; + } #ifdef DEBUG - LineToConsole ("Init_Sound using SDL\n"); + LineToConsole ("Init_Sound using SDL\n"); #endif - /* Initialize the SDL library */ - if (SDL_Init(SDL_INIT_AUDIO) < 0) - LineToConsole("Couldn't initialize SDL: %s\n",SDL_GetError()); + /* Initialize the SDL library */ + if (SDL_Init(SDL_INIT_AUDIO) < 0) + LineToConsole("Couldn't initialize SDL: %s\n",SDL_GetError()); - atexit(sound_cleanup); + atexit(sound_cleanup); - /* Open the audio device at 22050 Hz 8 bit Microsoft PCM with stereo */ - if (Mix_OpenAudio(22050, AUDIO_S16SYS, 2, 1024) < 0) - { - LineToConsole("Mix_OpenAudio: %s\n", Mix_GetError()); - sound_init = 0; - return; - } + /* Open the audio device at 22050 Hz 8 bit Microsoft PCM with stereo */ + if (Mix_OpenAudio(22050, AUDIO_S16SYS, 2, 1024) < 0) + { + LineToConsole("Mix_OpenAudio: %s\n", Mix_GetError()); + sound_init = 0; + return; + } - /* Set sound and music volume to half (128 is MAXVOLUME) */ - Mix_Volume(-1, 64); - Mix_VolumeMusic(64); + /* Set sound and music volume to half (128 is MAXVOLUME) */ + Mix_Volume(-1, 64); + Mix_VolumeMusic(64); - /* Toggle on sound, and load sound files */ - sound_toggle = 1; - loadSounds(); - - /* Load music files, and play random intro music */ - loadMusic(); - i = RANDOM() % MUSIC_OFFSET; - Play_Music(i); - /* See if volume is adjustable */ - CheckVolumeSettings (); - /* Default of 8 channels not enough */ - Mix_AllocateChannels(16); - } - else - { - if (InitSound () == -1) - { - sound_toggle = 0; - sound_init = 0; - } - else - { - sound_init = 1; - sound_toggle = 1; - /* See if volume is adjustable */ - CheckVolumeSettings (); - } + /* Toggle on sound, and load sound files */ + sound_toggle = 1; + loadSounds(); - strcpy (sound_prefix, sounddir); - strcat (sound_prefix, "/"); + /* Load music files, and play random intro music */ + loadMusic(); + i = RANDOM() % MUSIC_OFFSET; + Play_Music(i); - if (sound_toggle) - { - strcpy (buf, sounddir); - strcat (buf, "/nt_intro"); - StartSound (buf); - } - } + /* Default of 8 channels not enough */ + Mix_AllocateChannels(16); } } extern void Play_Sound (int type) { - if (newSound) - { - int channel; + int channel; - if (!sound_init || !newSoundEffects || !sound_toggle) - return; + if (!sound_init || !soundEffects || !sound_toggle) + return; - if ((type >= NUM_WAVES) || (type < 0)) - { - LineToConsole("Invalid sound type %d\n", type); - return; - } + /* Don't play other ship's sounds if turned off */ + if (type > OTHER_SOUND_OFFSET && !sound_other) + return; - if ((channel = Mix_PlayChannel(-1, newsounds[type], 0)) < 0) - { + if ((type >= NUM_WAVES) || (type < 0)) + { + LineToConsole("Invalid sound type %d\n", type); + return; + } + + if ((channel = Mix_PlayChannel(-1, sounds[type], 0)) < 0) + { #ifdef DEBUG - /* Frequent occurence is more than 16 channels playing sound */ - LineToConsole("Mix_PlayChannel: %s\n", Mix_GetError()); + /* Frequent occurence is more than 16 channels playing sound */ + LineToConsole("Mix_PlayChannel: %s\n", Mix_GetError()); #endif - return; - } - - Group_Sound(type, channel); + return; } - else - { - char buf[PATH_MAX]; - - /* Don't play other ship's sounds if turned off */ - if (type > OTHER_SOUND_OFFSET && !sound_other) - return; - - if (sound_toggle && sounds[type].flag && - ((sounds[type].priority >= sounds[current_sound].priority) || - !SoundPlaying ())) - { - STRNCPY (buf, sound_prefix, PATH_MAX); - strcat (buf, sounds[type].name); - StartSound (buf); - current_sound = type; - } - - if (!(sound_toggle)) - current_sound = NO_SOUND; - } + + Group_Sound(type, channel); } extern void Play_Sound_Loc (int type, int angle, int distance) { int channel; - if (!sound_init || !newSoundEffects || !sound_toggle) + if (!sound_init || !soundEffects || !sound_toggle) return; if ((type >= NUM_WAVES) || (type < 0)) @@ -347,7 +236,7 @@ return; } - if ((channel = Mix_PlayChannel(-1, newsounds[type], 0)) < 0) + if ((channel = Mix_PlayChannel(-1, sounds[type], 0)) < 0) { #ifdef DEBUG /* Frequent occurence is more than 16 channels playing sound */ @@ -360,7 +249,7 @@ distance = 0; if (distance > 255) distance = 255; - if (newSoundAngles) + if (soundAngles) { // Adjust volume with distance and angle if (Mix_SetPosition(channel, angle, distance) == 0) @@ -383,10 +272,9 @@ return; } -/* Only works with SDL, i.e. newSound */ extern void Play_Music (int type) { - if (!sound_init || !sound_toggle || !newSound || !newSoundMusic) + if (!sound_init || !sound_toggle || !soundMusic) return; if ((type >= NUM_MUSIC) || (type < 0)) @@ -395,19 +283,18 @@ return; } - if (Mix_PlayMusic(newmusic[type], 1) < 0) + if (Mix_PlayMusic(music[type], 1) < 0) { LineToConsole("Mix_PlayMusic: %s\n", Mix_GetError()); return; } } -/* Only works with SDL, i.e. newSound */ extern void Play_Music_Bkgd (void) { int i; - if (!sound_init || !sound_toggle || !newSound || !newSoundMusic || !newSoundMusicBkgd) + if (!sound_init || !sound_toggle || !soundMusic || !soundMusicBkgd) return; if (Mix_PlayingMusic()) @@ -415,14 +302,13 @@ i = RANDOM() % NUM_MUSIC; - if (Mix_PlayMusic(newmusic[i], 1) < 0) + if (Mix_PlayMusic(music[i], 1) < 0) { LineToConsole("Mix_PlayMusic: %s\n", Mix_GetError()); return; } /* So we play another one when done */ - Mix_HookMusicFinished(Play_Music_Bkgd); - + Mix_HookMusicFinished(Play_Music_Bkgd); } void Group_Sound (int type, int channel) @@ -462,8 +348,7 @@ } } -/* Only works with SDL, i.e. newSound */ -extern void ChangeNewsoundVolume (int vol) +extern void ChangeVolume (int vol) { int mvolume, volume; @@ -484,48 +369,28 @@ Mix_VolumeMusic(mvolume); } -extern void Abort_Sound (int type) -{ - if ((current_sound != NO_SOUND) && (type == current_sound)) - StopSound (); -} - - /* Sound options window stuff */ #define SOUND_TOGGLE 0 -#define SOUND_OTHER MESSAGE_SOUND + 1 -#define SOUND_INIT MESSAGE_SOUND + 2 -#define SOUND_DONE MESSAGE_SOUND + 3 - -#define SDL_EFFECTS_TOGGLE 1 -#define SDL_MUSIC_TOGGLE 2 -#define SDL_MUSIC_BKGD 3 -#define SDL_SOUND_ANGLE 4 -#define SDL_SOUND_DONE 5 - -static void soundrefresh (int i); -static void sdlsoundrefresh (int i); +#define EFFECTS_TOGGLE 1 +#define MUSIC_TOGGLE 2 +#define MUSIC_BKGD 3 +#define SOUND_ANGLE 4 +#define SOUND_OTHER 5 +#define SOUND_DONE 6 extern void soundwindow (void) { int i; - if (newSound) - { - for (i = 0; i <= SDL_SOUND_DONE; i++) - sdlsoundrefresh (i); - } - else - { - for (i = 0; i <= SOUND_DONE; i++) - soundrefresh (i); - } + + for (i = 0; i <= SOUND_DONE; i++) + soundrefresh (i); + /* Map window */ W_MapWindow (soundWin); } - -static void sdlsoundrefresh (int i) +static void soundrefresh (int i) { char buf[BUFSIZ]; @@ -534,134 +399,30 @@ sprintf (buf, "Sound is turned %s", (sound_toggle == 1) ? "ON" : "OFF"); } - else if (i == SDL_EFFECTS_TOGGLE) + else if (i == EFFECTS_TOGGLE) { sprintf (buf, "Sound effects are turned %s", - (newSoundEffects == 1) ? "ON" : "OFF"); + (soundEffects == 1) ? "ON" : "OFF"); } - else if (i == SDL_MUSIC_TOGGLE) + else if (i == MUSIC_TOGGLE) { sprintf (buf, "Music is turned %s", - (newSoundMusic == 1) ? "ON" : "OFF"); + (soundMusic == 1) ? "ON" : "OFF"); } - else if (i == SDL_MUSIC_BKGD) + else if (i == MUSIC_BKGD) { sprintf (buf, "Background music is turned %s", - (newSoundMusicBkgd == 1) ? "ON" : "OFF"); + (soundMusicBkgd == 1) ? "ON" : "OFF"); } - else if (i == SDL_SOUND_ANGLE) + else if (i == SOUND_ANGLE) { sprintf (buf, "Angular sound is turned %s", - (newSoundAngles) ? "ON" : "OFF"); - } - else if (i == SDL_SOUND_DONE) - { - strcpy (buf, "Done"); - } - else - { - LineToConsole ("Uh oh, bogus refresh number in sdlsoundrefresh\n"); - } - - W_WriteText (soundWin, 0, i, textColor, buf, strlen (buf), 0); -} - -static void soundrefresh (int i) -{ - char buf[BUFSIZ], *flag; - - if (i == SOUND_TOGGLE) - { - sprintf (buf, "Sound is turned %s", - (sound_toggle == 1) ? "ON" : "OFF"); - } - else if (i < SOUND_OTHER) - { - flag = ((sounds[i].flag == 1) ? "ON" : "OFF"); - switch (i) - { - case CLOAK_SOUND: - sprintf (buf, "Cloak sound is %s", flag); - break; - case UNCLOAK_SOUND: - sprintf (buf, "Uncloak sound is %s", flag); - break; - case ENGINE_SOUND: - sprintf (buf, "Engine sound is not supported"); - /* sprintf (buf, "Engine sound is %s", flag); */ - break; - case ENTER_SHIP_SOUND: - sprintf (buf, "Enter ship sound is %s", flag); - break; - case ENTER_WARP_SOUND: - sprintf (buf, "Enter warp sound is %s", flag); - break; - case EXIT_WARP_SOUND: - sprintf (buf, "Exit warp sound is %s", flag); - break; - case EXPLOSION_SOUND: - sprintf (buf, "Explosion sound is %s", flag); - break; - case BASE_EXPLOSION_SOUND: - sprintf (buf, "Base explosion sound is %s", flag); - break; - case FIRE_TORP_SOUND: - sprintf (buf, "Fire torp sound is %s", flag); - break; - case MESSAGE_SOUND: - sprintf (buf, "Message sound is %s", flag); - break; - case PHASER_SOUND: - sprintf (buf, "Phaser sound is %s", flag); - break; - case WARNING_SOUND: - sprintf (buf, "Warning sound is %s", flag); - break; - case RED_ALERT_SOUND: - sprintf (buf, "Red alert sound is %s", flag); - break; - case SHIELD_DOWN_SOUND: - sprintf (buf, "Shield down sound is %s", flag); - break; - case SHIELD_UP_SOUND: - sprintf (buf, "Shield up sound is %s", flag); - break; - case START_TMODE_SOUND: - sprintf (buf, "Start tmode sound is %s", flag); - break; - case STOP_TMODE_SOUND: - sprintf (buf, "Stop tmode sound is %s", flag); - break; - case TORP_HIT_SOUND: - sprintf (buf, "Torp hit sound is %s", flag); - break; - case SELF_DESTRUCT_SOUND: - sprintf (buf, "Self destruct sound is %s", flag); - break; - case FIRE_PLASMA_SOUND: - sprintf (buf, "Fire plasma sound is %s", flag); - break; - case PLASMA_HIT_SOUND: - sprintf (buf, "Plasma hit sound is %s", flag); - break; - case PLASMA_KILL_SOUND: - sprintf (buf, "Plasma kill sound is %s", flag); - break; - } + (soundAngles) ? "ON" : "OFF"); } else if (i == SOUND_OTHER) { - if (sound_other) - strcpy (buf, "Other ship's sound is ON"); - else - strcpy (buf, "Other ship's sound is OFF"); - } - else if (i == SOUND_INIT) - { - if (sound_init) - strcpy (buf, "Restart external sound player"); - else - strcpy (buf, "Initialize external sound player"); + sprintf (buf, "Other ship's sound is turned %s", + (sound_other) ? "ON" : "OFF"); } else if (i == SOUND_DONE) { @@ -675,7 +436,7 @@ W_WriteText (soundWin, 0, i, textColor, buf, strlen (buf), 0); } -void sdlsoundaction (W_Event * data) +void soundaction (W_Event * data) { int i; @@ -691,96 +452,43 @@ Mix_HaltChannel(-1); Mix_HaltMusic(); } - sdlsoundrefresh (SOUND_TOGGLE); + soundrefresh (SOUND_TOGGLE); } - else if (i == SDL_EFFECTS_TOGGLE) + else if (i == EFFECTS_TOGGLE) { if (sound_init) - newSoundEffects = (newSoundEffects) ? 0 : 1; - if (!newSoundEffects) + soundEffects = (soundEffects) ? 0 : 1; + if (!soundEffects) Mix_HaltChannel(-1); - sdlsoundrefresh (SDL_EFFECTS_TOGGLE); + soundrefresh (EFFECTS_TOGGLE); } - else if (i == SDL_MUSIC_TOGGLE) + else if (i == MUSIC_TOGGLE) { if (sound_init) - newSoundMusic = (newSoundMusic) ? 0 : 1; - if (!newSoundMusic) + soundMusic = (soundMusic) ? 0 : 1; + if (!soundMusic) Mix_HaltMusic(); - sdlsoundrefresh (SDL_MUSIC_TOGGLE); + soundrefresh (MUSIC_TOGGLE); } - else if (i == SDL_MUSIC_BKGD) + else if (i == MUSIC_BKGD) { if (sound_init) - newSoundMusicBkgd = (newSoundMusicBkgd) ? 0 : 1; - if (!newSoundMusicBkgd) + soundMusicBkgd = (soundMusicBkgd) ? 0 : 1; + if (!soundMusicBkgd) Mix_HaltMusic(); else Play_Music_Bkgd(); - sdlsoundrefresh (SDL_MUSIC_BKGD); - } - else if (i == SDL_SOUND_ANGLE) - { - newSoundAngles = (newSoundAngles) ? 0 : 1; - sdlsoundrefresh (SDL_SOUND_ANGLE); - } - else - { - sounddone (); - } -} - - -void soundaction (W_Event * data) -{ - int i, j; - - i = data->y; - - if (i == SOUND_TOGGLE) - { - if (sound_init) - sound_toggle = (sound_toggle == 1) ? 0 : 1; - soundrefresh (SOUND_TOGGLE); - if (!sound_toggle) - { - Abort_Sound (ENGINE_SOUND); - } - else - { - Play_Sound (ENGINE_SOUND); - } + soundrefresh (MUSIC_BKGD); } - else if (i < SOUND_OTHER) + else if (i == SOUND_ANGLE) { - sounds[i].flag = (sounds[i].flag == 1) ? 0 : 1; - if (i + OTHER_SOUND_OFFSET <= NUM_SOUNDS) - sounds[i + OTHER_SOUND_OFFSET].flag = sounds[i].flag; - - soundrefresh (i); - Play_Sound (i); - if (i == MESSAGE_SOUND) - { - for (j = MESSAGE1_SOUND; j <= MESSAGE9_SOUND; j++) - sounds[j].flag = sounds[MESSAGE_SOUND].flag; - } - /* case ENGINE: st_engine = (st_engine == 1) ? 0 : 0; soundrefresh - * (ENGINE); if (st_engine && sound_toggle) { Play_Sound - * (ENGINE_SOUND); } else { Abort_Sound (ENGINE_SOUND); } break; */ - + soundAngles = (soundAngles) ? 0 : 1; + soundrefresh (SOUND_ANGLE); } else if (i == SOUND_OTHER) { - sound_other = !sound_other; - soundrefresh (SOUND_OTHER); - } - else if (i == SOUND_INIT) - { - Exit_Sound (); - sound_init = 1; - Init_Sound (); - soundrefresh (SOUND_INIT); - soundrefresh (SOUND_TOGGLE); + sound_other = (sound_other) ? 0 : 1; + soundrefresh (SOUND_OTHER); } else { @@ -788,6 +496,7 @@ } } + extern void sounddone (void) { W_UnmapWindow (soundWin); Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- newwin.c 21 Feb 2007 15:17:06 -0000 1.47 +++ newwin.c 28 Feb 2007 09:35:20 -0000 1.48 @@ -927,6 +927,14 @@ W_SetWindowButtonHandler (spWin, spaction); #endif +#if defined(SOUND) + soundWin = W_MakeMenu("sound", WINSIDE + 20, -BORDER + 10, 33, + 7, NULL, 2); + W_SetWindowKeyDownHandler(soundWin, soundaction); + W_SetWindowButtonHandler(soundWin, soundaction); + W_DefineArrowCursor(soundWin); +#endif + #ifdef TOOLS toolsWin = W_MakeScrollingWindow ("tools", WINSIDE + BORDER, BORDER, 80, TOOLSWINLEN, NULL, BORDER); @@ -1002,33 +1010,6 @@ getResources (progname); } -#if defined(SOUND) -/******************************************************************************/ -/*** newsoundwin() - Need to map it after reset_defaults, so pulled out of newwin -/******************************************************************************/ -void -newsoundwin (char *hostmon, - char *progname) -{ - if (newSound) - { - soundWin = W_MakeMenu("sound", WINSIDE + 20, -BORDER + 10, 33, - 6, NULL, 2); - W_SetWindowKeyDownHandler(soundWin, sdlsoundaction); - W_SetWindowButtonHandler(soundWin, sdlsoundaction); - W_DefineArrowCursor(soundWin); - } - else - { - soundWin = W_MakeMenu("sound", WINSIDE + 20, -BORDER + 10, 30, - MESSAGE_SOUND + 4, NULL, 2); - W_SetWindowKeyDownHandler(soundWin, soundaction); - W_SetWindowButtonHandler(soundWin, soundaction); - W_DefineArrowCursor(soundWin); - } -} -#endif - /******************************************************************************/ /*** mapAll() /******************************************************************************/ Index: input.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/input.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- input.c 28 Feb 2007 07:44:00 -0000 1.24 +++ input.c 28 Feb 2007 09:35:20 -0000 1.25 @@ -28,9 +28,6 @@ #include "spopt.h" #include "map.h" #include "proto.h" -#ifdef SOUND -#include "audio.h" -#endif #ifdef __BORLANDC__ #ifndef CYGWIN @@ -1521,10 +1518,7 @@ /* Here we will have to enter message_on () followed by smessage to player */ #ifdef SOUND - if (newSound) - Play_Sound(MESSAGE_WAV); - else - Play_Sound(MESSAGE_SOUND); + Play_Sound(MESSAGE_WAV); #endif message_on (); data->key = players[target->o_num].p_mapchars[1]; @@ -1538,10 +1532,7 @@ /* Here we will have to enter message_on () followed by smessage to player */ #ifdef SOUND - if (newSound) - Play_Sound(MESSAGE_WAV); - else - Play_Sound(MESSAGE_SOUND); + Play_Sound(MESSAGE_WAV); #endif message_on (); data->key = 'T'; @@ -1555,10 +1546,7 @@ /* Here we will have to enter message_on () followed by smessage to player */ #ifdef SOUND - if (newSound) - Play_Sound(MESSAGE_WAV); - else - Play_Sound(MESSAGE_SOUND); + Play_Sound(MESSAGE_WAV); #endif message_on (); data->key = 'A'; @@ -2765,10 +2753,7 @@ { #ifdef SOUND - if (newSound) - Play_Sound(SELF_DESTRUCT_WAV); - else - Play_Sound(SELF_DESTRUCT_SOUND); + Play_Sound(SELF_DESTRUCT_WAV); #endif sendQuitReq (); @@ -2849,10 +2834,7 @@ Key86 (void) { #ifdef SOUND - if (newSound) - ChangeNewsoundVolume (1); - else - ChangeVolume (1); + ChangeVolume (1); #else emptyKey (); #endif @@ -3196,10 +3178,7 @@ { #ifdef SOUND - if (newSound) - Play_Sound(MESSAGE_WAV); - else - Play_Sound(MESSAGE_SOUND); + Play_Sound(MESSAGE_WAV); #endif message_on (); @@ -3263,10 +3242,7 @@ { #ifdef SOUND - if (newSound) - Play_Sound(SELF_DESTRUCT_WAV); - else - Play_Sound(SELF_DESTRUCT_SOUND); + Play_Sound(SELF_DESTRUCT_WAV); #endif fastQuit = 1; @@ -3331,10 +3307,7 @@ Key118 (W_Event * data) { #ifdef SOUND - if (newSound) - ChangeNewsoundVolume (-1); - else - ChangeVolume (-1); + ChangeVolume (-1); #else emptyKey (); #endif Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- local.c 28 Feb 2007 07:44:00 -0000 1.63 +++ local.c 28 Feb 2007 09:35:20 -0000 1.64 @@ -641,7 +641,7 @@ 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; - int newdx, newdy, distance, angle; /* For newSound */ + int newdx, newdy, distance, angle; W_Icon (*ship_bits)[SHIP_VIEWS]; W_Icon (*ship_bitsHR); @@ -659,7 +659,6 @@ /* Twarp sounds put up here so observers can hear them */ #ifdef SOUND - /* Have to use me->p_flags because server doesn't send us twarp flag info on other players. Current Vanilla does not let observer change players if the player they are observing is transwarping. */ @@ -674,27 +673,17 @@ { if (warpchange && (j->p_flags & PFTWARP)) { - if (newSound) // Kill any channels with ENTER_WARP_WAV or EXIT_WARP_WAV (group 3) - { - Mix_HaltGroup(3); - Play_Sound(ENTER_WARP_WAV); - } - else - Play_Sound(ENTER_WARP_SOUND); - + // Kill any channels with ENTER_WARP_WAV or EXIT_WARP_WAV (group 3) + Mix_HaltGroup(3); + Play_Sound(ENTER_WARP_WAV); warpchange = 0; } if (warpchange && !(j->p_flags & PFTWARP)) { - if (newSound) // Kill any channels with ENTER_WARP_WAV or EXIT_WARP_WAV (group 3) - { - Mix_HaltGroup(3); - Play_Sound(EXIT_WARP_WAV); - } - else - Play_Sound(EXIT_WARP_SOUND); - - warpchange = 0; + // Kill any channels with ENTER_WARP_WAV or EXIT_WARP_WAV (group 3) + Mix_HaltGroup(3); + Play_Sound(EXIT_WARP_WAV); + warpchange = 0; } } #endif @@ -733,36 +722,28 @@ { // To avoid hearing twarp cloak sounds as the twarper/observer if ( (myPlayer(j) || isObsLockPlayer(j)) ? ((me->p_flags & PFTWARP) ? 0 : 1) : 1 ) - { - if (newSound) - { - newdx = dx - WINSIDE/2; - newdy = dy - WINSIDE/2; - - distance = (int) sqrt((newdx)*(newdx) + (newdy)*(newdy)); - // Normalize from 0 to 255, 0 being on top of player, 255 being max distance - // which would be a diagonal from player to corner of tactical - // Reason for normalization is Mix_SetDistance requires that range - distance = (int)((255 * distance)/CORNER_DIST); - // Calculate angle, then adjust as necessary for Mix_SetDistance - if (distance != 0) - { - angle = (int)(atan2(-newdy, newdx)*180/XPI); - angle = 90 - angle; - } - else - angle = 0; - // At short distances, don't use angular sound - if (distance < SCALE/2) - Play_Sound(CLOAKED_WAV); - else - Play_Sound_Loc(CLOAKED_WAV, angle, distance); - } - else + { + newdx = dx - WINSIDE/2; + newdy = dy - WINSIDE/2; + + distance = (int) sqrt((newdx)*(newdx) + (newdy)*(newdy)); + // Normalize from 0 to 255, 0 being on top of player, 255 being max distance + // which would be a diagonal from player to corner of tactical + // Reason for normalization is Mix_SetDistance requires that range + distance = (int)((255 * distance)/CORNER_DIST); + // Calculate angle, then adjust as necessary for Mix_SetDistance + if (distance != 0) { - if (myPlayer(j) || isObsLockPlayer(j)) - Play_Sound(CLOAK_SOUND); + angle = (int)(atan2(-newdy, newdx)*180/XPI); + angle = 90 - angle; } + else + angle = 0; + // At short distances, don't use angular sound + if (distance < SCALE/2) + Play_Sound(CLOAKED_WAV); + else + Play_Sound_Loc(CLOAKED_WAV, angle, distance); } } #endif @@ -779,45 +760,32 @@ // To avoid twarp cloak sounds as the twarper/observer if ( (myPlayer(j) || isObsLockPlayer(j)) ? ((me->p_flags & PFTWARP) ? 0 : 1) : 1 ) { - if (newSound) + if (j->p_cloakphase == cloak_phases - 1) { - if (j->p_cloakphase == cloak_phases - 1) - { - newdx = dx - WINSIDE/2; - newdy = dy - WINSIDE/2; + newdx = dx - WINSIDE/2; + newdy = dy - WINSIDE/2; - distance = (int) sqrt((newdx)*(newdx) + (newdy)*(newdy)); - // Normalize from 0 to 255, 0 being on top of player, 255 being max distance - // which would be a diagonal from player to corner of tactical - // Reason for normalization is Mix_SetDistance requires that range - distance = (int)((255 * distance)/CORNER_DIST); - // Calculate angle, then adjust as necessary for Mix_SetDistance - if (distance != 0) - { - angle = (int)(atan2(-newdy, newdx)*180/XPI); - angle = 90 - angle; - } - else - angle = 0; - // At short distances, don't use angular sound - if (distance < SCALE/2) - Play_Sound(UNCLOAK_WAV); - else - Play_Sound_Loc(UNCLOAK_WAV, angle, distance); - } - else // Kill any channels with CLOAKED_WAV on them (group 1) - Mix_HaltGroup(1); - } - else - { - if (myPlayer(j) || isObsLockPlayer(j)) + distance = (int) sqrt((newdx)*(newdx) + (newdy)*(newdy)); + // Normalize from 0 to 255, 0 being on top of player, 255 being max distance + // which would be a diagonal from player to corner of tactical + // Reason for normalization is Mix_SetDistance requires that range + distance = (int)((255 * distance)/CORNER_DIST); + // Calculate angle, then adjust as necessary for Mix_SetDistance + if (distance != 0) { - if (j->p_cloakphase == cloak_phases - 1) - Play_Sound(UNCLOAK_SOUND); - else - Abort_Sound(CLOAK_SOUND); + angle = (int)(atan2(-newdy, newdx)*180/XPI); + angle = 90 - angle; } + else + angle = 0; + // At short distances, don't use angular sound + if (distance < SCALE/2) + Play_Sound(UNCLOAK_WAV); + else + Play_Sound_Loc(UNCLOAK_WAV, angle, distance); } + else // Kill any channels with CLOAKED_WAV on them (group 1) + Mix_HaltGroup(1); } #endif @@ -1055,25 +1023,15 @@ { if ((sound_flags & PFSHIELD) && !(j->p_flags & PFSHIELD)) { - if (newSound) - { - // Kill any channels with SHIELD_UP/DOWN_WAV on them (group 4) - Mix_HaltGroup(4); - Play_Sound(SHIELD_DOWN_WAV); - } - else - Play_Sound(SHIELD_DOWN_SOUND); + // Kill any channels with SHIELD_UP/DOWN_WAV on them (group 4) + Mix_HaltGroup(4); + Play_Sound(SHIELD_DOWN_WAV); } if (!(sound_flags & PFSHIELD) && (j->p_flags & PFSHIELD)) { - if (newSound) - { - // Kill any channels with SHIELD_UP/DOWN_WAV on them (group 4) - Mix_HaltGroup(4); - Play_Sound(SHIELD_UP_WAV); - } - else - Play_Sound(SHIELD_UP_SOUND); + // Kill any channels with SHIELD_UP/DOWN_WAV on them (group 4) + Mix_HaltGroup(4); + Play_Sound(SHIELD_UP_WAV); } } #endif @@ -1330,60 +1288,48 @@ #ifdef SOUND if (j->p_explode == 1) { - if (newSound) + if (myPlayer(j) || isObsLockPlayer(j)) { - if (myPlayer(j) || isObsLockPlayer(j)) + if (j->p_ship.s_type == STARBASE) + Play_Sound(BASE_EXPLOSION_WAV); + else + Play_Sound(EXPLOSION_WAV); + } + else + { + int newdx, newdy, distance, angle; + + newdx = dx - WINSIDE/2; + newdy = dy - WINSIDE/2; + + distance = (int) sqrt((newdx)*(newdx) + (newdy)*(newdy)); + // Normalize from 0 to 255, 0 being on top of player, 255 being max distance + // which would be a diagonal from player to corner of tactical + // Reason for normalization is Mix_SetDistance requires that range + distance = (int)((255 * distance)/CORNER_DIST); + // Calculate angle, then adjust as necessary for Mix_SetDistance + if (distance != 0) { - if (j->p_ship.s_type == STARBASE) - Play_Sound(BASE_EXPLOSION_WAV); - else - Play_Sound(EXPLOSION_WAV); + angle = (int)(atan2(-newdy, newdx)*180/XPI); + angle = 90 - angle; } else + angle = 0; + // At short distances, don't use angular sound + if (distance < SCALE/2) { - int newdx, newdy, distance, angle; - - newdx = dx - WINSIDE/2; - newdy = dy - WINSIDE/2; - - distance = (int) sqrt((newdx)*(newdx) + (newdy)*(newdy)); - // Normalize from 0 to 255, 0 being on top of player, 255 being max distance - // which would be a diagonal from player to corner of tactical - // Reason for normalization is Mix_SetDistance requires that range - distance = (int)((255 * distance)/CORNER_DIST); - // Calculate angle, then adjust as necessary for Mix_SetDistance - if (distance != 0) - { - angle = (int)(atan2(-newdy, newdx)*180/XPI); - angle = 90 - angle; - } - else - angle = 0; - // At short distances, don't use angular sound - if (distance < SCALE/2) - { - if (j->p_ship.s_type == STARBASE) - Play_Sound(BASE_EXPLOSION_WAV); - else - Play_Sound(EXPLOSION_OTHER_WAV); - } - else - { - if (j->p_ship.s_type == STARBASE) - Play_Sound_Loc(BASE_EXPLOSION_WAV, angle, distance); - else - Play_Sound_Loc(EXPLOSION_OTHER_WAV, angle, distance); - } + if (j->p_ship.s_type == STARBASE) + Play_Sound(BASE_EXPLOSION_WAV); + else + Play_Sound(EXPLOSION_OTHER_WAV); } - } - else - { - if (j->p_ship.s_type == STARBASE) - Play_Sound(BASE_EXPLOSION_SOUND); - else if (myPlayer(j) || isObsLockPlayer(j)) - Play_Sound(EXPLOSION_SOUND); else - Play_Sound(OTHER_EXPLOSION_SOUND); + { + if (j->p_ship.s_type == STARBASE) + Play_Sound_Loc(BASE_EXPLOSION_WAV, angle, distance); + else + Play_Sound_Loc(EXPLOSION_OTHER_WAV, angle, distance); + } } } #endif @@ -1433,41 +1379,34 @@ #ifdef SOUND if (php->sound_phaser) { - if (newSound) + if (myPlayer(j) || isObsLockPlayer(j)) + Play_Sound(PHASER_WAV); + else { - if (myPlayer(j) || isObsLockPlayer(j)) - Play_Sound(PHASER_WAV); - else + int newdx, newdy, distance, angle; + + newdx = dx - WINSIDE/2; + newdy = dy - WINSIDE/2; + + distance = (int) sqrt((newdx)*(newdx) + (newdy)*(newdy)); + // Normalize from 0 to 255, 0 being on top of player, 255 being max distance + // which would be a diagonal from player to corner of tactical + // Reason for normalization is Mix_SetDistance requires that range + distance = (int)((255 * distance)/CORNER_DIST); + // Calculate angle, then adjust as necessary for Mix_SetDistance + if (distance != 0) { - int newdx, newdy, distance, angle; - - newdx = dx - WINSIDE/2; - newdy = dy - WINSIDE/2; - - distance = (int) sqrt((newdx)*(newdx) + (newdy)*(newdy)); - // Normalize from 0 to 255, 0 being on top of player, 255 being max distance - // which would be a diagonal from player to corner of tactical - // Reason for normalization is Mix_SetDistance requires that range - distance = (int)((255 * distance)/CORNER_DIST); - // Calculate angle, then adjust as necessary for Mix_SetDistance - if (distance != 0) - { - angle = (int)(atan2(-newdy, newdx)*180/XPI); - angle = 90 - angle; - } - else - angle = 0; - // At short distances, don't use angular sound - if (distance < SCALE/2) - Play_Sound(PHASER_OTHER_WAV); - else - Play_Sound_Loc(PHASER_OTHER_WAV, angle, distance); + angle = (int)(atan2(-newdy, newdx)*180/XPI); + angle = 90 - angle; } + else + angle = 0; + // At short distances, don't use angular sound + if (distance < SCALE/2) + Play_Sound(PHASER_OTHER_WAV); + else + Play_Sound_Loc(PHASER_OTHER_WAV, angle, distance); } - else - Play_Sound((myPlayer(j) || isObsLockPlayer(j)) - ? PHASER_SOUND : OTHER_PHASER_SOUND); - php->sound_phaser = 0; } #endif @@ -1870,7 +1809,7 @@ } #ifdef SOUND - if (j != me && newSound) + if (j != me) { int new_angle; int newdy, newdx; @@ -1922,34 +1861,29 @@ #ifdef SOUND if (k->t_fuse == (MAX(2, BMP_TORPDET_FRAMES * server_ups / 10) - 1)) { - if (newSound) + int newdx, newdy, distance, angle; + + newdx = dx - WINSIDE/2; + newdy = dy - WINSIDE/2; + + distance = (int) sqrt((newdx)*(newdx) + (newdy)*(newdy)); + // Normalize from 0 to 255, 0 being on top of player, 255 being max distance + // which would be a diagonal from player to corner of tactical + // Reason for normalization is Mix_SetDistance requires that range + distance = (int)((255 * distance)/CORNER_DIST); + // Calculate angle, then adjust as necessary for Mix_SetDistance + if (distance != 0) { - int newdx, newdy, distance, angle; - - newdx = dx - WINSIDE/2; - newdy = dy - WINSIDE/2; - - distance = (int) sqrt((newdx)*(newdx) + (newdy)*(newdy)); - // Normalize from 0 to 255, 0 being on top of player, 255 being max distance - // which would be a diagonal from player to corner of tactical - // Reason for normalization is Mix_SetDistance requires that range - distance = (int)((255 * distance)/CORNER_DIST); - // Calculate angle, then adjust as necessary for Mix_SetDistance - if (distance != 0) - { - angle = (int)(atan2(-newdy, newdx)*180/XPI); - angle = 90 - angle; - } - else - angle = 0; - // At short distances, don't use angular sound - if (distance < SCALE/2) - Play_Sound(TORP_HIT_WAV); - else - Play_Sound_Loc(TORP_HIT_WAV, angle, distance); + angle = (int)(atan2(-newdy, newdx)*180/XPI); + angle = 90 - angle; } else - Play_Sound(TORP_HIT_SOUND); + angle = 0; + // At short distances, don't use angular sound + if (distance < SCALE/2) + Play_Sound(TORP_HIT_WAV); + else + Play_Sound_Loc(TORP_HIT_WAV, angle, distance); } #endif if (colorWeapons) @@ -2137,7 +2071,7 @@ #ifdef SOUND - if (pt->pt_owner != me->p_no && newSound) + if (pt->pt_owner != me->p_no) { int new_angle; int newdy, newdx; @@ -2189,34 +2123,29 @@ #ifdef SOUND if (pt->pt_fuse == (MAX(2, BMP_TORPDET_FRAMES * server_ups / 10) - 1)) { - if (newSound) + int newdx, newdy, distance, angle; + + newdx = dx - WINSIDE/2; + newdy = dy - WINSIDE/2; + + distance = (int) sqrt((newdx)*(newdx) + (newdy)*(newdy)); + // Normalize from 0 to 255, 0 being on top of player, 255 being max distance + // which would be a diagonal from player to corner of tactical + // Reason for normalization is Mix_SetDistance requires that range + distance = (int)((255 * distance)/CORNER_DIST); + // Calculate angle, then adjust as necessary for Mix_SetDistance + if (distance != 0) { - int newdx, newdy, distance, angle; - - newdx = dx - WINSIDE/2; - newdy = dy - WINSIDE/2; - - distance = (int) sqrt((newdx)*(newdx) + (newdy)*(newdy)); - // Normalize from 0 to 255, 0 being on top of player, 255 being max distance - // which would be a diagonal from player to corner of tactical - // Reason for normalization is Mix_SetDistance requires that range - distance = (int)((255 * distance)/CORNER_DIST); - // Calculate angle, then adjust as necessary for Mix_SetDistance - if (distance != 0) - { - angle = (int)(atan2(-newdy, newdx)*180/XPI); - angle = 90 - angle; - } - else - angle = 0; - // At short distances, don't use angular sound - if (distance < SCALE/2) - Play_Sound(PLASMA_HIT_WAV); - else - Play_Sound_Loc(PLASMA_HIT_WAV, angle, distance); + angle = (int)(atan2(-newdy, newdx)*180/XPI); + angle = 90 - angle; } else - Play_Sound(PLASMA_HIT_SOUND); + angle = 0; + // At short distances, don't use angular sound + if (distance < SCALE/2) + Play_Sound(PLASMA_HIT_WAV); + else + Play_Sound_Loc(PLASMA_HIT_WAV, angle, distance); } #endif @@ -2521,14 +2450,8 @@ W_ChangeBorder (baseWin, gColor); #if defined(SOUND) - if (newSound) // Kill any channels with WARNING_WAV or RED_ALERT_WAV (group 2) - Mix_HaltGroup(2); - else - { - Abort_Sound(WARNING_SOUND); - Abort_Sound(RED_ALERT_SOUND); - } - + // Kill any channels with WARNING_WAV or RED_ALERT_WAV (group 2) + Mix_HaltGroup(2); #endif break; @@ -2544,18 +2467,9 @@ W_ChangeBorder (baseWin, yColor); #if defined(SOUND) - - if (newSound) // Kill any channels with RED_ALERT_WAV (group 2) - { - Mix_HaltGroup(2); - Play_Sound(WARNING_WAV); - } - else - { - Abort_Sound(RED_ALERT_SOUND); - Play_Sound(WARNING_SOUND); - } - + // Kill any channels with RED_ALERT_WAV (group 2) + Mix_HaltGroup(2); + Play_Sound(WARNING_WAV); #endif break; @@ -2571,10 +2485,7 @@ W_ChangeBorder (baseWin, rColor); #if defined(SOUND) - if (newSound) - Play_Sound(RED_ALERT_WAV); - else - Play_Sound(RED_ALERT_SOUND); + Play_Sound(RED_ALERT_WAV); #endif break; @@ -2598,45 +2509,31 @@ } #if defined(SOUND) - if (newSound) + if (sound_torps < me->p_ntorp) + Play_Sound(FIRE_TORP_WAV); + if (sound_other_torps < num_other_torps) { - if (sound_torps < me->p_ntorp) - Play_Sound(FIRE_TORP_WAV); - if (sound_other_torps < num_other_torps) - { - if (other_torp_dist < SCALE/2) - Play_Sound(OTHER_FIRE_TORP_WAV); - else - Play_Sound_Loc(OTHER_FIRE_TORP_WAV, other_torp_angle, other_torp_dist); - } - if (sound_plasma < me->p_nplasmatorp) - Play_Sound(FIRE_PLASMA_WAV); - if (sound_other_plasmas < num_other_plasmas) - { - if (other_plasma_dist < SCALE/2) - Play_Sound(OTHER_FIRE_PLASMA_WAV); - else - Play_Sound_Loc(OTHER_FIRE_PLASMA_WAV, other_plasma_angle, other_plasma_dist); - } - // Reset locations and fuses of other's closest torps and plasmas - other_torp_dist = CORNER_DIST; - new_other_torp_dist = 0; - other_torp_angle = 0; - other_plasma_dist = CORNER_DIST; - new_other_plasma_dist = 0; - other_plasma_angle = 0; + if (other_torp_dist < SCALE/2) + Play_Sound(OTHER_FIRE_TORP_WAV); + else + Play_Sound_Loc(OTHER_FIRE_TORP_WAV, other_torp_angle, other_torp_dist); } - else + if (sound_plasma < me->p_nplasmatorp) + Play_Sound(FIRE_PLASMA_WAV); + if (sound_other_plasmas < num_other_plasmas) { - if (sound_torps < me->p_ntorp) - Play_Sound(FIRE_TORP_SOUND); - if (sound_other_torps < num_other_torps) - Play_Sound(OTHER_FIRE_TORP_SOUND); - if (sound_plasma < me->p_nplasmatorp) - Play_Sound(FIRE_PLASMA_SOUND); - if (sound_other_plasmas < num_other_plasmas) - Play_Sound(OTHER_FIRE_PLASMA_SOUND); + if (other_plasma_dist < SCALE/2) + Play_Sound(OTHER_FIRE_PLASMA_WAV); + else + Play_Sound_Loc(OTHER_FIRE_PLASMA_WAV, other_plasma_angle, other_plasma_dist); } + // Reset locations and fuses of other's closest torps and plasmas + other_torp_dist = CORNER_DIST; + new_other_torp_dist = 0; + other_torp_angle = 0; + other_plasma_dist = CORNER_DIST; + new_other_plasma_dist = 0; + other_plasma_angle = 0; sound_flags = me->p_flags; sound_torps = me->p_ntorp; Index: death.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/death.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- death.c 7 Feb 2007 23:04:57 -0000 1.13 +++ death.c 28 Feb 2007 09:35:20 -0000 1.14 @@ -153,11 +153,8 @@ break; } #ifdef SOUND - if (newSound) - { - i = MUSIC_OFFSET + (RANDOM() % (NUM_MUSIC - MUSIC_OFFSET)); // Play random end theme - Play_Music(i); - } + i = MUSIC_OFFSET + (RANDOM() % (NUM_MUSIC - MUSIC_OFFSET)); // Play random end theme + Play_Music(i); #endif break; case KGHOST: @@ -184,11 +181,8 @@ break; } #ifdef SOUND - if (newSound) - { - i = MUSIC_OFFSET + (RANDOM() % (NUM_MUSIC - MUSIC_OFFSET)); // Play random end theme - Play_Music(i); - } + i = MUSIC_OFFSET + (RANDOM() % (NUM_MUSIC - MUSIC_OFFSET)); // Play random end theme + Play_Music(i); #endif break; case KPROVIDENCE: Index: playback.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/playback.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- playback.c 26 Feb 2007 06:54:49 -0000 1.16 +++ playback.c 28 Feb 2007 09:35:20 -0000 1.17 @@ -293,7 +293,6 @@ #endif #ifdef SOUND - newsoundwin (display_host, name); Init_Sound (); #endif @@ -307,11 +306,6 @@ if (i >= RETURNBASE) return (i - RETURNBASE); /* Terminate with retcode */ -#if defined(SOUND) - if (!newSound) - Abort_Sound(ENGINE_SOUND); -#endif - //#ifdef nodef /* Code from entrywindow() */ { @@ -352,16 +346,8 @@ redrawPStats (); #ifdef SOUND - if (newSound) - { - Mix_HaltChannel(-1); /* Kill all currently playing sounds when entering game */ - Play_Sound(ENTER_SHIP_WAV); - } - else - { - Play_Sound(ENTER_SHIP_SOUND); - Play_Sound(ENGINE_SOUND); - } + Mix_HaltChannel(-1); /* Kill all currently playing sounds when entering game */ + Play_Sound(ENTER_SHIP_WAV); #endif while (1) Index: map.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/map.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- map.c 28 Feb 2007 07:44:00 -0000 1.25 +++ map.c 28 Feb 2007 09:35:20 -0000 1.26 @@ -814,8 +814,6 @@ /* Just increment the counter instead */ lastRedraw[i]++; } - if (&players[i] == me) - LineToConsole("Last redraw %d ", lastRedraw[i]); } } --- winsndlib.c DELETED --- Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- data.c 28 Feb 2007 07:44:00 -0000 1.55 +++ data.c 28 Feb 2007 09:35:20 -0000 1.56 @@ -794,10 +794,9 @@ int richText = 0; /* temporary variable to select rich text message windows */ int newQuit = 0; /* new quit clock */ -int newSound = 1; /* Use new SDL sound interface */ -int newSoundEffects = 1; /* Use SDL sound effects playback */ -int newSoundMusic = 1; /* Use SDL music playback */ -int newSoundMusicBkgd = 0; /* Play random background music continuously */ -int newSoundAngles = 1; /* Use SDL with angular 3D sound */ +int soundEffects = 1; /* Use sound effects playback */ +int soundMusic = 1; /* Use music playback */ +int soundMusicBkgd = 0; /* Play random background music continuously */ +int soundAngles = 0; /* Use 3D sound */ int useFullShipInfo = 1; /* Prefer SP_PLAYER packets over SP_S_PLAYER packets */ \ No newline at end of file Index: beeplite.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/beeplite.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- beeplite.c 23 Feb 2007 13:43:56 -0000 1.13 +++ beeplite.c 28 Feb 2007 09:35:20 -0000 1.14 @@ -193,15 +193,10 @@ { #if defined(SOUND) - if (newSound) + if (sound_toggle) Play_Sound(MESSAGE_WAV); else - { - if (sound_toggle) - Play_Sound(MESSAGE_SOUND); - else - W_Beep(); - } + W_Beep(); #endif } break; @@ -210,84 +205,39 @@ #ifdef SOUND case '1': if (F_beeplite_flags & LITE_SOUNDS) - { - if (newSound) - Play_Sound(MESSAGE1_WAV); - else - Play_Sound(MESSAGE1_SOUND); - } + Play_Sound(MESSAGE1_WAV); break; case '2': if (F_beeplite_flags & LITE_SOUNDS) - { - if (newSound) - Play_Sound(MESSAGE2_WAV); - else - Play_Sound(MESSAGE2_SOUND); - } + Play_Sound(MESSAGE2_WAV); break; case '3': if (F_beeplite_flags & LITE_SOUNDS) - { - if (newSound) - Play_Sound(MESSAGE3_WAV); - else - Play_Sound(MESSAGE3_SOUND); - } + Play_Sound(MESSAGE3_WAV); break; case '4': if (F_beeplite_flags & LITE_SOUNDS) - { - if (newSound) - Play_Sound(MESSAGE4_WAV); - else - Play_Sound(MESSAGE4_SOUND); - } + Play_Sound(MESSAGE4_WAV); break; case '5': if (F_beeplite_flags & LITE_SOUNDS) - { - if (newSound) - Play_Sound(MESSAGE5_WAV); - else - Play_Sound(MESSAGE5_SOUND); - } + Play_Sound(MESSAGE5_WAV); break; case '6': if (F_beeplite_flags & LITE_SOUNDS) - { - if (newSound) - Play_Sound(MESSAGE6_WAV); - else - Play_Sound(MESSAGE6_SOUND); - } + Play_Sound(MESSAGE6_WAV); break; case '7': if (F_beeplite_flags & LITE_SOUNDS) - { - if (newSound) - Play_Sound(MESSAGE7_WAV); - else - Play_Sound(MESSAGE7_SOUND); - } + Play_Sound(MESSAGE7_WAV); break; case '8': if (F_beeplite_flags & LITE_SOUNDS) - { - if (newSound) - Play_Sound(MESSAGE_WAV); - else - Play_Sound(MESSAGE8_SOUND); - } + Play_Sound(MESSAGE_WAV); break; case '9': if (F_beeplite_flags & LITE_SOUNDS) - { - if (newSound) - Play_Sound(MESSAGE_WAV); - else - Play_Sound(MESSAGE9_SOUND); - } + Play_Sound(MESSAGE_WAV); break; #endif Index: warning.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/warning.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- warning.c 26 Feb 2007 06:54:50 -0000 1.11 +++ warning.c 28 Feb 2007 09:35:20 -0000 1.12 @@ -47,10 +47,7 @@ if (doRefit) { #ifdef SOUND - if (newSound) - Play_Sound(ENTER_SHIP_WAV); - else - Play_Sound(ENTER_SHIP_SOUND); + Play_Sound(ENTER_SHIP_WAV); #endif rdelay = time (0) + REFITTIME; } Index: cowmain.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/cowmain.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- cowmain.c 28 Feb 2007 07:44:00 -0000 1.24 +++ cowmain.c 28 Feb 2007 09:35:20 -0000 1.25 @@ -804,9 +804,9 @@ savebitmaps (); #if defined(SOUND) - newsoundwin (display_host, name); - if (newSound) - Init_Sound(); + /* Moved sound initialization to right after readdefaults() so + * the intro can start playing ASAP */ + Init_Sound(); #endif /* open memory...? */ @@ -932,25 +932,12 @@ init_hockey_lines (); #endif - /* Moved SDL sound initialization to right after readdefaults() so - * the intro can start playing ASAP */ -#if defined(SOUND) - if (!newSound) - Init_Sound(); -#endif - - isFirstEntry = 1; /* First entry into game */ i = setjmp (env); /* Reentry point of game */ if (i >= RETURNBASE) return (i - RETURNBASE); /* Terminate with retcode */ -#if defined(SOUND) - if (!newSound) - Abort_Sound(ENGINE_SOUND); -#endif - /* give the player the motd and find out which team he wants */ #ifndef RWATCH @@ -995,13 +982,6 @@ sendByeReq (); -#if defined(SOUND) - if (!newSound) - Exit_Sound(); - else - Mix_CloseAudio(); -#endif - sleep (1); if (logFile != NULL) fclose (logFile); @@ -1086,24 +1066,16 @@ #ifdef SOUND - if (newSound) - { - /* Kill all currently playing sounds when entering game */ - Mix_HaltChannel(-1); - /* Fade out any music playing over 5 seconds */ - if (Mix_PlayingMusic()) - { - Mix_FadeOutMusic(5000); - /* Attempt to start background music once fadeout done */ - Mix_HookMusicFinished(Play_Music_Bkgd); - } - Play_Sound(ENTER_SHIP_WAV); - } - else + /* Kill all currently playing sounds when entering game */ + Mix_HaltChannel(-1); + /* Fade out any music playing over 5 seconds */ + if (Mix_PlayingMusic()) { - Play_Sound(ENTER_SHIP_SOUND); - Play_Sound(ENGINE_SOUND); + Mix_FadeOutMusic(5000); + /* Attempt to start background music once fadeout done */ + Mix_HookMusicFinished(Play_Music_Bkgd); } + Play_Sound(ENTER_SHIP_WAV); #endif promoted = 0; ingame = 1; Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- socket.c 26 Feb 2007 06:54:49 -0000 1.19 +++ socket.c 28 Feb 2007 09:35:20 -0000 1.20 @@ -1183,19 +1183,9 @@ if (!inplayback) { #endif if (status->tourn) - { - if (newSound) - Play_Sound(START_TMODE_WAV); - else - Play_Sound(START_TMODE_SOUND); - } + Play_Sound(START_TMODE_WAV); else - { - if (newSound) - Play_Sound(STOP_TMODE_WAV); - else - Play_Sound(STOP_TMODE_SOUND); - } + Play_Sound(STOP_TMODE_WAV); #ifdef RECORDGAME } #endif Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- defaults.c 25 Feb 2007 14:12:10 -0000 1.45 +++ defaults.c 28 Feb 2007 09:35:20 -0000 1.46 @@ -341,36 +341,6 @@ NULL } }, - {"newSound", &newSound, RC_BOOL, - { - "Use new layered, stereo sound", - NULL - } - }, - {"newSoundEffects", &newSoundEffects, RC_BOOL, - { - "Play sound effects (newSound only)", - NULL - } - }, - {"newSoundMusic", &newSoundMusic, RC_BOOL, - { - "Play music (newSound only)", - NULL - } - }, - {"newSoundMusicBkgd", &newSoundMusicBkgd, RC_BOOL, - { - "Play theme music in background (requires newSound and newSoundMusic)", - NULL - } - }, - {"newSoundAngles", &newSoundAngles, RC_BOOL, - { - "Use 3D sound effects (only works if newSound is on)", - NULL - } - }, {"omitTeamLetter", &omitTeamLetter, RC_BOOL, { "Omit team letter on galaxy", @@ -700,7 +670,31 @@ #ifdef SOUND {"sound", &sound_init, RC_BOOL, { - "Enable sound", + "Enable layered, stereo sound", + NULL + } + }, + {"soundEffects", &soundEffects, RC_BOOL, + { + "Play sound effects", + NULL + } + }, + {"soundMusic", &soundMusic, RC_BOOL, + { + "Play music", + NULL + } + }, + {"soundMusicBkgd", &soundMusicBkgd, RC_BOOL, + { + "Play theme music in background (requires soundMusic)", + NULL + } + }, + {"soundAngles", &soundAngles, RC_BOOL, + { + "Use 3D sound effects", NULL } }, @@ -1537,11 +1531,10 @@ doubleBuffering = booleanDefault ("doubleBuffering", doubleBuffering); allowWheelActions = booleanDefault ("allowWheelActions", allowWheelActions); newQuit = booleanDefault ("newQuit", newQuit); - newSound = booleanDefault ("newSound", newSound); - newSoundEffects= booleanDefault ("newSoundEffects", newSoundEffects); - newSoundMusic = booleanDefault ("newSoundMusic", newSoundMusic); - newSoundMusicBkgd = booleanDefault ("newSoundMusicBkgd", newSoundMusicBkgd); - newSoundAngles = booleanDefault ("newSoundAngles", newSoundAngles); + soundEffects= booleanDefault ("soundEffects", soundEffects); + soundMusic = booleanDefault ("soundMusic", soundMusic); + soundMusicBkgd = booleanDefault ("soundMusicBkgd", soundMusicBkgd); + soundAngles = booleanDefault ("soundAngles", soundAngles); useFullShipInfo = booleanDefault ("useFullShipInfo", useFullShipInfo); tpDotDist = intDefault ("tpDotDist", tpDotDist); omitTeamLetter = booleanDefault ("omitTeamLetter", omitTeamLetter); From modemhero at users.sourceforge.net Wed Feb 28 03:35:22 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 28 Feb 2007 09:35:22 +0000 Subject: [netrek-cvs] client/netrekxp/resources/htmlhelp/html generalconfig.html, 1.28, 1.29 Message-ID: <20070228093600.787CAB3F2@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11631/resources/htmlhelp/html Modified Files: generalconfig.html Log Message: Completely gutted the old windows sound system. Resulting in removal of nt_intro.wav (yay!), audio.h and winsndlib.c (bigger yay!). All the clunky old windows code for loading sound, checking if sound is enabled, and changing volume is now handled by 20x less code using SDL. And it's done better, too. All references to "newSound" have been renamed to "sound". No longer support the old sound menu/loading of sounds, so that got gutted too. Still todo: menu option for removing other ship's sounds, ability to toggle certain sound categories on/off, and to control starting volume. All to be netrekrc entries. Index: generalconfig.html =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html/generalconfig.html,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- generalconfig.html 25 Feb 2007 14:12:10 -0000 1.28 +++ generalconfig.html 28 Feb 2007 09:35:20 -0000 1.29 @@ -613,56 +613,6 @@ -newSound -Use new layered, stereo sound - -
        -
      • on(default)
      • -
      • off
      • -
      - - - -newSoundEffects -Use sound effects - -
        -
      • on(default)
      • -
      • off
      • -
      - - - -newSoundMusic -Use music - -
        -
      • on(default)
      • -
      • off
      • -
      - - - -newSoundMusicBkgd -Use background music - -
        -
      • on
      • -
      • off(default)
      • -
      - - - -newSoundAngles -Use 3D sound effects (only works if newSound is on) - -
        -
      • on(default)
      • -
      • off
      • -
      - - - omitTeamLetter Don't draw team letter on galaxy @@ -1210,7 +1160,7 @@ sound -Enable sounds +Enable layered, stereo sound
      • on (default)
      • @@ -1219,6 +1169,46 @@ +soundEffects +Use sound effects + +
          +
        • on(default)
        • +
        • off
        • +
        + + + +soundMusic +Use music + +
          +
        • on(default)
        • +
        • off
        • +
        + + + +soundMusicBkgd +Use background music + +
          +
        • on
        • +
        • off(default)
        • +
        + + + +soundAngles +Use 3D sound effects + +
          +
        • on
        • +
        • off(default)
        • +
        + + + soundDir Directory where all sounds are located path From modemhero at users.sourceforge.net Wed Feb 28 03:35:22 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 28 Feb 2007 09:35:22 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h, 1.50, 1.51 proto.h, 1.33, 1.34 sound.h, 1.14, 1.15 audio.h, 1.2, NONE Message-ID: <20070228093559.DCCD01867D0@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11631/include Modified Files: data.h proto.h sound.h Removed Files: audio.h Log Message: Completely gutted the old windows sound system. Resulting in removal of nt_intro.wav (yay!), audio.h and winsndlib.c (bigger yay!). All the clunky old windows code for loading sound, checking if sound is enabled, and changing volume is now handled by 20x less code using SDL. And it's done better, too. All references to "newSound" have been renamed to "sound". No longer support the old sound menu/loading of sounds, so that got gutted too. Still todo: menu option for removing other ship's sounds, ability to toggle certain sound categories on/off, and to control starting volume. All to be netrekrc entries. Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- data.h 28 Feb 2007 07:44:00 -0000 1.50 +++ data.h 28 Feb 2007 09:35:19 -0000 1.51 @@ -697,11 +697,10 @@ extern int richText; /* temporary variable to enable/disable rich text windows */ extern int newQuit; /* new quit clock */ -extern int newSound; /* Use new SDL sound interface */ -extern int newSoundEffects; /* Use SDL sound effects playback */ -extern int newSoundMusic; /* Use SDL music playback */ -extern int newSoundMusicBkgd; /* Play random background music continuously */ -extern int newSoundAngles; /* Use SDL with angular 3D sound */ +extern int soundEffects; /* Use sound effects playback */ +extern int soundMusic; /* Use music playback */ +extern int soundMusicBkgd; /* Play random background music continuously */ +extern int soundAngles; /* Use 3D sound */ extern int useFullShipInfo; /* Prefer SP_PLAYER packets over SP_S_PLAYER packets */ #endif /* _h_data */ --- audio.h DELETED --- Index: sound.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/sound.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- sound.h 17 Feb 2007 01:58:50 -0000 1.14 +++ sound.h 28 Feb 2007 09:35:19 -0000 1.15 @@ -61,10 +61,8 @@ extern void Play_Sound_Loc (int type, int angle, int distance); extern void Play_Music (int type); extern void Play_Music_Bkgd (void); -extern void ChangeNewsoundVolume (int vol); -extern void Abort_Sound (int type); +extern void ChangeVolume (int vol); extern void Init_Sound (void); -extern void Exit_Sound (void); enum { CLOAKED_WAV, Index: proto.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- proto.h 28 Feb 2007 07:44:00 -0000 1.33 +++ proto.h 28 Feb 2007 09:35:19 -0000 1.34 @@ -779,8 +779,6 @@ //static void handleMessageWindowButton(W_Event * event); void newwin (char *hostmon, char *progname); -void newsoundwin (char *hostmon, - char *progname); void mapAll (void); void savebitmaps (void); void entrywindow (int *team, @@ -1266,18 +1264,4 @@ 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 (); -void CheckVolumeSettings (); #endif /* __INCLUDED_proto_h__ */ From modemhero at users.sourceforge.net Wed Feb 28 03:35:21 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 28 Feb 2007 09:35:21 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.104, 1.105 clientr.vcproj, 1.10, 1.11 compile.txt, 1.12, 1.13 Message-ID: <20070228093559.7762DB3EE@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11631 Modified Files: NetrekXP to do list.C clientr.vcproj compile.txt Log Message: Completely gutted the old windows sound system. Resulting in removal of nt_intro.wav (yay!), audio.h and winsndlib.c (bigger yay!). All the clunky old windows code for loading sound, checking if sound is enabled, and changing volume is now handled by 20x less code using SDL. And it's done better, too. All references to "newSound" have been renamed to "sound". No longer support the old sound menu/loading of sounds, so that got gutted too. Still todo: menu option for removing other ship's sounds, ability to toggle certain sound categories on/off, and to control starting volume. All to be netrekrc entries. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.104 retrieving revision 1.105 diff -u -d -r1.104 -r1.105 --- NetrekXP to do list.C 28 Feb 2007 07:43:59 -0000 1.104 +++ NetrekXP to do list.C 28 Feb 2007 09:35:18 -0000 1.105 @@ -50,8 +50,20 @@ 11) ships orbiting and galactip map refresh..blinking..server not sending orbiters until every 4th packet? at 50 fps? and every other packet at 20 fps. Where's the code that makes vplayer not get sent if not moving/in orbit? -12) remove old sound, all new sound..add sound menu options to turn off sounds +12)Add sound menu options to turn off sounds by category (cloak, weapons, explosions), add rc option for those settings + 11: death sounds + 10: explosion + 9: phaser,plasma + 8: torp/plasma hit + 7: torp fire, cloak + 6: alert + 4: "informational" sounds (self destruct, enter ship, message, etc.) + 3: shield up/down, other people's sounds (phaser, torp, plasma, explode) + 0: background or ambient (engine?) + +Also to turn off other ship's sounds. +Also add option for starting sound volume. Stas's list: - color coded playerlist. Index: compile.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/compile.txt,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- compile.txt 19 Dec 2006 14:30:53 -0000 1.12 +++ compile.txt 28 Feb 2007 09:35:18 -0000 1.13 @@ -18,6 +18,10 @@ Step 2: -------- + +First off, you will need the development package for SDL, as well as SDL-mixer. +Refer to the SDL website for how to install it with your compiler/IDE. + If you're building with MS Visual C++: - Edit clientr.dsp and change \netrek_files to be same as InstCWD Index: clientr.vcproj =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.vcproj,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- clientr.vcproj 27 Feb 2007 08:37:05 -0000 1.10 +++ clientr.vcproj 28 Feb 2007 09:35:18 -0000 1.11 @@ -1663,29 +1663,6 @@ /> - - - - - - - - - - From modemhero at users.sourceforge.net Wed Feb 28 03:35:22 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 28 Feb 2007 09:35:22 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.114, 1.115 netrekrc, 1.25, 1.26 netrekrc_options.txt, 1.27, 1.28 Message-ID: <20070228093600.68647B3F0@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11631/resources/docs Modified Files: changes.txt netrekrc netrekrc_options.txt Log Message: Completely gutted the old windows sound system. Resulting in removal of nt_intro.wav (yay!), audio.h and winsndlib.c (bigger yay!). All the clunky old windows code for loading sound, checking if sound is enabled, and changing volume is now handled by 20x less code using SDL. And it's done better, too. All references to "newSound" have been renamed to "sound". No longer support the old sound menu/loading of sounds, so that got gutted too. Still todo: menu option for removing other ship's sounds, ability to toggle certain sound categories on/off, and to control starting volume. All to be netrekrc entries. Index: netrekrc =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- netrekrc 25 Feb 2007 14:12:10 -0000 1.25 +++ netrekrc 28 Feb 2007 09:35:20 -0000 1.26 @@ -173,21 +173,6 @@ # Use new quit window newQuit: on -# Use new layered, stereo sound -newSound: on - -# Play sound effects (newSound only) -newSoundEffects: on - -# Play music (newSound only) -newSoundMusic: on - -# Play theme music in background (requires newSound and newSoundMusic) -newSoundMusicBkgd: off - -# Use 3D sound effects (only works if newSound is on) -newSoundAngles: off - # Omit team letter on galaxy omitTeamLetter: off @@ -356,9 +341,21 @@ # Sort players by team sortPlayers: on -# Enable sound +# Enable layered, stereo sound sound: on +# Play sound effects +soundEffects: on + +# Play music +soundMusic: on + +# Play theme music in background (requires soundMusic) +soundMusicBkgd: off + +# Use 3D sound effects +soundAngles: off + # Shrink enemy phaser by x/16 of its length # 1-16 range theirPhaserShrink: 0 Index: netrekrc_options.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc_options.txt,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- netrekrc_options.txt 25 Feb 2007 14:12:10 -0000 1.27 +++ netrekrc_options.txt 28 Feb 2007 09:35:20 -0000 1.28 @@ -122,12 +122,6 @@ # off - old style newQuit: (on/off) use new quit window -newSound: (on/off) use layered, stereo sound -newSoundEffects: (on/off) play sound effects (newSound only) -newSoundMusic: (on/off) play music (newSound only) -newSoundMusicBkgd: (on/off) play theme music in background - (this option requires newSound and newSoundMusic to be on) -newSoundAngles: (on/off) use 3D sound effects (only works if newSound is on) omitTeamLetter: (on/off) omit team letter on galaxy orishipbmpfile: (path) - old color bitmaps oriship1bmpfile: (path) - new color bitmaps @@ -254,7 +248,12 @@ singleMacro: (string) macro keys that will trigger macro without macro mode sortMyTeamFirst: (on/off) show my team first in the player list sortPlayers: (on/off) sort players by teams -sound: (on/off) enable sound +sound: (on/off) enable layered, stereo sound +soundEffects: (on/off) play sound effects +soundMusic: (on/off) play music +soundMusicBkgd: (on/off) play theme music in background + (this option requires soundMusic to be on) +soundAngles: (on/off) use 3D sound effects soundDir: (path) path to directory containing sound files theirPhaserShrink: (0-16) shrink enemy phaser by x/16 of its length timerType: (0-4) type of timer on dashboard window Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.114 retrieving revision 1.115 diff -u -d -r1.114 -r1.115 --- changes.txt 27 Feb 2007 10:16:33 -0000 1.114 +++ changes.txt 28 Feb 2007 09:35:20 -0000 1.115 @@ -1,4 +1,6 @@ Netrek XP 2006, Version 1.2: (Released Feb-2007) +- all "newSound" options have just been renamed "sound". The old sound playback (newSound + off) is no longer supported. Thus the newSound netrekrc option is no longer. - border refresh now works slightly differently for those using the new color bitmaps (colorClient = 4), ships can now be seen along the border edges that were normally not drawn, allowing players to get a slightly increased viewable tactical range. @@ -26,18 +28,16 @@ in the player list. - fixed cloak/decloak cycling so that it animates properly at 10 updates/second. - sound and music volume are now independent of Windows sound volume, i.e. changing - game volume with the in game raise/lower volume keys does not change system WAV volume - (newSound only). -- three new netrekrc options, which are newSoundEffects, newSoundMusic, and newSoundMusicBkgd. + game volume with the in game raise/lower volume keys does not change system WAV volume. +- three new netrekrc options, which are soundEffects, soundMusic, and soundMusicBkgd. The first toggles sound effects on/off, the second toggles music on/off, the third plays a mix of star trek theme music continually in the background. Thus, if you wish to play with only music, you can. If you want to play with only sound effects, you can. Or both. - Or neither. Defaults are on for sound effects and music, and off for background music - (newSound only). + Or neither. Defaults are on for sound effects and music, and off for background music. - the client can now play music files, 10 star trek themed music files from the various star trek series and movies have been added. Random intro themes will play on client connect, and random end credits themes will play on genocide. These new music files are in the .ogg - format (newSound only). + format. - servers that don't respond to metaping are not saved in the UDPcache, as they are likely defunct - fixed some bugs relating to message windows, most noticeably, messages that are @@ -49,7 +49,7 @@ not used in normal gameplay though - changed default beeplite settings to include highlighting and sound effects for carrying, take and escorting RCDs. -- sound now fades out over 1 second upon quitting (newSound only) +- sound now fades out over 1 second upon quitting - support for new server feature packet SP_GENERIC_32. This is a great upgrade to the server as it allows for future data to be sent in this packet (lots of empty room). Currently it sends your ship's repair time..removing the need for the client side repair time From modemhero at users.sourceforge.net Wed Feb 28 06:21:52 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 28 Feb 2007 12:21:52 +0000 Subject: [netrek-cvs] client/netrekxp/resources/htmlhelp/html generalconfig.html, 1.29, 1.30 Message-ID: <20070228122200.B6AAE1867D0@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29612/resources/htmlhelp/html Modified Files: generalconfig.html Log Message: Cleanup more unused sound defines in sound.h and proto.h New netrekrc option soundVolume to control starting volume level. New sound flags to designate what category a sound falls in. Pass sound flag to sound playing functions, then check against current sound flag settings to see whether to play that sound. Added the sound flag categories to the sound menu for easy toggling. Fixed bug where soundAngles wasn't being checked before playing certain sounds angularly. Fixed bug with volume level, did not know that new channels are allocated to maxvolume. Thus, volume needs to be set during every sound play event. Index: generalconfig.html =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html/generalconfig.html,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- generalconfig.html 28 Feb 2007 09:35:20 -0000 1.29 +++ generalconfig.html 28 Feb 2007 12:21:49 -0000 1.30 @@ -1169,6 +1169,11 @@ +soundVolume +Starting sound volume +0-128
        default: 64 + + soundEffects Use sound effects From modemhero at users.sourceforge.net Wed Feb 28 06:21:52 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 28 Feb 2007 12:21:52 +0000 Subject: [netrek-cvs] client/netrekxp/src beeplite.c, 1.14, 1.15 cowmain.c, 1.25, 1.26 data.c, 1.56, 1.57 defaults.c, 1.46, 1.47 dmessage.c, 1.7, 1.8 input.c, 1.25, 1.26 local.c, 1.64, 1.65 makecyg, 1.2, 1.3 makefile, 1.12, 1.13 newwin.c, 1.48, 1.49 playback.c, 1.17, 1.18 socket.c, 1.20, 1.21 sound.c, 1.30, 1.31 warning.c, 1.12, 1.13 Message-ID: <20070228122204.7D514B3EE@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29612/src Modified Files: beeplite.c cowmain.c data.c defaults.c dmessage.c input.c local.c makecyg makefile newwin.c playback.c socket.c sound.c warning.c Log Message: Cleanup more unused sound defines in sound.h and proto.h New netrekrc option soundVolume to control starting volume level. New sound flags to designate what category a sound falls in. Pass sound flag to sound playing functions, then check against current sound flag settings to see whether to play that sound. Added the sound flag categories to the sound menu for easy toggling. Fixed bug where soundAngles wasn't being checked before playing certain sounds angularly. Fixed bug with volume level, did not know that new channels are allocated to maxvolume. Thus, volume needs to be set during every sound play event. Index: dmessage.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/dmessage.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- dmessage.c 28 Feb 2007 09:35:20 -0000 1.7 +++ dmessage.c 28 Feb 2007 12:21:50 -0000 1.8 @@ -217,7 +217,7 @@ #ifdef SOUND if (why_dead && (instr (message, "[plasma]") || instr (message, "[zapped plasma]"))) - Play_Sound(PLASMA_KILL_WAV); + Play_Sound(PLASMA_KILL_WAV, SF_INFO); #endif } @@ -274,7 +274,7 @@ #ifdef SOUND if (why_dead && (instr (message, "[plasma]") || instr (message, "[zapped plasma]"))) - Play_Sound(PLASMA_KILL_WAV); + Play_Sound(PLASMA_KILL_WAV, SF_INFO); #endif if (logging) Index: makecyg =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/makecyg,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- makecyg 24 Feb 2007 10:19:55 -0000 1.2 +++ makecyg 28 Feb 2007 12:21:50 -0000 1.3 @@ -76,12 +76,12 @@ rsa_box_3.o rsa_box_4.o endif -WIN32_SRCS = winmain.c mswindow.c winsndlib.c -WIN32_OBJS = winmain.o mswindow.o winsndlib.o +WIN32_SRCS = winmain.c mswindow.c +WIN32_OBJS = winmain.o mswindow.o 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\ + sound.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 Index: sound.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/sound.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- sound.c 28 Feb 2007 09:35:20 -0000 1.30 +++ sound.c 28 Feb 2007 12:21:50 -0000 1.31 @@ -32,10 +32,13 @@ static Mix_Chunk *sounds[NUM_WAVES]; static Mix_Music *music[NUM_MUSIC]; -static int sound_other = 1; /* Play other ship's sounds? */ - static char sound_prefix[PATH_MAX]; +/* For tracking current volume levels, new channels need to be + told what volume to use */ +static int mvolume = 0; +static int volume = 0; + char *DATAFILE(const char* wav) { strcpy(sound_prefix, sounddir); strcat(sound_prefix, "/"); @@ -56,11 +59,8 @@ sounds[EXIT_WARP_WAV] = Mix_LoadWAV(DATAFILE("nt_exit_warp.wav")); sounds[EXPLOSION_WAV] = Mix_LoadWAV(DATAFILE("nt_explosion.wav")); sounds[BASE_EXPLOSION_WAV] = Mix_LoadWAV(DATAFILE("nt_base_explosion.wav")); - sounds[EXPLOSION_OTHER_WAV] = Mix_LoadWAV(DATAFILE("nt_explosion_other.wav")); sounds[FIRE_PLASMA_WAV] = Mix_LoadWAV(DATAFILE("nt_fire_plasma.wav")); - sounds[OTHER_FIRE_PLASMA_WAV] = Mix_LoadWAV(DATAFILE("nt_fire_plasma_other.wav")); sounds[FIRE_TORP_WAV] = Mix_LoadWAV(DATAFILE("nt_fire_torp.wav")); - sounds[OTHER_FIRE_TORP_WAV] = Mix_LoadWAV(DATAFILE("nt_fire_torp_other.wav")); sounds[INTRO_WAV] = Mix_LoadWAV(DATAFILE("nt_intro.wav")); sounds[MESSAGE_WAV] = Mix_LoadWAV(DATAFILE("nt_message.wav")); sounds[MESSAGE1_WAV] = Mix_LoadWAV(DATAFILE("nt_message1.wav")); @@ -71,7 +71,6 @@ sounds[MESSAGE6_WAV] = Mix_LoadWAV(DATAFILE("nt_message6.wav")); sounds[MESSAGE7_WAV] = Mix_LoadWAV(DATAFILE("nt_message7.wav")); sounds[PHASER_WAV] = Mix_LoadWAV(DATAFILE("nt_phaser.wav")); - sounds[PHASER_OTHER_WAV] = Mix_LoadWAV(DATAFILE("nt_phaser_other.wav")); sounds[PLASMA_HIT_WAV] = Mix_LoadWAV(DATAFILE("nt_plasma_hit.wav")); sounds[PLASMA_KILL_WAV] = Mix_LoadWAV(DATAFILE("nt_plasma_kill.wav")); sounds[RED_ALERT_WAV] = Mix_LoadWAV(DATAFILE("nt_red_alert.wav")); @@ -83,6 +82,10 @@ sounds[TORP_HIT_WAV] = Mix_LoadWAV(DATAFILE("nt_torp_hit.wav")); sounds[UNCLOAK_WAV] = Mix_LoadWAV(DATAFILE("nt_uncloak.wav")); sounds[WARNING_WAV] = Mix_LoadWAV(DATAFILE("nt_warning.wav")); + sounds[EXPLOSION_OTHER_WAV] = Mix_LoadWAV(DATAFILE("nt_explosion_other.wav")); + sounds[FIRE_PLASMA_OTHER_WAV] = Mix_LoadWAV(DATAFILE("nt_fire_plasma_other.wav")); + sounds[FIRE_TORP_OTHER_WAV] = Mix_LoadWAV(DATAFILE("nt_fire_torp_other.wav")); + sounds[PHASER_OTHER_WAV] = Mix_LoadWAV(DATAFILE("nt_phaser_other.wav")); for (i=0; i < NUM_WAVES; i++) { if (!sounds[i]) { @@ -176,16 +179,20 @@ return; } - /* Set sound and music volume to half (128 is MAXVOLUME) */ - Mix_Volume(-1, 64); - Mix_VolumeMusic(64); + /* Set sound and music volume */ + mvolume = volume = soundVolume; + Mix_Volume(-1, volume); + Mix_VolumeMusic(mvolume); + + /* Set sound flags to on. TODO: use netrekrc values */ + sound_flags = SF_EXPLOSIONS|SF_WEAPONS|SF_ALERT|SF_MESSAGE|SF_INFO|SF_CLOAKING|SF_SHIELD|SF_OTHER; /* Toggle on sound, and load sound files */ sound_toggle = 1; loadSounds(); /* Load music files, and play random intro music */ - loadMusic(); + loadMusic(); i = RANDOM() % MUSIC_OFFSET; Play_Music(i); @@ -194,17 +201,17 @@ } } -extern void Play_Sound (int type) +extern void Play_Sound (int type, u_int flag) { int channel; - + if (!sound_init || !soundEffects || !sound_toggle) return; - /* Don't play other ship's sounds if turned off */ - if (type > OTHER_SOUND_OFFSET && !sound_other) + /* Don't play sound types you have turned off */ + if (flag != (sound_flags & flag)) return; - + if ((type >= NUM_WAVES) || (type < 0)) { LineToConsole("Invalid sound type %d\n", type); @@ -219,17 +226,23 @@ #endif return; } - + /* Now that we know the channel, set the volume */ + Mix_Volume(channel, volume); + Group_Sound(type, channel); } -extern void Play_Sound_Loc (int type, int angle, int distance) +extern void Play_Sound_Loc (int type, u_int flag, int angle, int distance) { int channel; if (!sound_init || !soundEffects || !sound_toggle) return; + /* Don't play sound types you have turned off */ + if (flag != (sound_flags & flag)) + return; + if ((type >= NUM_WAVES) || (type < 0)) { LineToConsole("Invalid sound type %d\n", type); @@ -244,6 +257,9 @@ #endif return; } + /* Now that we know the channel, set the volume */ + Mix_Volume(channel, volume); + /* Make sure distance in boundary range that function accepts */ if (distance < 0) distance = 0; @@ -350,11 +366,9 @@ extern void ChangeVolume (int vol) { - int mvolume, volume; - // Get current average sound volume and music volume - volume = Mix_Volume(-1, -1); - mvolume = Mix_VolumeMusic(-1); + //volume = Mix_Volume(-1, -1); + //mvolume = Mix_VolumeMusic(-1); // Change sound volume for all channels, range is 0 to 128 volume = volume + 10*vol; @@ -376,8 +390,15 @@ #define MUSIC_TOGGLE 2 #define MUSIC_BKGD 3 #define SOUND_ANGLE 4 -#define SOUND_OTHER 5 -#define SOUND_DONE 6 +#define SOUND_EXPLOSIONS 5 +#define SOUND_WEAPONS 6 +#define SOUND_ALERT 7 +#define SOUND_MESSAGE 8 +#define SOUND_INFO 9 +#define SOUND_CLOAKING 10 +#define SOUND_SHIELD 11 +#define SOUND_OTHER 12 +#define SOUND_DONE 13 extern void soundwindow (void) { @@ -419,10 +440,45 @@ sprintf (buf, "Angular sound is turned %s", (soundAngles) ? "ON" : "OFF"); } + else if (i == SOUND_EXPLOSIONS) + { + sprintf (buf, "Explosion sounds are turned %s", + (sound_flags & SF_EXPLOSIONS) ? "ON" : "OFF"); + } + else if (i == SOUND_WEAPONS) + { + sprintf (buf, "Weapon sounds are turned %s", + (sound_flags & SF_WEAPONS) ? "ON" : "OFF"); + } + else if (i == SOUND_ALERT) + { + sprintf (buf, "Alert sounds are turned %s", + (sound_flags & SF_ALERT) ? "ON" : "OFF"); + } + else if (i == SOUND_MESSAGE) + { + sprintf (buf, "Message sounds are turned %s", + (sound_flags & SF_MESSAGE) ? "ON" : "OFF"); + } + else if (i == SOUND_INFO) + { + sprintf (buf, "Info sounds are turned %s", + (sound_flags & SF_INFO) ? "ON" : "OFF"); + } + else if (i == SOUND_CLOAKING) + { + sprintf (buf, "Cloaking sounds are turned %s", + (sound_flags & SF_CLOAKING) ? "ON" : "OFF"); + } + else if (i == SOUND_SHIELD) + { + sprintf (buf, "Shield sounds are turned %s", + (sound_flags & SF_SHIELD) ? "ON" : "OFF"); + } else if (i == SOUND_OTHER) { sprintf (buf, "Other ship's sound is turned %s", - (sound_other) ? "ON" : "OFF"); + (sound_flags & SF_OTHER) ? "ON" : "OFF"); } else if (i == SOUND_DONE) { @@ -485,10 +541,45 @@ soundAngles = (soundAngles) ? 0 : 1; soundrefresh (SOUND_ANGLE); } + else if (i == SOUND_EXPLOSIONS) + { + sound_flags ^= SF_EXPLOSIONS; + soundrefresh (SOUND_EXPLOSIONS); + } + else if (i == SOUND_WEAPONS) + { + sound_flags ^= SF_WEAPONS; + soundrefresh (SOUND_WEAPONS); + } + else if (i == SOUND_ALERT) + { + sound_flags ^= SF_ALERT; + soundrefresh (SOUND_ALERT); + } + else if (i == SOUND_MESSAGE) + { + sound_flags ^= SF_MESSAGE; + soundrefresh (SOUND_MESSAGE); + } + else if (i == SOUND_INFO) + { + sound_flags ^= SF_INFO; + soundrefresh (SOUND_INFO); + } + else if (i == SOUND_CLOAKING) + { + sound_flags ^= SF_CLOAKING; + soundrefresh (SOUND_CLOAKING); + } + else if (i == SOUND_SHIELD) + { + sound_flags ^= SF_SHIELD; + soundrefresh (SOUND_SHIELD); + } else if (i == SOUND_OTHER) { - sound_other = (sound_other) ? 0 : 1; - soundrefresh (SOUND_OTHER); + sound_flags ^= SF_OTHER; + soundrefresh (SOUND_OTHER); } else { Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- newwin.c 28 Feb 2007 09:35:20 -0000 1.48 +++ newwin.c 28 Feb 2007 12:21:50 -0000 1.49 @@ -929,7 +929,7 @@ #if defined(SOUND) soundWin = W_MakeMenu("sound", WINSIDE + 20, -BORDER + 10, 33, - 7, NULL, 2); + 14, NULL, 2); W_SetWindowKeyDownHandler(soundWin, soundaction); W_SetWindowButtonHandler(soundWin, soundaction); W_DefineArrowCursor(soundWin); Index: input.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/input.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- input.c 28 Feb 2007 09:35:20 -0000 1.25 +++ input.c 28 Feb 2007 12:21:50 -0000 1.26 @@ -1518,7 +1518,7 @@ /* Here we will have to enter message_on () followed by smessage to player */ #ifdef SOUND - Play_Sound(MESSAGE_WAV); + Play_Sound(MESSAGE_WAV, SF_MESSAGE); #endif message_on (); data->key = players[target->o_num].p_mapchars[1]; @@ -1532,7 +1532,7 @@ /* Here we will have to enter message_on () followed by smessage to player */ #ifdef SOUND - Play_Sound(MESSAGE_WAV); + Play_Sound(MESSAGE_WAV, SF_MESSAGE); #endif message_on (); data->key = 'T'; @@ -1546,7 +1546,7 @@ /* Here we will have to enter message_on () followed by smessage to player */ #ifdef SOUND - Play_Sound(MESSAGE_WAV); + Play_Sound(MESSAGE_WAV, SF_MESSAGE); #endif message_on (); data->key = 'A'; @@ -2753,7 +2753,7 @@ { #ifdef SOUND - Play_Sound(SELF_DESTRUCT_WAV); + Play_Sound(SELF_DESTRUCT_WAV, SF_INFO); #endif sendQuitReq (); @@ -3178,7 +3178,7 @@ { #ifdef SOUND - Play_Sound(MESSAGE_WAV); + Play_Sound(MESSAGE_WAV, SF_MESSAGE); #endif message_on (); @@ -3242,7 +3242,7 @@ { #ifdef SOUND - Play_Sound(SELF_DESTRUCT_WAV); + Play_Sound(SELF_DESTRUCT_WAV, SF_INFO); #endif fastQuit = 1; Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- local.c 28 Feb 2007 09:35:20 -0000 1.64 +++ local.c 28 Feb 2007 12:21:50 -0000 1.65 @@ -675,14 +675,14 @@ { // Kill any channels with ENTER_WARP_WAV or EXIT_WARP_WAV (group 3) Mix_HaltGroup(3); - Play_Sound(ENTER_WARP_WAV); + Play_Sound(ENTER_WARP_WAV, SF_INFO); warpchange = 0; } if (warpchange && !(j->p_flags & PFTWARP)) { // Kill any channels with ENTER_WARP_WAV or EXIT_WARP_WAV (group 3) Mix_HaltGroup(3); - Play_Sound(EXIT_WARP_WAV); + Play_Sound(EXIT_WARP_WAV, SF_INFO); warpchange = 0; } } @@ -740,10 +740,10 @@ else angle = 0; // At short distances, don't use angular sound - if (distance < SCALE/2) - Play_Sound(CLOAKED_WAV); + if (!soundAngles || distance < SCALE/2) + Play_Sound(CLOAKED_WAV, SF_CLOAKING); else - Play_Sound_Loc(CLOAKED_WAV, angle, distance); + Play_Sound_Loc(CLOAKED_WAV, SF_CLOAKING, angle, distance); } } #endif @@ -779,10 +779,10 @@ else angle = 0; // At short distances, don't use angular sound - if (distance < SCALE/2) - Play_Sound(UNCLOAK_WAV); + if (!soundAngles || distance < SCALE/2) + Play_Sound(UNCLOAK_WAV, SF_CLOAKING); else - Play_Sound_Loc(UNCLOAK_WAV, angle, distance); + Play_Sound_Loc(UNCLOAK_WAV, SF_CLOAKING, angle, distance); } else // Kill any channels with CLOAKED_WAV on them (group 1) Mix_HaltGroup(1); @@ -1025,13 +1025,13 @@ { // Kill any channels with SHIELD_UP/DOWN_WAV on them (group 4) Mix_HaltGroup(4); - Play_Sound(SHIELD_DOWN_WAV); + Play_Sound(SHIELD_DOWN_WAV, SF_SHIELD); } if (!(sound_flags & PFSHIELD) && (j->p_flags & PFSHIELD)) { // Kill any channels with SHIELD_UP/DOWN_WAV on them (group 4) Mix_HaltGroup(4); - Play_Sound(SHIELD_UP_WAV); + Play_Sound(SHIELD_UP_WAV, SF_SHIELD); } } #endif @@ -1291,9 +1291,9 @@ if (myPlayer(j) || isObsLockPlayer(j)) { if (j->p_ship.s_type == STARBASE) - Play_Sound(BASE_EXPLOSION_WAV); + Play_Sound(BASE_EXPLOSION_WAV, SF_EXPLOSIONS); else - Play_Sound(EXPLOSION_WAV); + Play_Sound(EXPLOSION_WAV, SF_EXPLOSIONS); } else { @@ -1316,19 +1316,19 @@ else angle = 0; // At short distances, don't use angular sound - if (distance < SCALE/2) + if (!soundAngles || distance < SCALE/2) { if (j->p_ship.s_type == STARBASE) - Play_Sound(BASE_EXPLOSION_WAV); + Play_Sound(BASE_EXPLOSION_WAV, SF_EXPLOSIONS); else - Play_Sound(EXPLOSION_OTHER_WAV); + Play_Sound(EXPLOSION_OTHER_WAV, SF_OTHER|SF_EXPLOSIONS); } else { if (j->p_ship.s_type == STARBASE) - Play_Sound_Loc(BASE_EXPLOSION_WAV, angle, distance); + Play_Sound_Loc(BASE_EXPLOSION_WAV, SF_EXPLOSIONS, angle, distance); else - Play_Sound_Loc(EXPLOSION_OTHER_WAV, angle, distance); + Play_Sound_Loc(EXPLOSION_OTHER_WAV, SF_OTHER|SF_EXPLOSIONS, angle, distance); } } } @@ -1380,7 +1380,7 @@ if (php->sound_phaser) { if (myPlayer(j) || isObsLockPlayer(j)) - Play_Sound(PHASER_WAV); + Play_Sound(PHASER_WAV, SF_WEAPONS); else { int newdx, newdy, distance, angle; @@ -1402,10 +1402,10 @@ else angle = 0; // At short distances, don't use angular sound - if (distance < SCALE/2) - Play_Sound(PHASER_OTHER_WAV); + if (!soundAngles || distance < SCALE/2) + Play_Sound(PHASER_OTHER_WAV, SF_OTHER|SF_WEAPONS); else - Play_Sound_Loc(PHASER_OTHER_WAV, angle, distance); + Play_Sound_Loc(PHASER_OTHER_WAV, SF_OTHER|SF_WEAPONS, angle, distance); } php->sound_phaser = 0; } @@ -1880,10 +1880,10 @@ else angle = 0; // At short distances, don't use angular sound - if (distance < SCALE/2) - Play_Sound(TORP_HIT_WAV); + if (!soundAngles || distance < SCALE/2) + Play_Sound(TORP_HIT_WAV, SF_WEAPONS); else - Play_Sound_Loc(TORP_HIT_WAV, angle, distance); + Play_Sound_Loc(TORP_HIT_WAV, SF_WEAPONS, angle, distance); } #endif if (colorWeapons) @@ -2142,10 +2142,10 @@ else angle = 0; // At short distances, don't use angular sound - if (distance < SCALE/2) - Play_Sound(PLASMA_HIT_WAV); + if (!soundAngles || distance < SCALE/2) + Play_Sound(PLASMA_HIT_WAV, SF_WEAPONS); else - Play_Sound_Loc(PLASMA_HIT_WAV, angle, distance); + Play_Sound_Loc(PLASMA_HIT_WAV, SF_WEAPONS, angle, distance); } #endif @@ -2469,7 +2469,7 @@ #if defined(SOUND) // Kill any channels with RED_ALERT_WAV (group 2) Mix_HaltGroup(2); - Play_Sound(WARNING_WAV); + Play_Sound(WARNING_WAV, SF_ALERT); #endif break; @@ -2485,7 +2485,7 @@ W_ChangeBorder (baseWin, rColor); #if defined(SOUND) - Play_Sound(RED_ALERT_WAV); + Play_Sound(RED_ALERT_WAV, SF_ALERT); #endif break; @@ -2510,22 +2510,22 @@ #if defined(SOUND) if (sound_torps < me->p_ntorp) - Play_Sound(FIRE_TORP_WAV); + Play_Sound(FIRE_TORP_WAV, SF_WEAPONS); if (sound_other_torps < num_other_torps) { - if (other_torp_dist < SCALE/2) - Play_Sound(OTHER_FIRE_TORP_WAV); + if (!soundAngles || other_torp_dist < SCALE/2) + Play_Sound(FIRE_TORP_OTHER_WAV, SF_OTHER|SF_WEAPONS); else - Play_Sound_Loc(OTHER_FIRE_TORP_WAV, other_torp_angle, other_torp_dist); + Play_Sound_Loc(FIRE_TORP_OTHER_WAV, SF_OTHER|SF_WEAPONS, other_torp_angle, other_torp_dist); } if (sound_plasma < me->p_nplasmatorp) - Play_Sound(FIRE_PLASMA_WAV); + Play_Sound(FIRE_PLASMA_WAV, SF_WEAPONS); if (sound_other_plasmas < num_other_plasmas) { - if (other_plasma_dist < SCALE/2) - Play_Sound(OTHER_FIRE_PLASMA_WAV); + if (!soundAngles || other_plasma_dist < SCALE/2) + Play_Sound(FIRE_PLASMA_OTHER_WAV, SF_OTHER|SF_WEAPONS); else - Play_Sound_Loc(OTHER_FIRE_PLASMA_WAV, other_plasma_angle, other_plasma_dist); + Play_Sound_Loc(FIRE_PLASMA_OTHER_WAV, SF_OTHER|SF_WEAPONS, other_plasma_angle, other_plasma_dist); } // Reset locations and fuses of other's closest torps and plasmas other_torp_dist = CORNER_DIST; Index: makefile =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/makefile,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- makefile 23 Feb 2007 13:43:56 -0000 1.12 +++ makefile 28 Feb 2007 12:21:50 -0000 1.13 @@ -65,12 +65,12 @@ 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 +WIN32_SRCS = winmain.c mswindow.c +WIN32_OBJS = winmain.obj mswindow.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\ + sound.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 Index: playback.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/playback.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- playback.c 28 Feb 2007 09:35:20 -0000 1.17 +++ playback.c 28 Feb 2007 12:21:50 -0000 1.18 @@ -347,7 +347,7 @@ #ifdef SOUND Mix_HaltChannel(-1); /* Kill all currently playing sounds when entering game */ - Play_Sound(ENTER_SHIP_WAV); + Play_Sound(ENTER_SHIP_WAV, SF_INFO); #endif while (1) Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- defaults.c 28 Feb 2007 09:35:20 -0000 1.46 +++ defaults.c 28 Feb 2007 12:21:50 -0000 1.47 @@ -674,6 +674,13 @@ NULL } }, + {"soundVolume", &soundVolume, RC_INT, + { + "Starting sound volume", + "0-128 range", + NULL + } + }, {"soundEffects", &soundEffects, RC_BOOL, { "Play sound effects", @@ -1531,6 +1538,7 @@ doubleBuffering = booleanDefault ("doubleBuffering", doubleBuffering); allowWheelActions = booleanDefault ("allowWheelActions", allowWheelActions); newQuit = booleanDefault ("newQuit", newQuit); + soundVolume= intDefault ("soundVolume", soundVolume); soundEffects= booleanDefault ("soundEffects", soundEffects); soundMusic = booleanDefault ("soundMusic", soundMusic); soundMusicBkgd = booleanDefault ("soundMusicBkgd", soundMusicBkgd); Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- data.c 28 Feb 2007 09:35:20 -0000 1.56 +++ data.c 28 Feb 2007 12:21:50 -0000 1.57 @@ -640,7 +640,7 @@ int music_toggle = 0; char *sounddir = NULL; W_Window soundWin = NULL; - +unsigned int sound_flags = 0; #endif #ifdef HOCKEY_LINES @@ -794,6 +794,7 @@ int richText = 0; /* temporary variable to select rich text message windows */ int newQuit = 0; /* new quit clock */ +int soundVolume = 64; /* Starting sound volume (0-128 range) */ int soundEffects = 1; /* Use sound effects playback */ int soundMusic = 1; /* Use music playback */ int soundMusicBkgd = 0; /* Play random background music continuously */ Index: beeplite.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/beeplite.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- beeplite.c 28 Feb 2007 09:35:20 -0000 1.14 +++ beeplite.c 28 Feb 2007 12:21:49 -0000 1.15 @@ -194,7 +194,7 @@ #if defined(SOUND) if (sound_toggle) - Play_Sound(MESSAGE_WAV); + Play_Sound(MESSAGE_WAV, SF_MESSAGE); else W_Beep(); #endif @@ -205,39 +205,39 @@ #ifdef SOUND case '1': if (F_beeplite_flags & LITE_SOUNDS) - Play_Sound(MESSAGE1_WAV); + Play_Sound(MESSAGE1_WAV, SF_MESSAGE); break; case '2': if (F_beeplite_flags & LITE_SOUNDS) - Play_Sound(MESSAGE2_WAV); + Play_Sound(MESSAGE2_WAV, SF_MESSAGE); break; case '3': if (F_beeplite_flags & LITE_SOUNDS) - Play_Sound(MESSAGE3_WAV); + Play_Sound(MESSAGE3_WAV, SF_MESSAGE); break; case '4': if (F_beeplite_flags & LITE_SOUNDS) - Play_Sound(MESSAGE4_WAV); + Play_Sound(MESSAGE4_WAV, SF_MESSAGE); break; case '5': if (F_beeplite_flags & LITE_SOUNDS) - Play_Sound(MESSAGE5_WAV); + Play_Sound(MESSAGE5_WAV, SF_MESSAGE); break; case '6': if (F_beeplite_flags & LITE_SOUNDS) - Play_Sound(MESSAGE6_WAV); + Play_Sound(MESSAGE6_WAV, SF_MESSAGE); break; case '7': if (F_beeplite_flags & LITE_SOUNDS) - Play_Sound(MESSAGE7_WAV); + Play_Sound(MESSAGE7_WAV, SF_MESSAGE); break; case '8': if (F_beeplite_flags & LITE_SOUNDS) - Play_Sound(MESSAGE_WAV); + Play_Sound(MESSAGE_WAV, SF_MESSAGE); break; case '9': if (F_beeplite_flags & LITE_SOUNDS) - Play_Sound(MESSAGE_WAV); + Play_Sound(MESSAGE_WAV, SF_MESSAGE); break; #endif Index: warning.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/warning.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- warning.c 28 Feb 2007 09:35:20 -0000 1.12 +++ warning.c 28 Feb 2007 12:21:50 -0000 1.13 @@ -47,7 +47,7 @@ if (doRefit) { #ifdef SOUND - Play_Sound(ENTER_SHIP_WAV); + Play_Sound(ENTER_SHIP_WAV, SF_INFO); #endif rdelay = time (0) + REFITTIME; } Index: cowmain.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/cowmain.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- cowmain.c 28 Feb 2007 09:35:20 -0000 1.25 +++ cowmain.c 28 Feb 2007 12:21:50 -0000 1.26 @@ -1075,7 +1075,7 @@ /* Attempt to start background music once fadeout done */ Mix_HookMusicFinished(Play_Music_Bkgd); } - Play_Sound(ENTER_SHIP_WAV); + Play_Sound(ENTER_SHIP_WAV, SF_INFO); #endif promoted = 0; ingame = 1; Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- socket.c 28 Feb 2007 09:35:20 -0000 1.20 +++ socket.c 28 Feb 2007 12:21:50 -0000 1.21 @@ -1183,9 +1183,9 @@ if (!inplayback) { #endif if (status->tourn) - Play_Sound(START_TMODE_WAV); + Play_Sound(START_TMODE_WAV, SF_INFO); else - Play_Sound(STOP_TMODE_WAV); + Play_Sound(STOP_TMODE_WAV, SF_INFO); #ifdef RECORDGAME } #endif From modemhero at users.sourceforge.net Wed Feb 28 06:21:51 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 28 Feb 2007 12:21:51 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C, 1.105, 1.106 clientr.suo, 1.85, 1.86 Message-ID: <20070228122200.B01AEB3EE@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29612 Modified Files: NetrekXP to do list.C clientr.suo Log Message: Cleanup more unused sound defines in sound.h and proto.h New netrekrc option soundVolume to control starting volume level. New sound flags to designate what category a sound falls in. Pass sound flag to sound playing functions, then check against current sound flag settings to see whether to play that sound. Added the sound flag categories to the sound menu for easy toggling. Fixed bug where soundAngles wasn't being checked before playing certain sounds angularly. Fixed bug with volume level, did not know that new channels are allocated to maxvolume. Thus, volume needs to be set during every sound play event. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.105 retrieving revision 1.106 diff -u -d -r1.105 -r1.106 --- NetrekXP to do list.C 28 Feb 2007 09:35:18 -0000 1.105 +++ NetrekXP to do list.C 28 Feb 2007 12:21:48 -0000 1.106 @@ -50,20 +50,7 @@ 11) ships orbiting and galactip map refresh..blinking..server not sending orbiters until every 4th packet? at 50 fps? and every other packet at 20 fps. Where's the code that makes vplayer not get sent if not moving/in orbit? -12)Add sound menu options to turn off sounds -by category (cloak, weapons, explosions), add rc option for those settings - 11: death sounds - 10: explosion - 9: phaser,plasma - 8: torp/plasma hit - 7: torp fire, cloak - 6: alert - 4: "informational" sounds (self destruct, enter ship, message, etc.) - 3: shield up/down, other people's sounds (phaser, torp, plasma, explode) - 0: background or ambient (engine?) - -Also to turn off other ship's sounds. -Also add option for starting sound volume. +12) Add netrekrc option to turn off sounds by category Stas's list: - color coded playerlist. Index: clientr.suo =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/clientr.suo,v retrieving revision 1.85 retrieving revision 1.86 diff -u -d -r1.85 -r1.86 Binary files /tmp/cvsL77hZP and /tmp/cvscbSavL differ From modemhero at users.sourceforge.net Wed Feb 28 06:21:51 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 28 Feb 2007 12:21:51 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.115, 1.116 netrekrc, 1.26, 1.27 netrekrc_options.txt, 1.28, 1.29 Message-ID: <20070228122200.E2A451867D3@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29612/resources/docs Modified Files: changes.txt netrekrc netrekrc_options.txt Log Message: Cleanup more unused sound defines in sound.h and proto.h New netrekrc option soundVolume to control starting volume level. New sound flags to designate what category a sound falls in. Pass sound flag to sound playing functions, then check against current sound flag settings to see whether to play that sound. Added the sound flag categories to the sound menu for easy toggling. Fixed bug where soundAngles wasn't being checked before playing certain sounds angularly. Fixed bug with volume level, did not know that new channels are allocated to maxvolume. Thus, volume needs to be set during every sound play event. Index: netrekrc =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- netrekrc 28 Feb 2007 09:35:20 -0000 1.26 +++ netrekrc 28 Feb 2007 12:21:49 -0000 1.27 @@ -344,6 +344,10 @@ # Enable layered, stereo sound sound: on +# Starting sound volume +# 0-128 range +soundVolume: 64 + # Play sound effects soundEffects: on Index: netrekrc_options.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc_options.txt,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- netrekrc_options.txt 28 Feb 2007 09:35:20 -0000 1.28 +++ netrekrc_options.txt 28 Feb 2007 12:21:49 -0000 1.29 @@ -249,6 +249,7 @@ sortMyTeamFirst: (on/off) show my team first in the player list sortPlayers: (on/off) sort players by teams sound: (on/off) enable layered, stereo sound +soundVolume: (0-128) starting sound volume soundEffects: (on/off) play sound effects soundMusic: (on/off) play music soundMusicBkgd: (on/off) play theme music in background Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.115 retrieving revision 1.116 diff -u -d -r1.115 -r1.116 --- changes.txt 28 Feb 2007 09:35:20 -0000 1.115 +++ changes.txt 28 Feb 2007 12:21:49 -0000 1.116 @@ -1,4 +1,8 @@ Netrek XP 2006, Version 1.2: (Released Feb-2007) +- sound menu now has ability to turn sounds off by type, i.e. to turn all explosion sounds + off, all message sounds off, etc. +- added "soundVolume: #" where the number is the starting sound volume. Valid range + is 0-128. - all "newSound" options have just been renamed "sound". The old sound playback (newSound off) is no longer supported. Thus the newSound netrekrc option is no longer. - border refresh now works slightly differently for those using the new color bitmaps From modemhero at users.sourceforge.net Wed Feb 28 06:21:51 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 28 Feb 2007 12:21:51 +0000 Subject: [netrek-cvs] client/netrekxp/include data.h, 1.51, 1.52 proto.h, 1.34, 1.35 sound.h, 1.15, 1.16 Message-ID: <20070228122200.CB8261867D2@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/include In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv29612/include Modified Files: data.h proto.h sound.h Log Message: Cleanup more unused sound defines in sound.h and proto.h New netrekrc option soundVolume to control starting volume level. New sound flags to designate what category a sound falls in. Pass sound flag to sound playing functions, then check against current sound flag settings to see whether to play that sound. Added the sound flag categories to the sound menu for easy toggling. Fixed bug where soundAngles wasn't being checked before playing certain sounds angularly. Fixed bug with volume level, did not know that new channels are allocated to maxvolume. Thus, volume needs to be set during every sound play event. Index: data.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- data.h 28 Feb 2007 09:35:19 -0000 1.51 +++ data.h 28 Feb 2007 12:21:49 -0000 1.52 @@ -536,7 +536,7 @@ extern int music_toggle; extern char *sounddir; extern W_Window soundWin; - +extern unsigned int sound_flags; #endif #ifdef HOCKEY_LINES @@ -697,10 +697,11 @@ extern int richText; /* temporary variable to enable/disable rich text windows */ extern int newQuit; /* new quit clock */ +extern int soundVolume; /* Starting sound volume (0-128 range) */ extern int soundEffects; /* Use sound effects playback */ extern int soundMusic; /* Use music playback */ extern int soundMusicBkgd; /* Play random background music continuously */ -extern int soundAngles; /* Use 3D sound */ +extern int soundAngles; /* Use 3D sound */ extern int useFullShipInfo; /* Prefer SP_PLAYER packets over SP_S_PLAYER packets */ #endif /* _h_data */ Index: sound.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/sound.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- sound.h 28 Feb 2007 09:35:19 -0000 1.15 +++ sound.h 28 Feb 2007 12:21:49 -0000 1.16 @@ -4,66 +4,26 @@ #ifndef __SOUND_H #define __SOUND_H -#define NO_SOUND 0 -#define FIRE_TORP_SOUND 1 -#define PHASER_SOUND 2 -#define FIRE_PLASMA_SOUND 3 -#define EXPLOSION_SOUND 4 -#define BASE_EXPLOSION_SOUND 5 -#define CLOAK_SOUND 6 -#define UNCLOAK_SOUND 7 -#define SHIELD_DOWN_SOUND 8 -#define SHIELD_UP_SOUND 9 -#define TORP_HIT_SOUND 10 -#define WARNING_SOUND 11 -#define RED_ALERT_SOUND 12 -#define ENGINE_SOUND 13 -#define ENTER_SHIP_SOUND 14 -#define SELF_DESTRUCT_SOUND 15 -#define PLASMA_HIT_SOUND 16 -#define PLASMA_KILL_SOUND 17 -#define ENTER_WARP_SOUND 18 -#define EXIT_WARP_SOUND 19 -#define START_TMODE_SOUND 20 -#define STOP_TMODE_SOUND 21 -#define MESSAGE_SOUND 22 -#define MESSAGE1_SOUND 23 -#define MESSAGE2_SOUND 24 -#define MESSAGE3_SOUND 25 -#define MESSAGE4_SOUND 26 -#define MESSAGE5_SOUND 27 -#define MESSAGE6_SOUND 28 -#define MESSAGE7_SOUND 29 -#define MESSAGE8_SOUND 30 -#define MESSAGE9_SOUND 31 -#define OTHER_SOUND_OFFSET 31 - -/* Other people's sounds; not all of these are currently used */ -#define OTHER_FIRE_TORP_SOUND 32 -#define OTHER_PHASER_SOUND 33 -#define OTHER_FIRE_PLASMA_SOUND 34 -#define OTHER_EXPLOSION_SOUND 35 - - -#define NUM_SOUNDS 35 - -struct Sound -{ - char *name; - int priority; - int flag; -}; - extern void sounddone (void); extern void soundwindow (void); - -extern void Play_Sound (int type); -extern void Play_Sound_Loc (int type, int angle, int distance); +extern void soundaction (W_Event * data); +extern void Play_Sound (int type, u_int flag); +extern void Play_Sound_Loc (int type, u_int flag, int angle, int distance); extern void Play_Music (int type); extern void Play_Music_Bkgd (void); +extern void Group_Sound (int type, int channel); extern void ChangeVolume (int vol); extern void Init_Sound (void); +#define SF_EXPLOSIONS 0x001 +#define SF_WEAPONS 0x002 +#define SF_ALERT 0x004 +#define SF_MESSAGE 0x008 +#define SF_INFO 0x010 +#define SF_CLOAKING 0x020 +#define SF_SHIELD 0x040 +#define SF_OTHER 0x080 + enum { CLOAKED_WAV, ENGINE_WAV, @@ -72,11 +32,8 @@ EXIT_WARP_WAV, EXPLOSION_WAV, BASE_EXPLOSION_WAV, - EXPLOSION_OTHER_WAV, FIRE_PLASMA_WAV, - OTHER_FIRE_PLASMA_WAV, FIRE_TORP_WAV, - OTHER_FIRE_TORP_WAV, INTRO_WAV, MESSAGE_WAV, MESSAGE1_WAV, @@ -87,7 +44,6 @@ MESSAGE6_WAV, MESSAGE7_WAV, PHASER_WAV, - PHASER_OTHER_WAV, PLASMA_HIT_WAV, PLASMA_KILL_WAV, RED_ALERT_WAV, @@ -99,6 +55,10 @@ TORP_HIT_WAV, UNCLOAK_WAV, WARNING_WAV, + EXPLOSION_OTHER_WAV, + FIRE_PLASMA_OTHER_WAV, + FIRE_TORP_OTHER_WAV, + PHASER_OTHER_WAV, NUM_WAVES }; @@ -114,6 +74,7 @@ END4_MUSIC, NUM_MUSIC, }; + #define MUSIC_OFFSET END1_MUSIC /* Offset for end music */ #endif /* __SOUND_H */ Index: proto.h =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- proto.h 28 Feb 2007 09:35:19 -0000 1.34 +++ proto.h 28 Feb 2007 12:21:49 -0000 1.35 @@ -1142,25 +1142,6 @@ register char *s2); /******************************************************************************/ -/*** sound.c -/******************************************************************************/ - extern void Exit_Sound (void); - extern void Init_Sound (void); - extern void Play_Sound (int type); - extern void Play_Sound_Loc (int type, int angle, int distance); - extern void Play_Music (int type); - extern void Play_Music_Bkgd (void); - void Group_Sound (int type, int channel); - extern void Abort_Sound (int type); - extern void soundwindow (void); -//static void soundrefresh(int i); -#if defined(SOUND) - void soundaction (W_Event * data); - void sdlsoundaction (W_Event * data); -#endif - extern void sounddone (void); - -/******************************************************************************/ /*** spopt.c /******************************************************************************/ void sprefresh (int i); From modemhero at users.sourceforge.net Wed Feb 28 07:01:19 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 28 Feb 2007 13:01:19 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs changes.txt, 1.116, 1.117 netrekrc, 1.27, 1.28 Message-ID: <20070228130129.D2F661867D0@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv17940/resources/docs Modified Files: changes.txt netrekrc Log Message: Netrekrc option soundExclude to turn certain sound categories off. Index: netrekrc =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- netrekrc 28 Feb 2007 12:21:49 -0000 1.27 +++ netrekrc 28 Feb 2007 13:01:17 -0000 1.28 @@ -442,6 +442,12 @@ # Two characters to show cloaked player on map window cloakChars: ?? +# Sound categories to turn off +# e=explosions, w=weapons, a=alerts, +# m=messages, i=info, c=cloaking, +# s=shield, o=other ships +soundExclude: + # Sound directory sounddir: .\sounds Index: changes.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/changes.txt,v retrieving revision 1.116 retrieving revision 1.117 diff -u -d -r1.116 -r1.117 --- changes.txt 28 Feb 2007 12:21:49 -0000 1.116 +++ changes.txt 28 Feb 2007 13:01:16 -0000 1.117 @@ -1,6 +1,17 @@ Netrek XP 2006, Version 1.2: (Released Feb-2007) -- sound menu now has ability to turn sounds off by type, i.e. to turn all explosion sounds - off, all message sounds off, etc. +- both sound menu and netrekrc now have ability to turn sounds off by type, i.e. to turn + all explosion sounds off, all message sounds off, etc. + The netrekrc option is called "soundExclude", and the valid sound types are: + e - explosion sounds + w - weapon sounds + a - alert sounds + m - message sounds + i - info sounds + c - cloak sounds + s - shield sounds + o - other's sounds + For example, to turn off explosions and alerts, you would have the line + "soundExclude: wa" in your netrekrc. - added "soundVolume: #" where the number is the starting sound volume. Valid range is 0-128. - all "newSound" options have just been renamed "sound". The old sound playback (newSound From modemhero at users.sourceforge.net Wed Feb 28 07:01:21 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 28 Feb 2007 13:01:21 +0000 Subject: [netrek-cvs] client/netrekxp/src defaults.c, 1.47, 1.48 sound.c, 1.31, 1.32 Message-ID: <20070228130133.DF2E7B3EE@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv17940/src Modified Files: defaults.c sound.c Log Message: Netrekrc option soundExclude to turn certain sound categories off. Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- defaults.c 28 Feb 2007 12:21:50 -0000 1.47 +++ defaults.c 28 Feb 2007 13:01:17 -0000 1.48 @@ -1942,6 +1942,7 @@ struct dmacro_list *dm; unsigned int i; unsigned char c; + char *adefault; char macroKey[3] = ""; if (!saveFile) @@ -2125,6 +2126,21 @@ fputs ("\n", fp); #ifdef SOUND + // excluded sound categories + if ((adefault = stringDefault ("soundExclude")) != NULL) + { + if (saveBig) + { + fputs ("# Sound categories to turn off\n", fp); + fputs ("# e=explosions, w=weapons, a=alerts,\n", fp); + fputs ("# m=messages, i=info, c=cloaking,\n", fp); + fputs ("# s=shield, o=other ships\n", fp); + } + sprintf (str, "soundExclude: %s\n", adefault); + fputs (str, fp); + if (saveBig) + fputs ("\n", fp); + } // sound directory if (sounddir != NULL) { @@ -2203,8 +2219,6 @@ // Window placements if (saveWindow) { - char *adefault; - if (saveBig) { fputs ("# Window placements section\n", fp); Index: sound.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/sound.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- sound.c 28 Feb 2007 12:21:50 -0000 1.31 +++ sound.c 28 Feb 2007 13:01:17 -0000 1.32 @@ -28,6 +28,7 @@ #include "proto.h" static void soundrefresh (int i); +static void Init_sound_flags (void); static Mix_Chunk *sounds[NUM_WAVES]; static Mix_Music *music[NUM_MUSIC]; @@ -184,8 +185,8 @@ Mix_Volume(-1, volume); Mix_VolumeMusic(mvolume); - /* Set sound flags to on. TODO: use netrekrc values */ - sound_flags = SF_EXPLOSIONS|SF_WEAPONS|SF_ALERT|SF_MESSAGE|SF_INFO|SF_CLOAKING|SF_SHIELD|SF_OTHER; + /* Set sound flags */ + Init_sound_flags(); /* Toggle on sound, and load sound files */ sound_toggle = 1; @@ -201,6 +202,57 @@ } } +void Init_sound_flags(void) +{ + unsigned int i; + char *tmp; + + /* Turn them all on first */ + sound_flags = SF_EXPLOSIONS|SF_WEAPONS|SF_ALERT|SF_MESSAGE|SF_INFO|SF_CLOAKING|SF_SHIELD|SF_OTHER; + + if ((tmp = stringDefault ("soundExclude")) != NULL) + { + for (i = 0; i < strlen (tmp); i++) + { + switch (tmp[i]) + { + case 'E': + case 'e': + sound_flags &= ~(SF_EXPLOSIONS); + break; + case 'W': + case 'w': + sound_flags &= ~(SF_WEAPONS); + break; + case 'A': + case 'a': + sound_flags &= ~(SF_ALERT); + break; + case 'M': + case 'm': + sound_flags &= ~(SF_MESSAGE); + break; + case 'I': + case 'i': + sound_flags &= ~(SF_INFO); + break; + case 'C': + case 'c': + sound_flags &= ~(SF_CLOAKING); + break; + case 'S': + case 's': + sound_flags &= ~(SF_SHIELD); + break; + case 'O': + case 'o': + sound_flags &= ~(SF_OTHER); + break; + } + } + } +} + extern void Play_Sound (int type, u_int flag) { int channel; From modemhero at users.sourceforge.net Wed Feb 28 07:01:18 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 28 Feb 2007 13:01:18 +0000 Subject: [netrek-cvs] client/netrekxp NetrekXP to do list.C,1.106,1.107 Message-ID: <20070228130157.450E5B3EE@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv17940 Modified Files: NetrekXP to do list.C Log Message: Netrekrc option soundExclude to turn certain sound categories off. Index: NetrekXP to do list.C =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/NetrekXP to do list.C,v retrieving revision 1.106 retrieving revision 1.107 diff -u -d -r1.106 -r1.107 --- NetrekXP to do list.C 28 Feb 2007 12:21:48 -0000 1.106 +++ NetrekXP to do list.C 28 Feb 2007 13:01:14 -0000 1.107 @@ -50,7 +50,6 @@ 11) ships orbiting and galactip map refresh..blinking..server not sending orbiters until every 4th packet? at 50 fps? and every other packet at 20 fps. Where's the code that makes vplayer not get sent if not moving/in orbit? -12) Add netrekrc option to turn off sounds by category Stas's list: - color coded playerlist. From modemhero at users.sourceforge.net Wed Feb 28 07:06:47 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 28 Feb 2007 13:06:47 +0000 Subject: [netrek-cvs] client/netrekxp/resources/htmlhelp/html generalconfig.html, 1.30, 1.31 Message-ID: <20070228130656.2563C1867D0@smtpgrey-1.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv21488/resources/htmlhelp/html Modified Files: generalconfig.html Log Message: Html help/netrek rc options updated with soundExclude. Index: generalconfig.html =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/htmlhelp/html/generalconfig.html,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- generalconfig.html 28 Feb 2007 12:21:49 -0000 1.30 +++ generalconfig.html 28 Feb 2007 13:06:45 -0000 1.31 @@ -1214,6 +1214,11 @@ +soundExlcude +What sound types to exclude from being played +[ewamicso] - see netrekrc for details + + soundDir Directory where all sounds are located path From modemhero at users.sourceforge.net Wed Feb 28 07:06:47 2007 From: modemhero at users.sourceforge.net (Bill Balcerski) Date: Wed, 28 Feb 2007 13:06:47 +0000 Subject: [netrek-cvs] client/netrekxp/resources/docs netrekrc_options.txt, 1.29, 1.30 Message-ID: <20070228130656.0DD4CB3EE@smtpgrey-2.real-time.com> Update of /cvsroot/netrek/client/netrekxp/resources/docs In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv21488/resources/docs Modified Files: netrekrc_options.txt Log Message: Html help/netrek rc options updated with soundExclude. Index: netrekrc_options.txt =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/resources/docs/netrekrc_options.txt,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- netrekrc_options.txt 28 Feb 2007 12:21:49 -0000 1.29 +++ netrekrc_options.txt 28 Feb 2007 13:06:44 -0000 1.30 @@ -255,6 +255,17 @@ soundMusicBkgd: (on/off) play theme music in background (this option requires soundMusic to be on) soundAngles: (on/off) use 3D sound effects +soundExclude: [ewamicso] +# Allow specific sound types to be turned off +# e - explosion sounds +# w - weapon sounds +# a - alert sounds +# m - message sounds +# i - info sounds +# c - cloak sounds +# s - shield sounds +# o - other's sounds + soundDir: (path) path to directory containing sound files theirPhaserShrink: (0-16) shrink enemy phaser by x/16 of its length timerType: (0-4) type of timer on dashboard window