Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: disabled verbose reporting about tracer invalid color index #1810

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions common/r_efx.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ color24 gTracerColors[] =
};
*/

#define TRACER_COLORINDEX_DEFAULT 4

// Temporary entity array
#define TENTPRIORITY_LOW 0
#define TENTPRIORITY_HIGH 1
Expand Down
2 changes: 1 addition & 1 deletion engine/client/cl_efx.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ static particle_t *R_AllocTracer( const vec3_t org, const vec3_t vel, float life
VectorCopy( vel, p->vel );
p->die = cl.time + life;
p->ramp = tracerlength.value;
p->color = 4; // select custom color
p->color = TRACER_COLORINDEX_DEFAULT; // select custom color
p->packedColor = 255; // alpha

return p;
Expand Down
5 changes: 2 additions & 3 deletions ref/gl/gl_rpart.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,9 @@ void CL_DrawTracers( double frametime, particle_t *cl_active_tracers )
VectorAdd( verts[0], delta, verts[2] );
VectorAdd( verts[1], delta, verts[3] );

if( p->color > sizeof( gTracerColors ) / sizeof( gTracerColors[0] ))
if( p->color < 0 || p->color > sizeof( gTracerColors ) / sizeof( gTracerColors[0] ))
{
gEngfuncs.Con_Printf( S_ERROR "UserTracer with color(%d) > %zu\n", p->color, sizeof( gTracerColors ) / sizeof( gTracerColors[0] ));
p->color = 0;
p->color = TRACER_COLORINDEX_DEFAULT;
}

color = gTracerColors[p->color];
Expand Down
5 changes: 2 additions & 3 deletions ref/soft/r_part.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,9 @@ void GAME_EXPORT CL_DrawTracers( double frametime, particle_t *cl_active_tracers
VectorAdd( verts[0], delta, verts[2] );
VectorAdd( verts[1], delta, verts[3] );

if( p->color > sizeof( gTracerColors ) / sizeof( gTracerColors[0] ))
if( p->color < 0 || p->color > sizeof( gTracerColors ) / sizeof( gTracerColors[0] ))
{
gEngfuncs.Con_Printf( S_ERROR "UserTracer with color(%d) > %zu\n", p->color, sizeof( gTracerColors ) / sizeof( gTracerColors[0] ));
p->color = 0;
p->color = TRACER_COLORINDEX_DEFAULT;
}

color = gTracerColors[p->color];
Expand Down