Skip to content

Commit 74ee25a

Browse files
committed
widescreen hud icon background
1 parent 7b90669 commit 74ee25a

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

code/cgame/cg_draw.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4174,8 +4174,8 @@ void CG_DrawIconBackground(void)
41744174

41754175
float holdFloat = (float) backgroundHeight;
41764176
backgroundHeight = (int) (holdFloat*cg.iconHUDPercent);
4177-
CG_DrawPic( backgroundXPos, backgroundYPos, backgroundWidth, -backgroundHeight, background); // Top half
4178-
CG_DrawPic( backgroundXPos, backgroundYPos-2,backgroundWidth, backgroundHeight, background); // Bottom half
4177+
CG_DrawPic( backgroundXPos + ( 128 * (1 - cgs.widthRatioCoef) ), backgroundYPos, backgroundWidth * cgs.widthRatioCoef, -backgroundHeight, background); // Top half
4178+
CG_DrawPic( backgroundXPos + ( 128 * (1 - cgs.widthRatioCoef) ), backgroundYPos-2,backgroundWidth * cgs.widthRatioCoef, backgroundHeight, background); // Bottom half
41794179
}
41804180
return;
41814181
}
@@ -4207,8 +4207,8 @@ void CG_DrawIconBackground(void)
42074207
cgi_R_SetColor( colorTable[CT_WHITE] );
42084208
float holdFloat = (float) backgroundHeight;
42094209
backgroundHeight = (int) (holdFloat*cg.iconHUDPercent);
4210-
CG_DrawPic( backgroundXPos, backgroundYPos, backgroundWidth, -backgroundHeight, background); // Top half
4211-
CG_DrawPic( backgroundXPos, backgroundYPos-2,backgroundWidth, backgroundHeight, background); // Bottom half
4210+
CG_DrawPic( backgroundXPos + ( 128 * (1 - cgs.widthRatioCoef) ), backgroundYPos, backgroundWidth * cgs.widthRatioCoef, -backgroundHeight, background); // Top half
4211+
CG_DrawPic( backgroundXPos + ( 128 * (1 - cgs.widthRatioCoef) ), backgroundYPos-2,backgroundWidth * cgs.widthRatioCoef, backgroundHeight, background); // Bottom half
42124212
}
42134213
if ((cg.inventorySelectTime+WEAPON_SELECT_TIME)>cg.time)
42144214
{

codemp/cgame/cg_weapons.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ void CG_DrawIconBackground(void)
934934
return;
935935
}
936936

937-
x2 = 30;
937+
x2 = 30 + ( 128 * (1 - cgs.widthRatioCoef) );
938938
y2 = SCREEN_HEIGHT-70;
939939

940940
//prongLeftX =x2+37;
@@ -974,8 +974,8 @@ void CG_DrawIconBackground(void)
974974
// xAdd = (int) 8*cg.iconHUDPercent;
975975

976976
height = (int) (60.0f*cg.iconHUDPercent);
977-
CG_DrawPic( x2+60, y2+30+yOffset, 460, -height, drawType); // Top half
978-
CG_DrawPic( x2+60, y2+30-2+yOffset, 460, height, drawType); // Bottom half
977+
CG_DrawPic( x2+60, y2+30+yOffset, 460 * cgs.widthRatioCoef, -height, drawType); // Top half
978+
CG_DrawPic( x2+60, y2+30-2+yOffset, 460 * cgs.widthRatioCoef, height, drawType); // Bottom half
979979

980980
}
981981
else
@@ -1011,8 +1011,8 @@ void CG_DrawIconBackground(void)
10111011

10121012
trap->R_SetColor( colorTable[CT_WHITE] );
10131013
height = (int) (60.0f*cg.iconHUDPercent);
1014-
CG_DrawPic( x2+60, y2+30+yOffset, 460, -height, drawType); // Top half
1015-
CG_DrawPic( x2+60, y2+30-2+yOffset, 460, height, drawType); // Bottom half
1014+
CG_DrawPic( x2+60, y2+30+yOffset, 460 * cgs.widthRatioCoef, -height, drawType); // Top half
1015+
CG_DrawPic( x2+60, y2+30-2+yOffset, 460 * cgs.widthRatioCoef, height, drawType); // Bottom half
10161016

10171017
// And now for the prongs
10181018
if (inTime>cg.time)

0 commit comments

Comments
 (0)