Move handling of ud.drawweapon from G_DrawWeaponTileWithID() to P_DisplayWeapon(). This fixes it not being applied to the quick kick and mighty foot.

git-svn-id: https://svn.eduke32.com/eduke32@5117 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2015-03-30 05:57:11 +00:00
parent 48358dae19
commit 0b1d786f35
2 changed files with 30 additions and 35 deletions

View file

@ -1606,14 +1606,11 @@ onevent EVENT_DISPLAYWEAPON // P_DisplayWeapon
case SHOTGUN_WEAPON case SHOTGUN_WEAPON
setvar hud_tilenum SHOTGUNSPRITE setvar hud_tilenum SHOTGUNSPRITE
break break
case KNEE_WEAPON
break
default default
addlogvar currentweapon addlogvar currentweapon
break break
/*
case KNEE_WEAPON
setvar hud_tilenum -1
break
*/
endswitch endswitch
ifvarn hud_tilenum -1 ifvarn hud_tilenum -1

View file

@ -1827,9 +1827,6 @@ static void G_DrawWeaponTile(int32_t x, int32_t y, int32_t tilenum, int32_t shad
palf[slot] = p; palf[slot] = p;
switch (ud.drawweapon)
{
case 1:
#ifdef USE_OPENGL #ifdef USE_OPENGL
if (getrendermode() >= REND_POLYMOST) if (getrendermode() >= REND_POLYMOST)
if (tilenum >= CHAINGUN + 1 && tilenum <= CHAINGUN + 4) if (tilenum >= CHAINGUN + 1 && tilenum <= CHAINGUN + 4)
@ -1844,20 +1841,6 @@ static void G_DrawWeaponTile(int32_t x, int32_t y, int32_t tilenum, int32_t shad
} }
#endif #endif
G_DrawTileScaled(x, y, tilenum, shadef[slot], orientation, p); G_DrawTileScaled(x, y, tilenum, shadef[slot], orientation, p);
return;
case 2:
{
const DukePlayer_t *const ps = g_player[screenpeek].ps;
const int32_t sc = scale(65536, ud.statusbarscale, 100);
if ((unsigned)hudweap.cur < MAX_WEAPONS && hudweap.cur != KNEE_WEAPON)
rotatesprite_win(160 << 16, (180 + (ps->weapon_pos * ps->weapon_pos)) << 16, sc, 0,
hudweap.cur == GROW_WEAPON ? GROWSPRITEICON : WeaponPickupSprites[hudweap.cur], 0,
0, 2);
return;
}
}
} }
static inline void G_DrawWeaponTileWithID(int32_t id, int32_t x, int32_t y, int32_t tilenum, int32_t shade, static inline void G_DrawWeaponTileWithID(int32_t id, int32_t x, int32_t y, int32_t tilenum, int32_t shade,
@ -2160,7 +2143,7 @@ void P_DisplayWeapon(void)
if (VM_OnEvent(EVENT_DISPLAYWEAPON, p->i, screenpeek) == 0) if (VM_OnEvent(EVENT_DISPLAYWEAPON, p->i, screenpeek) == 0)
{ {
j = 14-p->quick_kick; j = 14-p->quick_kick;
if (j != 14 || p->last_quick_kick) if ((j != 14 || p->last_quick_kick) && ud.drawweapon == 1)
{ {
pal = P_GetHudPal(p); pal = P_GetHudPal(p);
if (pal == 0) if (pal == 0)
@ -2198,6 +2181,20 @@ void P_DisplayWeapon(void)
} }
else else
{ {
switch (ud.drawweapon)
{
case 1:
break;
case 2:
if ((unsigned)hudweap.cur < MAX_WEAPONS && hudweap.cur != KNEE_WEAPON)
rotatesprite_win(160 << 16, (180 + (p->weapon_pos * p->weapon_pos)) << 16, scale(65536, ud.statusbarscale, 100), 0,
hudweap.cur == GROW_WEAPON ? GROWSPRITEICON : WeaponPickupSprites[hudweap.cur], 0,
0, 2);
default:
goto enddisplayweapon;
}
const int doanim = !(sprite[p->i].pal == 1 || ud.pause_on || g_player[myconnectindex].ps->gm&MODE_MENU); const int doanim = !(sprite[p->i].pal == 1 || ud.pause_on || g_player[myconnectindex].ps->gm&MODE_MENU);
const int hla = p->look_ang >> 1; const int hla = p->look_ang >> 1;
@ -2567,6 +2564,7 @@ void P_DisplayWeapon(void)
} }
} }
enddisplayweapon:
P_DisplaySpit(); P_DisplaySpit();
} }