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;