diff --git a/src/g_heretic/a_chicken.cpp b/src/g_heretic/a_chicken.cpp index ee154dc38..3251e3812 100644 --- a/src/g_heretic/a_chicken.cpp +++ b/src/g_heretic/a_chicken.cpp @@ -125,8 +125,7 @@ void P_UpdateBeak (AActor *self) { if (self->player != NULL) { - self->player->psprites[ps_weapon].sy = WEAPONTOP + - (self->player->chickenPeck << (FRACBITS-1)); + self->player->psprites[ps_weapon].sy = WEAPONTOP + self->player->chickenPeck / 2; } } diff --git a/src/g_heretic/a_hereticweaps.cpp b/src/g_heretic/a_hereticweaps.cpp index f1e660ed8..f36ea54b5 100644 --- a/src/g_heretic/a_hereticweaps.cpp +++ b/src/g_heretic/a_hereticweaps.cpp @@ -272,8 +272,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GauntletAttack) if (!weapon->DepleteAmmo (weapon->bAltFire)) return 0; } - player->psprites[ps_weapon].sx = ((pr_gatk()&3)-2) * FRACUNIT; - player->psprites[ps_weapon].sy = WEAPONTOP + (pr_gatk()&3) * FRACUNIT; + player->psprites[ps_weapon].sx = ((pr_gatk()&3)-2); + player->psprites[ps_weapon].sy = WEAPONTOP + (pr_gatk()&3); Angle = self->Angles.Yaw; if (power) { @@ -441,8 +441,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMacePL1) if (!weapon->DepleteAmmo(weapon->bAltFire)) return 0; } - player->psprites[ps_weapon].sx = ((pr_maceatk() & 3) - 2)*FRACUNIT; - player->psprites[ps_weapon].sy = WEAPONTOP + (pr_maceatk() & 3)*FRACUNIT; + player->psprites[ps_weapon].sx = ((pr_maceatk() & 3) - 2); + player->psprites[ps_weapon].sy = WEAPONTOP + (pr_maceatk() & 3); ball = P_SpawnPlayerMissile(self, PClass::FindActor("MaceFX1"), self->Angles.Yaw + (((pr_maceatk() & 7) - 4) * (360. / 256))); if (ball) { @@ -1065,7 +1065,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SkullRodStorm) return 0; } if (self->bouncecount >= 0 && (unsigned)self->bouncecount < self->Sector->e->XFloor.ffloors.Size()) - pos.Z = self->Sector->e->XFloor.ffloors[self->bouncecount]->bottom.plane->ZatPointF(mo);// - 40 * FRACUNIT; + pos.Z = self->Sector->e->XFloor.ffloors[self->bouncecount]->bottom.plane->ZatPointF(mo); else pos.Z = self->Sector->ceilingplane.ZatPointF(mo); int moceiling = P_Find3DFloor(NULL, pos, false, false, pos.Z); diff --git a/src/g_heretic/a_ironlich.cpp b/src/g_heretic/a_ironlich.cpp index 0b0e29e86..820d650f9 100644 --- a/src/g_heretic/a_ironlich.cpp +++ b/src/g_heretic/a_ironlich.cpp @@ -73,7 +73,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichAttack) int randAttack; static const int atkResolve1[] = { 50, 150 }; static const int atkResolve2[] = { 150, 200 }; - int dist; // Ice ball (close 20% : far 60%) // Fire column (close 40% : far 20%) @@ -93,7 +92,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichAttack) P_TraceBleed (newdam > 0 ? newdam : damage, target, self); return 0; } - dist = self->AproxDistance (target) > 8*64*FRACUNIT; + int dist = self->Distance2D(target) > 8 * 64; randAttack = pr_atk (); if (randAttack < atkResolve1[dist]) { // Ice ball diff --git a/src/g_shared/a_artifacts.cpp b/src/g_shared/a_artifacts.cpp index 6cd6006f5..83ce03099 100644 --- a/src/g_shared/a_artifacts.cpp +++ b/src/g_shared/a_artifacts.cpp @@ -1316,10 +1316,10 @@ void APowerTargeter::InitEffect () P_SetPsprite (player, ps_targetright, state + 2); } - player->psprites[ps_targetcenter].sx = (160-3)*FRACUNIT; + player->psprites[ps_targetcenter].sx = (160-3); player->psprites[ps_targetcenter].sy = player->psprites[ps_targetleft].sy = - player->psprites[ps_targetright].sy = (100-3)*FRACUNIT; + player->psprites[ps_targetright].sy = (100-3); PositionAccuracy (); } @@ -1382,8 +1382,8 @@ void APowerTargeter::PositionAccuracy () if (player != NULL) { - player->psprites[ps_targetleft].sx = (160-3)*FRACUNIT - ((100 - player->mo->accuracy) << FRACBITS); - player->psprites[ps_targetright].sx = (160-3)*FRACUNIT + ((100 - player->mo->accuracy) << FRACBITS); + player->psprites[ps_targetleft].sx = (160-3) - ((100 - player->mo->accuracy)); + player->psprites[ps_targetright].sx = (160-3)+ ((100 - player->mo->accuracy)); } } diff --git a/src/g_strife/a_strifestuff.cpp b/src/g_strife/a_strifestuff.cpp index aff0672cd..beb64e2dd 100644 --- a/src/g_strife/a_strifestuff.cpp +++ b/src/g_strife/a_strifestuff.cpp @@ -741,7 +741,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_HandLower) if (self->player != NULL) { pspdef_t *psp = &self->player->psprites[ps_weapon]; - psp->sy += FRACUNIT*9; + psp->sy += 9; if (psp->sy > WEAPONBOTTOM*2) { P_SetPsprite (self->player, ps_weapon, NULL); diff --git a/src/g_strife/a_strifeweapons.cpp b/src/g_strife/a_strifeweapons.cpp index 5ee3393f8..0b56bc416 100644 --- a/src/g_strife/a_strifeweapons.cpp +++ b/src/g_strife/a_strifeweapons.cpp @@ -500,8 +500,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMauler2Pre) if (self->player != NULL) { - self->player->psprites[ps_weapon].sx += pr_mauler2.Random2() << 10; - self->player->psprites[ps_weapon].sy += pr_mauler2.Random2() << 10; + self->player->psprites[ps_weapon].sx += pr_mauler2.Random2() / 64.; + self->player->psprites[ps_weapon].sy += pr_mauler2.Random2() / 64.; } return 0; } diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index 2fef1b625..7b1dbc50d 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -33,8 +33,8 @@ // MACROS ------------------------------------------------------------------ -#define LOWERSPEED FRACUNIT*6 -#define RAISESPEED FRACUNIT*6 +#define LOWERSPEED 6. +#define RAISESPEED 6. // TYPES ------------------------------------------------------------------- @@ -169,11 +169,11 @@ void P_SetPsprite (player_t *player, int position, FState *state, bool nofunctio if (state->GetMisc1()) { // Set coordinates. - psp->sx = state->GetMisc1()<sx = state->GetMisc1(); } if (state->GetMisc2()) { - psp->sy = state->GetMisc2()<sy = state->GetMisc2(); } if (!nofunction && player->mo != NULL) diff --git a/src/p_pspr.h b/src/p_pspr.h index 4d27e3444..2f19eb4e8 100644 --- a/src/p_pspr.h +++ b/src/p_pspr.h @@ -28,12 +28,12 @@ #include "tables.h" #include "thingdef/thingdef.h" -#define WEAPONBOTTOM 128*FRACUNIT +#define WEAPONBOTTOM 128. // [RH] +0x6000 helps it meet the screen bottom // at higher resolutions while still being in // the right spot at 320x200. -#define WEAPONTOP (32*FRACUNIT+0x6000) +#define WEAPONTOP (32+6./16) // @@ -66,8 +66,8 @@ struct pspdef_t { FState* state; // a NULL state means not active int tics; - fixed_t sx; - fixed_t sy; + double sx; + double sy; int sprite; int frame; bool processPending; // true: waiting for periodic processing on this tick diff --git a/src/r_things.cpp b/src/r_things.cpp index a213d4392..5aa00e44c 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -1590,7 +1590,7 @@ void R_DrawPlayerSprites () // [RH] Don't draw the targeter's crosshair if the player already has a crosshair set. if (psp->state && (i != ps_targetcenter || CrosshairImage == NULL)) { - R_DrawPSprite (psp, i, camera, psp->sx + ofsx, psp->sy + ofsy); + R_DrawPSprite (psp, i, camera, FLOAT2FIXED(psp->sx) + ofsx, FLOAT2FIXED(psp->sy) + ofsy); } // [RH] Don't bob the targeter. if (i == ps_flash)