Skip to content

Commit

Permalink
widescreen hud icon background
Browse files Browse the repository at this point in the history
  • Loading branch information
TwelveEyes committed Jun 23, 2024
1 parent 7b90669 commit 74ee25a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions code/cgame/cg_draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4174,8 +4174,8 @@ void CG_DrawIconBackground(void)

float holdFloat = (float) backgroundHeight;
backgroundHeight = (int) (holdFloat*cg.iconHUDPercent);
CG_DrawPic( backgroundXPos, backgroundYPos, backgroundWidth, -backgroundHeight, background); // Top half
CG_DrawPic( backgroundXPos, backgroundYPos-2,backgroundWidth, backgroundHeight, background); // Bottom half
CG_DrawPic( backgroundXPos + ( 128 * (1 - cgs.widthRatioCoef) ), backgroundYPos, backgroundWidth * cgs.widthRatioCoef, -backgroundHeight, background); // Top half
CG_DrawPic( backgroundXPos + ( 128 * (1 - cgs.widthRatioCoef) ), backgroundYPos-2,backgroundWidth * cgs.widthRatioCoef, backgroundHeight, background); // Bottom half
}
return;
}
Expand Down Expand Up @@ -4207,8 +4207,8 @@ void CG_DrawIconBackground(void)
cgi_R_SetColor( colorTable[CT_WHITE] );
float holdFloat = (float) backgroundHeight;
backgroundHeight = (int) (holdFloat*cg.iconHUDPercent);
CG_DrawPic( backgroundXPos, backgroundYPos, backgroundWidth, -backgroundHeight, background); // Top half
CG_DrawPic( backgroundXPos, backgroundYPos-2,backgroundWidth, backgroundHeight, background); // Bottom half
CG_DrawPic( backgroundXPos + ( 128 * (1 - cgs.widthRatioCoef) ), backgroundYPos, backgroundWidth * cgs.widthRatioCoef, -backgroundHeight, background); // Top half
CG_DrawPic( backgroundXPos + ( 128 * (1 - cgs.widthRatioCoef) ), backgroundYPos-2,backgroundWidth * cgs.widthRatioCoef, backgroundHeight, background); // Bottom half
}
if ((cg.inventorySelectTime+WEAPON_SELECT_TIME)>cg.time)
{
Expand Down
10 changes: 5 additions & 5 deletions codemp/cgame/cg_weapons.c
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ void CG_DrawIconBackground(void)
return;
}

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

//prongLeftX =x2+37;
Expand Down Expand Up @@ -974,8 +974,8 @@ void CG_DrawIconBackground(void)
// xAdd = (int) 8*cg.iconHUDPercent;

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

}
else
Expand Down Expand Up @@ -1011,8 +1011,8 @@ void CG_DrawIconBackground(void)

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

// And now for the prongs
if (inTime>cg.time)
Expand Down

0 comments on commit 74ee25a

Please sign in to comment.