- weapon draw code tested and old version removed.

# Conflicts:
#	source/games/duke/src/zz_player.cpp
This commit is contained in:
Christoph Oelckers 2020-05-20 10:38:56 +02:00
parent e827e7a59b
commit 603afdde87
11 changed files with 825 additions and 2470 deletions

View file

@ -196,7 +196,7 @@ void addweapon_r(struct player_struct* p, int weapon)
case KNEE_WEAPON:
case DYNAMITE_WEAPON:
case TRIPBOMB_WEAPON:
case HANDREMOTE_WEAPON:
case THROWINGDYNAMITE_WEAPON:
break;
case SHOTGUN_WEAPON:
spritesound(SHOTGUN_COCK, p->i);

View file

@ -107,6 +107,8 @@ void processinput_d(int snum);
void processinput_r(int snum);
void displayweapon_d(int snum);
void displayweapon_r(int snum);
void displaymasks_d(int snum);
void displaymasks_r(int snum);
@ -157,6 +159,7 @@ void SetDispatcher()
checkweapons_d,
processinput_d,
displayweapon_d,
displaymasks_d,
};
}
else
@ -202,6 +205,7 @@ void SetDispatcher()
checkweapons_r,
processinput_r,
displayweapon_r,
displaymasks_r,
};
}
}

View file

@ -533,6 +533,7 @@ struct Dispatcher
void (*checkweapons)(struct player_struct* p);
void (*processinput)(int snum);
void (*displayweapon)(int snum);
void (*displaymasks)(int snum);
};

View file

@ -198,7 +198,7 @@ int animateknuckles(int gs, int snum)
//
//---------------------------------------------------------------------------
void displaymasks(int snum)
void displaymasks_d(int snum)
{
int p;
@ -211,12 +211,12 @@ void displaymasks(int snum)
{
if (ud.screen_size > 4)
{
rotatesprite(43 << 16, (200 - 8 - tilesiz[SCUBAMASK].y) << 16, 65536, 0, SCUBAMASK, 0, p, 2 + 16, CRECT);
rotatesprite(44 << 16, (200 - 8 - tilesiz[SCUBAMASK].y) << 16, 65536, 0, SCUBAMASK, 0, p, 2 + 16, CRECT);
rotatesprite((320 - 43) << 16, (200 - 8 - tilesiz[SCUBAMASK].y) << 16, 65536, 1024, SCUBAMASK, 0, p, 2 + 4 + 16, CRECT);
}
else
{
rotatesprite(43 << 16, (200 - tilesiz[SCUBAMASK].y) << 16, 65536, 0, SCUBAMASK, 0, p, 2 + 16, CRECT);
rotatesprite(44 << 16, (200 - tilesiz[SCUBAMASK].y) << 16, 65536, 0, SCUBAMASK, 0, p, 2 + 16, CRECT);
rotatesprite((320 - 43) << 16, (200 - tilesiz[SCUBAMASK].y) << 16, 65536, 1024, SCUBAMASK, 0, p, 2 + 4 + 16, CRECT);
}
}
@ -294,7 +294,7 @@ int animateaccess(int gs,int snum)
void displayweapon_d(int snum)
{
int gun_pos, looking_arc, cw;
int weapon_xoffset, i, j, x1, y1, x2;
int weapon_xoffset, i, j;
int o,pal;
signed char gs;
struct player_struct *p;
@ -851,44 +851,46 @@ void displayweapon_d(int snum)
}
else
{
pin = (isWW2GI() || (duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING)) ? 0 : RS_ALIGN_R;
const int WEAPON2_RELOAD_TIME = 50;
auto reload_time = isWW2GI() ? aplWeaponReload[PISTOL_WEAPON][snum] : WEAPON2_RELOAD_TIME;
if (p->kickback_pic < 10)
hud_drawpal(194 - (p->look_ang >> 1), looking_arc + 230 - gun_pos, FIRSTGUN + 4, gs, o, pal);
hud_drawpal(194 - (p->look_ang >> 1), looking_arc + 230 - gun_pos, FIRSTGUN + 4, gs, o|pin, pal);
else if (p->kickback_pic < 15)
{
hud_drawpal(244 - (p->kickback_pic << 3) - (p->look_ang >> 1), looking_arc + 130 - gun_pos + (p->kickback_pic << 4), FIRSTGUN + 6, gs, o, pal);
hud_drawpal(224 - (p->look_ang >> 1), looking_arc + 220 - gun_pos, FIRSTGUN + 5, gs, o, pal);
hud_drawpal(244 - (p->kickback_pic << 3) - (p->look_ang >> 1), looking_arc + 130 - gun_pos + (p->kickback_pic << 4), FIRSTGUN + 6, gs, o | pin, pal);
hud_drawpal(224 - (p->look_ang >> 1), looking_arc + 220 - gun_pos, FIRSTGUN + 5, gs, o | pin, pal);
}
else if (p->kickback_pic < 20)
{
hud_drawpal(124 + (p->kickback_pic << 1) - (p->look_ang >> 1), looking_arc + 430 - gun_pos - (p->kickback_pic << 3), FIRSTGUN + 6, gs, o, pal);
hud_drawpal(224 - (p->look_ang >> 1), looking_arc + 220 - gun_pos, FIRSTGUN + 5, gs, o, pal);
hud_drawpal(124 + (p->kickback_pic << 1) - (p->look_ang >> 1), looking_arc + 430 - gun_pos - (p->kickback_pic << 3), FIRSTGUN + 6, gs, o | pin, pal);
hud_drawpal(224 - (p->look_ang >> 1), looking_arc + 220 - gun_pos, FIRSTGUN + 5, gs, o | pin, pal);
}
else if (p->kickback_pic < (reload_time - 12))
{
hud_drawpal(184 - (p->look_ang >> 1), looking_arc + 235 - gun_pos, FIRSTGUN + 8, gs, o, pal);
hud_drawpal(224 - (p->look_ang >> 1), looking_arc + 210 - gun_pos, FIRSTGUN + 5, gs, o, pal);
hud_drawpal(184 - (p->look_ang >> 1), looking_arc + 235 - gun_pos, FIRSTGUN + 8, gs, o | pin, pal);
hud_drawpal(224 - (p->look_ang >> 1), looking_arc + 210 - gun_pos, FIRSTGUN + 5, gs, o | pin, pal);
}
else if (p->kickback_pic < (reload_time - 6))
{
hud_drawpal(164 - (p->look_ang >> 1), looking_arc + 245 - gun_pos, FIRSTGUN + 8, gs, o, pal);
hud_drawpal(224 - (p->look_ang >> 1), looking_arc + 220 - gun_pos, FIRSTGUN + 5, gs, o, pal);
hud_drawpal(164 - (p->look_ang >> 1), looking_arc + 245 - gun_pos, FIRSTGUN + 8, gs, o | pin, pal);
hud_drawpal(224 - (p->look_ang >> 1), looking_arc + 220 - gun_pos, FIRSTGUN + 5, gs, o | pin, pal);
}
else if (p->kickback_pic < (reload_time))
hud_drawpal(194 - (p->look_ang >> 1), looking_arc + 235 - gun_pos, FIRSTGUN + 5, gs, o, pal);
else if (p->kickback_pic < 23)
{
hud_drawpal(184 - (p->look_ang >> 1), looking_arc + 235 - gun_pos, FIRSTGUN + 8, gs, o, pal);
hud_drawpal(224 - (p->look_ang >> 1), looking_arc + 210 - gun_pos, FIRSTGUN + 5, gs, o, pal);
hud_drawpal(184 - (p->look_ang >> 1), looking_arc + 235 - gun_pos, FIRSTGUN + 8, gs, o | pin, pal);
hud_drawpal(224 - (p->look_ang >> 1), looking_arc + 210 - gun_pos, FIRSTGUN + 5, gs, o | pin, pal);
}
else if (p->kickback_pic < 25)
{
hud_drawpal(164 - (p->look_ang >> 1), looking_arc + 245 - gun_pos, FIRSTGUN + 8, gs, o, pal);
hud_drawpal(224 - (p->look_ang >> 1), looking_arc + 220 - gun_pos, FIRSTGUN + 5, gs, o, pal);
hud_drawpal(164 - (p->look_ang >> 1), looking_arc + 245 - gun_pos, FIRSTGUN + 8, gs, o | pin, pal);
hud_drawpal(224 - (p->look_ang >> 1), looking_arc + 220 - gun_pos, FIRSTGUN + 5, gs, o | pin, pal);
}
else if (p->kickback_pic < 27)
hud_drawpal(194 - (p->look_ang >> 1), looking_arc + 235 - gun_pos, FIRSTGUN + 5, gs, o, pal);
hud_drawpal(194 - (p->look_ang >> 1), looking_arc + 235 - gun_pos, FIRSTGUN + 5, gs, o | pin, pal);
}
};

File diff suppressed because it is too large Load diff

View file

@ -54,8 +54,4 @@ enum dukeinvicon_t
ICON_MAX
};
extern int const icon_to_inv[ICON_MAX];
extern int const inv_to_icon[GET_MAX];
END_DUKE_NS

View file

@ -3602,7 +3602,7 @@ enum redneck_weapon_t
ALIENBLASTER_WEAPON = 7,
POWDERKEG_WEAPON = 8,
TIT_WEAPON = 9,
//HANDREMOTE_WEAPON = 10;
THROWINGDYNAMITE_WEAPON = 10,
BUZZSAW_WEAPON = 11,
BOWLING_WEAPON = 12,
MOTORCYCLE_WEAPON = 13,

View file

@ -402,7 +402,6 @@ inline void addammo(int weaponNum, DukePlayer_t* pPlayer, int addAmount)
}
void P_AddWeapon(DukePlayer_t *pPlayer, int weaponNum);
void P_CheckWeapon(DukePlayer_t *pPlayer);
void P_DisplayScuba(void);
void P_DisplayWeapon(void);
void checkweapons(DukePlayer_t* const pPlayer);
int findotherplayer(int p, int* d);
@ -423,8 +422,6 @@ inline void setpal(DukePlayer_t* pPlayer)
void P_EndLevel(void);
void P_CheckWeaponI(int playerNum);
int P_GetHudPal(const DukePlayer_t *pPlayer);
int P_GetKneePal(const DukePlayer_t *pPlayer);
int P_GetKneePal(const DukePlayer_t *pPlayer, int hudPal);
int P_GetOverheadPal(const DukePlayer_t *pPlayer);
void madenoise(int playerNum);
int haskey(int sect, int snum);

View file

@ -997,7 +997,7 @@ void selectweapon_r(int snum, int j)
if (sprite[k].picnum == HEAVYHBOMB && sprite[k].owner == p->i)
{
p->gotweapon.Set(DYNAMITE_WEAPON);
j = HANDREMOTE_WEAPON;
j = THROWINGDYNAMITE_WEAPON;
break;
}
k = nextspritestat[k];
@ -1124,10 +1124,10 @@ void selectweapon_r(int snum, int j)
}
break;
case HANDREMOTE_WEAPON: // what's up with this? RR doesn't define this weapon.
case THROWINGDYNAMITE_WEAPON:
if (k >= 0) // Found in list of [1]'s
{
p->curr_weapon = HANDREMOTE_WEAPON;
p->curr_weapon = THROWINGDYNAMITE_WEAPON;
p->last_weapon = -1;
p->weapon_pos = 10;
}
@ -2667,7 +2667,7 @@ static void fireweapon(int snum)
if (p->ammo_amount[DYNAMITE_WEAPON] > 0)
p->kickback_pic = 1;
break;
case HANDREMOTE_WEAPON:
case THROWINGDYNAMITE_WEAPON:
p->hbomb_hold_delay = 0;
p->kickback_pic = 1;
break;
@ -2794,7 +2794,7 @@ static void operateweapon(int snum, int sb_snum, int psect)
if (p->kickback_pic > 19)
{
p->kickback_pic = 0;
p->curr_weapon = HANDREMOTE_WEAPON;
p->curr_weapon = THROWINGDYNAMITE_WEAPON;
p->last_weapon = -1;
p->weapon_pos = 10;
p->detonate_time = 45;
@ -2805,7 +2805,7 @@ static void operateweapon(int snum, int sb_snum, int psect)
break;
case HANDREMOTE_WEAPON:
case THROWINGDYNAMITE_WEAPON:
p->kickback_pic++;
@ -3682,7 +3682,7 @@ void processinput_r(int snum)
fi.doincrements(p);
if (p->curr_weapon == HANDREMOTE_WEAPON) processweapon(snum, sb_snum, psect);
if (p->curr_weapon == THROWINGDYNAMITE_WEAPON) processweapon(snum, sb_snum, psect);
return;
}

File diff suppressed because it is too large Load diff

View file

@ -744,10 +744,9 @@ void G_DisplayRest(int32_t smoothratio)
{
PspTwoDSetter set;
fi.displayweapon(screenpeek);
//P_DisplayWeapon();
if (pp->over_shoulder_on == 0)
P_DisplayScuba();
fi.displaymasks(screenpeek);
}
if (!RR)
G_MoveClouds();