mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
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:
parent
48358dae19
commit
0b1d786f35
2 changed files with 30 additions and 35 deletions
|
@ -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
|
||||||
|
|
|
@ -1827,37 +1827,20 @@ 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)
|
||||||
if (!usemodels || md_tilehasmodel(tilenum, p) < 0)
|
if (!usemodels || md_tilehasmodel(tilenum, p) < 0)
|
||||||
{
|
{
|
||||||
// HACK: Draw the upper part of the chaingun two screen
|
// HACK: Draw the upper part of the chaingun two screen
|
||||||
// pixels (not texels; multiplied by weapon scale) lower
|
// pixels (not texels; multiplied by weapon scale) lower
|
||||||
// first, preventing ugly horizontal seam.
|
// first, preventing ugly horizontal seam.
|
||||||
g_dts_yadd = tabledivide32_noinline(65536 * 2 * 200, ydim);
|
g_dts_yadd = tabledivide32_noinline(65536 * 2 * 200, ydim);
|
||||||
G_DrawTileScaled(x, y, tilenum, shadef[slot], orientation, p);
|
G_DrawTileScaled(x, y, tilenum, shadef[slot], orientation, p);
|
||||||
g_dts_yadd = 0;
|
g_dts_yadd = 0;
|
||||||
}
|
}
|
||||||
#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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue