Skip to content

Commit

Permalink
Allow r_clear to accept standard RGB values (ref #132)
Browse files Browse the repository at this point in the history
  • Loading branch information
MadDeCoDeR committed Nov 15, 2023
1 parent 6a150f8 commit fb6fdaf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions neo/renderer/OpenGL/RenderBackend_GL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1851,6 +1851,11 @@ void idRenderBackend::SetBuffer( const void* data )
float c[3];
if( sscanf( r_clear.GetString(), "%f %f %f", &c[0], &c[1], &c[2] ) == 3 )
{
if (c[0] > 1.0f || c[1] > 1.0f || c[2] > 1.0f) {
c[0] = c[0] / 255.0f;
c[1] = c[1] / 255.0f;
c[2] = c[2] / 255.0f;
}
GL_Clear( true, false, false, 0, c[0], c[1], c[2], 1.0f, true );
}
else if( r_clear.GetInteger() == 2 )
Expand Down
2 changes: 1 addition & 1 deletion neo/renderer/RenderSystem_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ idCVar r_useLightAreaCulling( "r_useLightAreaCulling", "1", CVAR_RENDERER | CVAR
idCVar r_useLightScissors( "r_useLightScissors", "3", CVAR_RENDERER | CVAR_INTEGER, "0 = no scissor, 1 = non-clipped scissor, 2 = near-clipped scissor, 3 = fully-clipped scissor", 0, 3, idCmdSystem::ArgCompletion_Integer<0, 3> );
idCVar r_useEntityPortalCulling( "r_useEntityPortalCulling", "1", CVAR_RENDERER | CVAR_INTEGER, "0 = none, 1 = cull frustum corners to plane, 2 = exact clip the frustum faces", 0, 2, idCmdSystem::ArgCompletion_Integer<0, 2> );
idCVar r_logFile( "r_logFile", "0", CVAR_RENDERER | CVAR_INTEGER, "number of frames to emit GL logs" );
idCVar r_clear( "r_clear", "2", CVAR_RENDERER, "force screen clear every frame, 1 = purple, 2 = black, 'r g b' = custom" );
idCVar r_clear( "r_clear", "2", CVAR_RENDERER, "force screen clear every frame, 1 = purple, 2 = black, 'r g b' = custom, NOTE: acceptable values must be either in the range of 0-1 or 0-255" );

idCVar r_offsetFactor( "r_offsetfactor", "0", CVAR_RENDERER | CVAR_FLOAT, "polygon offset parameter" );
// RB: offset factor was 0, and units were -600 which caused some very ugly polygon offsets on Android so I reverted the values to the same as in Q3A
Expand Down

0 comments on commit fb6fdaf

Please sign in to comment.