diff --git a/source/cgame/cg_draw.c b/source/cgame/cg_draw.c index 18a6895..6df3ace 100644 --- a/source/cgame/cg_draw.c +++ b/source/cgame/cg_draw.c @@ -359,7 +359,8 @@ static void CG_DrawStatusBar( void ) { int spacer = CHAR_WIDTH*2; vec4_t hcolor; vec3_t angles; - vec3_t origin; + // BFP - Unused variable + // vec3_t origin; static float colors[4][4] = { // { 0.2, 1.0, 0.2, 1.0 } , { 1.0, 0.2, 0.2, 1.0 }, {0.5, 0.5, 0.5, 1} }; @@ -449,7 +450,6 @@ static void CG_DrawStatusBar( void ) { } #endif - // BFP - TODO: Draw a HUD bar of 6 points to indicate ki attack preparation // BFP - TODO: Draw player powerlevel info @@ -1980,7 +1980,7 @@ static void CG_DrawTeamVote(void) { } -static qboolean CG_DrawScoreboard() { +static qboolean CG_DrawScoreboard( void ) { return CG_DrawOldScoreboard(); } @@ -2319,7 +2319,7 @@ static void CG_Draw2D( void ) { } -static void CG_DrawTourneyScoreboard() { +static void CG_DrawTourneyScoreboard( void ) { CG_DrawOldTourneyScoreboard(); } diff --git a/source/cgame/cg_effects.c b/source/cgame/cg_effects.c index 244dc90..ec05a73 100644 --- a/source/cgame/cg_effects.c +++ b/source/cgame/cg_effects.c @@ -727,7 +727,7 @@ void CG_ExplosionEffect( vec3_t origin, vec3_t dir ) { // BFP - Explosion effect // BFP - Low poly sphere // BFP - TODO: Apply explosionModel from bfp attack config, highPolySphereModel is just a test qhandle_t sphereModel = ( cg_lowpolysphere.integer > 0 ) ? cgs.media.lowPolySphereModel : cgs.media.highPolySphereModel; - localEntity_t *leSphere, *leRing, *leShell; + localEntity_t *leSphere, *leRing = NULL, *leShell = NULL; VectorMA( origin, 10, dir, origin ); @@ -768,9 +768,11 @@ void CG_ExplosionEffect( vec3_t origin, vec3_t dir ) { // BFP - Explosion effect if ( explosionRingScaleFactorChargeMult > MAX_SCALEFACTOR ) explosionRingScaleFactorChargeMult = MAX_SCALEFACTOR; scale = explosionRingScaleFactor + explosionRingScaleFactorChargeMult * numPointsChargedOverMin; if ( scale > MAX_SCALE ) scale = MAX_SCALE; - VectorScale( leRing->refEntity.axis[0], scale, leRing->refEntity.axis[0] ); - VectorScale( leRing->refEntity.axis[1], scale, leRing->refEntity.axis[1] ); - VectorScale( leRing->refEntity.axis[2], scale, leRing->refEntity.axis[2] ); + if ( leRing ) { + VectorScale( leRing->refEntity.axis[0], scale, leRing->refEntity.axis[0] ); + VectorScale( leRing->refEntity.axis[1], scale, leRing->refEntity.axis[1] ); + VectorScale( leRing->refEntity.axis[2], scale, leRing->refEntity.axis[2] ); + } } if ( cg_explosionShell.integer > 0 ) { @@ -778,9 +780,11 @@ void CG_ExplosionEffect( vec3_t origin, vec3_t dir ) { // BFP - Explosion effect if ( explosionShellScaleFactorChargeMult > MAX_SCALEFACTOR ) explosionShellScaleFactorChargeMult = MAX_SCALEFACTOR; scale = explosionShellScaleFactor + explosionShellScaleFactorChargeMult * numPointsChargedOverMin; if ( scale > MAX_SCALE ) scale = MAX_SCALE; - VectorScale( leShell->refEntity.axis[0], scale, leShell->refEntity.axis[0] ); - VectorScale( leShell->refEntity.axis[1], scale, leShell->refEntity.axis[1] ); - VectorScale( leShell->refEntity.axis[2], scale, leShell->refEntity.axis[2] ); + if ( leShell ) { + VectorScale( leShell->refEntity.axis[0], scale, leShell->refEntity.axis[0] ); + VectorScale( leShell->refEntity.axis[1], scale, leShell->refEntity.axis[1] ); + VectorScale( leShell->refEntity.axis[2], scale, leShell->refEntity.axis[2] ); + } } } diff --git a/source/cgame/cg_local.h b/source/cgame/cg_local.h index 99c5d36..277f30f 100644 --- a/source/cgame/cg_local.h +++ b/source/cgame/cg_local.h @@ -1085,8 +1085,8 @@ void CG_MouseEvent(int x, int y); void CG_EventHandling(int type); void CG_RankRunFrame( void ); void CG_SetScoreSelection(void *menu); -score_t *CG_GetSelectedScore(); -void CG_BuildSpectatorString(); +score_t *CG_GetSelectedScore( void ); +void CG_BuildSpectatorString( void ); // @@ -1159,23 +1159,23 @@ void CG_OwnerDraw(float x, float y, float w, float h, float text_x, float text_y void CG_Text_Paint(float x, float y, float scale, vec4_t color, const char *text, float adjust, int limit, int style); int CG_Text_Width(const char *text, float scale, int limit); int CG_Text_Height(const char *text, float scale, int limit); -void CG_SelectPrevPlayer(); -void CG_SelectNextPlayer(); +void CG_SelectPrevPlayer( void ); +void CG_SelectNextPlayer( void ); float CG_GetValue(int ownerDraw); qboolean CG_OwnerDrawVisible(int flags); void CG_RunMenuScript(char **args); -void CG_ShowResponseHead(); +void CG_ShowResponseHead( void ); void CG_SetPrintString(int type, const char *p); -void CG_InitTeamChat(); +void CG_InitTeamChat( void ); void CG_GetTeamColor(vec4_t *color); -const char *CG_GetGameStatusText(); -const char *CG_GetKillerText(); +const char *CG_GetGameStatusText( void ); +const char *CG_GetKillerText( void ); void CG_Draw3DModel( float x, float y, float w, float h, qhandle_t model, qhandle_t skin, vec3_t origin, vec3_t angles ); void CG_Text_PaintChar(float x, float y, float width, float height, float scale, float s, float t, float s2, float t2, qhandle_t hShader); -void CG_CheckOrderPending(); -const char *CG_GameTypeString(); -qboolean CG_YourTeamHasFlag(); -qboolean CG_OtherTeamHasFlag(); +void CG_CheckOrderPending( void ); +const char *CG_GameTypeString( void ); +qboolean CG_YourTeamHasFlag( void ); +qboolean CG_OtherTeamHasFlag( void ); qhandle_t CG_StatusHandle(int task); diff --git a/source/cgame/cg_localents.c b/source/cgame/cg_localents.c index 3833506..33a0e70 100644 --- a/source/cgame/cg_localents.c +++ b/source/cgame/cg_localents.c @@ -530,6 +530,8 @@ static void CG_AddExplosion( localEntity_t *ex ) { case LE_EXPLOSION_SHELL: scale = 1.12f; // scale faster than the explosion sphere break; + default: + break; } VectorScale( ent->axis[0], scale, ent->axis[0] ); diff --git a/source/cgame/cg_main.c b/source/cgame/cg_main.c index e2465f4..2ccbddc 100644 --- a/source/cgame/cg_main.c +++ b/source/cgame/cg_main.c @@ -754,7 +754,7 @@ CG_BuildSpectatorString ======================= */ -void CG_BuildSpectatorString() { +void CG_BuildSpectatorString( void ) { int i; cg.spectatorList[0] = 0; for (i = 0; i < MAX_CLIENTS; i++) { diff --git a/source/cgame/cg_particles.c b/source/cgame/cg_particles.c index 0717d5d..31265a8 100644 --- a/source/cgame/cg_particles.c +++ b/source/cgame/cg_particles.c @@ -203,10 +203,9 @@ void CG_AddParticleToScene (cparticle_t *p, vec3_t org, float alpha) float ratio; float invratio; vec3_t color; - polyVert_t TRIverts[3]; vec3_t rright2, rup2; - -#if 0 /* // BFP - Unused particle type conditionals */ +#if 0 /* // BFP - Unused particle type variable and conditionals */ + polyVert_t TRIverts[3]; if (p->type == P_WEATHER || p->type == P_WEATHER_TURBULENT || p->type == P_WEATHER_FLURRY) {// create a front facing polygon @@ -867,9 +866,7 @@ void CG_AddParticles (void) float alpha; float time, time2; vec3_t org; - int color; cparticle_t *active, *tail; - int type; vec3_t rotate_ang; timenonscaled = trap_Milliseconds(); // BFP - That's what the variable makes non-timescaled @@ -948,16 +945,12 @@ void CG_AddParticles (void) if (alpha > 1.0) alpha = 1; - color = p->color; - time2 = time*time; org[0] = p->org[0] + p->vel[0]*time + p->accel[0]*time2; org[1] = p->org[1] + p->vel[1]*time + p->accel[1]*time2; org[2] = p->org[2] + p->vel[2]*time + p->accel[2]*time2; - type = p->type; - CG_AddParticleToScene (p, org, alpha); } diff --git a/source/cgame/cg_playerstate.c b/source/cgame/cg_playerstate.c index 4d2081c..953b06c 100644 --- a/source/cgame/cg_playerstate.c +++ b/source/cgame/cg_playerstate.c @@ -37,9 +37,11 @@ If the ammo has gone low enough to generate the warning, play a sound void CG_CheckAmmo( void ) { int i; int total; - int previous; int weapons; + // BFP - Unused variable + // int previous; + // BFP - TODO: Replace to ki // see about how many seconds of ammo we have remaining diff --git a/source/cgame/cg_weapons.c b/source/cgame/cg_weapons.c index b6ec335..fcbc0f1 100644 --- a/source/cgame/cg_weapons.c +++ b/source/cgame/cg_weapons.c @@ -1442,7 +1442,8 @@ CG_ShotgunPellet */ static void CG_ShotgunPellet( vec3_t start, vec3_t end, int skipNum ) { trace_t tr; - int sourceContentType, destContentType; + // BFP - Unused variables + // int sourceContentType, destContentType; CG_Trace( &tr, start, NULL, NULL, end, skipNum, MASK_SHOT ); diff --git a/source/game/bg_misc.c b/source/game/bg_misc.c index 80942fa..5d6f1a2 100644 --- a/source/game/bg_misc.c +++ b/source/game/bg_misc.c @@ -747,7 +747,7 @@ grabbing them easier ============ */ qboolean BG_PlayerTouchesItem( playerState_t *ps, entityState_t *item, int atTime ) { - vec3_t origin; + vec3_t origin = {0, 0, 0}; BG_EvaluateTrajectory( &item->pos, atTime, origin ); diff --git a/source/game/bg_pmove.c b/source/game/bg_pmove.c index da2d92b..82b5145 100644 --- a/source/game/bg_pmove.c +++ b/source/game/bg_pmove.c @@ -172,7 +172,7 @@ keep holding down the attack key, keeps muzzling and doesn't shoot anything while the ki is wasted out of control. ================== */ -static void PM_KiAttackTorsoAnim() { // BFP - Torso ki attack anims +static void PM_KiAttackTorsoAnim( void ) { // BFP - Torso ki attack anims if ( ( pm->cmd.buttons & BUTTON_ATTACK ) && !( pm->ps->pm_flags & PMF_KI_ATTACK ) ) { switch( pm->ps->weapon ) { case WP_ROCKET_LAUNCHER: { PM_StartTorsoAnim( TORSO_ATTACK1_PREPARE ); break; } @@ -216,7 +216,7 @@ static void PM_TorsoStatusAnim( int anim ) { // BFP - Torso status handling PM_ForceJumpAnim ================== */ -static void PM_ForceJumpAnim() { // BFP - Jump anim handling +static void PM_ForceJumpAnim( void ) { // BFP - Jump anim handling ( pm->cmd.forwardmove >= 0 ) ? PM_ForceLegsAnim( LEGS_JUMP ) : PM_ForceLegsAnim( LEGS_JUMPB ); } @@ -225,7 +225,7 @@ static void PM_ForceJumpAnim() { // BFP - Jump anim handling PM_ContinueFlyAnim ================== */ -static void PM_ContinueFlyAnim() { // BFP - Continuous fly anim handling +static void PM_ContinueFlyAnim( void ) { // BFP - Continuous fly anim handling if ( pm->cmd.forwardmove > 0 ) { PM_TorsoStatusAnim( TORSO_FLYA ); PM_ContinueLegsAnim( LEGS_FLYA ); } else if ( pm->cmd.forwardmove < 0 ) { PM_TorsoStatusAnim( TORSO_FLYB ); PM_ContinueLegsAnim( LEGS_FLYB ); } else { PM_TorsoStatusAnim( TORSO_STAND ); PM_ContinueLegsAnim( LEGS_FLYIDLE ); } @@ -555,7 +555,6 @@ static qboolean PM_CheckJump( void ) { pml.groundTrace = trace; if ( trace.plane.normal[2] < 1 ) { - float scale = PM_CmdScale( &pm->cmd ); float fmove, smove; int i; @@ -1449,7 +1448,7 @@ static int PM_CorrectAllSolid( trace_t *trace ) { PM_ControlJumpOnGround ============= */ -static void PM_ControlJumpOnGround() { // BFP - A control to handle user movement intentions when jumping off the ground +static void PM_ControlJumpOnGround( void ) { // BFP - A control to handle user movement intentions when jumping off the ground if ( !pml.walking // don't use on walking && pm->ps->weaponstate != WEAPON_STUN && pm->ps->groundEntityNum != ENTITYNUM_NONE @@ -1457,7 +1456,6 @@ static void PM_ControlJumpOnGround() { // BFP - A control to handle user movemen && ( pm->cmd.upmove > 0 || ( pm->ps->pm_flags & PMF_JUMP_HELD ) ) && ( pm->cmd.forwardmove > 0 || pm->cmd.forwardmove < 0 || pm->cmd.rightmove > 0 || pm->cmd.rightmove < 0 ) ) { - float scale = PM_CmdScale( &pm->cmd ); float fmove, smove; float vel; int i; @@ -1604,7 +1602,7 @@ static void PM_GroundTrace( void ) { if ( ( pm->cmd.upmove > 0 || ( pm->ps->pm_flags & PMF_JUMP_HELD ) ) && !( pm->ps->pm_flags & PMF_BLOCK ) // BFP - Don't increase the speed when blocking && pm->ps->weaponstate != WEAPON_BEAMFIRING // BFP - Don't increase speed when beam firing - && pm->ps->powerups[PW_HASTE] > 0 || ( pm->cmd.buttons & BUTTON_KI_USE ) ) { + && ( pm->ps->powerups[PW_HASTE] > 0 || ( pm->cmd.buttons & BUTTON_KI_USE ) ) ) { pm->ps->velocity[0] *= 5; pm->ps->velocity[1] *= 5; } @@ -1813,7 +1811,7 @@ PM_Footsteps =============== */ static void PM_Footsteps( void ) { - float bobmove; + float bobmove = 0.0f; int old; qboolean footstep; @@ -2118,7 +2116,6 @@ static void PM_TorsoAnimation( void ) { // Control the player depending their moves if ( pm->cmd.forwardmove > 0 || pm->cmd.forwardmove < 0 || pm->cmd.rightmove > 0 || pm->cmd.rightmove < 0 ) { - float scale = PM_CmdScale( &pm->cmd ); float fmove, smove; float vel; int i; @@ -2390,7 +2387,7 @@ static void PM_HitStunAnimation( void ) { // BFP - Hit stun } // When the player doesn't have more ki, play hit stun animation - if ( pm->ps->ammo[WP_KI] <= 0 && !( pm->ps->pm_flags & PMF_HITSTUN ) + if ( ( pm->ps->ammo[WP_KI] <= 0 && !( pm->ps->pm_flags & PMF_HITSTUN ) ) || ( pm->ps->powerups[PW_FLIGHT] > 0 && pm->ps->ammo[WP_KI] <= 24 ) // BFP - TODO: Apply some timer if used any ki, if flying and has less ki, then hit stun (also BFP does that) || ( ( pm->cmd.buttons & BUTTON_ATTACK ) && ( pm->ps->pm_flags & PMF_HITSTUN ) ) ) { pm->ps->pm_time = 1000; @@ -2472,7 +2469,8 @@ Generates weapon events and modifes the weapon counter ============== */ static void PM_Weapon( void ) { - int addTime; + // BFP - TODO: Unused variable, remove for the future? + // int addTime; // BFP - Hit stun, avoid shooting if the player is in this status if ( pm->ps->pm_flags & PMF_HITSTUN ) { diff --git a/source/game/g_active.c b/source/game/g_active.c index b31fa7b..b1c943a 100644 --- a/source/game/g_active.c +++ b/source/game/g_active.c @@ -102,6 +102,8 @@ void P_WorldEffects( gentity_t *ent ) { envirosuit = ent->client->ps.powerups[PW_BATTLESUIT] > level.time; + waterlevel = ent->waterlevel; + // BFP - No drowning #if 0 if ( ent->client->noclip ) { @@ -109,9 +111,6 @@ void P_WorldEffects( gentity_t *ent ) { return; } - waterlevel = ent->waterlevel; - - // // check for drowning // @@ -491,8 +490,9 @@ void ClientEvents( gentity_t *ent, int oldEventSequence ) { int i, j; int event; gclient_t *client; - int damage; - vec3_t dir; + // BFP - Unused variables + // int damage; + // vec3_t dir; vec3_t origin, angles; // qboolean fired; gitem_t *item; @@ -1479,15 +1479,12 @@ while a slow client may have multiple ClientEndFrame between ClientThink. */ void ClientEndFrame( gentity_t *ent ) { int i; - clientPersistant_t *pers; if ( ent->client->sess.sessionTeam == TEAM_SPECTATOR ) { SpectatorClientEndFrame( ent ); return; } - pers = &ent->client->pers; - // turn off any expired powerups for ( i = 0 ; i < MAX_POWERUPS ; i++ ) { // BFP - Flight and haste are skipped, these are treated for player status diff --git a/source/game/g_combat.c b/source/game/g_combat.c index 903bed7..318c5ec 100644 --- a/source/game/g_combat.c +++ b/source/game/g_combat.c @@ -133,7 +133,6 @@ LookAtKiller */ void LookAtKiller( gentity_t *self, gentity_t *inflictor, gentity_t *attacker ) { vec3_t dir; - vec3_t angles; if ( attacker && attacker != self ) { VectorSubtract (attacker->s.pos.trBase, self->s.pos.trBase, dir); @@ -145,10 +144,6 @@ void LookAtKiller( gentity_t *self, gentity_t *inflictor, gentity_t *attacker ) } self->client->ps.stats[STAT_DEAD_YAW] = vectoyaw ( dir ); - - angles[YAW] = vectoyaw ( dir ); - angles[PITCH] = 0; - angles[ROLL] = 0; } /* @@ -157,11 +152,11 @@ GibEntity ================== */ void GibEntity( gentity_t *self, int killer ) { +// BFP - No EF_KAMIKAZE flag +#if 0 gentity_t *ent; int i; -// BFP - No EF_KAMIKAZE flag -#if 0 //if this entity still has kamikaze if (self->s.eFlags & EF_KAMIKAZE) { // check if there is a kamikaze timer around for this owner diff --git a/source/game/g_local.h b/source/game/g_local.h index 81d804d..10be4f9 100644 --- a/source/game/g_local.h +++ b/source/game/g_local.h @@ -511,7 +511,7 @@ void G_AddPredictableEvent( gentity_t *ent, int event, int eventParm ); void G_AddEvent( gentity_t *ent, int event, int eventParm ); void G_SetOrigin( gentity_t *ent, vec3_t origin ); void AddRemap(const char *oldShader, const char *newShader, float timeOffset); -const char *BuildShaderStateConfig(); +const char *BuildShaderStateConfig( void ); // // g_combat.c diff --git a/source/game/g_main.c b/source/game/g_main.c index 7af4748..94db90d 100644 --- a/source/game/g_main.c +++ b/source/game/g_main.c @@ -189,7 +189,7 @@ void G_FindTeams( void ) { G_Printf ("%i teams with %i entities\n", c, c2); } -void G_RemapTeamShaders() { +void G_RemapTeamShaders( void ) { } @@ -1612,8 +1612,6 @@ Advances the non-player objects in the world void G_RunFrame( int levelTime ) { int i; gentity_t *ent; - int msec; -int start, end; // if we are waiting for the level to restart, do nothing if ( level.restarted ) { @@ -1623,7 +1621,6 @@ int start, end; level.framenum++; level.previousTime = level.time; level.time = levelTime; - msec = level.time - level.previousTime; // get any cvar changes G_UpdateCvars(); @@ -1631,7 +1628,6 @@ int start, end; // // go through all allocated objects // - start = trap_Milliseconds(); ent = &g_entities[0]; for (i=0 ; iinuse ) { @@ -1691,9 +1687,7 @@ int start, end; G_RunThink( ent ); } -end = trap_Milliseconds(); -start = trap_Milliseconds(); // perform final fixups on the players ent = &g_entities[0]; for (i=0 ; i < level.maxclients ; i++, ent++ ) { @@ -1701,7 +1695,6 @@ start = trap_Milliseconds(); ClientEndFrame( ent ); } } -end = trap_Milliseconds(); // see if it is time to do a tournement restart CheckTournament(); diff --git a/source/game/g_utils.c b/source/game/g_utils.c index afc45b6..f07a637 100644 --- a/source/game/g_utils.c +++ b/source/game/g_utils.c @@ -54,7 +54,7 @@ void AddRemap(const char *oldShader, const char *newShader, float timeOffset) { } } -const char *BuildShaderStateConfig() { +const char *BuildShaderStateConfig( void ) { static char buff[MAX_STRING_CHARS*4]; char out[(MAX_QPATH * 2) + 5]; int i; diff --git a/source/game/g_weapon.c b/source/game/g_weapon.c index 6b91cd5..277557b 100644 --- a/source/game/g_weapon.c +++ b/source/game/g_weapon.c @@ -440,7 +440,7 @@ void ShotgunPattern( vec3_t origin, vec3_t origin2, int seed, gentity_t *ent ) { float r, u; vec3_t end; vec3_t forward, right, up; - int oldScore; + // int oldScore; qboolean hitClient = qfalse; // derive the right and up vectors from the forward vector, because @@ -449,7 +449,7 @@ void ShotgunPattern( vec3_t origin, vec3_t origin2, int seed, gentity_t *ent ) { PerpendicularVector( right, forward ); CrossProduct( forward, right, up ); - oldScore = ent->client->ps.persistant[PERS_SCORE]; + // oldScore = ent->client->ps.persistant[PERS_SCORE]; // generate the "random" spread pattern for ( i = 0 ; i < DEFAULT_SHOTGUN_COUNT ; i++ ) { @@ -556,10 +556,9 @@ weapon_railgun_fire void weapon_railgun_fire (gentity_t *ent) { vec3_t end; trace_t trace; - gentity_t *tent; - gentity_t *traceEnt; + gentity_t *tent = NULL; + gentity_t *traceEnt = NULL; int damage; - int i; int hits; int passent; // BFP - For splash damage @@ -590,11 +589,13 @@ void weapon_railgun_fire (gentity_t *ent) { // no explosion at end if SURF_NOIMPACT, but still make the trail if ( !( trace.surfaceFlags & SURF_NOIMPACT ) ) { // BFP - Railgun events are also treated as a missile - if ( traceEnt->s.eType != ET_PLAYER || traceEnt->physicsObject ) { + if ( traceEnt && ( traceEnt->s.eType != ET_PLAYER || traceEnt->physicsObject ) ) { tent = G_TempEntity( trace.endpos, EV_MISSILE_MISS ); } // BFP - Sends dir vector variable to the event - tent->s.eventParm = DirToByte( trace.plane.normal ); + if ( tent ) { + tent->s.eventParm = DirToByte( trace.plane.normal ); + } } // send railgun beam effect diff --git a/source/game/q_shared.h b/source/game/q_shared.h index be9cc8b..d61a67d 100644 --- a/source/game/q_shared.h +++ b/source/game/q_shared.h @@ -85,7 +85,10 @@ typedef int intptr_t; #elif defined __linux__ || __FreeBSD__ // BFP - Linux and FreeBSD support -typedef int intptr_t; +// BFP - Don't use this: +// typedef int intptr_t; +// BFP - Use this instead, to remove 'cast to pointer' compiler warnings +#include #include #include diff --git a/source/q3_ui/ui_bfpoptions.c b/source/q3_ui/ui_bfpoptions.c index 7207f31..16ff4b9 100644 --- a/source/q3_ui/ui_bfpoptions.c +++ b/source/q3_ui/ui_bfpoptions.c @@ -701,7 +701,6 @@ void BFPExplosionsOptions_MenuInit( void ) { void BFPViewEffSndsOptions_MenuInit( void ) { int y; int thirdperson, firstpersonvis; - int particles; memset( &s_bfpoptions, 0, sizeof(bfpoptions_t) ); diff --git a/source/q3_ui/ui_credits.c b/source/q3_ui/ui_credits.c index 7e7919e..00e3344 100644 --- a/source/q3_ui/ui_credits.c +++ b/source/q3_ui/ui_credits.c @@ -249,7 +249,7 @@ static void ScrollingCredits_Draw( void ) if ( !ysize ) // ysize not calculated, so calculate it dammit! { // loop through entire credits array - for( n = 0; n <= sizeof(credits) - 1; n++ ) + for( n = 0; credits[n].string != NULL; ++n ) { // it is a small character if ( credits[n].style & UI_SMALLFONT ) @@ -281,27 +281,8 @@ static void ScrollingCredits_Draw( void ) y = 480 - SCROLLSPEED * (float)( uis.realtime - starttime ) / 100; // loop through the entire credits sequence - for( n = 0; n <= sizeof(credits) - 1; n++ ) - { - // this NULL string marks the end of the credits struct - if ( credits[n].string == NULL ) - { - endcount = y; - if ( endcount <= 200 ) { - endcount = 200; - } - UI_DrawNamedPic( 100, endcount, 465, 125, ART_BFPLOGO ); // BFP - Draw logo when it's the last credit and stop during 7 seconds - if ( y < -(16*12) ) // credits sequence is completely off screen, note: 16 are 3 seconds if you multiply by 3, you add 1 second more to last (more or less) - { - trap_Cmd_ExecuteText( - EXEC_APPEND, - va( "s_musicvolume %f; quit\n", mvolume ) - ); - break; // end of credits - } - break; - } - + for( n = 0; credits[n].string != NULL; n++ ) + { if ( strlen( credits[n].string ) == 1 ) // spacer string, no need to draw continue; if ( y > -( PROP_HEIGHT * (1 / PROP_SMALL_SIZE_SCALE) ) ) { @@ -324,6 +305,20 @@ static void ScrollingCredits_Draw( void ) break; } + // end of credits + endcount = y; + if ( endcount <= 200 ) { + endcount = 200; + } + UI_DrawNamedPic( 100, endcount, 465, 125, ART_BFPLOGO ); // BFP - Draw logo when it's the last credit and stop during 7 seconds + if ( y < -(16*12) ) // credits sequence is completely off screen, note: 16 are 3 seconds if you multiply by 3, you add 1 second more to last (more or less) + { + trap_Cmd_ExecuteText( + EXEC_APPEND, + va( "s_musicvolume %f; quit\n", mvolume ) + ); + } + Credits_DrawHeader(); // BFP - Header } diff --git a/source/q3_ui/ui_demo2.c b/source/q3_ui/ui_demo2.c index 87f3b14..b547e8f 100644 --- a/source/q3_ui/ui_demo2.c +++ b/source/q3_ui/ui_demo2.c @@ -118,9 +118,9 @@ UI_DemosMenu_Key ================= */ static sfxHandle_t UI_DemosMenu_Key( int key ) { - menucommon_s *item; + // menucommon_s *item; - item = Menu_ItemAtCursor( &s_demos.menu ); + // item = Menu_ItemAtCursor( &s_demos.menu ); return Menu_DefaultKey( &s_demos.menu, key ); } diff --git a/source/q3_ui/ui_mfield.c b/source/q3_ui/ui_mfield.c index 0d096c6..ae3b68e 100644 --- a/source/q3_ui/ui_mfield.c +++ b/source/q3_ui/ui_mfield.c @@ -334,7 +334,7 @@ void MenuField_Draw( menufield_s *f ) int x; int y; int w; - int h; + // int h; // SMALLCHAR_HEIGHT or BIGCHAR_HEIGHT int style; qboolean focus; float *color; @@ -345,13 +345,11 @@ void MenuField_Draw( menufield_s *f ) if (f->generic.flags & QMF_SMALLFONT) { w = SMALLCHAR_WIDTH; - h = SMALLCHAR_HEIGHT; style = UI_SMALLFONT; } else { w = BIGCHAR_WIDTH; - h = BIGCHAR_HEIGHT; style = UI_BIGFONT; } diff --git a/source/q3_ui/ui_playermodel.c b/source/q3_ui/ui_playermodel.c index ab4f3de..8d5adae 100644 --- a/source/q3_ui/ui_playermodel.c +++ b/source/q3_ui/ui_playermodel.c @@ -406,7 +406,7 @@ static void PlayerModel_SetKiAttacks( void ) // BFP - Set ki attack pics int numdirs; char dirlist[2048], modelselected[2048]; char* dirptr; - int i, j, dirlen, bfpnumber; + int i, dirlen, bfpnumber; // BFP - NOTE: BFP vanilla uses the static icons for every character from bfp1 to bfp6. // It would be cool to parse bfp_attacksets.cfg file and set every character their own ki attacks. diff --git a/source/q3_ui/ui_players.c b/source/q3_ui/ui_players.c index 317f4dc..2add216 100644 --- a/source/q3_ui/ui_players.c +++ b/source/q3_ui/ui_players.c @@ -160,7 +160,8 @@ static void UI_ForceLegsAnim( playerInfo_t *pi, int anim ) { } } - +// BFP - Unused Q3 function +#if 0 /* =============== UI_SetLegsAnim @@ -173,6 +174,7 @@ static void UI_SetLegsAnim( playerInfo_t *pi, int anim ) { } UI_ForceLegsAnim( pi, anim ); } +#endif /* diff --git a/source/q3_ui/ui_serverinfo.c b/source/q3_ui/ui_serverinfo.c index b10c5c4..c6ab56e 100644 --- a/source/q3_ui/ui_serverinfo.c +++ b/source/q3_ui/ui_serverinfo.c @@ -176,7 +176,7 @@ static void ServerInfo_MenuDraw( void ) char pageIndicator[64]; int startLine, endLine; int lineIndex; - int len, wrappedLen, i, j; + int len, wrappedLen, i; char wrappedValue[MAX_INFO_VALUE]; #define LIMIT_CHARACTERS 39 diff --git a/source/q3_ui/ui_servers2.c b/source/q3_ui/ui_servers2.c index 260af1f..ddbc98b 100644 --- a/source/q3_ui/ui_servers2.c +++ b/source/q3_ui/ui_servers2.c @@ -171,7 +171,7 @@ static char* netnames[] = { }; static char bfpMessage[] = "Visit www.bidforpower.com"; // BFP -static char otherMessage[] = "Visit www.globalrankings.com - you kick ass, we'll take names"; // BFP - unused message :P +// static char otherMessage[] = "Visit www.globalrankings.com - you kick ass, we'll take names"; // BFP - unused message :P typedef struct { char adrstr[MAX_ADDRESSLENGTH]; @@ -751,13 +751,13 @@ void ArenaServers_LoadFavorites( void ) int i; int j; int numtempitems; - char emptyinfo[MAX_INFO_STRING]; + // char emptyinfo[MAX_INFO_STRING]; char adrstr[MAX_ADDRESSLENGTH]; servernode_t templist[MAX_FAVORITESERVERS]; qboolean found; found = qfalse; - emptyinfo[0] = '\0'; + // emptyinfo[0] = '\0'; // copy the old memcpy( templist, g_favoriteserverlist, sizeof(servernode_t)*MAX_FAVORITESERVERS ); @@ -1188,7 +1188,9 @@ ArenaServers_Event */ static void ArenaServers_Event( void* ptr, int event ) { int id; +#if ( !ENABLE_MPLAYER ) /* Q3 default */ int value; +#endif id = ((menucommon_s*)ptr)->id; @@ -1202,7 +1204,7 @@ static void ArenaServers_Event( void* ptr, int event ) { #if ENABLE_MPLAYER g_arenaservers.master.curvalue = ArenaServers_SetType( g_arenaservers.master.curvalue ); trap_Cvar_SetValue( "ui_browserMaster", g_arenaservers.master.curvalue ); -#else // Q3 default +#else /* Q3 default */ value = g_arenaservers.master.curvalue; if (value >= 1) { @@ -1330,10 +1332,12 @@ ArenaServers_MenuInit */ static void ArenaServers_MenuInit( void ) { int i; - int type; int y; int value; static char statusbuffer[MAX_STATUSLENGTH]; +#if ( !ENABLE_MPLAYER ) /* Q3 default */ + int type; +#endif // zero set all our globals memset( &g_arenaservers, 0 ,sizeof(arenaservers_t) ); diff --git a/source/q3_ui/ui_startserver.c b/source/q3_ui/ui_startserver.c index 9a4e9a9..d5f2623 100644 --- a/source/q3_ui/ui_startserver.c +++ b/source/q3_ui/ui_startserver.c @@ -697,7 +697,8 @@ static const char *botSkill_list[] = { 0 }; - +// BFP - Bot pic selection, this is disabled (used for Q3) +#if 0 /* ================= BotAlreadySelected @@ -721,6 +722,7 @@ static qboolean BotAlreadySelected( const char *checkName ) { return qfalse; } +#endif /* diff --git a/source/q3_ui/ui_syscalls.c b/source/q3_ui/ui_syscalls.c index 890bd0c..15a1766 100644 --- a/source/q3_ui/ui_syscalls.c +++ b/source/q3_ui/ui_syscalls.c @@ -266,11 +266,11 @@ int trap_LAN_ServerStatus( const char *serverAddress, char *serverStatus, int ma return syscall( UI_LAN_SERVERSTATUS, serverAddress, serverStatus, maxLen ); } -void trap_LAN_SaveCachedServers() { +void trap_LAN_SaveCachedServers( void ) { syscall( UI_LAN_SAVECACHEDSERVERS ); } -void trap_LAN_LoadCachedServers() { +void trap_LAN_LoadCachedServers( void ) { syscall( UI_LAN_LOADCACHEDSERVERS ); } diff --git a/source/q3_ui/ui_video.c b/source/q3_ui/ui_video.c index e0a9847..b6a4ca4 100644 --- a/source/q3_ui/ui_video.c +++ b/source/q3_ui/ui_video.c @@ -125,7 +125,7 @@ static void DriverInfo_MenuDraw( void ) // BFP - For pagination char pageIndicator[64]; int startLine, endLine; - int lineIndex, len, wrappedLen, j; + int len, wrappedLen, j; char wrappedExtension[40]; // 39 characters + 1 null terminator #define DRIVERINFO_LINES_PER_PAGE 20 #define LIMIT_CHARACTERS 39 @@ -163,10 +163,10 @@ static void DriverInfo_MenuDraw( void ) } // copy the first part of the string and wrap it - strncpy( wrappedExtension, s_driverinfo.strings[i] + wrappedLen, j + 1 ); - wrappedExtension[j + 1] = '\0'; - wrappedLen += j + 1; - len -= j + 1; + strncpy( wrappedExtension, s_driverinfo.strings[i] + wrappedLen, j ); + wrappedExtension[j] = '\0'; + wrappedLen += j; + len -= j; } else { strcpy( wrappedExtension, s_driverinfo.strings[i] + wrappedLen ); len = 0; @@ -217,7 +217,6 @@ UI_DriverInfo_Menu static void UI_DriverInfo_Menu( void ) { char* eptr; - int len; // zero set all our globals memset( &s_driverinfo, 0 ,sizeof(driverinfo_t) );