diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index c72508772..67f1db7e8 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -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); diff --git a/source/games/duke/src/dispatch.cpp b/source/games/duke/src/dispatch.cpp index 90a2642f5..8dd35c914 100644 --- a/source/games/duke/src/dispatch.cpp +++ b/source/games/duke/src/dispatch.cpp @@ -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, }; } } diff --git a/source/games/duke/src/game.h b/source/games/duke/src/game.h index 4b21cddcc..0c532132b 100644 --- a/source/games/duke/src/game.h +++ b/source/games/duke/src/game.h @@ -533,6 +533,7 @@ struct Dispatcher void (*checkweapons)(struct player_struct* p); void (*processinput)(int snum); void (*displayweapon)(int snum); + void (*displaymasks)(int snum); }; diff --git a/source/games/duke/src/hudweapon_d.cpp b/source/games/duke/src/hudweapon_d.cpp index fa8848c2d..885b89ebd 100644 --- a/source/games/duke/src/hudweapon_d.cpp +++ b/source/games/duke/src/hudweapon_d.cpp @@ -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); } }; diff --git a/source/games/duke/src/hudweapon_r.cpp b/source/games/duke/src/hudweapon_r.cpp index ba12154be..a63e93bfb 100644 --- a/source/games/duke/src/hudweapon_r.cpp +++ b/source/games/duke/src/hudweapon_r.cpp @@ -43,22 +43,22 @@ BEGIN_DUKE_NS inline static void hud_drawpal(int x, int y, int tilenum, int shade, int orientation, int p, int scale = 32768) { - hud_rotatesprite(x << 16, y << 16, scale, (orientation & 4) ? 1024 : 0, tilenum, shade, p, 2 | orientation, windowxy1.x, windowxy1.y, windowxy2.x, windowxy2.y); + hud_rotatesprite(x << 16, y << 16, scale, (orientation & 4) ? 1024 : 0, tilenum, shade, p, 2 | orientation, windowxy1.x, windowxy1.y, windowxy2.x, windowxy2.y); } inline static void rdmyospal(int x, int y, int tilenum, int shade, int orientation, int p) { - hud_drawpal(x, y, tilenum, shade, orientation, p, 36700); + hud_drawpal(x, y, tilenum, shade, orientation, p, 36700); } inline static void rd2myospal(int x, int y, int tilenum, int shade, int orientation, int p) { - hud_drawpal(x, y, tilenum, shade, orientation, p, 44040); + hud_drawpal(x, y, tilenum, shade, orientation, p, 44040); } inline static void rd3myospal(int x, int y, int tilenum, int shade, int orientation, int p) { - hud_drawpal(x, y, tilenum, shade, orientation, p, 47040); + hud_drawpal(x, y, tilenum, shade, orientation, p, 47040); } //--------------------------------------------------------------------------- @@ -69,8 +69,8 @@ inline static void rd3myospal(int x, int y, int tilenum, int shade, int orientat inline static void hud_draw(int x, int y, int tilenum, int shade, int orientation) { - int p = sector[ps[screenpeek].cursectnum].floorpal; - rotatesprite(x << 16, y << 16, 65536L, (orientation & 4) ? 1024 : 0, tilenum, shade, p, 2 | orientation, windowxy1.x, windowxy1.y, windowxy2.x, windowxy2.y); + int p = sector[ps[screenpeek].cursectnum].floorpal; + rotatesprite(x << 16, y << 16, 65536L, (orientation & 4) ? 1024 : 0, tilenum, shade, p, 2 | orientation, windowxy1.x, windowxy1.y, windowxy2.x, windowxy2.y); } @@ -80,34 +80,25 @@ inline static void hud_draw(int x, int y, int tilenum, int shade, int orientatio // //--------------------------------------------------------------------------- -void displaymasks(short snum) +void displaymasks_r(int snum) { - short p; + short p; - if (sprite[ps[snum].i].pal == 1) - p = 1; - else - p = sector[ps[snum].cursectnum].floorpal; + if (sprite[ps[snum].i].pal == 1) + p = 1; + else + p = sector[ps[snum].cursectnum].floorpal; - if (ps[snum].scuba_on) - { - if (ud.screen_size > 4) - { - hud_rotatesprite((320 - (tilesiz[SCUBAMASK].x >> 1) - 15) << 16, (200 - (tilesiz[SCUBAMASK].y >> 1) + (sintable[(int)totalclock & 2047] >> 10)) << 16, 49152, 0, SCUBAMASK, 0, p, 2 + 16, CRECT); - hud_rotatesprite((320 - tilesiz[SCUBAMASK + 4].x) << 16, (200 - tilesiz[SCUBAMASK + 4].y) << 16, 65536, 0, SCUBAMASK + 4, 0, p, 2 + 16, CRECT); - hud_rotatesprite(tilesiz[SCUBAMASK + 4].x << 16, (200 - tilesiz[SCUBAMASK + 4].y) << 16, 65536, 1024, SCUBAMASK + 4, 0, p, 2 + 4 + 16, CRECT); - hud_rotatesprite(35 << 16, (-1) << 16, 65536, 0, SCUBAMASK + 3, 0, p, 2 + 16, CRECT); - hud_rotatesprite(285 << 16, 200 << 16, 65536, 1024, SCUBAMASK + 3, 0, p, 2 + 16, CRECT); - } - else - { - hud_rotatesprite((320 - (tilesiz[SCUBAMASK].x >> 1) - 15) << 16, (200 - (tilesiz[SCUBAMASK].y >> 1) + (sintable[(int)totalclock & 2047] >> 10)) << 16, 49152, 0, SCUBAMASK, 0, p, 2 + 16, CRECT); - hud_rotatesprite((320 - tilesiz[SCUBAMASK + 4].x) << 16, (200 - tilesiz[SCUBAMASK + 4].y) << 16, 65536, 0, SCUBAMASK + 4, 0, p, 2 + 16, CRECT); - hud_rotatesprite(tilesiz[SCUBAMASK + 4].x << 16, (200 - tilesiz[SCUBAMASK + 4].y) << 16, 65536, 1024, SCUBAMASK + 4, 0, p, 2 + 4 + 16, CRECT); - hud_rotatesprite(35 << 16, (-1) << 16, 65536, 0, SCUBAMASK + 3, 0, p, 2 + 16, CRECT); - hud_rotatesprite(285 << 16, 200 << 16, 65536, 1024, SCUBAMASK + 3, 0, p, 2 + 16, CRECT); - } - } + if (ps[snum].scuba_on) + { + int pin = 0; + if (!(duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING)) pin = RS_STRETCH; + hud_rotatesprite((320 - (tilesiz[SCUBAMASK].x >> 1) - 15) << 16, (200 - (tilesiz[SCUBAMASK].y >> 1) + (sintable[(int)totalclock & 2047] >> 10)) << 16, 49152, 0, SCUBAMASK, 0, p, 2 + 16 + pin, CRECT); + hud_rotatesprite((320 - tilesiz[SCUBAMASK + 4].x) << 16, (200 - tilesiz[SCUBAMASK + 4].y) << 16, 65536, 0, SCUBAMASK + 4, 0, p, 2 + 16 + pin, CRECT); + hud_rotatesprite(tilesiz[SCUBAMASK + 4].x << 16, (200 - tilesiz[SCUBAMASK + 4].y) << 16, 65536, 1024, SCUBAMASK + 4, 0, p, 2 + 4 + 16 + pin, CRECT); + hud_rotatesprite(35 << 16, (-1) << 16, 65536, 0, SCUBAMASK + 3, 0, p, 2 + 16 + pin, CRECT); + hud_rotatesprite(285 << 16, 200 << 16, 65536, 1024, SCUBAMASK + 3, 0, p, 2 + 16 + pin, CRECT); + } } //--------------------------------------------------------------------------- @@ -118,13 +109,13 @@ void displaymasks(short snum) void ShowMotorcycle(int x, int y, short tilenum, signed char shade, char orientation, char p, short a) { - hud_rotatesprite(x << 16, y << 16, 34816L, a, tilenum, shade, p, 2 | orientation, CRECT); + hud_rotatesprite(x << 16, y << 16, 34816L, a, tilenum, shade, p, 2 | orientation, CRECT); } void ShowBoat(int x, int y, short tilenum, signed char shade, char orientation, char p, short a) { - hud_rotatesprite(x << 16, y << 16, 66048L, a, tilenum, shade, p, 2 | orientation, CRECT); + hud_rotatesprite(x << 16, y << 16, 66048L, a, tilenum, shade, p, 2 | orientation, CRECT); } @@ -134,726 +125,816 @@ void ShowBoat(int x, int y, short tilenum, signed char shade, char orientation, // //--------------------------------------------------------------------------- -void displayweapon(int snum) +void displayweapon_r(int snum) { - int gun_pos, looking_arc, cw; - int weapon_xoffset, i, j; - char o,pal; - signed char gs; + int gun_pos, looking_arc, cw; + int weapon_xoffset, i, j; + char o,pal; + signed char gs; - auto p = &ps[snum]; - auto kb = &p->kickback_pic; + auto p = &ps[snum]; + auto kb = &p->kickback_pic; - o = 0; + o = 0; - looking_arc = abs(p->look_ang)/9; + looking_arc = abs(p->look_ang)/9; - if (shadedsector[p->cursectnum] == 1) - gs = 16; - else - gs = sprite[p->i].shade; - if(gs > 24) gs = 24; + if (shadedsector[p->cursectnum] == 1) + gs = 16; + else + gs = sprite[p->i].shade; + if(gs > 24) gs = 24; - if(p->newowner >= 0 || ud.camerasprite >= 0 || (sprite[p->i].pal != 1 && sprite[p->i].extra <= 0)) - return; + if(p->newowner >= 0 || ud.camerasprite >= 0 || (sprite[p->i].pal != 1 && sprite[p->i].extra <= 0)) + return; - gun_pos = 80-(p->weapon_pos*p->weapon_pos); + gun_pos = 80-(p->weapon_pos*p->weapon_pos); - weapon_xoffset = (160)-90; - weapon_xoffset -= (sintable[((p->weapon_sway>>1)+512)&2047]/(1024+512)); - weapon_xoffset -= 58 + p->weapon_ang; - if( sprite[p->i].xrepeat < 8 ) - gun_pos -= abs(sintable[(p->weapon_sway<<2)&2047]>>9); - else gun_pos -= abs(sintable[(p->weapon_sway>>1)&2047]>>10); + weapon_xoffset = (160)-90; + weapon_xoffset -= (sintable[((p->weapon_sway>>1)+512)&2047]/(1024+512)); + weapon_xoffset -= 58 + p->weapon_ang; + if( sprite[p->i].xrepeat < 8 ) + gun_pos -= abs(sintable[(p->weapon_sway<<2)&2047]>>9); + else gun_pos -= abs(sintable[(p->weapon_sway>>1)&2047]>>10); - gun_pos -= (p->hard_landing<<3); + gun_pos -= (p->hard_landing<<3); - if(p->last_weapon >= 0) - cw = p->last_weapon; - else cw = p->curr_weapon; + if(p->last_weapon >= 0) + cw = p->last_weapon; + else cw = p->curr_weapon; - j = 14-p->quick_kick; - if(j != 14) - { - if(sprite[p->i].pal == 1) - pal = 1; - else - pal = p->palookup; - } + j = 14-p->quick_kick; + if(j != 14) + { + if(sprite[p->i].pal == 1) + pal = 1; + else + pal = p->palookup; + } - if (p->OnMotorcycle) - { - int temp_kb; - if (numplayers == 1) - { - if (*kb) - { - gs = 0; - if (*kb == 1) - { - if ((krand()&1) == 1) - temp_kb = MOTOHIT+1; - else - temp_kb = MOTOHIT+2; - } - else if (*kb == 4) - { - if ((krand()&1) == 1) - temp_kb = MOTOHIT+3; - else - temp_kb = MOTOHIT+4; - } - else - temp_kb = MOTOHIT; + if (p->OnMotorcycle) + { + int temp_kb; + if (numplayers == 1) + { + if (*kb) + { + gs = 0; + if (*kb == 1) + { + if ((krand()&1) == 1) + temp_kb = MOTOHIT+1; + else + temp_kb = MOTOHIT+2; + } + else if (*kb == 4) + { + if ((krand()&1) == 1) + temp_kb = MOTOHIT+3; + else + temp_kb = MOTOHIT+4; + } + else + temp_kb = MOTOHIT; - } - else - temp_kb = MOTOHIT; - } - else - { - if (*kb) - { - gs = 0; - if (*kb == 1) - temp_kb = MOTOHIT+1; - else if (*kb == 2) - temp_kb = MOTOHIT+2; - else if (*kb == 3) - temp_kb = MOTOHIT+3; - else if (*kb == 4) - temp_kb = MOTOHIT+4; - else - temp_kb = MOTOHIT; + } + else + temp_kb = MOTOHIT; + } + else + { + if (*kb) + { + gs = 0; + if (*kb == 1) + temp_kb = MOTOHIT+1; + else if (*kb == 2) + temp_kb = MOTOHIT+2; + else if (*kb == 3) + temp_kb = MOTOHIT+3; + else if (*kb == 4) + temp_kb = MOTOHIT+4; + else + temp_kb = MOTOHIT; - } - else - temp_kb = MOTOHIT; - } - if (sprite[p->i].pal == 1) - pal = 1; - else - pal = sector[p->cursectnum].floorpal; + } + else + temp_kb = MOTOHIT; + } + if (sprite[p->i].pal == 1) + pal = 1; + else + pal = sector[p->cursectnum].floorpal; - if (p->TiltStatus >= 0) - ShowMotorcycle(160-(p->look_ang>>1), 174, temp_kb, gs, 0, pal, p->TiltStatus*5); - else if (p->TiltStatus < 0) - ShowMotorcycle(160-(p->look_ang>>1), 174, temp_kb, gs, 0, pal, p->TiltStatus*5+2047); - return; - } - if (p->OnBoat) - { - int temp2, temp_kb, temp3; - temp2 = 0; - if (p->TiltStatus > 0) - { - if (*kb == 0) - temp_kb = BOATHIT+1; - else if (*kb <= 3) - { - temp_kb = BOATHIT+5; - temp2 = 1; - } - else if (*kb <= 6) - { - temp_kb = BOATHIT+6; - temp2 = 1; - } - else - temp_kb = BOATHIT+1; - } - else if (p->TiltStatus < 0) - { - if (*kb == 0) - temp_kb = BOATHIT+2; - else if (*kb <= 3) - { - temp_kb = BOATHIT+7; - temp2 = 1; - } - else if (*kb <= 6) - { - temp_kb = BOATHIT+8; - temp2 = 1; - } - else - temp_kb = BOATHIT+2; - } - else - { - if (*kb == 0) - temp_kb = BOATHIT; - else if (*kb <= 3) - { - temp_kb = BOATHIT+3; - temp2 = 1; - } - else if (*kb <= 6) - { - temp_kb = BOATHIT+4; - temp2 = 1; - } - else - temp_kb = BOATHIT; - } + if (p->TiltStatus >= 0) + ShowMotorcycle(160-(p->look_ang>>1), 174, temp_kb, gs, 0, pal, p->TiltStatus*5); + else if (p->TiltStatus < 0) + ShowMotorcycle(160-(p->look_ang>>1), 174, temp_kb, gs, 0, pal, p->TiltStatus*5+2047); + return; + } + if (p->OnBoat) + { + int temp2, temp_kb, temp3; + temp2 = 0; + if (p->TiltStatus > 0) + { + if (*kb == 0) + temp_kb = BOATHIT+1; + else if (*kb <= 3) + { + temp_kb = BOATHIT+5; + temp2 = 1; + } + else if (*kb <= 6) + { + temp_kb = BOATHIT+6; + temp2 = 1; + } + else + temp_kb = BOATHIT+1; + } + else if (p->TiltStatus < 0) + { + if (*kb == 0) + temp_kb = BOATHIT+2; + else if (*kb <= 3) + { + temp_kb = BOATHIT+7; + temp2 = 1; + } + else if (*kb <= 6) + { + temp_kb = BOATHIT+8; + temp2 = 1; + } + else + temp_kb = BOATHIT+2; + } + else + { + if (*kb == 0) + temp_kb = BOATHIT; + else if (*kb <= 3) + { + temp_kb = BOATHIT+3; + temp2 = 1; + } + else if (*kb <= 6) + { + temp_kb = BOATHIT+4; + temp2 = 1; + } + else + temp_kb = BOATHIT; + } - if (sprite[p->i].pal == 1) - pal = 1; - else - pal = sector[p->cursectnum].floorpal; + if (sprite[p->i].pal == 1) + pal = 1; + else + pal = sector[p->cursectnum].floorpal; - if (p->NotOnWater) - temp3 = 170; - else - temp3 = 170 + (*kb>>2); + if (p->NotOnWater) + temp3 = 170; + else + temp3 = 170 + (*kb>>2); - if (temp2) - gs = -96; + if (temp2) + gs = -96; - if (p->TiltStatus >= 0) - ShowBoat(160-(p->look_ang>>1), temp3, temp_kb, gs, 0, pal, p->TiltStatus); - else if (p->TiltStatus < 0) - ShowBoat(160-(p->look_ang>>1), temp3, temp_kb, gs, 0, pal, p->TiltStatus+2047); - return; - } + if (p->TiltStatus >= 0) + ShowBoat(160-(p->look_ang>>1), temp3, temp_kb, gs, 0, pal, p->TiltStatus); + else if (p->TiltStatus < 0) + ShowBoat(160-(p->look_ang>>1), temp3, temp_kb, gs, 0, pal, p->TiltStatus+2047); + return; + } - if( sprite[p->i].xrepeat < 8 ) - { - static int fistsign; - if(p->jetpack_on == 0 ) - { - i = sprite[p->i].xvel; - looking_arc += 32-(i>>1); - fistsign += i>>1; - } - cw = weapon_xoffset; - weapon_xoffset += sintable[(fistsign)&2047]>>10; - hud_draw(weapon_xoffset+250-(p->look_ang>>1), - looking_arc+258-(abs(sintable[(fistsign)&2047]>>8)), - FIST,gs,o); - weapon_xoffset = cw; - weapon_xoffset -= sintable[(fistsign)&2047]>>10; - hud_draw(weapon_xoffset+40-(p->look_ang>>1), - looking_arc+200+(abs(sintable[(fistsign)&2047]>>8)), - FIST,gs,o|4); - } - else switch(cw) - { - case KNEE_WEAPON: - case SLINGBLADE_WEAPON: - if(sprite[p->i].pal == 1) - pal = 1; - else - pal = sector[p->cursectnum].floorpal; - if (cw == KNEE_WEAPON) - { - static const short kb_frames[] = { 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7 }; - static const short kb_ox[] = { 310,342,364,418,350,316,282,288,0,0 }; - static const short kb_oy[] = { 300,362,320,268,248,248,277,420,0,0 }; - short x; - short y; - x = weapon_xoffset + ((kb_ox[kb_frames[*kb]]>>1) - 12); - y = 200 - (244-kb_oy[kb_frames[*kb]]); - hud_drawpal(x-(p->look_ang>>1),looking_arc+y-gun_pos, - KNEE+kb_frames[*kb],gs,0,pal); - } - else - { - static const short kb_frames[] = { 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7 }; - static const short kb_ox[] = { 580,676,310,491,356,210,310,614 }; - static const short kb_oy[] = { 369,363,300,323,371,400,300,440 }; - short x, y; - x = weapon_xoffset + ((kb_ox[kb_frames[*kb]]>>1) - 12); - y = 210 - (244-kb_oy[kb_frames[*kb]]); - hud_drawpal(x-(p->look_ang>>1)+20,looking_arc+y-gun_pos-80, - SLINGBLADE+kb_frames[*kb],gs,0,pal); - } - break; + if( sprite[p->i].xrepeat < 8 ) + { + static int fistsign; + if(p->jetpack_on == 0 ) + { + i = sprite[p->i].xvel; + looking_arc += 32-(i>>1); + fistsign += i>>1; + } + cw = weapon_xoffset; + weapon_xoffset += sintable[(fistsign)&2047]>>10; + hud_draw(weapon_xoffset+250-(p->look_ang>>1), + looking_arc+258-(abs(sintable[(fistsign)&2047]>>8)), + FIST,gs,o); + weapon_xoffset = cw; + weapon_xoffset -= sintable[(fistsign)&2047]>>10; + hud_draw(weapon_xoffset+40-(p->look_ang>>1), + looking_arc+200+(abs(sintable[(fistsign)&2047]>>8)), + FIST,gs,o|4); + } + else + { + int pin = 0; - case POWDERKEG_WEAPON: - case BOWLING_WEAPON: - if(sprite[p->i].pal == 1) - pal = 1; - else - pal = sector[p->cursectnum].floorpal; - - weapon_xoffset += 8; - gun_pos -= 10; - - if (cw == BOWLING_WEAPON) - { - if (p->ammo_amount[BOWLING_WEAPON]) - { - hud_drawpal(weapon_xoffset+162-(p->look_ang>>1), - looking_arc+214-gun_pos+(*kb<<3),BOWLINGBALLH,gs,o,pal); - } - else - { - rdmyospal(weapon_xoffset+162-(p->look_ang>>1), - looking_arc+214-gun_pos,HANDTHROW+5,gs,o,pal); - } - } - else - { - if (p->ammo_amount[POWDERKEG_WEAPON]) - { - rdmyospal(weapon_xoffset+180-(p->look_ang>>1), - looking_arc+214-gun_pos+(*kb<<3),POWDERH,gs,o,pal); - rdmyospal(weapon_xoffset+90-(p->look_ang>>1), - looking_arc+214-gun_pos+(*kb<<3),POWDERH,gs,o|4,pal); - } - else - { - rdmyospal(weapon_xoffset+162-(p->look_ang>>1), - looking_arc+214-gun_pos,HANDTHROW+5,gs,o,pal); - } - } - break; - - case CROSSBOW_WEAPON: - case CHICKEN_WEAPON: - if(sprite[p->i].pal == 1) - pal = 1; - else pal = sector[p->cursectnum].floorpal; - - if (cw == CROSSBOW_WEAPON) - { - if (*kb) - { - static const char kb_frames[] = { 0,1,1,2,2,3,2,3,2,3,2,2,2,2,2,2,2,2,2,4,4,4,4,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,7 }; - if (kb_frames[*kb] == 2) - { - rdmyospal((weapon_xoffset + 200) - (p->look_ang >> 1), - looking_arc + 250 - gun_pos, RPGGUN + kb_frames[*kb], gs, o, pal); - } - else if (kb_frames[*kb] == 3) - { - rdmyospal((weapon_xoffset + 200) - (p->look_ang >> 1), - looking_arc + 250 - gun_pos, RPGGUN + kb_frames[*kb], gs, o, pal); - } - else if (kb_frames[*kb] == 1) - { - rdmyospal((weapon_xoffset + 200) - (p->look_ang >> 1), - looking_arc + 250 - gun_pos, RPGGUN + kb_frames[*kb], 0, o, pal); - } - else - { - rdmyospal((weapon_xoffset + 210) - (p->look_ang >> 1), - looking_arc + 255 - gun_pos, RPGGUN + kb_frames[*kb], gs, o, pal); - } - } - else - { - rdmyospal((weapon_xoffset + 210) - (p->look_ang >> 1), - looking_arc + 255 - gun_pos, RPGGUN, gs, o, pal); - } - } - else - { - if (*kb) - { - char kb_frames[] = { 0,1,1,2,2,3,2,3,2,3,2,2,2,2,2,2,2,2,2,4,4,4,4,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,7 }; - if (kb_frames[*kb] == 2) - { - rdmyospal((weapon_xoffset + 200) - (p->look_ang >> 1), - looking_arc + 250 - gun_pos, RPGGUN2 + kb_frames[*kb], gs, o, pal); - } - else if (kb_frames[*kb] == 3) - { - rdmyospal((weapon_xoffset + 200) - (p->look_ang >> 1), - looking_arc + 250 - gun_pos, RPGGUN2 + kb_frames[*kb], gs, o, pal); - } - else if (kb_frames[*kb] == 1) - { - rdmyospal((weapon_xoffset + 200) - (p->look_ang >> 1), - looking_arc + 250 - gun_pos, RPGGUN2 + kb_frames[*kb], 0, o, pal); - } - else - { - rdmyospal((weapon_xoffset + 210) - (p->look_ang >> 1), - looking_arc + 255 - gun_pos, RPGGUN2 + kb_frames[*kb], gs, o, pal); - } - } - else - { - if (ud.multimode < 2) - { - if (chickenphase) - { - rdmyospal((weapon_xoffset + 210) - (p->look_ang >> 1), - looking_arc + 222 - gun_pos, RPGGUN2 + 7, gs, o, pal); - } - else if ((krand() & 15) == 5) - { - spritesound(327, p->i); - rdmyospal((weapon_xoffset + 210) - (p->look_ang >> 1), - looking_arc + 222 - gun_pos, RPGGUN2 + 7, gs, o, pal); - chickenphase = 6; - } - else - { - rdmyospal((weapon_xoffset + 210) - (p->look_ang >> 1), - looking_arc + 225 - gun_pos, RPGGUN2, gs, o, pal); - } - } - else - { - rdmyospal((weapon_xoffset + 210) - (p->look_ang >> 1), - looking_arc + 225 - gun_pos, RPGGUN2, gs, o, pal); - } - } - } - break; - - case SHOTGUN_WEAPON: - if(sprite[p->i].pal == 1) - pal = 1; - else - pal = sector[p->cursectnum].floorpal; - - weapon_xoffset -= 8; - - if(sprite[p->i].pal == 1) - pal = 1; - else - pal = sector[p->cursectnum].floorpal; - - { - short x; - short y; - static const short kb_frames3[] = { 0,0,1,1,2,2,5,5,6,6,7,7,8,8,0,0,0,0,0,0,0 }; - static const short kb_frames2[] = { 0,0,3,3,4,4,5,5,6,6,7,7,8,8,0,0,20,20,21,21,21,21,20,20,20,20,0,0 }; - static const short kb_frames[] = { 0,0,1,1,2,2,3,3,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8,8,0,0,20,20,21,21,21,21,20,20,20,20,0,0 }; - static const short kb_ox[] = { 300,300,300,300,300,330,320,310,305,306,302 }; - static const short kb_oy[] = { 315,300,302,305,302,302,303,306,302,404,384 }; - short tm; - tm = 180; - if (p->shotgun_state[1]) - { - if ((*kb) < 26) - { - if (kb_frames[*kb] == 3 || kb_frames[*kb] == 4) - gs = 0; - x = weapon_xoffset+((kb_ox[kb_frames[*kb]]>>1)-12); - y = tm-(244-kb_oy[kb_frames[*kb]]); - hud_drawpal(x+64-(p->look_ang>>1), - y+looking_arc-gun_pos,SHOTGUN+kb_frames[*kb],gs,0,pal); - } - else - { - if (kb_frames[*kb] > 0) - { - x = weapon_xoffset+((kb_ox[kb_frames[(*kb)-11]]>>1)-12); - y = tm-(244-kb_oy[kb_frames[(*kb)-11]]); - } - else - { - x = weapon_xoffset+((kb_ox[kb_frames[*kb]]>>1)-12); - y = tm-(244-kb_oy[kb_frames[*kb]]); - } - switch (*kb) - { - case 23: - y += 60; - break; - case 24: - y += 30; - break; - } - hud_drawpal(x+64-(p->look_ang>>1),y+looking_arc-gun_pos,SHOTGUN+kb_frames[*kb],gs,0,pal); - if(kb_frames[*kb] == 21) - hud_drawpal(x+96-(p->look_ang>>1),y+looking_arc-gun_pos,SHOTGUNSHELLS,gs,0,pal); - } - } - else - { - if ((*kb) < 16) - { - if (p->shotgun_state[0]) - { - if (kb_frames2[*kb] == 3 || kb_frames2[*kb] == 4) - gs = 0; - x = weapon_xoffset+((kb_ox[kb_frames2[*kb]]>>1)-12); - y = tm-(244-kb_oy[kb_frames2[*kb]]); - hud_drawpal(x+64-(p->look_ang>>1), - y+looking_arc-gun_pos,SHOTGUN+kb_frames2[*kb],gs,0,pal); - } - else - { - if (kb_frames3[*kb] == 1 || kb_frames3[*kb] == 2) - gs = 0; - x = weapon_xoffset+((kb_ox[kb_frames3[*kb]]>>1)-12); - y = tm-(244-kb_oy[kb_frames3[*kb]]); - hud_drawpal(x+64-(p->look_ang>>1), - y+looking_arc-gun_pos,SHOTGUN+kb_frames3[*kb],gs,0,pal); - } - } - else if (p->shotgun_state[0]) - { - if (kb_frames2[*kb] > 0) - { - x = weapon_xoffset+((kb_ox[kb_frames2[(*kb)-11]]>>1)-12); - y = tm-(244-kb_oy[kb_frames2[(*kb)-11]]); - } - else - { - x = weapon_xoffset+((kb_ox[kb_frames2[*kb]]>>1)-12); - y = tm-(244-kb_oy[kb_frames2[*kb]]); - } - switch (*kb) - { - case 23: - y += 60; - break; - case 24: - y += 30; - break; - } - hud_drawpal(x+64-(p->look_ang>>1),y+looking_arc-gun_pos,SHOTGUN+kb_frames2[*kb],gs,0,pal); - if(kb_frames2[*kb] == 21) - hud_drawpal(x+96-(p->look_ang>>1),y+looking_arc-gun_pos,SHOTGUNSHELLS,gs,0,pal); - } - } - } - break; + if (sprite[p->i].pal == 1) + pal = 1; + else + pal = sector[p->cursectnum].floorpal; + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- - case CHAINGUN_WEAPON: - if(sprite[p->i].pal == 1) - pal = 1; - else - pal = sector[p->cursectnum].floorpal; + auto displaycrowbar = [&] + { + static const short kb_frames[] = { 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7 }; + static const short kb_ox[] = { 310,342,364,418,350,316,282,288,0,0 }; + static const short kb_oy[] = { 300,362,320,268,248,248,277,420,0,0 }; + short x; + short y; + x = weapon_xoffset + ((kb_ox[kb_frames[*kb]] >> 1) - 12); + y = 200 - (244 - kb_oy[kb_frames[*kb]]); + hud_drawpal(x - (p->look_ang >> 1), looking_arc + y - gun_pos, + KNEE + kb_frames[*kb], gs, 0, pal); + }; - if(*kb > 0) - gun_pos -= sintable[(*kb)<<7]>>12; + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- - if(*kb > 0 && sprite[p->i].pal != 1) weapon_xoffset += 1-(rand()&3); + auto displayslingblade = [&] + { + static const short kb_frames[] = { 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7 }; + static const short kb_ox[] = { 580,676,310,491,356,210,310,614 }; + static const short kb_oy[] = { 369,363,300,323,371,400,300,440 }; + short x, y; + x = weapon_xoffset + ((kb_ox[kb_frames[*kb]] >> 1) - 12); + y = 210 - (244 - kb_oy[kb_frames[*kb]]); + hud_drawpal(x - (p->look_ang >> 1) + 20, looking_arc + y - gun_pos - 80, + SLINGBLADE + kb_frames[*kb], gs, 0, pal); + }; - switch(*kb) - { - case 0: - hud_drawpal(weapon_xoffset+178-(p->look_ang>>1)+30,looking_arc+233-gun_pos+5, - CHAINGUN,gs,o,pal); - break; - default: - gs = 0; - if(*kb < 8) - { - i = rand()&7; - hud_drawpal(weapon_xoffset+178-(p->look_ang>>1)+30,looking_arc+233-gun_pos+5, - CHAINGUN+1,gs,o,pal); - } - else hud_drawpal(weapon_xoffset+178-(p->look_ang>>1)+30,looking_arc+233-gun_pos+5, - CHAINGUN+2,gs,o,pal); - break; - } - break; - case PISTOL_WEAPON: - if(sprite[p->i].pal == 1) - pal = 1; - else - pal = sector[p->cursectnum].floorpal; + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- - if( (*kb) < 22) - { - static const uint8_t kb_frames[] = { 0,0,1,1,2,2,3,3,4,4,6,6,6,6,5,5,4,4,3,3,0,0 }; - static const short kb_ox[] = { 194,190,185,208,215,215,216,216,201,170 }; - static const short kb_oy[] = { 256,249,248,238,228,218,208,256,245,258 }; - short x; - short y; + auto displaybowlingball = [&] + { + weapon_xoffset += 8; + gun_pos -= 10; + if (p->ammo_amount[BOWLING_WEAPON]) + { + hud_drawpal(weapon_xoffset + 162 - (p->look_ang >> 1), + looking_arc + 214 - gun_pos + (*kb << 3), BOWLINGBALLH, gs, o, pal); + } + else + { + rdmyospal(weapon_xoffset + 162 - (p->look_ang >> 1), + looking_arc + 214 - gun_pos, HANDTHROW + 5, gs, o, pal); + } + }; - x = weapon_xoffset+(kb_ox[kb_frames[*kb]]-12); - y = 244-(244-kb_oy[kb_frames[*kb]]); + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- - if (kb_frames[*kb]) - gs = 0; + auto displaypowderkeg = [&] + { + weapon_xoffset += 8; + gun_pos -= 10; + if (p->ammo_amount[POWDERKEG_WEAPON]) + { + rdmyospal(weapon_xoffset + 180 - (p->look_ang >> 1), + looking_arc + 214 - gun_pos + (*kb << 3), POWDERH, gs, o, pal); + rdmyospal(weapon_xoffset + 90 - (p->look_ang >> 1), + looking_arc + 214 - gun_pos + (*kb << 3), POWDERH, gs, o | 4, pal); + } + else + { + rdmyospal(weapon_xoffset + 162 - (p->look_ang >> 1), + looking_arc + 214 - gun_pos, HANDTHROW + 5, gs, o, pal); + } + }; - rdmyospal(x-(p->look_ang>>1), - y+looking_arc-gun_pos,FIRSTGUN+kb_frames[*kb],gs,0,pal); - } - else - { - static const short kb_frames[] = { 0,0,1,1,2,2,2,2,2,2,2,2,2,2,2,1,1,0,0 }; - static const short kb_ox[] = { 244,244,244 }; - static const short kb_oy[] = { 256,249,248 }; - short x; - short dx; - short y; - short dy; + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- - x = weapon_xoffset+(kb_ox[kb_frames[(*kb)-22]]-12); - y = 244-(244-kb_oy[kb_frames[(*kb)-22]]); - switch (*kb) - { - case 28: - dy = 10; - dx = 5; - break; - case 29: - dy = 20; - dx = 10; - break; - case 30: - dy = 30; - dx = 15; - break; - case 31: - dy = 40; - dx = 20; - break; - case 32: - dy = 50; - dx = 25; - break; - case 33: - dy = 40; - dx = 20; - break; - case 34: - dy = 30; - dx = 15; - break; - case 35: - dy = 20; - dx = 10; - break; - case 36: - dy = 10; - dx = 5; - break; - default: - dy = 0; - dx = 0; - break; - } - rdmyospal(x-(p->look_ang>>1)-dx, - y+looking_arc-gun_pos+dy,FIRSTGUNRELOAD+kb_frames[(*kb)-22],gs,0,pal); - } + auto displaycrossbow = [&] + { + if (!(duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING)) pin = RS_ALIGN_R; + static const uint8_t kb_frames[] = { 0,1,1,2,2,3,2,3,2,3,2,2,2,2,2,2,2,2,2,4,4,4,4,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,7 }; + if (kb_frames[*kb] == 2 || kb_frames[*kb] == 3) + { + rdmyospal((weapon_xoffset + 200) - (p->look_ang >> 1), + looking_arc + 250 - gun_pos, RPGGUN + kb_frames[*kb], gs, o | pin, pal); + } + else if (kb_frames[*kb] == 1) + { + rdmyospal((weapon_xoffset + 200) - (p->look_ang >> 1), + looking_arc + 250 - gun_pos, RPGGUN + kb_frames[*kb], 0, o | pin, pal); + } + else + { + rdmyospal((weapon_xoffset + 210) - (p->look_ang >> 1), + looking_arc + 255 - gun_pos, RPGGUN + kb_frames[*kb], gs, o | pin, pal); + } + }; - break; - case DYNAMITE_WEAPON: - { - if(sprite[p->i].pal == 1) - pal = 1; - else - pal = sector[p->cursectnum].floorpal; + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- - gun_pos -= 9*(*kb); + auto displaychicken = [&] + { + if (!(duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING)) pin = RS_ALIGN_R; + if (*kb) + { + static const uint8_t kb_frames[] = { 0,1,1,2,2,3,2,3,2,3,2,2,2,2,2,2,2,2,2,4,4,4,4,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,7 }; + if (kb_frames[*kb] == 2 || kb_frames[*kb] == 3) + { + rdmyospal((weapon_xoffset + 200) - (p->look_ang >> 1), + looking_arc + 250 - gun_pos, RPGGUN2 + kb_frames[*kb], gs, o | pin, pal); + } + else if (kb_frames[*kb] == 1) + { + rdmyospal((weapon_xoffset + 200) - (p->look_ang >> 1), + looking_arc + 250 - gun_pos, RPGGUN2 + kb_frames[*kb], 0, o | pin, pal); + } + else + { + rdmyospal((weapon_xoffset + 210) - (p->look_ang >> 1), + looking_arc + 255 - gun_pos, RPGGUN2 + kb_frames[*kb], gs, o | pin, pal); + } + } + else + { + if (ud.multimode < 2) + { + if (chickenphase) + { + rdmyospal((weapon_xoffset + 210) - (p->look_ang >> 1), + looking_arc + 222 - gun_pos, RPGGUN2 + 7, gs, o | pin, pal); + } + else if ((krand() & 15) == 5) + { + spritesound(327, p->i); + rdmyospal((weapon_xoffset + 210) - (p->look_ang >> 1), + looking_arc + 222 - gun_pos, RPGGUN2 + 7, gs, o | pin, pal); + chickenphase = 6; + } + else + { + rdmyospal((weapon_xoffset + 210) - (p->look_ang >> 1), + looking_arc + 225 - gun_pos, RPGGUN2, gs, o | pin, pal); + } + } + else + { + rdmyospal((weapon_xoffset + 210) - (p->look_ang >> 1), + looking_arc + 225 - gun_pos, RPGGUN2, gs, o | pin, pal); + } + } + }; - rdmyospal(weapon_xoffset+190-(p->look_ang>>1),looking_arc+260-gun_pos,HANDTHROW,gs,o,pal); - } - break; + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- - case HANDREMOTE_WEAPON: - { - int dx; - int x; - int dy; - dx = 25; - x = 100; - dy = 20; - if((*kb) < 20) - { - signed char remote_frames[] = {1,1,1,1,1,2,2,2,2,3,3,3,4,4,4,5,5,5,5,5,6,6,6}; - if(sprite[p->i].pal == 1) - pal = 1; - else - pal = sector[p->cursectnum].floorpal; + auto displayshotgun = [&] + { + weapon_xoffset -= 8; - if (*kb) - { - if ((*kb) < 5) - { - rdmyospal(weapon_xoffset+x+190-(p->look_ang>>1)-dx, - looking_arc+258-gun_pos-64+p->at57e-dy,RRTILE1752,0,o,pal); - } - rdmyospal(weapon_xoffset+x+190-(p->look_ang>>1), - looking_arc+258-gun_pos-dy,HANDTHROW+remote_frames[*kb],gs,o,pal); - } - else - { - if ((*kb) < 5) - { - rdmyospal(weapon_xoffset+x+190-(p->look_ang>>1)-dx, - looking_arc+258-gun_pos-64+p->at57e-dy,RRTILE1752,0,o,pal); - } - rdmyospal(weapon_xoffset+x+190-(p->look_ang>>1), - looking_arc+258-gun_pos-dy,HANDTHROW+1,gs,o,pal); - } - } - } - break; - case TIT_WEAPON: - if(sprite[p->i].pal == 1) - pal = 1; - else - pal = sector[p->cursectnum].floorpal; + if (sprite[p->i].pal == 1) + pal = 1; + else + pal = sector[p->cursectnum].floorpal; - if (*kb) - { - gs = 0; - rd3myospal(150+(weapon_xoffset>>1)-(p->look_ang>>1),266+(looking_arc>>1)-gun_pos,DEVISTATOR,gs,o,pal); - } - else - rd3myospal(150+(weapon_xoffset>>1)-(p->look_ang>>1),266+(looking_arc>>1)-gun_pos,DEVISTATOR+1,gs,o,pal); - break; + { + short x; + short y; + static const short kb_frames3[] = { 0,0,1,1,2,2,5,5,6,6,7,7,8,8,0,0,0,0,0,0,0 }; + static const short kb_frames2[] = { 0,0,3,3,4,4,5,5,6,6,7,7,8,8,0,0,20,20,21,21,21,21,20,20,20,20,0,0 }; + static const short kb_frames[] = { 0,0,1,1,2,2,3,3,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8,8,0,0,20,20,21,21,21,21,20,20,20,20,0,0 }; + static const short kb_ox[] = { 300,300,300,300,300,330,320,310,305,306,302 }; + static const short kb_oy[] = { 315,300,302,305,302,302,303,306,302,404,384 }; + short tm; + tm = 180; + if (p->shotgun_state[1]) + { + if ((*kb) < 26) + { + if (kb_frames[*kb] == 3 || kb_frames[*kb] == 4) + gs = 0; + x = weapon_xoffset + ((kb_ox[kb_frames[*kb]] >> 1) - 12); + y = tm - (244 - kb_oy[kb_frames[*kb]]); + hud_drawpal(x + 64 - (p->look_ang >> 1), + y + looking_arc - gun_pos, SHOTGUN + kb_frames[*kb], gs, 0, pal); + } + else + { + if (kb_frames[*kb] > 0) + { + x = weapon_xoffset + ((kb_ox[kb_frames[(*kb) - 11]] >> 1) - 12); + y = tm - (244 - kb_oy[kb_frames[(*kb) - 11]]); + } + else + { + x = weapon_xoffset + ((kb_ox[kb_frames[*kb]] >> 1) - 12); + y = tm - (244 - kb_oy[kb_frames[*kb]]); + } + switch (*kb) + { + case 23: + y += 60; + break; + case 24: + y += 30; + break; + } + hud_drawpal(x + 64 - (p->look_ang >> 1), y + looking_arc - gun_pos, SHOTGUN + kb_frames[*kb], gs, 0, pal); + if (kb_frames[*kb] == 21) + hud_drawpal(x + 96 - (p->look_ang >> 1), y + looking_arc - gun_pos, SHOTGUNSHELLS, gs, 0, pal); + } + } + else + { + if ((*kb) < 16) + { + if (p->shotgun_state[0]) + { + if (kb_frames2[*kb] == 3 || kb_frames2[*kb] == 4) + gs = 0; + x = weapon_xoffset + ((kb_ox[kb_frames2[*kb]] >> 1) - 12); + y = tm - (244 - kb_oy[kb_frames2[*kb]]); + hud_drawpal(x + 64 - (p->look_ang >> 1), + y + looking_arc - gun_pos, SHOTGUN + kb_frames2[*kb], gs, 0, pal); + } + else + { + if (kb_frames3[*kb] == 1 || kb_frames3[*kb] == 2) + gs = 0; + x = weapon_xoffset + ((kb_ox[kb_frames3[*kb]] >> 1) - 12); + y = tm - (244 - kb_oy[kb_frames3[*kb]]); + hud_drawpal(x + 64 - (p->look_ang >> 1), + y + looking_arc - gun_pos, SHOTGUN + kb_frames3[*kb], gs, 0, pal); + } + } + else if (p->shotgun_state[0]) + { + if (kb_frames2[*kb] > 0) + { + x = weapon_xoffset + ((kb_ox[kb_frames2[(*kb) - 11]] >> 1) - 12); + y = tm - (244 - kb_oy[kb_frames2[(*kb) - 11]]); + } + else + { + x = weapon_xoffset + ((kb_ox[kb_frames2[*kb]] >> 1) - 12); + y = tm - (244 - kb_oy[kb_frames2[*kb]]); + } + switch (*kb) + { + case 23: + y += 60; + break; + case 24: + y += 30; + break; + } + hud_drawpal(x + 64 - (p->look_ang >> 1), y + looking_arc - gun_pos, SHOTGUN + kb_frames2[*kb], gs, 0, pal); + if (kb_frames2[*kb] == 21) + hud_drawpal(x + 96 - (p->look_ang >> 1), y + looking_arc - gun_pos, SHOTGUNSHELLS, gs, 0, pal); + } + } + } + }; - case MOTORCYCLE_WEAPON: - case BOAT_WEAPON: - break; + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- - case ALIENBLASTER_WEAPON: - if(sprite[p->i].pal == 1) - pal = 1; - else - pal = sector[p->cursectnum].floorpal; + auto displayrifle = [&] + { + if (*kb > 0) + gun_pos -= sintable[(*kb) << 7] >> 12; - if((*kb)) - { - char cat_frames[] = { 0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; - rdmyospal(weapon_xoffset+260-(p->look_ang>>1),looking_arc+215-gun_pos,FREEZE+cat_frames[*kb],-32,o,pal); - } - else rdmyospal(weapon_xoffset+260-(p->look_ang>>1),looking_arc+215-gun_pos,FREEZE,gs,o,pal); + if (*kb > 0 && sprite[p->i].pal != 1) weapon_xoffset += 1 - (rand() & 3); - break; + switch (*kb) + { + case 0: + hud_drawpal(weapon_xoffset + 178 - (p->look_ang >> 1) + 30, looking_arc + 233 - gun_pos + 5, + CHAINGUN, gs, o, pal); + break; + default: + gs = 0; + if (*kb < 8) + { + i = rand() & 7; + hud_drawpal(weapon_xoffset + 178 - (p->look_ang >> 1) + 30, looking_arc + 233 - gun_pos + 5, + CHAINGUN + 1, gs, o, pal); + } + else hud_drawpal(weapon_xoffset + 178 - (p->look_ang >> 1) + 30, looking_arc + 233 - gun_pos + 5, + CHAINGUN + 2, gs, o, pal); + break; + } + }; - case THROWSAW_WEAPON: - case BUZZSAW_WEAPON: - weapon_xoffset += 28; - looking_arc += 18; - if(sprite[p->i].pal == 1) - pal = 1; - else - pal = sector[p->cursectnum].floorpal; - if((*kb) == 0) - { - rd2myospal(weapon_xoffset+188-(p->look_ang>>1), - looking_arc+240-gun_pos,SHRINKER,gs,o,pal); - } - else - { - if(sprite[p->i].pal != 1) - { - weapon_xoffset += rand()&3; - gun_pos += (rand()&3); - } + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- - if(cw == BUZZSAW_WEAPON) - { - rd2myospal(weapon_xoffset+184-(p->look_ang>>1), - looking_arc+240-gun_pos,GROWSPARK+((*kb)&2),gs,o,0); - } - else - { - signed char kb_frames[] = { 1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,0,0,0,0,0,0,0,0,0,0 }; - short frm = kb_frames[*kb]; - rd2myospal(weapon_xoffset+184-(p->look_ang>>1), - looking_arc+240-gun_pos,SHRINKER+frm,gs,o,0); - } - } - break; - } + auto displaypistol = [&] + { + if ((*kb) < 22) + { + static const uint8_t kb_frames[] = { 0,0,1,1,2,2,3,3,4,4,6,6,6,6,5,5,4,4,3,3,0,0 }; + static const short kb_ox[] = { 194,190,185,208,215,215,216,216,201,170 }; + static const short kb_oy[] = { 256,249,248,238,228,218,208,256,245,258 }; + short x; + short y; + + x = weapon_xoffset + (kb_ox[kb_frames[*kb]] - 12); + y = 244 - (244 - kb_oy[kb_frames[*kb]]); + + if (kb_frames[*kb]) + gs = 0; + + rdmyospal(x - (p->look_ang >> 1), + y + looking_arc - gun_pos, FIRSTGUN + kb_frames[*kb], gs, 0, pal); + } + else + { + static const short kb_frames[] = { 0,0,1,1,2,2,2,2,2,2,2,2,2,2,2,1,1,0,0 }; + static const short kb_ox[] = { 244,244,244 }; + static const short kb_oy[] = { 256,249,248 }; + short x; + short dx; + short y; + short dy; + + x = weapon_xoffset + (kb_ox[kb_frames[(*kb) - 22]] - 12); + y = 244 - (244 - kb_oy[kb_frames[(*kb) - 22]]); + switch (*kb) + { + case 28: + dy = 10; + dx = 5; + break; + case 29: + dy = 20; + dx = 10; + break; + case 30: + dy = 30; + dx = 15; + break; + case 31: + dy = 40; + dx = 20; + break; + case 32: + dy = 50; + dx = 25; + break; + case 33: + dy = 40; + dx = 20; + break; + case 34: + dy = 30; + dx = 15; + break; + case 35: + dy = 20; + dx = 10; + break; + case 36: + dy = 10; + dx = 5; + break; + default: + dy = 0; + dx = 0; + break; + } + rdmyospal(x - (p->look_ang >> 1) - dx, + y + looking_arc - gun_pos + dy, FIRSTGUNRELOAD + kb_frames[(*kb) - 22], gs, 0, pal); + } + }; + + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- + + auto displaydynamite = [&] + { + gun_pos -= 9 * (*kb); + + rdmyospal(weapon_xoffset + 190 - (p->look_ang >> 1), looking_arc + 260 - gun_pos, HANDTHROW, gs, o, pal); + }; + + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- + + auto displaythrowingdynamite = [&] + { + int dx; + int x; + int dy; + dx = 25; + x = 100; + dy = 20; + if ((*kb) < 20) + { + if (!(duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING)) pin = RS_ALIGN_R; + static const int8_t remote_frames[] = { 1,1,1,1,1,2,2,2,2,3,3,3,4,4,4,5,5,5,5,5,6,6,6 }; + + if (*kb) + { + if ((*kb) < 5) + { + rdmyospal(weapon_xoffset + x + 190 - (p->look_ang >> 1) - dx, + looking_arc + 258 - gun_pos - 64 + p->at57e - dy, RRTILE1752, 0, o | pin, pal); + } + rdmyospal(weapon_xoffset + x + 190 - (p->look_ang >> 1), + looking_arc + 258 - gun_pos - dy, HANDTHROW + remote_frames[*kb], gs, o | pin, pal); + } + else + { + if ((*kb) < 5) + { + rdmyospal(weapon_xoffset + x + 190 - (p->look_ang >> 1) - dx, + looking_arc + 258 - gun_pos - 64 + p->at57e - dy, RRTILE1752, 0, o | pin, pal); + } + rdmyospal(weapon_xoffset + x + 190 - (p->look_ang >> 1), + looking_arc + 258 - gun_pos - dy, HANDTHROW + 1, gs, o | pin, pal); + } + } + }; + + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- + + auto displaytits = [&] + { + if (*kb) + { + gs = 0; + rd3myospal(150 + (weapon_xoffset >> 1) - (p->look_ang >> 1), 266 + (looking_arc >> 1) - gun_pos, DEVISTATOR, gs, o, pal); + } + else + rd3myospal(150 + (weapon_xoffset >> 1) - (p->look_ang >> 1), 266 + (looking_arc >> 1) - gun_pos, DEVISTATOR + 1, gs, o, pal); + }; + + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- + + auto displayblaster = [&] + { + if (!(duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING)) pin = RS_ALIGN_R; + if ((*kb)) + { + char cat_frames[] = { 0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; + rdmyospal(weapon_xoffset + 260 - (p->look_ang >> 1), looking_arc + 215 - gun_pos, FREEZE + cat_frames[*kb], -32, o | pin, pal); + } + else rdmyospal(weapon_xoffset + 260 - (p->look_ang >> 1), looking_arc + 215 - gun_pos, FREEZE, gs, o | pin, pal); + }; + + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- + + auto displaysaw = [&] + { + weapon_xoffset += 28; + looking_arc += 18; + if ((*kb) == 0) + { + rd2myospal(weapon_xoffset + 188 - (p->look_ang >> 1), + looking_arc + 240 - gun_pos, SHRINKER, gs, o, pal); + } + else + { + if (sprite[p->i].pal != 1) + { + weapon_xoffset += rand() & 3; + gun_pos += (rand() & 3); + } + + if (cw == BUZZSAW_WEAPON) + { + rd2myospal(weapon_xoffset + 184 - (p->look_ang >> 1), + looking_arc + 240 - gun_pos, GROWSPARK + ((*kb) & 2), gs, o, 0); + } + else + { + signed char kb_frames[] = { 1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,0,0,0,0,0,0,0,0,0,0 }; + short frm = kb_frames[*kb]; + rd2myospal(weapon_xoffset + 184 - (p->look_ang >> 1), + looking_arc + 240 - gun_pos, SHRINKER + frm, gs, o, 0); + } + } + }; + + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- + + switch (cw) + { + case KNEE_WEAPON: + displaycrowbar(); + break; + + case SLINGBLADE_WEAPON: + displayslingblade(); + break; + + case POWDERKEG_WEAPON: + displaypowderkeg(); + break; + + case BOWLING_WEAPON: + displaybowlingball(); + break; + + case CROSSBOW_WEAPON: + displaycrossbow(); + break; + + case CHICKEN_WEAPON: + displaychicken(); + break; + + case SHOTGUN_WEAPON: + displayshotgun(); + break; + + case RIFLEGUN_WEAPON: + displayrifle(); + break; + + case PISTOL_WEAPON: + displaypistol(); + break; + + case DYNAMITE_WEAPON: + displaydynamite(); + break; + + case THROWINGDYNAMITE_WEAPON: + displaythrowingdynamite(); + break; + + case TIT_WEAPON: + displaytits(); + break; + + case MOTORCYCLE_WEAPON: + case BOAT_WEAPON: + break; + + case ALIENBLASTER_WEAPON: + displayblaster(); + break; + + case THROWSAW_WEAPON: + case BUZZSAW_WEAPON: + displaysaw(); + break; + } + } } END_DUKE_NS \ No newline at end of file diff --git a/source/games/duke/src/inv.h b/source/games/duke/src/inv.h index 3a12d4f52..ffecd3ab6 100644 --- a/source/games/duke/src/inv.h +++ b/source/games/duke/src/inv.h @@ -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 diff --git a/source/games/duke/src/namesdyn.h b/source/games/duke/src/namesdyn.h index 6709bc302..e07f7f586 100644 --- a/source/games/duke/src/namesdyn.h +++ b/source/games/duke/src/namesdyn.h @@ -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, diff --git a/source/games/duke/src/player.h b/source/games/duke/src/player.h index 8731251da..2512ce39b 100644 --- a/source/games/duke/src/player.h +++ b/source/games/duke/src/player.h @@ -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); diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index d5f448e9b..0f27b3265 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -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; } diff --git a/source/games/duke/src/zz_player.cpp b/source/games/duke/src/zz_player.cpp index 0802da8ee..0739369fd 100644 --- a/source/games/duke/src/zz_player.cpp +++ b/source/games/duke/src/zz_player.cpp @@ -44,12 +44,6 @@ int32_t g_numObituaries = 0; int32_t g_numSelfObituaries = 0; -int const icon_to_inv[ICON_MAX] = { GET_FIRSTAID, GET_FIRSTAID, GET_STEROIDS, GET_HOLODUKE, - GET_JETPACK, GET_HEATS, GET_SCUBA, GET_BOOTS }; - -int const inv_to_icon[GET_MAX] = { ICON_STEROIDS, ICON_NONE, ICON_SCUBA, ICON_HOLODUKE, ICON_JETPACK, ICON_NONE, - ICON_NONE, ICON_HEATS, ICON_NONE, ICON_FIRSTAID, ICON_BOOTS }; - void P_AddKills(DukePlayer_t * const pPlayer, uint16_t kills) { pPlayer->actors_killed += kills; @@ -81,257 +75,16 @@ void P_UpdateScreenPal(DukePlayer_t * const pPlayer) } -//////////////////// HUD WEAPON / MISC. DISPLAY CODE //////////////////// - -static void P_DisplaySpit(void) -{ - DukePlayer_t *const pPlayer = g_player[screenpeek].ps; - int const loogCounter = pPlayer->loogcnt; - - if (loogCounter == 0) - return; - - int const rotY = loogCounter<<2; - - for (bssize_t i=0; i < pPlayer->numloogs; i++) - { - int const rotAng = klabs(sintable[((loogCounter + i) << 5) & 2047]) >> 5; - int const rotZoom = 4096 + ((loogCounter + i) << 9); - int const rotX = (-fix16_to_int(g_player[screenpeek].input->q16avel) >> 1) + (sintable[((loogCounter + i) << 6) & 2047] >> 10); - - rotatesprite_fs((pPlayer->loogiex[i] + rotX) << 16, (200 + pPlayer->loogiey[i] - rotY) << 16, rotZoom - (i << 8), - 256 - rotAng, TILE_LOOGIE, 0, 0, 2); - } -} - -int P_GetHudPal(const DukePlayer_t *p) -{ - if (sprite[p->i].pal == 1) - return 1; - - if (p->cursectnum >= 0) - { - int const hudPal = sector[p->cursectnum].floorpal; - if (!lookups.noFloorPal(hudPal)) - return hudPal; - } - - return 0; -} - -int P_GetKneePal(DukePlayer_t const * pPlayer) -{ - return P_GetKneePal(pPlayer, P_GetHudPal(pPlayer)); -} - -int P_GetKneePal(DukePlayer_t const * pPlayer, int const hudPal) -{ - return hudPal == 0 ? pPlayer->palookup : hudPal; -} - int P_GetOverheadPal(DukePlayer_t const * pPlayer) { return sprite[pPlayer->i].pal; } -static int P_DisplayFist(int const fistShade) -{ - DukePlayer_t const *const pPlayer = g_player[screenpeek].ps; - int fistInc = pPlayer->fist_incs; - - if (fistInc > 32) - fistInc = 32; - - if (fistInc <= 0) - return 0; - - int const fistY = klabs(pPlayer->look_ang) / 9; - int const fistZoom = clamp(65536 - (sintable[(512 + (fistInc << 6)) & 2047] << 2), 40920, 90612); - int const fistYOffset = 194 + (sintable[((6 + fistInc) << 7) & 2047] >> 9); - int const fistPal = P_GetHudPal(pPlayer); - int wx[2] = { windowxy1.x, windowxy2.x }; - -#ifdef SPLITSCREEN_MOD_HACKS - // XXX: this is outdated, doesn't handle above/below split. - if (g_fakeMultiMode==2) - wx[(g_snum==0)] = (wx[0]+wx[1])/2+1; -#endif - - rotatesprite((-fistInc + 222 + (fix16_to_int(g_player[screenpeek].input->q16avel) >> 5)) << 16, (fistY + fistYOffset) << 16, - fistZoom, 0, TILE_FIST, fistShade, fistPal, 2, wx[0], windowxy1.y, wx[1], windowxy2.y); - - return 1; -} - #define DRAWEAP_CENTER 262144 #define weapsc(sc) scale(sc, hud_weaponscale, 100) static int32_t g_dts_yadd; -static void G_DrawTileScaled(int drawX, int drawY, int tileNum, int drawShade, int drawBits, int drawPal, - int drawScale = 65536, int angleOffset = 0) -{ - int32_t wx[2] = { windowxy1.x, windowxy2.x }; - int32_t wy[2] = { windowxy1.y, windowxy2.y }; - - int drawYOffset = 0; - int drawXOffset = 192<<16; - - switch (DYNAMICWEAPONMAP(hudweap.cur)) - { - case DEVISTATOR_WEAPON__STATIC: - case TRIPBOMB_WEAPON__STATIC: - drawXOffset = 160<<16; - break; - default: - if (drawBits & DRAWEAP_CENTER) - { - drawXOffset = 160<<16; - drawBits &= ~DRAWEAP_CENTER; - } - break; - } - - // bit 4 means "flip x" for G_DrawTileScaled - int const drawAng = ((drawBits & 4) ? 1024 : 0) + angleOffset; - -#ifdef SPLITSCREEN_MOD_HACKS - if (g_fakeMultiMode==2) - { - int const sideBySide = (ud.screen_size!=0); - - // splitscreen HACK - drawBits &= ~(1024|512|256); - if (sideBySide) - { - drawBits &= ~8; - wx[(g_snum==0)] = (wx[0]+wx[1])/2 + 2; - } - else - { - drawBits |= 8; - if (g_snum==0) - drawYOffset = -(100<<16); - wy[(g_snum==0)] = (wy[0]+wy[1])/2 + 2; - } - } -#endif - -#ifdef USE_OPENGL - if (videoGetRenderMode() >= REND_POLYMOST && hw_models && md_tilehasmodel(tileNum,drawPal) >= 0) - drawYOffset += (224<<16)-weapsc(224<<16); -#endif - rotatesprite(weapsc(drawX<<16) + (drawXOffset-weapsc(drawXOffset)), - weapsc((drawY<<16) + g_dts_yadd) + ((200<<16)-weapsc(200<<16)) + drawYOffset, - weapsc(drawScale),drawAng,tileNum,drawShade,drawPal,(2|drawBits), - wx[0],wy[0], wx[1],wy[1]); -} - -static void G_DrawWeaponTile(int weaponX, int weaponY, int weaponTile, int weaponShade, int weaponBits, int weaponPal, int weaponScale = 65536) -{ - static int shadef = 0; - static int palf = 0; - - // basic fading between player weapon shades - if (shadef != weaponShade && (!weaponPal || palf == weaponPal)) - { - shadef += (weaponShade - shadef) >> 2; - - if (!((weaponShade - shadef) >> 2)) - shadef = logapproach(shadef, weaponShade); - } - else - shadef = weaponShade; - - palf = weaponPal; - -#ifdef USE_OPENGL - if (videoGetRenderMode() >= REND_POLYMOST) - { - if (!RR && weaponTile >= TILE_CHAINGUN + 1 && weaponTile <= TILE_CHAINGUN + 4) - { - if (!hw_models || md_tilehasmodel(weaponTile, weaponPal) < 0) - { - // HACK: Draw the upper part of the chaingun two screen - // pixels (not texels; multiplied by weapon scale) lower - // first, preventing ugly horizontal seam. - g_dts_yadd = tabledivide32_noinline(65536 * 2 * 200, ydim); - G_DrawTileScaled(weaponX, weaponY, weaponTile, shadef, weaponBits, weaponPal); - g_dts_yadd = 0; - } - } - } -#endif - - G_DrawTileScaled(weaponX, weaponY, weaponTile, shadef, weaponBits, weaponPal, weaponScale); -} - -static inline void G_DrawWeaponTileWithID(int uniqueID, int weaponX, int weaponY, int weaponTile, int weaponShade, - int weaponBits, int p, int weaponScale = 65536) -{ - int lastUniqueID = guniqhudid; - guniqhudid = uniqueID; - - G_DrawWeaponTile(weaponX, weaponY, weaponTile, weaponShade, weaponBits, p, weaponScale); - - guniqhudid = lastUniqueID; -} - -static inline void G_DrawWeaponTileUnfadedWithID(int uniqueID, int weaponX, int weaponY, int weaponTile, int weaponShade, - int weaponBits, int p) -{ - int lastUniqueID = guniqhudid; - guniqhudid = uniqueID; - - G_DrawTileScaled(weaponX, weaponY, weaponTile, weaponShade, weaponBits, p); // skip G_DrawWeaponTile - - guniqhudid = lastUniqueID; -} - -static int P_DisplayKnee(int kneeShade) -{ - static int8_t const knee_y[] = { 0, -8, -16, -32, -64, -84, -108, -108, -108, -72, -32, -8 }; - const DukePlayer_t *const ps = g_player[screenpeek].ps; - - if (ps->knee_incs == 0) - return 0; - - if (ps->knee_incs >= ARRAY_SIZE(knee_y) || sprite[ps->i].extra <= 0) - return 0; - - int const kneeY = knee_y[ps->knee_incs] + (klabs(ps->look_ang) / 9) - (ps->hard_landing << 3); - int const kneePal = P_GetKneePal(ps); - - G_DrawTileScaled(105+(fix16_to_int(g_player[screenpeek].input->q16avel)>>5)-(ps->look_ang>>1)+(knee_y[ps->knee_incs]>>2), - kneeY+280-(fix16_to_int(ps->q16horiz-ps->q16horizoff)>>4),TILE_KNEE,kneeShade,4+DRAWEAP_CENTER,kneePal); - - return 1; -} - -static int P_DisplayKnuckles(int knuckleShade) -{ - if (WW2GI) - return 0; - const DukePlayer_t *const pPlayer = g_player[screenpeek].ps; - - if (pPlayer->knuckle_incs == 0) - return 0; - - static int8_t const knuckleFrames[] = { 0, 1, 2, 2, 3, 3, 3, 2, 2, 1, 0 }; - - if ((unsigned) (pPlayer->knuckle_incs>>1) >= ARRAY_SIZE(knuckleFrames) || sprite[pPlayer->i].extra <= 0) - return 0; - - int const knuckleY = (klabs(pPlayer->look_ang) / 9) - (pPlayer->hard_landing << 3); - int const knucklePal = P_GetHudPal(pPlayer); - - G_DrawTileScaled(160 + (fix16_to_int(g_player[screenpeek].input->q16avel) >> 5) - (pPlayer->look_ang >> 1), - knuckleY + 180 - (fix16_to_int(pPlayer->q16horiz - pPlayer->q16horizoff) >> 4), - TILE_CRACKKNUCKLES + knuckleFrames[pPlayer->knuckle_incs >> 1], knuckleShade, 4 + DRAWEAP_CENTER, - knucklePal); - - return 1; -} // Set C-CON's WEAPON and WORKSLIKE gamevars. void P_SetWeaponGamevars(int playerNum, const DukePlayer_t * const pPlayer) @@ -344,1484 +97,6 @@ void P_SetWeaponGamevars(int playerNum, const DukePlayer_t * const pPlayer) pPlayer->i, playerNum); } -static void P_FireWeapon(int playerNum) -{ - auto const pPlayer = g_player[playerNum].ps; - - if (PWEAPON(playerNum, pPlayer->curr_weapon, WorksLike) != KNEE_WEAPON) - pPlayer->ammo_amount[pPlayer->curr_weapon]--; - - if (PWEAPON(playerNum, pPlayer->curr_weapon, FireSound) > 0) - A_PlaySound(PWEAPON(playerNum, pPlayer->curr_weapon, FireSound), pPlayer->i); - - P_SetWeaponGamevars(playerNum, pPlayer); - // Printf("doing %d %d %d\n",PWEAPON(snum, p->curr_weapon, Shoots),p->curr_weapon,snum); - fi.shoot(pPlayer->i, PWEAPON(playerNum, pPlayer->curr_weapon, Shoots)); - - for (bssize_t burstFire = PWEAPON(playerNum, pPlayer->curr_weapon, ShotsPerBurst) - 1; burstFire > 0; --burstFire) - { - fi.shoot(pPlayer->i, PWEAPON(playerNum, pPlayer->curr_weapon, Shoots)); - - if (PWEAPON(playerNum, pPlayer->curr_weapon, Flags) & WEAPON_AMMOPERSHOT) - { - pPlayer->ammo_amount[pPlayer->curr_weapon]--; - } - } - - if (!(PWEAPON(playerNum, pPlayer->curr_weapon, Flags) & WEAPON_NOVISIBLE)) - { -#ifdef POLYMER - spritetype *s = &sprite[pPlayer->i]; - int32_t x = ((sintable[(s->ang + 512) & 2047]) >> 7), y = ((sintable[(s->ang) & 2047]) >> 7); - - s->x += x; - s->y += y; - G_AddGameLight(0, pPlayer->i, PHEIGHT, 8192, PWEAPON(playerNum, pPlayer->curr_weapon, FlashColor), - PR_LIGHT_PRIO_MAX_GAME); - actor[pPlayer->i].lightcount = 2; - s->x -= x; - s->y -= y; -#endif // POLYMER - pPlayer->visibility = 0; - } - - if (/*!(PWEAPON(playerNum, p->curr_weapon, Flags) & WEAPON_CHECKATRELOAD) && */ - PWEAPON(playerNum, pPlayer->curr_weapon, Reload) > PWEAPON(playerNum, pPlayer->curr_weapon, TotalTime) && pPlayer->ammo_amount[pPlayer->curr_weapon] > 0 - && (PWEAPON(playerNum, pPlayer->curr_weapon, Clip)) && (((pPlayer->ammo_amount[pPlayer->curr_weapon]%(PWEAPON(playerNum, pPlayer->curr_weapon, Clip)))==0))) - { - pPlayer->kickback_pic = PWEAPON(playerNum, pPlayer->curr_weapon, TotalTime); - } - - if (PWEAPON(playerNum, pPlayer->curr_weapon, WorksLike) != KNEE_WEAPON) - P_CheckWeapon(pPlayer); -} - -static void P_DoWeaponSpawn(int playerNum) -{ - auto const pPlayer = g_player[playerNum].ps; - - // NOTE: For the 'Spawn' member, 0 means 'none', too (originally so, - // i.e. legacy). The check for <0 was added to the check because mod - // authors (rightly) assumed that -1 is the no-op value. - if (PWEAPON(playerNum, pPlayer->curr_weapon, Spawn) <= 0) // <=0 : AMC TC beta/RC2 has WEAPONx_SPAWN -1 - return; - - int newSprite = fi.spawn(pPlayer->i, PWEAPON(playerNum, pPlayer->curr_weapon, Spawn)); - - if ((PWEAPON(playerNum, pPlayer->curr_weapon, Flags) & WEAPON_SPAWNTYPE2)) - { - // like shotgun shells - sprite[newSprite].ang += 1024; - A_SetSprite(newSprite,CLIPMASK0); - sprite[newSprite].ang += 1024; - } - else if ((PWEAPON(playerNum, pPlayer->curr_weapon, Flags) & WEAPON_SPAWNTYPE3)) - { - // like chaingun shells - sprite[newSprite].ang += 1024; - sprite[newSprite].ang &= 2047; - sprite[newSprite].xvel += 32; - sprite[newSprite].z += (3<<8); - A_SetSprite(newSprite,CLIPMASK0); - } -} - -void P_DisplayScuba(void) -{ - if (g_player[screenpeek].ps->scuba_on) - { - const DukePlayer_t *const pPlayer = g_player[screenpeek].ps; - - int const scubaPal = P_GetHudPal(pPlayer); - -#ifdef SPLITSCREEN_MOD_HACKS - g_snum = screenpeek; -#endif - - if (RR) - { - - if (!(duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING)) - { - G_DrawTileScaled(320 - (tilesiz[TILE_SCUBAMASK].x >> 1) - 15, 200 - (tilesiz[TILE_SCUBAMASK].y >> 1) + (sintable[(int32_t) totalclock & 2047] >> 10), - TILE_SCUBAMASK, 0, 2 + 16 + DRAWEAP_CENTER+512, scubaPal,49152); - G_DrawTileScaled(320 - tilesiz[TILE_SCUBAMASK+4].x, 200 - tilesiz[TILE_SCUBAMASK+4].y, TILE_SCUBAMASK+4, 0, 2 + 16 + DRAWEAP_CENTER + 1024, scubaPal); - G_DrawTileScaled(tilesiz[TILE_SCUBAMASK+4].x, 200 - tilesiz[TILE_SCUBAMASK+4].y, TILE_SCUBAMASK+4, 0, 2 + 4 + 16 + DRAWEAP_CENTER + 1024, scubaPal); - //G_DrawTileScaled(35, -1, TILE_SCUBAMASK+3, 0, 2 + 16 + DRAWEAP_CENTER+512, scubaPal); - //G_DrawTileScaled(35, -1, TILE_SCUBAMASK+3, 0, 2 + 16 + DRAWEAP_CENTER+256, scubaPal); - //G_DrawTileScaled(285, 200, TILE_SCUBAMASK+3, 0, 2 + 16 + DRAWEAP_CENTER+512, scubaPal,65536,1024); - //G_DrawTileScaled(285, 200, TILE_SCUBAMASK+3, 0, 2 + 16 + DRAWEAP_CENTER+256, scubaPal,65536,1024); - G_DrawTileScaled(35, -1, TILE_SCUBAMASK+3, 0, 2 + 16 + DRAWEAP_CENTER+1024, scubaPal); - G_DrawTileScaled(285, 200, TILE_SCUBAMASK+3, 0, 2 + 16 + DRAWEAP_CENTER+1024, scubaPal,65536,1024); - } - else - { - G_DrawTileScaled(320 - (tilesiz[TILE_SCUBAMASK].x >> 1) - 15, 200 - (tilesiz[TILE_SCUBAMASK].y >> 1) + (sintable[(int32_t) totalclock & 2047] >> 10), - TILE_SCUBAMASK, 0, 2 + 16 + DRAWEAP_CENTER, scubaPal,49152); - G_DrawTileScaled(320 - tilesiz[TILE_SCUBAMASK+4].x, 200 - tilesiz[TILE_SCUBAMASK+4].y, TILE_SCUBAMASK+4, 0, 2 + 16 + DRAWEAP_CENTER, scubaPal); - G_DrawTileScaled(tilesiz[TILE_SCUBAMASK+4].x, 200 - tilesiz[TILE_SCUBAMASK+4].y, TILE_SCUBAMASK+4, 0, 2 + 4 + 16 + DRAWEAP_CENTER, scubaPal); - G_DrawTileScaled(35, -1, TILE_SCUBAMASK+3, 0, 2 + 16 + DRAWEAP_CENTER, scubaPal); - G_DrawTileScaled(285, 200, TILE_SCUBAMASK+3, 0, 2 + 16 + DRAWEAP_CENTER, scubaPal,65536,1024); - } - } - else - { - // this is a hack to hide the seam that appears between the two halves of the mask in GL -#ifdef USE_OPENGL - if (videoGetRenderMode() >= REND_POLYMOST) - G_DrawTileScaled(44, (200 - tilesiz[TILE_SCUBAMASK].y), TILE_SCUBAMASK, 0, 2 + 16 + DRAWEAP_CENTER, scubaPal); -#endif - G_DrawTileScaled(43, (200 - tilesiz[TILE_SCUBAMASK].y), TILE_SCUBAMASK, 0, 2 + 16 + DRAWEAP_CENTER, scubaPal); - G_DrawTileScaled(320 - 43, (200 - tilesiz[TILE_SCUBAMASK].y), TILE_SCUBAMASK, 0, 2 + 4 + 16 + DRAWEAP_CENTER, scubaPal); - } - } -} - -static int8_t const access_tip_y [] = { - 0, -8, -16, -32, -64, -84, -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, -96, -72, -64, -32, -16 -}; - -static int P_DisplayTip(int tipShade) -{ - const DukePlayer_t *const pPlayer = g_player[screenpeek].ps; - - if (pPlayer->tipincs == 0) - return 0; - - // Report that the tipping hand has been drawn so that the otherwise - // selected weapon is not drawn. - if ((unsigned)pPlayer->tipincs >= ARRAY_SIZE(access_tip_y)) - return 1; - - int const tipY = (klabs(pPlayer->look_ang) / 9) - (pPlayer->hard_landing << 3); - int const tipPal = P_GetHudPal(pPlayer); - int const tipYOffset = access_tip_y[pPlayer->tipincs] >> 1; - - guniqhudid = 201; - - G_DrawTileScaled(170 + (fix16_to_int(g_player[screenpeek].input->q16avel) >> 5) - (pPlayer->look_ang >> 1), - tipYOffset + tipY + 240 - (fix16_to_int(pPlayer->q16horiz - pPlayer->q16horizoff) >> 4), - TILE_TIP + ((26 - pPlayer->tipincs) >> 4), tipShade, DRAWEAP_CENTER, tipPal); - - guniqhudid = 0; - - return 1; -} - -static int P_DisplayAccess(int accessShade) -{ - const DukePlayer_t *const pSprite = g_player[screenpeek].ps; - - if (pSprite->access_incs == 0) - return 0; - - if ((unsigned)pSprite->access_incs >= ARRAY_SIZE(access_tip_y)-4 || sprite[pSprite->i].extra <= 0) - return 1; - - int const accessX = access_tip_y[pSprite->access_incs] >> 2; - int const accessY = access_tip_y[pSprite->access_incs] + (klabs(pSprite->look_ang) / 9) - (pSprite->hard_landing << 3); - int const accessPal = (pSprite->access_spritenum >= 0) ? sprite[pSprite->access_spritenum].pal : 0; - - guniqhudid = 200; - - if ((pSprite->access_incs - 3) > 0 && (pSprite->access_incs - 3) >> 3) - { - G_DrawTileScaled(170 + (fix16_to_int(g_player[screenpeek].input->q16avel) >> 5) - (pSprite->look_ang >> 1) + accessX, - accessY + 266 - (fix16_to_int(pSprite->q16horiz - pSprite->q16horizoff) >> 4), - TILE_HANDHOLDINGLASER + (pSprite->access_incs >> 3), accessShade, DRAWEAP_CENTER, accessPal); - } - else - { - G_DrawTileScaled(170 + (fix16_to_int(g_player[screenpeek].input->q16avel) >> 5) - (pSprite->look_ang >> 1) + accessX, - accessY + 266 - (fix16_to_int(pSprite->q16horiz - pSprite->q16horizoff) >> 4), TILE_HANDHOLDINGACCESS, accessShade, - 4 + DRAWEAP_CENTER, accessPal); - } - - guniqhudid = 0; - - return 1; -} - -void P_DisplayWeapon(void) -{ - DukePlayer_t *const pPlayer = g_player[screenpeek].ps; - const uint8_t *const weaponFrame = &pPlayer->kickback_pic; - - int currentWeapon, quickKickFrame; - -#ifdef SPLITSCREEN_MOD_HACKS - g_snum = screenpeek; -#endif - - - if (pPlayer->newowner >= 0 || ud.camerasprite >= 0 || (!RR && pPlayer->over_shoulder_on > 0) - || (sprite[pPlayer->i].pal != 1 && sprite[pPlayer->i].extra <= 0)) - return; - - int weaponX = (160) - 90; - int weaponY = klabs(pPlayer->look_ang) / 9; - int weaponYOffset = 80 - (pPlayer->weapon_pos * pPlayer->weapon_pos); - int weaponShade = (RR && pPlayer->cursectnum >= 0 && shadedsector[pPlayer->cursectnum]) ? 16 : (sprite[pPlayer->i].shade <= 24 ? sprite[pPlayer->i].shade : 24); - - int32_t weaponBits = 0; - UNREFERENCED_PARAMETER(weaponBits); - - if (!RR && (P_DisplayFist(weaponShade) || P_DisplayKnuckles(weaponShade) || P_DisplayTip(weaponShade) || P_DisplayAccess(weaponShade))) - goto enddisplayweapon; - - if (!RR) - P_DisplayKnee(weaponShade); - - if (cl_weaponsway) - { - weaponX -= (sintable[((pPlayer->weapon_sway>>1)+512)&2047]/(1024+512)); - weaponYOffset -= (sprite[pPlayer->i].xrepeat < (RR ? 8 : 32)) ? klabs(sintable[(pPlayer->weapon_sway << 2) & 2047] >> 9) - : klabs(sintable[(pPlayer->weapon_sway >> 1) & 2047] >> 10); - } - else weaponYOffset -= 16; - - weaponX -= 58 + pPlayer->weapon_ang; - weaponYOffset -= (pPlayer->hard_landing << 3); - - if (WW2GI) - currentWeapon = PWEAPON(screenpeek, (pPlayer->last_weapon >= 0) ? pPlayer->last_weapon : pPlayer->curr_weapon, WorksLike); - else - currentWeapon = (pPlayer->last_weapon >= 0) ? pPlayer->last_weapon : pPlayer->curr_weapon; - hudweap.gunposy = weaponYOffset; - hudweap.lookhoriz = weaponY; - hudweap.cur = currentWeapon; - hudweap.gunposx = weaponX; - hudweap.shade = weaponShade; - hudweap.count = *weaponFrame; - hudweap.lookhalfang = pPlayer->look_ang >> 1; - - quickKickFrame = 14 - pPlayer->quick_kick; - - if (!RR && (quickKickFrame != 14 || pPlayer->last_quick_kick) && r_drawweapon == 1) - { - int const weaponPal = P_GetKneePal(pPlayer); - - guniqhudid = 100; - - if (quickKickFrame < 6 || quickKickFrame > 12) - G_DrawTileScaled(weaponX + 80 - (pPlayer->look_ang >> 1), weaponY + 250 - weaponYOffset, TILE_KNEE, weaponShade, - weaponBits | 4 | DRAWEAP_CENTER, weaponPal); - else - G_DrawTileScaled(weaponX + 160 - 16 - (pPlayer->look_ang >> 1), weaponY + 214 - weaponYOffset, TILE_KNEE + 1, - weaponShade, weaponBits | 4 | DRAWEAP_CENTER, weaponPal); - guniqhudid = 0; - } - - if (RRRA) - { - if (pPlayer->OnMotorcycle) - { - int motoTile = TILE_MOTOHIT; - if (!g_netServer && numplayers == 1) - { - if (*weaponFrame) - { - weaponShade = 0; - if (*weaponFrame == 1) - { - if ((krand2()&1) == 1) - motoTile = TILE_MOTOHIT+1; - else - motoTile = TILE_MOTOHIT+2; - } - else if (*weaponFrame == 4) - { - if ((krand2()&1) == 1) - motoTile = TILE_MOTOHIT+3; - else - motoTile = TILE_MOTOHIT+4; - } - } - } - else - { - if (*weaponFrame) - { - weaponShade = 0; - if (*weaponFrame >= 1 && *weaponFrame <= 4) - motoTile += *weaponFrame; - } - } - - int const weaponPal = P_GetHudPal(pPlayer); - - G_DrawTileScaled(160-(pPlayer->look_ang>>1), 174, motoTile, weaponShade, 2 | DRAWEAP_CENTER, - weaponPal, 34816, pPlayer->TiltStatus * 5 + (pPlayer->TiltStatus < 0 ? 2047 : 0)); - return; - } - if (pPlayer->OnBoat) - { - int boatTile; - if (pPlayer->TiltStatus > 0) - { - if (*weaponFrame == 0) - boatTile = TILE_BOATHIT+1; - else if (*weaponFrame <= 3) - { - boatTile = TILE_BOATHIT+5; - weaponShade = -96; - } - else if (*weaponFrame <= 6) - { - boatTile = TILE_BOATHIT+6; - weaponShade = -96; - } - else - boatTile = TILE_BOATHIT+1; - } - else if (pPlayer->TiltStatus < 0) - { - if (*weaponFrame == 0) - boatTile = TILE_BOATHIT+2; - else if (*weaponFrame <= 3) - { - boatTile = TILE_BOATHIT+7; - weaponShade = -96; - } - else if (*weaponFrame <= 6) - { - boatTile = TILE_BOATHIT+8; - weaponShade = -96; - } - else - boatTile = TILE_BOATHIT+2; - } - else - { - if (*weaponFrame == 0) - boatTile = TILE_BOATHIT; - else if (*weaponFrame <= 3) - { - boatTile = TILE_BOATHIT+3; - weaponShade = -96; - } - else if (*weaponFrame <= 6) - { - boatTile = TILE_BOATHIT+4; - weaponShade = -96; - } - else - boatTile = TILE_BOATHIT; - } - - int const weaponPal = P_GetHudPal(pPlayer); - int weaponY; - - if (pPlayer->NotOnWater) - weaponY = 170; - else - weaponY = 170 + (*weaponFrame>>2); - - G_DrawTileScaled(160-(pPlayer->look_ang>>1), weaponY, boatTile, weaponShade, 2 | DRAWEAP_CENTER, - weaponPal, 66048, pPlayer->TiltStatus + (pPlayer->TiltStatus < 0 ? 2047 : 0)); - return; - } - } - - if (sprite[pPlayer->i].xrepeat < (RR ? 8 : 40)) - { - static int32_t fistPos; - - int const weaponPal = P_GetHudPal(pPlayer); - - if (pPlayer->jetpack_on == 0) - { - int const playerXvel = sprite[pPlayer->i].xvel; - weaponY += 32 - (playerXvel >> 3); - fistPos += playerXvel >> 3; - } - - currentWeapon = weaponX; - weaponX += sintable[(fistPos)&2047] >> 10; - G_DrawTileScaled(weaponX + 250 - (pPlayer->look_ang >> 1), weaponY + 258 - (klabs(sintable[(fistPos)&2047] >> 8)), - TILE_FIST, weaponShade, weaponBits, weaponPal); - weaponX = currentWeapon - (sintable[(fistPos)&2047] >> 10); - G_DrawTileScaled(weaponX + 40 - (pPlayer->look_ang >> 1), weaponY + 200 + (klabs(sintable[(fistPos)&2047] >> 8)), TILE_FIST, - weaponShade, weaponBits | 4, weaponPal); - } - else - { - switch (r_drawweapon) - { - case 1: break; - case 2: - if ((unsigned)hudweap.cur < MAX_WEAPONS && hudweap.cur != KNEE_WEAPON) - rotatesprite_win(160 << 16, (180 + (pPlayer->weapon_pos * pPlayer->weapon_pos)) << 16, divscale16(ud.statusbarscale, 100), 0, - (!RR && hudweap.cur == GROW_WEAPON) ? TILE_GROWSPRITEICON : WeaponPickupSprites[hudweap.cur], 0, - 0, 2); - default: goto enddisplayweapon; - } - - if (!RR && currentWeapon == KNEE_WEAPON && *weaponFrame == 0) - goto enddisplayweapon; - - int const doAnim = !(sprite[pPlayer->i].pal == 1 || ud.pause_on || g_player[myconnectindex].ps->gm & MODE_MENU); - int const halfLookAng = pPlayer->look_ang >> 1; - - int const weaponPal = P_GetHudPal(pPlayer); - - if (RR) - { - switch (DYNAMICWEAPONMAP(currentWeapon)) - { - case KNEE_WEAPON__STATIC: - { - static int weaponFrames[] = { 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7 }; - static int offsetX[] = { 310,342,364,418,350,316,282,288,0,0 }; - static int offsetY[] = { 300,362,320,268,248,248,277,420,0,0 }; - weaponX = weaponX + ((offsetX[weaponFrames[*weaponFrame]]>>1) - 12); - weaponY = weaponY + 200 - (244-offsetY[weaponFrames[*weaponFrame]]); - guniqhudid = currentWeapon; - G_DrawTileScaled(weaponX - halfLookAng, weaponY - weaponYOffset, TILE_KNEE + weaponFrames[*weaponFrame], - weaponShade, weaponBits, weaponPal, 32768); - guniqhudid = 0; - break; - } - case SLINGBLADE_WEAPON__STATIC: - if (RRRA) - { - if (!(duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING)) - weaponBits |= 512; - static int weaponFrames[] = { 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7 }; - static int offsetX[] = { 580,676,310,491,356,210,310,614 }; - static int offsetY[] = { 369,363,300,323,371,400,300,440 }; - weaponX = weaponX + ((offsetX[weaponFrames[*weaponFrame]]>>1) - 12); - weaponY = weaponY + 210 - (244-offsetY[weaponFrames[*weaponFrame]]); - guniqhudid = currentWeapon; - G_DrawTileScaled(weaponX - halfLookAng + 20, weaponY - weaponYOffset - 80, TILE_SLINGBLADE + weaponFrames[*weaponFrame], - weaponShade, weaponBits, weaponPal, 32768); - guniqhudid = 0; - break; - } - break; - - case TRIPBOMB_WEAPON__STATIC: - case BOWLINGBALL_WEAPON__STATIC: - weaponX += 8; - weaponYOffset -= 10; - - if (currentWeapon == BOWLING_WEAPON) - { - if (pPlayer->ammo_amount[BOWLING_WEAPON]) - { - G_DrawWeaponTileWithID(currentWeapon, weaponX + 162 - halfLookAng, weaponY + 214 - weaponYOffset + (*weaponFrame) * 8, TILE_BOWLINGBALLH, - weaponShade, weaponBits, weaponPal, 32768); - } - else - { - G_DrawWeaponTileWithID(currentWeapon << 1, weaponX + 162 - halfLookAng, weaponY + 214 - weaponYOffset, TILE_HANDTHROW+5, - weaponShade, weaponBits, weaponPal, 36700); - } - } - else - { - if (pPlayer->ammo_amount[TRIPBOMB_WEAPON]) - { - G_DrawWeaponTileWithID(currentWeapon, weaponX + 180 - halfLookAng, weaponY + 214 - weaponYOffset + (*weaponFrame) * 8, TILE_POWDERH, - weaponShade, weaponBits, weaponPal, 36700); - G_DrawWeaponTileWithID(currentWeapon << 1, weaponX + 90 - halfLookAng, weaponY + 214 - weaponYOffset + (*weaponFrame) * 8, TILE_POWDERH, - weaponShade, weaponBits | 4, weaponPal, 36700); - } - else - { - G_DrawWeaponTileWithID(currentWeapon << 2, weaponX + 162 - halfLookAng, weaponY + 214 - weaponYOffset, TILE_HANDTHROW+5, - weaponShade, weaponBits, weaponPal, 36700); - } - } - break; - - case RPG_WEAPON__STATIC: - { - if (!(duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING)) - weaponBits |= 512; - static int frames[] = { 0,1,1,2,2,3,2,3,2,3,2,2,2,2,2,2,2,2,2,4,4,4,4,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,7 }; - int frame = frames[*weaponFrame]; - if (frame == 2 || frame == 3) - { - G_DrawWeaponTileWithID(currentWeapon, weaponX + 200 - halfLookAng, weaponY + 250 - weaponYOffset, - TILE_RPGGUN + frame, weaponShade, weaponBits, weaponPal, 36700); - } - else if (frame == 1) - { - G_DrawWeaponTileWithID(currentWeapon, weaponX + 200 - halfLookAng, weaponY + 250 - weaponYOffset, - TILE_RPGGUN + frame, 0, weaponBits, weaponPal, 36700); - } - else - { - G_DrawWeaponTileWithID(currentWeapon, weaponX + 210 - halfLookAng, weaponY + 255 - weaponYOffset, - TILE_RPGGUN + frame, weaponShade, weaponBits, weaponPal, 36700); - } - break; - } - - case CHICKEN_WEAPON__STATIC: - { - if (!RRRA) break; - if (!(duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING)) - weaponBits |= 512; - if (*weaponFrame) - { - static int frames[] = { 0,1,1,2,2,3,2,3,2,3,2,2,2,2,2,2,2,2,2,4,4,4,4,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,7 }; - int frame = frames[*weaponFrame]; - if (frame == 2 || frame == 3) - { - G_DrawWeaponTileWithID(currentWeapon, weaponX + 200 - halfLookAng, weaponY + 250 - weaponYOffset, - TILE_RPGGUN2 + frame, weaponShade, weaponBits, weaponPal, 36700); - } - else if (frame == 1) - { - G_DrawWeaponTileWithID(currentWeapon, weaponX + 200 - halfLookAng, weaponY + 250 - weaponYOffset, - TILE_RPGGUN2 + frame, 0, weaponBits, weaponPal, 36700); - } - else - { - G_DrawWeaponTileWithID(currentWeapon, weaponX + 210 - halfLookAng, weaponY + 255 - weaponYOffset, - TILE_RPGGUN2 + frame, weaponShade, weaponBits, weaponPal, 36700); - } - } - else - { - if (!g_netServer && ud.multimode < 2) - { - if (chickenphase) - { - G_DrawWeaponTileWithID(currentWeapon, weaponX + 210 - halfLookAng, weaponY + 222 - weaponYOffset, - TILE_RPGGUN2+7, weaponShade, weaponBits, weaponPal, 36700); - } - else if ((krand2() & 15) == 5) - { - A_PlaySound(327, pPlayer->i); - G_DrawWeaponTileWithID(currentWeapon, weaponX + 210 - halfLookAng, weaponY + 222 - weaponYOffset, - TILE_RPGGUN2+7, weaponShade, weaponBits, weaponPal, 36700); - chickenphase = 6; - } - else - { - G_DrawWeaponTileWithID(currentWeapon, weaponX + 210 - halfLookAng, weaponY + 225 - weaponYOffset, - TILE_RPGGUN2, weaponShade, weaponBits, weaponPal, 36700); - } - - } - else - { - G_DrawWeaponTileWithID(currentWeapon, weaponX + 210 - halfLookAng, weaponY + 225 - weaponYOffset, - TILE_RPGGUN2, weaponShade, weaponBits, weaponPal, 36700); - } - } - break; - } - - case SHOTGUN_WEAPON__STATIC: - weaponX -= 8; - { - static int kb_frames3[] = { 0,0,1,1,2,2,5,5,6,6,7,7,8,8,0,0,0,0,0,0,0 }; - static int kb_frames2[] = { 0,0,3,3,4,4,5,5,6,6,7,7,8,8,0,0,20,20,21,21,21,21,20,20,20,20,0,0 }; - static int kb_frames[] = { 0,0,1,1,2,2,3,3,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8,8,0,0,20,20,21,21,21,21,20,20,20,20,0,0 }; - static int kb_ox[] = { 300,300,300,300,300,330,320,310,305,306,302 }; - static int kb_oy[] = { 315,300,302,305,302,302,303,306,302,404,384 }; - if (pPlayer->shotgun_state[1]) - { - if (*weaponFrame < 26) - { - int frm = kb_frames[*weaponFrame]; - if (frm == 3 || frm == 4) - weaponShade = 0; - G_DrawWeaponTileWithID(currentWeapon, weaponX + 52 - halfLookAng + (kb_ox[frm] >> 1), - weaponY + kb_oy[frm] - 64 - weaponYOffset, TILE_SHOTGUN + frm, weaponShade, weaponBits, weaponPal, 32768); - } - else - { - int frm; - if (kb_frames[*weaponFrame] > 0) - frm = kb_frames[(*weaponFrame) - 11]; - else - frm = kb_frames[*weaponFrame]; - weaponX += (kb_ox[frm] >> 1) - 12; - weaponY += kb_oy[frm] - 64; - switch (*weaponFrame) - { - case 23: - weaponY += 60; - break; - case 24: - weaponY += 30; - break; - } - G_DrawWeaponTileWithID(currentWeapon, weaponX + 64 - halfLookAng, weaponY - weaponYOffset, - TILE_SHOTGUN + kb_frames[*weaponFrame], weaponShade, weaponBits, weaponPal, 32768); - if (kb_frames[*weaponFrame] == 21) - G_DrawWeaponTileWithID(currentWeapon << 1, weaponX + 96 - halfLookAng, weaponY - weaponYOffset, - TILE_SHOTGUNSHELLS, weaponShade, weaponBits, weaponPal, 32768); - } - } - else - { - if ((*weaponFrame) < 16) - { - if (pPlayer->shotgun_state[0]) - { - int frm = kb_frames2[*weaponFrame]; - if (frm == 3 || frm == 4) - weaponShade = 0; - G_DrawWeaponTileWithID(currentWeapon, weaponX + 52 - halfLookAng + (kb_ox[frm] >> 1), - weaponY + kb_oy[frm] - 64 - weaponYOffset, TILE_SHOTGUN + frm, weaponShade, weaponBits, weaponPal, 32768); - } - else - { - int frm = kb_frames3[*weaponFrame]; - if (frm == 1 || frm == 2) - weaponShade = 0; - G_DrawWeaponTileWithID(currentWeapon, weaponX + 52 - halfLookAng + (kb_ox[frm] >> 1), - weaponY + kb_oy[frm] - 64 - weaponYOffset, TILE_SHOTGUN + frm, weaponShade, weaponBits, weaponPal, 32768); - } - } - else if (pPlayer->shotgun_state[0]) - { - int frm; - if (kb_frames2[*weaponFrame] > 0) - frm = kb_frames2[(*weaponFrame) - 11]; - else - frm = kb_frames2[*weaponFrame]; - weaponX += (kb_ox[frm] >> 1) - 12; - weaponY += kb_oy[frm] - 64; - switch (*weaponFrame) - { - case 23: - weaponY += 60; - break; - case 24: - weaponY += 30; - break; - } - G_DrawWeaponTileWithID(currentWeapon, weaponX + 64 - halfLookAng, weaponY - weaponYOffset, - TILE_SHOTGUN + kb_frames2[*weaponFrame], weaponShade, weaponBits, weaponPal, 32768); - if (kb_frames2[*weaponFrame] == 21) - G_DrawWeaponTileWithID(currentWeapon << 1, weaponX + 96 - halfLookAng, weaponY - weaponYOffset, - TILE_SHOTGUNSHELLS, weaponShade, weaponBits, weaponPal, 32768); - } - } - } - break; - - case CHAINGUN_WEAPON__STATIC: - if (*weaponFrame > 0) - { - weaponYOffset -= sintable[(*weaponFrame)<<7]>>12; - - if (doAnim) - weaponX += 1-(rand()&3); - } - - switch (*weaponFrame) - { - case 0: - G_DrawWeaponTileWithID(currentWeapon, weaponX + 178 - (pPlayer->look_ang >> 1) + 30, weaponY + 233 - weaponYOffset + 5, - TILE_CHAINGUN, weaponShade, weaponBits, weaponPal, 32768); - break; - - default: - if (*weaponFrame < 8) - G_DrawWeaponTileWithID(currentWeapon, weaponX + 178 - (pPlayer->look_ang >> 1) + 30, weaponY + 233 - weaponYOffset + 5, - TILE_CHAINGUN + 1, 0, weaponBits, weaponPal, 32768); - else - G_DrawWeaponTileWithID(currentWeapon, weaponX + 178 - (pPlayer->look_ang >> 1) + 30, weaponY + 233 - weaponYOffset + 5, - TILE_CHAINGUN + 2, weaponShade, weaponBits, weaponPal, 32768); - - break; - } - break; - - case PISTOL_WEAPON__STATIC: - if ((*weaponFrame) < 22) - { - static int frames[] = { 0,0,1,1,2,2,3,3,4,4,6,6,6,6,5,5,4,4,3,3,0,0 }; - static int offsetX[] = { 194,190,185,208,215,215,216,216,201,170 }; - static int offsetY[] = { 256,249,248,238,228,218,208,256,245,258 }; - int frame = frames[*weaponFrame]; - - if (frame) - weaponShade = 0; - - G_DrawWeaponTileWithID(currentWeapon, offsetX[frame] - 12 + weaponX - (pPlayer->look_ang >> 1), weaponY + offsetY[frame] - weaponYOffset, - TILE_FIRSTGUN + frame, weaponShade, weaponBits, weaponPal, 36700); - - break; - } - else - { - static int frames[] = { 0,0,1,1,2,2,2,2,2,2,2,2,2,2,2,1,1,0,0 }; - static int offsetX[] = { 244,244,244 }; - static int offsetY[] = { 256,249,248 }; - int dx, dy; - int frame = frames[(*weaponFrame) - 22]; - switch (*weaponFrame) - { - case 28: - dy = 10; - dx = 5; - break; - case 29: - dy = 20; - dx = 10; - break; - case 30: - dy = 30; - dx = 15; - break; - case 31: - dy = 40; - dx = 20; - break; - case 32: - dy = 50; - dx = 25; - break; - case 33: - dy = 40; - dx = 20; - break; - case 34: - dy = 30; - dx = 15; - break; - case 35: - dy = 20; - dx = 10; - break; - case 36: - dy = 10; - dx = 5; - break; - default: - dy = 0; - dx = 0; - break; - } - - G_DrawWeaponTileWithID(currentWeapon, weaponX + offsetX[frame] - 12 - dx - halfLookAng, weaponY + offsetY[frame] - weaponYOffset + dy, - TILE_FIRSTGUNRELOAD + frame, weaponShade, weaponBits, weaponPal, 36700); - } - break; - - case HANDBOMB_WEAPON__STATIC: - weaponYOffset -= 9 * (*weaponFrame); - G_DrawWeaponTileWithID(currentWeapon, weaponX + 190 - halfLookAng, weaponY + 260 - weaponYOffset, - TILE_HANDTHROW, weaponShade, weaponBits, weaponPal, 36700); - break; - - case HANDREMOTE_WEAPON__STATIC: - if (!(duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING)) - weaponBits |= 512; - - if(*weaponFrame < 20) - { - static uint8_t remoteFrames[] = { 1,1,1,1,1,2,2,2,2,3,3,3,4,4,4,5,5,5,5,5,6,6,6 }; - - if (*weaponFrame >= ARRAY_SIZE(remoteFrames)) - break; - - if (*weaponFrame < 5) - { - G_DrawWeaponTileWithID(currentWeapon << 1, weaponX + 265 - halfLookAng, weaponY + 174 - weaponYOffset + pPlayer->detonate_count, - TILE_RRTILE1752, 0, weaponBits, weaponPal, 36700); - } - G_DrawWeaponTileWithID(currentWeapon, weaponX + 290 - halfLookAng, weaponY + 238 - weaponYOffset, - TILE_HANDTHROW + remoteFrames[(*weaponFrame)], 0, weaponBits, weaponPal, 36700); - } - break; - - case DEVISTATOR_WEAPON__STATIC: - if (*weaponFrame) - G_DrawWeaponTileWithID(currentWeapon, 150 + (weaponX >> 1) - halfLookAng, 266 + (weaponY >> 1) - weaponYOffset, - TILE_DEVISTATOR, 0, weaponBits, weaponPal, 47040); - else - G_DrawWeaponTileWithID(currentWeapon, 150 + (weaponX >> 1) - halfLookAng, 266 + (weaponY >> 1) - weaponYOffset, - TILE_DEVISTATOR + 1, weaponShade, weaponBits, weaponPal, 47040); - break; - - case FREEZE_WEAPON__STATIC: - if (!(duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING)) - weaponBits |= 512; - - if ((*weaponFrame) > 0) - { - static uint8_t freezerFrames[] = { 0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; - - G_DrawWeaponTileWithID(currentWeapon, weaponX + 260 - (pPlayer->look_ang >> 1), weaponY + 215 - weaponYOffset, - TILE_FREEZE + freezerFrames[*weaponFrame], -32, weaponBits, weaponPal, 32768); - } - else - G_DrawWeaponTileWithID(currentWeapon, weaponX + 260 - (pPlayer->look_ang >> 1), weaponY + 215 - weaponYOffset, - TILE_FREEZE, weaponShade, weaponBits, weaponPal, 32768); - break; - - case GROW_WEAPON__STATIC: - case SHRINKER_WEAPON__STATIC: - weaponX += 28; - weaponY += 18; - - if ((*weaponFrame) > 0) - { - if (doAnim) - { - weaponX += rand() & 3; - weaponYOffset += (rand() & 3); - } - - if (currentWeapon == GROW_WEAPON) - { - G_DrawWeaponTileWithID(currentWeapon, weaponX + 184 - halfLookAng, weaponY + 240 - weaponYOffset, - TILE_GROWSPARK + ((*weaponFrame)&2), weaponShade, weaponBits, 0, 44040); - } - else - { - static int frames[] = { 1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,0,0,0,0,0,0,0,0,0,0 }; - G_DrawWeaponTileWithID(currentWeapon, weaponX + 184 - halfLookAng, weaponY + 240 - weaponYOffset, - TILE_SHRINKER + frames[*weaponFrame], weaponShade, weaponBits, 0, 44040); - } - } - else - { - G_DrawWeaponTileWithID(currentWeapon, weaponX + 188 - halfLookAng, weaponY + 240 - weaponYOffset, - TILE_SHRINKER, weaponShade, weaponBits, weaponPal, 44040); - } - break; - } - } - else - { - switch (DYNAMICWEAPONMAP(currentWeapon)) - { - case KNEE_WEAPON__STATIC: - { - int const kneePal = P_GetKneePal(pPlayer, weaponPal); - - guniqhudid = currentWeapon; - if (*weaponFrame < 5 || *weaponFrame > 9) - G_DrawTileScaled(weaponX + 220 - halfLookAng, weaponY + 250 - weaponYOffset, TILE_KNEE, - weaponShade, weaponBits, kneePal); - else - G_DrawTileScaled(weaponX + 160 - halfLookAng, weaponY + 214 - weaponYOffset, TILE_KNEE + 1, - weaponShade, weaponBits, kneePal); - guniqhudid = 0; - break; - } - - case TRIPBOMB_WEAPON__STATIC: - weaponX += 8; - weaponYOffset -= 10; - - if ((*weaponFrame) > 6) - weaponY += ((*weaponFrame) << 3); - else if ((*weaponFrame) < 4) - G_DrawWeaponTileWithID(currentWeapon << 2, weaponX + 142 - halfLookAng, - weaponY + 234 - weaponYOffset, TILE_HANDHOLDINGLASER + 3, weaponShade, weaponBits, weaponPal); - - G_DrawWeaponTileWithID(currentWeapon, weaponX + 130 - halfLookAng, weaponY + 249 - weaponYOffset, - TILE_HANDHOLDINGLASER + ((*weaponFrame) >> 2), weaponShade, weaponBits, weaponPal); - - G_DrawWeaponTileWithID(currentWeapon << 1, weaponX + 152 - halfLookAng, - weaponY + 249 - weaponYOffset, TILE_HANDHOLDINGLASER + ((*weaponFrame) >> 2), weaponShade, weaponBits | 4, - weaponPal); - break; - - case RPG_WEAPON__STATIC: - weaponX -= sintable[(768 + ((*weaponFrame) << 7)) & 2047] >> 11; - weaponYOffset += sintable[(768 + ((*weaponFrame) << 7)) & 2047] >> 11; - - if (!(duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING)) - weaponBits |= 512; - - if (*weaponFrame > 0) - { - int totalTime; - if (*weaponFrame < (WW2GI ? (totalTime = PWEAPON(screenpeek, pPlayer->curr_weapon, TotalTime)) : 8)) - G_DrawWeaponTileWithID(currentWeapon << 1, weaponX + 164, (weaponY << 1) + 176 - weaponYOffset, - TILE_RPGGUN + ((*weaponFrame) >> 1), weaponShade, weaponBits, weaponPal); - else if (WW2GI) - { - totalTime = PWEAPON(screenpeek, pPlayer->curr_weapon, TotalTime); - int const reloadTime = PWEAPON(screenpeek, pPlayer->curr_weapon, Reload); - - weaponYOffset -= (*weaponFrame < ((reloadTime - totalTime) / 2 + totalTime)) - ? 10 * ((*weaponFrame) - totalTime) // down - : 10 * (reloadTime - (*weaponFrame)); // up - } - } - - G_DrawWeaponTileWithID(currentWeapon, weaponX + 164, (weaponY << 1) + 176 - weaponYOffset, TILE_RPGGUN, weaponShade, - weaponBits, weaponPal); - break; - - case SHOTGUN_WEAPON__STATIC: - weaponX -= 8; - - if (WW2GI) - { - int const totalTime = PWEAPON(screenpeek, pPlayer->curr_weapon, TotalTime); - int const reloadTime = PWEAPON(screenpeek, pPlayer->curr_weapon, Reload); - - if (*weaponFrame > 0) - weaponYOffset -= sintable[(*weaponFrame)<<7]>>12; - - if (*weaponFrame > 0 && doAnim) - weaponX += 1-(rand()&3); - - if (*weaponFrame == 0) - { - G_DrawWeaponTileWithID(currentWeapon, weaponX + 146 - halfLookAng, weaponY + 202 - weaponYOffset, - TILE_SHOTGUN, weaponShade, weaponBits, weaponPal); - } - else if (*weaponFrame <= totalTime) - { - G_DrawWeaponTileWithID(currentWeapon, weaponX + 146 - halfLookAng, weaponY + 202 - weaponYOffset, - TILE_SHOTGUN + 1, weaponShade, weaponBits, weaponPal); - } - // else we are in 'reload time' - else - { - weaponYOffset -= (*weaponFrame < ((reloadTime - totalTime) / 2 + totalTime)) - ? 10 * ((*weaponFrame) - totalTime) // D - : 10 * (reloadTime - (*weaponFrame)); // U - - G_DrawWeaponTileWithID(currentWeapon, weaponX + 146 - halfLookAng, weaponY + 202 - weaponYOffset, - TILE_SHOTGUN, weaponShade, weaponBits, weaponPal); - } - - break; - } - - switch (*weaponFrame) - { - case 1: - case 2: - G_DrawWeaponTileWithID(currentWeapon << 1, weaponX + 168 - halfLookAng, weaponY + 201 - weaponYOffset, - TILE_SHOTGUN + 2, -128, weaponBits, weaponPal); - fallthrough__; - case 0: - case 6: - case 7: - case 8: - G_DrawWeaponTileWithID(currentWeapon, weaponX + 146 - halfLookAng, weaponY + 202 - weaponYOffset, - TILE_SHOTGUN, weaponShade, weaponBits, weaponPal); - break; - - case 3: - case 4: - weaponYOffset -= 40; - weaponX += 20; - - G_DrawWeaponTileWithID(currentWeapon << 1, weaponX + 178 - halfLookAng, weaponY + 194 - weaponYOffset, - TILE_SHOTGUN + 1 + ((*(weaponFrame)-1) >> 1), -128, weaponBits, weaponPal); - fallthrough__; - case 5: - case 9: - case 10: - case 11: - case 12: - G_DrawWeaponTileWithID(currentWeapon, weaponX + 158 - halfLookAng, weaponY + 220 - weaponYOffset, - TILE_SHOTGUN + 3, weaponShade, weaponBits, weaponPal); - break; - - case 13: - case 14: - case 15: - G_DrawWeaponTileWithID(currentWeapon, 32 + weaponX + 166 - halfLookAng, weaponY + 210 - weaponYOffset, - TILE_SHOTGUN + 4, weaponShade, weaponBits, weaponPal); - break; - - case 16: - case 17: - case 18: - case 19: - case 24: - case 25: - case 26: - case 27: - G_DrawWeaponTileWithID(currentWeapon, 64 + weaponX + 170 - halfLookAng, weaponY + 196 - weaponYOffset, - TILE_SHOTGUN + 5, weaponShade, weaponBits, weaponPal); - break; - - case 20: - case 21: - case 22: - case 23: - G_DrawWeaponTileWithID(currentWeapon, 64 + weaponX + 176 - halfLookAng, weaponY + 196 - weaponYOffset, - TILE_SHOTGUN + 6, weaponShade, weaponBits, weaponPal); - break; - - - case 28: - case 29: - case 30: - G_DrawWeaponTileWithID(currentWeapon, 32 + weaponX + 156 - halfLookAng, weaponY + 206 - weaponYOffset, - TILE_SHOTGUN + 4, weaponShade, weaponBits, weaponPal); - break; - } - break; - - case CHAINGUN_WEAPON__STATIC: - if (*weaponFrame > 0) - { - weaponYOffset -= sintable[(*weaponFrame)<<7]>>12; - - if (doAnim) - weaponX += 1-(rand()&3); - } - - if (WW2GI) - { - int const totalTime = PWEAPON(screenpeek, pPlayer->curr_weapon, TotalTime); - int const reloadTime = PWEAPON(screenpeek, pPlayer->curr_weapon, Reload); - - if (*weaponFrame == 0) - { - G_DrawWeaponTileWithID(currentWeapon, weaponX + 178 - halfLookAng,weaponY+233-weaponYOffset, - TILE_CHAINGUN+1,weaponShade,weaponBits,weaponPal); - } - else if (*weaponFrame <= totalTime) - { - G_DrawWeaponTileWithID(currentWeapon, weaponX + 188 - halfLookAng,weaponY+243-weaponYOffset, - TILE_CHAINGUN+2,weaponShade,weaponBits,weaponPal); - } - // else we are in 'reload time' - // divide reload time into fifths.. - // 1) move weapon up/right, hand on clip (TILE_CHAINGUN - 17) - // 2) move weapon up/right, hand removing clip (TILE_CHAINGUN - 18) - // 3) hold weapon up/right, hand removed clip (TILE_CHAINGUN - 19) - // 4) hold weapon up/right, hand inserting clip (TILE_CHAINGUN - 18) - // 5) move weapon down/left, clip inserted (TILE_CHAINGUN - 17) - else - { - int iFifths = (reloadTime - totalTime) / 5; - if (iFifths < 1) - iFifths = 1; - - if (*weaponFrame < iFifths + totalTime) - { - // first segment - int const weaponOffset = 80 - 10 * (totalTime + iFifths - (*weaponFrame)); - weaponYOffset += weaponOffset; - weaponX += weaponOffset; - G_DrawWeaponTileWithID(currentWeapon, weaponX + 168 - halfLookAng, weaponY + 260 - weaponYOffset, TILE_CHAINGUN - 17, - weaponShade, weaponBits, weaponPal); - } - else if (*weaponFrame < (iFifths * 2 + totalTime)) - { - // second segment - weaponYOffset += 80; // D - weaponX += 80; - G_DrawWeaponTileWithID(currentWeapon, weaponX + 168 - halfLookAng, weaponY + 260 - weaponYOffset, TILE_CHAINGUN - 18, - weaponShade, weaponBits, weaponPal); - } - else if (*weaponFrame < (iFifths * 3 + totalTime)) - { - // third segment - // up - weaponYOffset += 80; - weaponX += 80; - G_DrawWeaponTileWithID(currentWeapon, weaponX + 168 - halfLookAng, weaponY + 260 - weaponYOffset, TILE_CHAINGUN - 19, - weaponShade, weaponBits, weaponPal); - } - else if (*weaponFrame < (iFifths * 4 + totalTime)) - { - // fourth segment - // down - weaponYOffset += 80; // D - weaponX += 80; - G_DrawWeaponTileWithID(currentWeapon, weaponX + 168 - halfLookAng, weaponY + 260 - weaponYOffset, TILE_CHAINGUN - 18, - weaponShade, weaponBits, weaponPal); - } - else - { - // up and left - int const weaponOffset = 10 * (reloadTime - (*weaponFrame)); - weaponYOffset += weaponOffset; // U - weaponX += weaponOffset; - G_DrawWeaponTileWithID(currentWeapon, weaponX + 168 - halfLookAng, weaponY + 260 - weaponYOffset, TILE_CHAINGUN - 17, - weaponShade, weaponBits, weaponPal); - } - } - - break; - } - - switch (*weaponFrame) - { - case 0: - G_DrawWeaponTileWithID(currentWeapon, weaponX + 178 - (pPlayer->look_ang >> 1), weaponY + 233 - weaponYOffset, - TILE_CHAINGUN + 1, weaponShade, weaponBits, weaponPal); - break; - - default: - if (*weaponFrame > 4 && *weaponFrame < 12) - { - int randomOffset = doAnim ? rand()&7 : 0; - G_DrawWeaponTileWithID(currentWeapon << 2, randomOffset + weaponX - 4 + 140 - (pPlayer->look_ang >> 1), - randomOffset + weaponY - ((*weaponFrame) >> 1) + 208 - weaponYOffset, - TILE_CHAINGUN + 5 + ((*weaponFrame - 4) / 5), weaponShade, weaponBits, weaponPal); - if (doAnim) randomOffset = rand()&7; - G_DrawWeaponTileWithID(currentWeapon << 2, randomOffset + weaponX - 4 + 184 - (pPlayer->look_ang >> 1), - randomOffset + weaponY - ((*weaponFrame) >> 1) + 208 - weaponYOffset, - TILE_CHAINGUN + 5 + ((*weaponFrame - 4) / 5), weaponShade, weaponBits, weaponPal); - } - - if (*weaponFrame < 8) - { - int const randomOffset = doAnim ? rand()&7 : 0; - G_DrawWeaponTileWithID(currentWeapon << 2, randomOffset + weaponX - 4 + 162 - (pPlayer->look_ang >> 1), - randomOffset + weaponY - ((*weaponFrame) >> 1) + 208 - weaponYOffset, - TILE_CHAINGUN + 5 + ((*weaponFrame - 2) / 5), weaponShade, weaponBits, weaponPal); - G_DrawWeaponTileWithID(currentWeapon, weaponX + 178 - (pPlayer->look_ang >> 1), weaponY + 233 - weaponYOffset, - TILE_CHAINGUN + 1 + ((*weaponFrame) >> 1), weaponShade, weaponBits, weaponPal); - } - else - G_DrawWeaponTileWithID(currentWeapon, weaponX + 178 - (pPlayer->look_ang >> 1), weaponY + 233 - weaponYOffset, - TILE_CHAINGUN + 1, weaponShade, weaponBits, weaponPal); - - break; - } - - G_DrawWeaponTileWithID(currentWeapon << 1, weaponX + 168 - (pPlayer->look_ang >> 1), weaponY + 260 - weaponYOffset, - TILE_CHAINGUN, weaponShade, weaponBits, weaponPal); - break; - - case PISTOL_WEAPON__STATIC: - if ((*weaponFrame) < 5) - { - static uint8_t pistolFrames[] = { 0, 1, 2 }; - int pistolOffset = 195-12+weaponX; - - if ((*weaponFrame) == 2) - pistolOffset -= 3; - - G_DrawWeaponTileWithID(currentWeapon, (pistolOffset - (pPlayer->look_ang >> 1)), (weaponY + 244 - weaponYOffset), - TILE_FIRSTGUN + pistolFrames[*weaponFrame > 2 ? 0 : *weaponFrame], weaponShade, 2, - weaponPal); - - break; - } - - if (!(duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING) && DUKE) - weaponBits |= 512; - - if ((*weaponFrame) < 10) - G_DrawWeaponTileWithID(currentWeapon, 194 - (pPlayer->look_ang >> 1), weaponY + 230 - weaponYOffset, TILE_FIRSTGUN + 4, - weaponShade, weaponBits, weaponPal); - else if ((*weaponFrame) < 15) - { - G_DrawWeaponTileWithID(currentWeapon << 1, 244 - ((*weaponFrame) << 3) - (pPlayer->look_ang >> 1), - weaponY + 130 - weaponYOffset + ((*weaponFrame) << 4), TILE_FIRSTGUN + 6, weaponShade, - weaponBits, weaponPal); - G_DrawWeaponTileWithID(currentWeapon, 224 - (pPlayer->look_ang >> 1), weaponY + 220 - weaponYOffset, TILE_FIRSTGUN + 5, - weaponShade, weaponBits, weaponPal); - } - else if ((*weaponFrame) < 20) - { - G_DrawWeaponTileWithID(currentWeapon << 1, 124 + ((*weaponFrame) << 1) - (pPlayer->look_ang >> 1), - weaponY + 430 - weaponYOffset - ((*weaponFrame) << 3), TILE_FIRSTGUN + 6, weaponShade, - weaponBits, weaponPal); - G_DrawWeaponTileWithID(currentWeapon, 224 - (pPlayer->look_ang >> 1), weaponY + 220 - weaponYOffset, TILE_FIRSTGUN + 5, - weaponShade, weaponBits, weaponPal); - } - - else if ((*weaponFrame) < (WW2GI ? PWEAPON(screenpeek, PISTOL_WEAPON, Reload) - 12 : (NAM ? 38 : 23))) - { - G_DrawWeaponTileWithID(currentWeapon << 2, 184 - (pPlayer->look_ang >> 1), weaponY + 235 - weaponYOffset, - TILE_FIRSTGUN + 8, weaponShade, weaponBits, weaponPal); - G_DrawWeaponTileWithID(currentWeapon, 224 - (pPlayer->look_ang >> 1), weaponY + 210 - weaponYOffset, TILE_FIRSTGUN + 5, - weaponShade, weaponBits, weaponPal); - } - else if ((*weaponFrame) < (WW2GI ? PWEAPON(screenpeek, PISTOL_WEAPON, Reload) - 6 : (NAM ? 44 : 25))) - { - G_DrawWeaponTileWithID(currentWeapon << 2, 164 - (pPlayer->look_ang >> 1), weaponY + 245 - weaponYOffset, - TILE_FIRSTGUN + 8, weaponShade, weaponBits, weaponPal); - G_DrawWeaponTileWithID(currentWeapon, 224 - (pPlayer->look_ang >> 1), weaponY + 220 - weaponYOffset, TILE_FIRSTGUN + 5, - weaponShade, weaponBits, weaponPal); - } - else if ((*weaponFrame) < (WW2GI ? PWEAPON(screenpeek, PISTOL_WEAPON, Reload) : (NAM ? 50 : 27))) - G_DrawWeaponTileWithID(currentWeapon, 194 - (pPlayer->look_ang >> 1), weaponY + 235 - weaponYOffset, TILE_FIRSTGUN + 5, - weaponShade, weaponBits, weaponPal); - - break; - - case HANDBOMB_WEAPON__STATIC: - { - static uint8_t pipebombFrames [] = { 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2 }; - - if (*weaponFrame >= ARRAY_SIZE(pipebombFrames)) - break; - - if (WW2GI && *weaponFrame >= PWEAPON(screenpeek, pPlayer->curr_weapon, TotalTime)) - break; - - if (*weaponFrame) - { - if (WW2GI) - { - int const fireDelay = PWEAPON(screenpeek, pPlayer->curr_weapon, FireDelay); - int const totalTime = PWEAPON(screenpeek, pPlayer->curr_weapon, TotalTime); - - if (*weaponFrame <= fireDelay) - { - // it holds here - weaponYOffset -= 5 * (*weaponFrame); // D - } - else if (*weaponFrame < ((totalTime - fireDelay) / 2 + fireDelay)) - { - // up and left - int const weaponOffset = (*weaponFrame) - fireDelay; - weaponYOffset += 10 * weaponOffset; // U - weaponX += 80 * weaponOffset; - } - else if (*weaponFrame < totalTime) - { - // start high - weaponYOffset += 240; - weaponYOffset -= 12 * ((*weaponFrame) - fireDelay); // D - // move left - weaponX += 90 - 5 * (totalTime - (*weaponFrame)); - } - } - else - { - if (*weaponFrame < 7) weaponYOffset -= 10 * (*weaponFrame); // D - else if (*weaponFrame < 12) weaponYOffset += 20 * ((*weaponFrame) - 10); // U - else if (*weaponFrame < 20) weaponYOffset -= 9 * ((*weaponFrame) - 14); // D - - weaponYOffset += 10; - } - } - - G_DrawWeaponTileWithID(currentWeapon, weaponX + 190 - halfLookAng, weaponY + 260 - weaponYOffset, - TILE_HANDTHROW + pipebombFrames[(*weaponFrame)], weaponShade, weaponBits, weaponPal); - } - break; - - case HANDREMOTE_WEAPON__STATIC: - { - static uint8_t remoteFrames[] = { 0, 1, 1, 2, 1, 1, 0, 0, 0, 0, 0 }; - - if (*weaponFrame >= ARRAY_SIZE(remoteFrames)) - break; - - weaponX = -48; - G_DrawWeaponTileWithID(currentWeapon, weaponX + 150 - halfLookAng, weaponY + 258 - weaponYOffset, - TILE_HANDREMOTE + remoteFrames[(*weaponFrame)], weaponShade, weaponBits, weaponPal); - } - break; - - case DEVISTATOR_WEAPON__STATIC: - if (WW2GI) - { - if (*weaponFrame) - { - int32_t const totalTime = PWEAPON(screenpeek, pPlayer->curr_weapon, TotalTime); - int32_t const reloadTime = PWEAPON(screenpeek, pPlayer->curr_weapon, Reload); - - if (*weaponFrame < totalTime) - { - int const tileOffset = ksgn((*weaponFrame) >> 2); - - if (pPlayer->ammo_amount[pPlayer->curr_weapon] & 1) - { - G_DrawWeaponTileWithID(currentWeapon << 1, weaponX + 30 - halfLookAng, weaponY + 240 - weaponYOffset, - TILE_DEVISTATOR, weaponShade, weaponBits | 4, weaponPal); - G_DrawWeaponTileWithID(currentWeapon, weaponX + 268 - halfLookAng, weaponY + 238 - weaponYOffset, - TILE_DEVISTATOR + tileOffset, -32, weaponBits, weaponPal); - } - else - { - G_DrawWeaponTileWithID(currentWeapon << 1, weaponX + 30 - halfLookAng, weaponY + 240 - weaponYOffset, - TILE_DEVISTATOR + tileOffset, -32, weaponBits | 4, weaponPal); - G_DrawWeaponTileWithID(currentWeapon, weaponX + 268 - halfLookAng, weaponY + 238 - weaponYOffset, TILE_DEVISTATOR, - weaponShade, weaponBits, weaponPal); - } - } - // else we are in 'reload time' - else - { - weaponYOffset -= (*weaponFrame < ((reloadTime - totalTime) / 2 + totalTime)) - ? 10 * ((*weaponFrame) - totalTime) - : 10 * (reloadTime - (*weaponFrame)); - - G_DrawWeaponTileWithID(currentWeapon, weaponX + 268 - halfLookAng, weaponY + 238 - weaponYOffset, TILE_DEVISTATOR, - weaponShade, weaponBits, weaponPal); - G_DrawWeaponTileWithID(currentWeapon << 1, weaponX + 30 - halfLookAng, weaponY + 240 - weaponYOffset, TILE_DEVISTATOR, - weaponShade, weaponBits | 4, weaponPal); - } - } - else - { - G_DrawWeaponTileWithID(currentWeapon, weaponX + 268 - halfLookAng, weaponY + 238 - weaponYOffset, TILE_DEVISTATOR, - weaponShade, weaponBits, weaponPal); - G_DrawWeaponTileWithID(currentWeapon << 1, weaponX + 30 - halfLookAng, weaponY + 240 - weaponYOffset, TILE_DEVISTATOR, - weaponShade, weaponBits | 4, weaponPal); - } - break; - } - - if (*weaponFrame > 0) - { - static uint8_t const devastatorFrames[] = { 0, 4, 12, 24, 12, 4, 0 }; - - if (*weaponFrame >= ARRAY_SIZE(devastatorFrames)) - break; - - int const tileOffset = ksgn((*weaponFrame) >> 2); - - if (pPlayer->hbomb_hold_delay) - { - G_DrawWeaponTileWithID(currentWeapon, (devastatorFrames[*weaponFrame] >> 1) + weaponX + 268 - halfLookAng, - devastatorFrames[*weaponFrame] + weaponY + 238 - weaponYOffset, - TILE_DEVISTATOR + tileOffset, -32, weaponBits, weaponPal); - G_DrawWeaponTileWithID(currentWeapon << 1, weaponX + 30 - halfLookAng, weaponY + 240 - weaponYOffset, TILE_DEVISTATOR, - weaponShade, weaponBits | 4, weaponPal); - } - else - { - G_DrawWeaponTileWithID(currentWeapon << 1, -(devastatorFrames[*weaponFrame] >> 1) + weaponX + 30 - halfLookAng, - devastatorFrames[*weaponFrame] + weaponY + 240 - weaponYOffset, - TILE_DEVISTATOR + tileOffset, -32, weaponBits | 4, weaponPal); - G_DrawWeaponTileWithID(currentWeapon, weaponX + 268 - halfLookAng, weaponY + 238 - weaponYOffset, TILE_DEVISTATOR, - weaponShade, weaponBits, weaponPal); - } - } - else - { - G_DrawWeaponTileWithID(currentWeapon, weaponX + 268 - halfLookAng, weaponY + 238 - weaponYOffset, TILE_DEVISTATOR, weaponShade, - weaponBits, weaponPal); - G_DrawWeaponTileWithID(currentWeapon << 1, weaponX + 30 - halfLookAng, weaponY + 240 - weaponYOffset, TILE_DEVISTATOR, - weaponShade, weaponBits | 4, weaponPal); - } - break; - - case FREEZE_WEAPON__STATIC: - if (!(duke3d_globalflags & DUKE3D_NO_WIDESCREEN_PINNING) && DUKE) - weaponBits |= 512; - - if ((*weaponFrame) > 0) - { - static uint8_t freezerFrames[] = { 0, 0, 1, 1, 2, 2 }; - - if (*weaponFrame % 6 >= ARRAY_SIZE(freezerFrames)) - break; - - if (doAnim) - { - weaponX += rand() & 3; - weaponY += rand() & 3; - } - weaponYOffset -= 16; - G_DrawWeaponTileWithID(currentWeapon << 1, weaponX + 210 - (pPlayer->look_ang >> 1), weaponY + 261 - weaponYOffset, - TILE_FREEZE + 2, -32, weaponBits, weaponPal); - G_DrawWeaponTileWithID(currentWeapon, weaponX + 210 - (pPlayer->look_ang >> 1), weaponY + 235 - weaponYOffset, - TILE_FREEZE + 3 + freezerFrames[*weaponFrame % 6], -32, weaponBits, weaponPal); - } - else - G_DrawWeaponTileWithID(currentWeapon, weaponX + 210 - (pPlayer->look_ang >> 1), weaponY + 261 - weaponYOffset, - TILE_FREEZE, weaponShade, weaponBits, weaponPal); - break; - - case GROW_WEAPON__STATIC: - case SHRINKER_WEAPON__STATIC: - weaponX += 28; - weaponY += 18; - - if (WW2GI) - { - if (*weaponFrame == 0) - { - // the 'at rest' display - if (currentWeapon == GROW_WEAPON) - { - G_DrawWeaponTileWithID(currentWeapon, weaponX + 188 - halfLookAng, weaponY + 240 - weaponYOffset, TILE_SHRINKER - 2, - weaponShade, weaponBits, weaponPal); - break; - } - else if (pPlayer->ammo_amount[currentWeapon] > 0) - { - G_DrawWeaponTileUnfadedWithID(currentWeapon << 1, weaponX + 184 - halfLookAng, weaponY + 240 - weaponYOffset, TILE_SHRINKER + 2, - 16 - (sintable[pPlayer->random_club_frame & 2047] >> 10), weaponBits, 0); - G_DrawWeaponTileWithID(currentWeapon, weaponX + 188 - halfLookAng, weaponY + 240 - weaponYOffset, TILE_SHRINKER, - weaponShade, weaponBits, weaponPal); - break; - } - } - else - { - // the 'active' display. - if (doAnim) - { - weaponX += rand() & 3; - weaponYOffset += rand() & 3; - } - - int const totalTime = PWEAPON(screenpeek, pPlayer->curr_weapon, TotalTime); - int const reloadTime = PWEAPON(screenpeek, pPlayer->curr_weapon, Reload); - - if (*weaponFrame < totalTime) - { - if (*weaponFrame >= PWEAPON(screenpeek, pPlayer->curr_weapon, FireDelay)) - { - // after fire time. - // lower weapon to reload cartridge (not clip) - weaponYOffset -= (currentWeapon == GROW_WEAPON ? 15 : 10) * (totalTime - (*weaponFrame)); - } - } - // else we are in 'reload time' - else - { - weaponYOffset -= (*weaponFrame < ((reloadTime - totalTime) / 2 + totalTime)) - ? (currentWeapon == GROW_WEAPON ? 5 : 10) * ((*weaponFrame) - totalTime) // D - : 10 * (reloadTime - (*weaponFrame)); // U - } - } - - G_DrawWeaponTileUnfadedWithID(currentWeapon << 1, weaponX + 184 - halfLookAng, weaponY + 240 - weaponYOffset, - TILE_SHRINKER + 3 + ((*weaponFrame) & 3), -32, weaponBits, currentWeapon == GROW_WEAPON ? 2 : 0); - - G_DrawWeaponTileWithID(currentWeapon, weaponX + 188 - halfLookAng, weaponY + 240 - weaponYOffset, - TILE_SHRINKER + (currentWeapon == GROW_WEAPON ? -1 : 1), weaponShade, weaponBits, weaponPal); - - break; - } - - if ((*weaponFrame) > 0) - { - if (doAnim) - { - weaponX += rand() & 3; - weaponYOffset += (rand() & 3); - } - - G_DrawWeaponTileUnfadedWithID(currentWeapon << 1, weaponX + 184 - halfLookAng, weaponY + 240 - weaponYOffset, - TILE_SHRINKER + 3 + ((*weaponFrame) & 3), -32, weaponBits, currentWeapon == GROW_WEAPON ? 2 : 0); - G_DrawWeaponTileWithID(currentWeapon, weaponX + 188 - halfLookAng, weaponY + 240 - weaponYOffset, - currentWeapon == GROW_WEAPON ? TILE_SHRINKER - 1 : TILE_SHRINKER + 1, weaponShade, weaponBits, weaponPal); - } - else - { - G_DrawWeaponTileUnfadedWithID(currentWeapon << 1, weaponX + 184 - halfLookAng, weaponY + 240 - weaponYOffset, - TILE_SHRINKER + 2, 16 - (sintable[pPlayer->random_club_frame & 2047] >> 10), weaponBits, - currentWeapon == GROW_WEAPON ? 2 : 0); - G_DrawWeaponTileWithID(currentWeapon, weaponX + 188 - halfLookAng, weaponY + 240 - weaponYOffset, - currentWeapon == GROW_WEAPON ? TILE_SHRINKER - 2 : TILE_SHRINKER, weaponShade, weaponBits, weaponPal); - } - break; - } - } - } - -enddisplayweapon: - if (!RR) - P_DisplaySpit(); -} #define TURBOTURNTIME (TICRATE/8) // 7 #define NORMALTURN 15 diff --git a/source/games/duke/src/zz_screens.cpp b/source/games/duke/src/zz_screens.cpp index 891883321..a566b6855 100644 --- a/source/games/duke/src/zz_screens.cpp +++ b/source/games/duke/src/zz_screens.cpp @@ -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();