Enemy Territory

Project: Bug Fix

The objective

The goal of this project is to provide modders in the ET community with a SDK code base that contains fixes for various bugs which are present in the stock etmain game (version 2.60).

26th september 2006: Sadly bugfix 088 had a bug :-( There were 3 lines that should have been deleted for the fix to work correctly.

Show index
Previous bug: Cleanups in clientside code 1
Next bug: Player highlighting on the scoreboard was split into columns

Bugfix 076 - Scoreboard background draws double lines with higher resolutions

Problem:

The scoreboard code which draws the background is using drawing commands which draw on a virtual 640x480 screen. This results in wide lines getting drawn in higher resolutions.

Solution:

The code already contains functions which doesn't scale the width of the lines drawn. However we need one which doesn't scale and only draws the bottom line. So we'll copy and modify CG_DrawTopBottom_NoScale.

Notes:

These changes also adjust the background of the team headers, so that they better match.

2.56 & 2.60 Code

cg_drawtools.c @ 220 trap_R_DrawStretchPic( x, y + h - size, w, size, 0, 0, 0, 0, cgs.media.whiteShader ); }
// CHRUKER: b076 - Scoreboard background had black lines drawn twice void CG_DrawBottom_NoScale( float x, float y, float w, float h, float size ) { CG_AdjustFrom640( &x, &y, &w, &h ); trap_R_DrawStretchPic( x, y + h - size, w, size, 0, 0, 0, 0, cgs.media.whiteShader ); }
/*
cg_local.h @ 2329 void CG_DrawTopBottom(float x, float y, float w, float h, float size); void CG_DrawTopBottom_NoScale( float x, float y, float w, float h, float size );
// CHRUKER: b076 - Scoreboard background had black lines drawn twice void CG_DrawBottom_NoScale( float x, float y, float w, float h, float size );
// NERVE - SMF - localization functions
cg_scoreboard.c @ 587 tempx = x;
// CHRUKER: b076 - Adjusted y coordinate, and changed to use DrawBottom instead of DrawTopBottom
CG_FillRect( x-5, y-1, width+5, 18, clrUiBack );
//CG_FillRect( x-5, y-1, width+5, 18, clrUiBar );
trap_R_SetColor( colorBlack ); CG_DrawTopBottom_NoScale( x-5, y-1, width+5, 18, 1 ); trap_R_SetColor( NULL );
cg_scoreboard.c @ 617
// CHRUKER: b076 - The math says char height + 2 * border width (1 pixel)
y += SMALLCHAR_HEIGHT + 2; cg.teamPlayers[team] = 0; // JPW NERVE
cg_scoreboard.c @ 646 if ( use_mini_chars ) {
// CHRUKER: b076 - Adjusted y height, and changed to DrawBottom instead of DrawTopBottom
CG_FillRect( x-5, y, width+5, MINICHAR_HEIGHT+1, hcolor ); trap_R_SetColor( colorBlack ); CG_DrawTopBottom_NoScale( x-5, y, width+5, MINICHAR_HEIGHT+1, 1 ); trap_R_SetColor( NULL ); y += MINICHAR_HEIGHT; } else {
// CHRUKER: b076 - Adjusted y height, and changed to DrawBottom instead of DrawTopBottom
CG_FillRect( x-5, y, width+5, SMALLCHAR_HEIGHT+1, hcolor ); trap_R_SetColor( colorBlack ); CG_DrawTopBottom_NoScale( x-5, y, width+5, SMALLCHAR_HEIGHT+1, 1 ); trap_R_SetColor( NULL );

Show index
Previous bug: Cleanups in clientside code 1
Next bug: Player highlighting on the scoreboard was split into columns

Color coding

Sample = New code
Sample = Changed code (the new version is what is displayed)
Sample = Deleted code

©2017 Chruker