diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index cede59cb7..621d5145a 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -782,7 +782,7 @@ void A_MoveSector(int i) #define LIGHTRAD (s->yrepeat * tilesiz[s->picnum + LIGHTRAD_PICOFS].y) #define LIGHTRAD2 ((s->yrepeat + ((rand() % s->yrepeat)>>2)) * tilesiz[s->picnum + LIGHTRAD_PICOFS].y) -void G_AddGameLight(int32_t radius, int32_t srcsprite, int32_t zoffset, int32_t range, int32_t color, int32_t priority, int32_t smoothratio) +void G_AddGameLight(int32_t radius, int32_t srcsprite, int32_t zoffset, int32_t range, int32_t color, int32_t priority) { #ifdef POLYMER spritetype *s = &sprite[srcsprite]; @@ -801,11 +801,6 @@ void G_AddGameLight(int32_t radius, int32_t srcsprite, int32_t zoffset, int32_t mylight.x = s->x; mylight.y = s->y; mylight.z = s->z - zoffset; - - mylight.x -= mulscale16(65536-smoothratio, s->x-actor[srcsprite].bpos.x); - mylight.y -= mulscale16(65536-smoothratio, s->y-actor[srcsprite].bpos.y); - mylight.z -= mulscale16(65536-smoothratio, s->z-actor[srcsprite].bpos.z); - mylight.color[0] = color & 255; mylight.color[1] = (color >> 8) & 255; mylight.color[2] = (color >> 16) & 255; @@ -2709,6 +2704,9 @@ ACTOR_STATIC void Proj_MoveCustom(int32_t i) case PROJECTILE_RPG: Bmemcpy(&davect, s, sizeof(vec3_t)); + if (proj->flashcolor) + G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), 2048, proj->flashcolor, PR_LIGHT_PRIO_LOW_GAME); + if (proj->workslike & PROJECTILE_BOUNCESOFFWALLS && s->yvel < 1) { A_DoProjectileEffects(i, NULL, 1); @@ -7947,7 +7945,7 @@ static void G_DoEffectorLights(void) // STATNUM 14 } #ifdef POLYMER -static void A_DoLight(int32_t i, int32_t smoothratio) +static void A_DoLight(int32_t i) { spritetype *const s = &sprite[i]; int32_t numsavedfires = 0; @@ -8014,7 +8012,7 @@ static void A_DoLight(int32_t i, int32_t smoothratio) goto POOP; G_AddGameLight(0, i, (s->yrepeat*tilesiz[s->picnum].y)<<1, 512-ii*128, - ii==0 ? (172+(200<<8)+(104<<16)) : 216+(52<<8)+(20<<16), PR_LIGHT_PRIO_LOW, smoothratio); + ii==0 ? (172+(200<<8)+(104<<16)) : 216+(52<<8)+(20<<16), PR_LIGHT_PRIO_LOW); POOP: s->x -= d.x; @@ -8027,7 +8025,7 @@ static void A_DoLight(int32_t i, int32_t smoothratio) switch (DYNAMICTILEMAP(s->picnum)) { case ATOMICHEALTH__STATIC: - G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), LIGHTRAD2, 128+(128<<8)+(255<<16),PR_LIGHT_PRIO_HIGH_GAME, smoothratio); + G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), LIGHTRAD2, 128+(128<<8)+(255<<16),PR_LIGHT_PRIO_HIGH_GAME); break; case FIRE__STATIC: @@ -8061,7 +8059,7 @@ static void A_DoLight(int32_t i, int32_t smoothratio) if (jj==-1 && numsavedfires<32) { jj = numsavedfires; - G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), LIGHTRAD2, color, PR_LIGHT_PRIO_HIGH_GAME, smoothratio); + G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), LIGHTRAD2, color, PR_LIGHT_PRIO_HIGH_GAME); savedfires[jj][0] = s->sectnum; savedfires[jj][1] = s->x>>3; savedfires[jj][2] = s->y>>3; @@ -8073,12 +8071,12 @@ static void A_DoLight(int32_t i, int32_t smoothratio) case OOZFILTER__STATIC: if (s->xrepeat > 4) - G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), 4096, 176+(252<<8)+(120<<16),PR_LIGHT_PRIO_HIGH_GAME, smoothratio); + G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), 4096, 176+(252<<8)+(120<<16),PR_LIGHT_PRIO_HIGH_GAME); break; case FLOORFLAME__STATIC: case FIREBARREL__STATIC: case FIREVASE__STATIC: - G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<2), LIGHTRAD2>>1, 255+(95<<8),PR_LIGHT_PRIO_HIGH_GAME, smoothratio); + G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<2), LIGHTRAD2>>1, 255+(95<<8),PR_LIGHT_PRIO_HIGH_GAME); break; case EXPLOSION2__STATIC: @@ -8092,7 +8090,7 @@ static void A_DoLight(int32_t i, int32_t smoothratio) s->y -= y; G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), LIGHTRAD, 240+(160<<8)+(80<<16), - s->yrepeat > 32 ? PR_LIGHT_PRIO_HIGH_GAME : PR_LIGHT_PRIO_LOW_GAME, smoothratio); + s->yrepeat > 32 ? PR_LIGHT_PRIO_HIGH_GAME : PR_LIGHT_PRIO_LOW_GAME); s->x += x; s->y += y; @@ -8100,7 +8098,7 @@ static void A_DoLight(int32_t i, int32_t smoothratio) break; case FORCERIPPLE__STATIC: case TRANSPORTERBEAM__STATIC: - G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), LIGHTRAD, 80+(80<<8)+(255<<16),PR_LIGHT_PRIO_LOW_GAME, smoothratio); + G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), LIGHTRAD, 80+(80<<8)+(255<<16),PR_LIGHT_PRIO_LOW_GAME); break; case GROWSPARK__STATIC: { @@ -8110,7 +8108,7 @@ static void A_DoLight(int32_t i, int32_t smoothratio) s->x -= x; s->y -= y; - G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), 1024, 216+(52<<8)+(20<<16),PR_LIGHT_PRIO_HIGH_GAME, smoothratio); + G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), 1024, 216+(52<<8)+(20<<16),PR_LIGHT_PRIO_HIGH_GAME); s->x += x; s->y += y; @@ -8124,27 +8122,27 @@ static void A_DoLight(int32_t i, int32_t smoothratio) s->x -= x; s->y -= y; - G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), 2048, 176+(252<<8)+(120<<16),PR_LIGHT_PRIO_HIGH_GAME, smoothratio); + G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), 2048, 176+(252<<8)+(120<<16),PR_LIGHT_PRIO_HIGH_GAME); s->x += x; s->y += y; } break; case FREEZEBLAST__STATIC: - G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), LIGHTRAD<<2, 72+(88<<8)+(140<<16),PR_LIGHT_PRIO_HIGH_GAME, smoothratio); + G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), LIGHTRAD<<2, 72+(88<<8)+(140<<16),PR_LIGHT_PRIO_HIGH_GAME); break; case COOLEXPLOSION1__STATIC: - G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), LIGHTRAD<<2, 128+(0<<8)+(255<<16),PR_LIGHT_PRIO_HIGH_GAME, smoothratio); + G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), LIGHTRAD<<2, 128+(0<<8)+(255<<16),PR_LIGHT_PRIO_HIGH_GAME); break; case SHRINKSPARK__STATIC: - G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), LIGHTRAD, 176+(252<<8)+(120<<16),PR_LIGHT_PRIO_HIGH_GAME, smoothratio); + G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), LIGHTRAD, 176+(252<<8)+(120<<16),PR_LIGHT_PRIO_HIGH_GAME); break; case FIRELASER__STATIC: if (s->statnum == STAT_PROJECTILE) - G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), 64 * s->yrepeat, 255+(95<<8),PR_LIGHT_PRIO_LOW_GAME, smoothratio); + G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), 64 * s->yrepeat, 255+(95<<8),PR_LIGHT_PRIO_LOW_GAME); break; case RPG__STATIC: - G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), 128 * s->yrepeat, 255+(95<<8),PR_LIGHT_PRIO_LOW_GAME, smoothratio); + G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), 128 * s->yrepeat, 255+(95<<8),PR_LIGHT_PRIO_LOW_GAME); break; case SHOTSPARK1__STATIC: if (actor[i].t_data[2] == 0) // check for first frame of action @@ -8155,62 +8153,13 @@ static void A_DoLight(int32_t i, int32_t smoothratio) s->x -= x; s->y -= y; - G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), 8 * s->yrepeat, 240+(160<<8)+(80<<16),PR_LIGHT_PRIO_LOW_GAME, smoothratio); + G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), 8 * s->yrepeat, 240+(160<<8)+(80<<16),PR_LIGHT_PRIO_LOW_GAME); actor[i].lightcount = 1; s->x += x; s->y += y; } break; - case APLAYER__STATIC: - { - int const snum = sprite[i].yvel; - DukePlayer_t *p = g_player[snum].ps; - - if (!(PWEAPON(snum, p->curr_weapon, Flags) & WEAPON_NOVISIBLE) && p->kickback_pic && P_WeaponState(snum, 0)) - { - spritetype *s = &sprite[p->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, p->i, PHEIGHT, 8192, PWEAPON(snum, p->curr_weapon, FlashColor), PR_LIGHT_PRIO_MAX_GAME, smoothratio); - actor[p->i].lightcount = 2; - - s->x -= x; - s->y -= y; - } - - if (PWEAPON(snum, p->curr_weapon, Flags) & WEAPON_GLOWS) - { - if (p->kickback_pic == 0) - { - spritetype *s = &sprite[p->i]; - int32_t x = ((sintable[(s->ang+512)&2047])>>7), y = ((sintable[(s->ang)&2047])>>7); - int32_t r = 1024+(sintable[p->random_club_frame&2047]>>3); - - s->x += x; - s->y += y; - - G_AddGameLight(0, p->i, PHEIGHT, max(r, 0), PWEAPON(snum, p->curr_weapon, FlashColor), PR_LIGHT_PRIO_HIGH_GAME, smoothratio); - actor[p->i].lightcount = 2; - - s->x -= x; - s->y -= y; - } - } - } - break; - default: - if (s->statnum == STAT_PROJECTILE) - { - projectile_t *proj = &SpriteProjectile[i]; - - if ((proj->workslike & PROJECTILE_TYPE_MASK) == PROJECTILE_RPG && proj->flashcolor) - G_AddGameLight(0, i, ((s->yrepeat*tilesiz[s->picnum].y)<<1), 2048, proj->flashcolor, PR_LIGHT_PRIO_LOW_GAME, smoothratio); - } - break; } } } @@ -8329,7 +8278,7 @@ int32_t A_CheckSwitchTile(int32_t i) return 0; } -void G_RefreshLights(int32_t smoothratio) +void G_RefreshLights(void) { #ifdef POLYMER if (Numsprites && getrendermode() == REND_POLYMER) @@ -8342,7 +8291,7 @@ void G_RefreshLights(int32_t smoothratio) while (i >= 0) { - A_DoLight(i, smoothratio); + A_DoLight(i); i = nextspritestat[i]; } } while (k < MAXSTATUS); @@ -8438,7 +8387,7 @@ void G_MoveWorld(void) } while (k < MAXSTATUS); } -// G_RefreshLights(); + G_RefreshLights(); G_DoSectorAnimations(); G_MoveFX(); //ST 11 } diff --git a/polymer/eduke32/source/actors.h b/polymer/eduke32/source/actors.h index ce4c95a0e..0783c9b44 100644 --- a/polymer/eduke32/source/actors.h +++ b/polymer/eduke32/source/actors.h @@ -314,11 +314,11 @@ void A_PlayAlertSound(int32_t i); void A_RadiusDamage(int32_t i,int32_t r,int32_t hp1,int32_t hp2,int32_t hp3,int32_t hp4); void A_SpawnMultiple(int32_t sp,int32_t pic,int32_t n); -void G_AddGameLight(int32_t radius,int32_t srcsprite,int32_t zoffset,int32_t range,int32_t color,int32_t priority, int32_t smoothratio); +void G_AddGameLight(int32_t radius,int32_t srcsprite,int32_t zoffset,int32_t range,int32_t color,int32_t priority); void G_ClearCameraView(DukePlayer_t *ps); void G_DoInterpolations(int32_t smoothratio); void G_MoveWorld(void); -void G_RefreshLights(int32_t smoothratio); +void G_RefreshLights(void); int32_t G_SetInterpolation(int32_t * const posptr); void G_StopInterpolation(int32_t * const posptr); diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 6afc7c9e2..cad462559 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -722,7 +722,6 @@ void G_DrawRooms(int32_t snum, int32_t smoothratio) CAMERA(sect) = p->cursectnum; - G_RefreshLights(smoothratio); G_DoInterpolations(smoothratio); G_AnimateCamSprite(smoothratio); @@ -2134,7 +2133,7 @@ int32_t A_Spawn(int32_t j, int32_t pn) case EXPLOSION2__STATIC: if (sp->yrepeat > 32) { - G_AddGameLight(0, i, ((sp->yrepeat*tilesiz[sp->picnum].y)<<1), 32768, 255+(95<<8),PR_LIGHT_PRIO_MAX_GAME, 65536); + G_AddGameLight(0, i, ((sp->yrepeat*tilesiz[sp->picnum].y)<<1), 32768, 255+(95<<8),PR_LIGHT_PRIO_MAX_GAME); actor[i].lightcount = 2; } case EXPLOSION2BOT__STATIC: diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index 4b5aa9636..3b62a9acc 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -2959,7 +2959,7 @@ static void M_MenuEntryOptionDidModify(MenuEntry_t *entry) if (setgamemode(fullscreen, xdim, ydim, bpp)) OSD_Printf("restartvid: Reset failed...\n"); onvideomodechange(ud.config.ScreenBPP>8); - G_RefreshLights(65536); + G_RefreshLights(); } #endif } diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index b3b72e703..e68ef517b 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -872,6 +872,20 @@ static int32_t A_ShootCustom(const int32_t i, const int32_t atwith, int16_t sa, const int32_t p = (s->picnum == APLAYER) ? P_GetP(s) : -1; DukePlayer_t *const ps = p >= 0 ? g_player[p].ps : NULL; +#ifdef POLYMER + if (getrendermode() == REND_POLYMER && proj->flashcolor) + { + int32_t x = ((sintable[(s->ang + 512) & 2047]) >> 7), y = ((sintable[(s->ang) & 2047]) >> 7); + + s->x += x; + s->y += y; + G_AddGameLight(0, i, PHEIGHT, 8192, proj->flashcolor, PR_LIGHT_PRIO_MAX_GAME); + actor[i].lightcount = 2; + s->x -= x; + s->y -= y; + } +#endif // POLYMER + if (proj->offset == 0) proj->offset = 1; @@ -1619,6 +1633,29 @@ int32_t A_ShootWithZvel(int32_t i, int32_t atwith, int32_t override_zvel) srcvect.y += (sintable[(sa+512+96)&2047]>>7); } } + +#ifdef POLYMER + switch (DYNAMICTILEMAP(atwith)) + { + case FIRELASER__STATIC: + case SHOTGUN__STATIC: + case SHOTSPARK1__STATIC: + case CHAINGUN__STATIC: + case RPG__STATIC: + case MORTER__STATIC: + { + int32_t x = ((sintable[(s->ang+512)&2047])>>7), y = ((sintable[(s->ang)&2047])>>7); + s->x += x; + s->y += y; + G_AddGameLight(0, i, PHEIGHT, 8192, 255+(95<<8), PR_LIGHT_PRIO_MAX_GAME); + actor[i].lightcount = 2; + s->x -= x; + s->y -= y; + } + + break; + } +#endif // POLYMER } return A_CheckSpriteTileFlags(atwith, SFLAG_PROJECTILE) ? @@ -1953,7 +1990,20 @@ static void P_FireWeapon(int32_t snum) } if (!(PWEAPON(snum, p->curr_weapon, Flags) & WEAPON_NOVISIBLE)) + { +#ifdef POLYMER + spritetype *s = &sprite[p->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, p->i, PHEIGHT, 8192, PWEAPON(snum, p->curr_weapon, FlashColor), PR_LIGHT_PRIO_MAX_GAME); + actor[p->i].lightcount = 2; + s->x -= x; + s->y -= y; +#endif // POLYMER p->visibility = 0; + } } static void P_DoWeaponSpawn(int32_t snum) @@ -3793,58 +3843,6 @@ void P_FragPlayer(int32_t snum) # define PIPEBOMB_CONTROL(snum) (Gv_GetVarByLabel("PIPEBOMB_CONTROL", PIPEBOMB_REMOTE, -1, snum)) #endif -enum -{ - WS_NOTHING, - WS_FIRE, - WS_FIRE_AND_SPAWN, -}; - -int32_t P_WeaponState(int32_t snum, int32_t reset) -{ - int32_t kb = g_player[snum].ps->kickback_pic; - int32_t weapon = g_player[snum].ps->curr_weapon; - - if ((kb) < PWEAPON(snum, weapon, TotalTime)) - { - if (PWEAPON(snum, weapon, Flags) & WEAPON_AUTOMATIC) - { - if (!(PWEAPON(snum, weapon, Flags) & WEAPON_SEMIAUTO)) - { - if (reset) - kb = 0; - - if (PWEAPON(snum, weapon, Flags) & WEAPON_FIREEVERYTHIRD) - { - if ((kb % 3) == 0) - return WS_FIRE_AND_SPAWN; - } - else if (PWEAPON(snum, weapon, Flags) & WEAPON_FIREEVERYOTHER) - return WS_FIRE_AND_SPAWN; - else - { - if (kb == PWEAPON(snum, weapon, FireDelay)) - return WS_FIRE; - } - } - else - { - if (PWEAPON(snum, weapon, Flags) & WEAPON_FIREEVERYOTHER) - return WS_FIRE_AND_SPAWN; - else - { - if (kb == PWEAPON(snum, weapon, FireDelay)) - return WS_FIRE; - } - } - } - else if (kb == PWEAPON(snum, weapon, FireDelay)) - return WS_FIRE; - } - - return WS_NOTHING; -} - static void P_ProcessWeapon(int32_t snum) { DukePlayer_t *const p = g_player[snum].ps; @@ -3918,8 +3916,25 @@ static void P_ProcessWeapon(int32_t snum) } if (PWEAPON(snum, p->curr_weapon, Flags) & WEAPON_GLOWS) + { p->random_club_frame += 64; // Glowing + if (p->kickback_pic == 0) + { + spritetype *s = &sprite[p->i]; + int32_t x = ((sintable[(s->ang+512)&2047])>>7), y = ((sintable[(s->ang)&2047])>>7); + int32_t r = 1024+(sintable[p->random_club_frame&2047]>>3); + + s->x += x; + s->y += y; + G_AddGameLight(0, p->i, PHEIGHT, max(r, 0), PWEAPON(snum, p->curr_weapon, FlashColor),PR_LIGHT_PRIO_HIGH_GAME); + actor[p->i].lightcount = 2; + s->x -= x; + s->y -= y; + } + + } + // this is a hack for WEAPON_FIREEVERYOTHER if (actor[p->i].t_data[7]) { @@ -4290,32 +4305,63 @@ static void P_ProcessWeapon(int32_t snum) } } } - else if (*kb >= PWEAPON(snum, p->curr_weapon, FireDelay) && (*kb) < PWEAPON(snum, p->curr_weapon, TotalTime) && - ((PWEAPON(snum, p->curr_weapon, WorksLike) == KNEE_WEAPON) ? 1 : p->ammo_amount[p->curr_weapon] > 0)) + else if (*kb >= PWEAPON(snum, p->curr_weapon, FireDelay) && (*kb) < PWEAPON(snum, p->curr_weapon, TotalTime) + && ((PWEAPON(snum, p->curr_weapon, WorksLike) == KNEE_WEAPON)?1:p->ammo_amount[p->curr_weapon] > 0)) { - int const reset = (TEST_SYNC_KEY(sb_snum, SK_FIRE) == 0 && PWEAPON(snum, p->curr_weapon, Flags) & WEAPON_RESET); - - switch (P_WeaponState(snum, reset)) + if (PWEAPON(snum, p->curr_weapon, Flags) & WEAPON_AUTOMATIC) { - case WS_FIRE_AND_SPAWN: - P_FireWeapon(snum); - P_DoWeaponSpawn(snum); - - if (reset) *kb = 0; - else if (PWEAPON(snum, p->curr_weapon, Flags) & WEAPON_RESET && - (*kb) > PWEAPON(snum, p->curr_weapon, TotalTime) - PWEAPON(snum, p->curr_weapon, HoldDelay)) - *kb = (TEST_SYNC_KEY(sb_snum, SK_FIRE)) ? 1 : 0; - break; - case WS_FIRE: - P_FireWeapon(snum); - - if (reset) *kb = 0; - else if (PWEAPON(snum, p->curr_weapon, Flags) & WEAPON_RESET && - (*kb) > PWEAPON(snum, p->curr_weapon, TotalTime) - PWEAPON(snum, p->curr_weapon, HoldDelay)) - *kb = (TEST_SYNC_KEY(sb_snum, SK_FIRE)) ? 1 : 0; - break; - default: break; + if (!(PWEAPON(snum, p->curr_weapon, Flags) & WEAPON_SEMIAUTO)) + { + if (TEST_SYNC_KEY(sb_snum, SK_FIRE) == 0 && PWEAPON(snum, p->curr_weapon, Flags) & WEAPON_RESET) + *kb = 0; + if (PWEAPON(snum, p->curr_weapon, Flags) & WEAPON_FIREEVERYTHIRD) + { + if (((*(kb))%3) == 0) + { + P_FireWeapon(snum); + P_DoWeaponSpawn(snum); + } + } + else if (PWEAPON(snum, p->curr_weapon, Flags) & WEAPON_FIREEVERYOTHER) + { + P_FireWeapon(snum); + P_DoWeaponSpawn(snum); + } + else + { + if (*kb == PWEAPON(snum, p->curr_weapon, FireDelay)) + { + P_FireWeapon(snum); +// P_DoWeaponSpawn(snum); + } + } + if (PWEAPON(snum, p->curr_weapon, Flags) & WEAPON_RESET && + (*kb) > PWEAPON(snum, p->curr_weapon, TotalTime)-PWEAPON(snum, p->curr_weapon, HoldDelay) && + ((PWEAPON(snum, p->curr_weapon, WorksLike) == KNEE_WEAPON) || p->ammo_amount[p->curr_weapon] > 0)) + { + if (TEST_SYNC_KEY(sb_snum, SK_FIRE)) *kb = 1; + else *kb = 0; + } + } + else + { + if (PWEAPON(snum, p->curr_weapon, Flags) & WEAPON_FIREEVERYOTHER) + { + P_FireWeapon(snum); + P_DoWeaponSpawn(snum); + } + else + { + if (*kb == PWEAPON(snum, p->curr_weapon, FireDelay)) + { + P_FireWeapon(snum); +// P_DoWeaponSpawn(snum); + } + } + } } + else if (*kb == PWEAPON(snum, p->curr_weapon, FireDelay)) + P_FireWeapon(snum); } } } @@ -5333,7 +5379,6 @@ HORIZONLY: // RBG*** p->pos.z += PHEIGHT; - actor[p->i].bpos = *(vec3_t *)&sprite[p->i]; setsprite(p->i,(vec3_t *)&p->pos.x); p->pos.z -= PHEIGHT; diff --git a/polymer/eduke32/source/player.h b/polymer/eduke32/source/player.h index 1094a03b6..c70a2c1df 100644 --- a/polymer/eduke32/source/player.h +++ b/polymer/eduke32/source/player.h @@ -352,7 +352,6 @@ void P_QuickKill(DukePlayer_t *p); void P_SelectNextInvItem(DukePlayer_t *p); void P_UpdateScreenPal(DukePlayer_t *p); void P_EndLevel(void); -int32_t P_WeaponState(int32_t snum, int32_t reset); void P_CheckWeaponI(int32_t snum); int32_t P_GetHudPal(const DukePlayer_t *p);