Skip to content
Permalink
Browse files

cgame: add silencer icon on pistol silenced in HUD

  • Loading branch information...
Aranud committed Jul 3, 2019
1 parent 2ef4dbf commit f6fe203fac02a78ba8ee0531c2b59a0ad24691fc
Showing with 12 additions and 3 deletions.
  1. +4 −2 src/cgame/cg_local.h
  2. +2 −0 src/cgame/cg_main.c
  3. +6 −1 src/cgame/cg_newDraw.c
@@ -790,7 +790,7 @@ typedef struct weaponInfo_s

vec3_t flashDlightColor;
weaponSounds_t flashSound; ///< fast firing weapons randomly choose
weaponSounds_t flashSoundSilenced; ///< silenced firing weapons
weaponSounds_t flashSoundSilenced; ///< silenced firing weapons
weaponSounds_t flashEchoSound; ///< distant gun firing sound
weaponSounds_t lastShotSound; ///< sound of the last shot can be different (mauser doesn't have bolt action on last shot for example)

@@ -829,7 +829,7 @@ typedef struct weaponInfo_s
sfxHandle_t spindownSound; ///< sound called if the above is running but player doesn't follow through and fire

sfxHandle_t switchSoundOn; ///< alt switch sound do
sfxHandle_t switchSoundOff; ///< alt switch sound undo
sfxHandle_t switchSoundOff; ///< alt switch sound undo
sfxHandle_t noAmmoSound;

int impactSoundRange;
@@ -1780,6 +1780,8 @@ typedef struct

qhandle_t countryFlags; ///< GeoIP

qhandle_t silencer;

} cgMedia_t;

/**
@@ -2098,6 +2098,8 @@ static void CG_RegisterGraphics(void)
cgs.media.cm_spec_icon = trap_R_RegisterShaderNoMip("ui/assets/mp_spec");
cgs.media.cm_arrow_spec = trap_R_RegisterShaderNoMip("ui/assets/mp_arrow_spec");

cgs.media.silencer = trap_R_RegisterShaderNoMip("icons/iconw_silencer");

for (i = 0; i < 6; i++)
{
cgs.media.fireteamicons[i] = trap_R_RegisterShaderNoMip(va("gfx/hud/fireteam/fireteam%i", i + 1));
@@ -336,6 +336,11 @@ void CG_DrawPlayerWeaponIcon(rectDef_t *rect, qboolean drawHighlighted, int alig

trap_R_SetColor(hcolor);
CG_DrawPic(x, y, w, h, icon);

if (cg.pmext.silencedSideArm & WALTTYPE_SILENCER && GetWeaponTableData(cg.predictedPlayerState.weapon)->type & WEAPON_TYPE_SILENCEABLE)
{
CG_DrawPic(x, y + rect->h * 0.5f, w * 0.75f, h * 0.75f, cgs.media.silencer);
}
}
}

@@ -434,7 +439,7 @@ void CG_DrawCursorhint(rectDef_t *rect)
case HINT_POWERUP:
icon = cgs.media.powerupHintShader;
break;

// multiplayer hints
case HINT_BUILD:
icon = cgs.media.buildHintShader;

0 comments on commit f6fe203

Please sign in to comment.
You can’t perform that action at this time.