mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 15:22:15 +00:00
- floatified the remaining fixed point variables accessible through DECORATE. PROP_FIXED_PARAM is no longer used anywhere.
This commit is contained in:
parent
7a26318bf0
commit
4d22b346f4
8 changed files with 30 additions and 35 deletions
|
@ -150,17 +150,17 @@ public:
|
|||
|
||||
// [GRB] Player class properties
|
||||
double JumpZ;
|
||||
fixed_t GruntSpeed;
|
||||
fixed_t FallingScreamMinSpeed, FallingScreamMaxSpeed;
|
||||
double GruntSpeed;
|
||||
double FallingScreamMinSpeed, FallingScreamMaxSpeed;
|
||||
double ViewHeight;
|
||||
double ForwardMove1, ForwardMove2;
|
||||
double SideMove1, SideMove2;
|
||||
FTextureID ScoreIcon;
|
||||
int SpawnMask;
|
||||
FNameNoInit MorphWeapon;
|
||||
fixed_t AttackZOffset; // attack height, relative to player center
|
||||
fixed_t UseRange; // [NS] Distance at which player can +use
|
||||
fixed_t AirCapacity; // Multiplier for air supply underwater.
|
||||
double AttackZOffset; // attack height, relative to player center
|
||||
double UseRange; // [NS] Distance at which player can +use
|
||||
double AirCapacity; // Multiplier for air supply underwater.
|
||||
PClassActor *FlechetteType;
|
||||
|
||||
|
||||
|
|
|
@ -4014,7 +4014,7 @@ void DLevelScript::DoSetActorProperty (AActor *actor, int property, int value)
|
|||
|
||||
case APROP_AttackZOffset:
|
||||
if (actor->IsKindOf (RUNTIME_CLASS (APlayerPawn)))
|
||||
static_cast<APlayerPawn *>(actor)->AttackZOffset = value;
|
||||
static_cast<APlayerPawn *>(actor)->AttackZOffset = ACSToDouble(value);
|
||||
break;
|
||||
|
||||
case APROP_StencilColor:
|
||||
|
@ -4108,7 +4108,7 @@ int DLevelScript::GetActorProperty (int tid, int property)
|
|||
case APROP_AttackZOffset:
|
||||
if (actor->IsKindOf (RUNTIME_CLASS (APlayerPawn)))
|
||||
{
|
||||
return static_cast<APlayerPawn *>(actor)->AttackZOffset;
|
||||
return DoubleToACS(static_cast<APlayerPawn *>(actor)->AttackZOffset);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -4027,7 +4027,7 @@ DAngle P_AimLineAttack(AActor *t1, DAngle angle, double distance, FTranslatedLin
|
|||
fixed_t shootz = t1->_f_Z() + (t1->_f_height() >> 1) - t1->_f_floorclip();
|
||||
if (t1->player != NULL)
|
||||
{
|
||||
shootz += fixed_t(t1->player->mo->AttackZOffset * t1->player->crouchfactor);
|
||||
shootz += FLOAT2FIXED(t1->player->mo->AttackZOffset * t1->player->crouchfactor);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -4172,7 +4172,7 @@ AActor *P_LineAttack(AActor *t1, DAngle angle, double distance,
|
|||
shootz = t1->_f_Z() - t1->_f_floorclip() + (t1->_f_height() >> 1);
|
||||
if (t1->player != NULL)
|
||||
{
|
||||
shootz += fixed_t(t1->player->mo->AttackZOffset * t1->player->crouchfactor);
|
||||
shootz += FLOAT2FIXED(t1->player->mo->AttackZOffset * t1->player->crouchfactor);
|
||||
if (damageType == NAME_Melee || damageType == NAME_Hitscan)
|
||||
{
|
||||
// this is coming from a weapon attack function which needs to transfer information to the obituary code,
|
||||
|
@ -4433,7 +4433,7 @@ AActor *P_LinePickActor(AActor *t1, angle_t angle, fixed_t distance, int pitch,
|
|||
shootz = t1->_f_Z() - t1->_f_floorclip() + (t1->_f_height() >> 1);
|
||||
if (t1->player != NULL)
|
||||
{
|
||||
shootz += fixed_t(t1->player->mo->AttackZOffset * t1->player->crouchfactor);
|
||||
shootz += FLOAT2FIXED(t1->player->mo->AttackZOffset * t1->player->crouchfactor);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -4707,7 +4707,7 @@ void P_RailAttack(AActor *source, int damage, int offset_xy, fixed_t offset_z, i
|
|||
{
|
||||
if (source->player != NULL)
|
||||
{
|
||||
shootz += fixed_t(source->player->mo->AttackZOffset * source->player->crouchfactor);
|
||||
shootz += FLOAT2FIXED(source->player->mo->AttackZOffset * source->player->crouchfactor);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -5092,8 +5092,6 @@ bool P_NoWayTraverse(AActor *usething, fixed_t startx, fixed_t starty, fixed_t e
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
CVAR(Int, userange, 0, 0);
|
||||
|
||||
void P_UseLines(player_t *player)
|
||||
{
|
||||
bool foundline = false;
|
||||
|
@ -5101,7 +5099,7 @@ void P_UseLines(player_t *player)
|
|||
// If the player is transitioning a portal, use the group that is at its vertical center.
|
||||
fixedvec2 start = player->mo->GetPortalTransition(player->mo->_f_height() / 2);
|
||||
// [NS] Now queries the Player's UseRange.
|
||||
fixedvec2 end = start + Vec2Angle(userange > 0? fixed_t(userange<<FRACBITS) : player->mo->UseRange, player->mo->_f_angle());
|
||||
fixedvec2 end = start + Vec2Angle(FLOAT2FIXED(player->mo->UseRange), player->mo->_f_angle());
|
||||
|
||||
// old code:
|
||||
//
|
||||
|
@ -5141,7 +5139,7 @@ bool P_UsePuzzleItem(AActor *PuzzleItemUser, int PuzzleItemType)
|
|||
|
||||
// [NS] If it's a Player, get their UseRange.
|
||||
if (PuzzleItemUser->player)
|
||||
usedist = PuzzleItemUser->player->mo->UseRange;
|
||||
usedist = FLOAT2FIXED(PuzzleItemUser->player->mo->UseRange);
|
||||
else
|
||||
usedist = USERANGE;
|
||||
|
||||
|
|
|
@ -2716,7 +2716,7 @@ static void PlayerLandedOnThing (AActor *mo, AActor *onmobj)
|
|||
{
|
||||
grunted = false;
|
||||
// Why should this number vary by gravity?
|
||||
if (mo->health > 0 && mo->_f_velz() < -mo->player->mo->GruntSpeed)
|
||||
if (mo->health > 0 && mo->Vel.Z < -mo->player->mo->GruntSpeed)
|
||||
{
|
||||
S_Sound (mo, CHAN_VOICE, "*grunt", 1, ATTN_NORM);
|
||||
grunted = true;
|
||||
|
@ -6177,7 +6177,7 @@ AActor *P_SpawnPlayerMissile (AActor *source, double x, double y, double z,
|
|||
z += source->Center() - source->Floorclip;
|
||||
if (source->player != NULL) // Considering this is for player missiles, it better not be NULL.
|
||||
{
|
||||
z += ((FIXED2DBL(source->player->mo->AttackZOffset) - 4) * source->player->crouchfactor);
|
||||
z += ((source->player->mo->AttackZOffset - 4) * source->player->crouchfactor);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -648,9 +648,9 @@ void APlayerPawn::Serialize (FArchive &arc)
|
|||
<< FlechetteType;
|
||||
if (SaveVersion < 3829)
|
||||
{
|
||||
GruntSpeed = 12*FRACUNIT;
|
||||
FallingScreamMinSpeed = 35*FRACUNIT;
|
||||
FallingScreamMaxSpeed = 40*FRACUNIT;
|
||||
GruntSpeed = 12;
|
||||
FallingScreamMinSpeed = 35;
|
||||
FallingScreamMaxSpeed = 40;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1265,7 +1265,7 @@ bool APlayerPawn::ResetAirSupply (bool playgasp)
|
|||
{
|
||||
S_Sound (this, CHAN_VOICE, "*gasp", 1, ATTN_NORM);
|
||||
}
|
||||
if (level.airsupply> 0 && player->mo->AirCapacity > 0) player->air_finished = level.time + FixedMul(level.airsupply, player->mo->AirCapacity);
|
||||
if (level.airsupply> 0 && player->mo->AirCapacity > 0) player->air_finished = level.time + int(level.airsupply * player->mo->AirCapacity);
|
||||
else player->air_finished = INT_MAX;
|
||||
return wasdrowning;
|
||||
}
|
||||
|
@ -2618,8 +2618,8 @@ void P_PlayerThink (player_t *player)
|
|||
// Player must be touching the floor
|
||||
P_PlayerOnSpecialFlat(player, P_GetThingFloorType(player->mo));
|
||||
}
|
||||
if (player->mo->_f_velz() <= -player->mo->FallingScreamMinSpeed &&
|
||||
player->mo->_f_velz() >= -player->mo->FallingScreamMaxSpeed && !player->morphTics &&
|
||||
if (player->mo->Vel.Z <= -player->mo->FallingScreamMinSpeed &&
|
||||
player->mo->Vel.Z >= -player->mo->FallingScreamMaxSpeed && !player->morphTics &&
|
||||
player->mo->waterlevel == 0)
|
||||
{
|
||||
int id = S_FindSkinnedSound (player->mo, "*falling");
|
||||
|
|
|
@ -326,9 +326,6 @@ int MatchString (const char *in, const char **strings);
|
|||
#define PROP_DOUBLE_PARM(var, no) \
|
||||
double var = params[(no)+1].d;
|
||||
|
||||
#define PROP_FIXED_PARM(var, no) \
|
||||
fixed_t var = FLOAT2FIXED(params[(no)+1].d);
|
||||
|
||||
#define PROP_COLOR_PARM(var, no) \
|
||||
int var = params[(no)+1].i== 0? params[(no)+2].i : V_GetColor(NULL, params[(no)+2].s);
|
||||
|
||||
|
|
|
@ -3736,7 +3736,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckLOF)
|
|||
pos.z += (self->_f_height() >> 1);
|
||||
if (self->player != NULL)
|
||||
{
|
||||
pos.z += fixed_t (self->player->mo->AttackZOffset * self->player->crouchfactor);
|
||||
pos.z += FLOAT2FIXED(self->player->mo->AttackZOffset * self->player->crouchfactor);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -2093,9 +2093,9 @@ DEFINE_CLASS_PROPERTY(slotnumber, I, Weapon)
|
|||
//==========================================================================
|
||||
DEFINE_CLASS_PROPERTY(slotpriority, F, Weapon)
|
||||
{
|
||||
PROP_FIXED_PARM(i, 0);
|
||||
PROP_DOUBLE_PARM(i, 0);
|
||||
assert(info->IsKindOf(RUNTIME_CLASS(PClassWeapon)));
|
||||
static_cast<PClassWeapon *>(info)->SlotPriority = i;
|
||||
static_cast<PClassWeapon *>(info)->SlotPriority = int(i*65536);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
@ -2504,7 +2504,7 @@ DEFINE_CLASS_PROPERTY_PREFIX(player, clearcolorset, I, PlayerPawn)
|
|||
//==========================================================================
|
||||
DEFINE_CLASS_PROPERTY_PREFIX(player, attackzoffset, F, PlayerPawn)
|
||||
{
|
||||
PROP_FIXED_PARM(z, 0);
|
||||
PROP_DOUBLE_PARM(z, 0);
|
||||
defaults->AttackZOffset = z;
|
||||
}
|
||||
|
||||
|
@ -2522,7 +2522,7 @@ DEFINE_CLASS_PROPERTY_PREFIX(player, jumpz, F, PlayerPawn)
|
|||
//==========================================================================
|
||||
DEFINE_CLASS_PROPERTY_PREFIX(player, GruntSpeed, F, PlayerPawn)
|
||||
{
|
||||
PROP_FIXED_PARM(z, 0);
|
||||
PROP_DOUBLE_PARM(z, 0);
|
||||
defaults->GruntSpeed = z;
|
||||
}
|
||||
|
||||
|
@ -2531,8 +2531,8 @@ DEFINE_CLASS_PROPERTY_PREFIX(player, GruntSpeed, F, PlayerPawn)
|
|||
//==========================================================================
|
||||
DEFINE_CLASS_PROPERTY_PREFIX(player, FallingScreamSpeed, FF, PlayerPawn)
|
||||
{
|
||||
PROP_FIXED_PARM(minz, 0);
|
||||
PROP_FIXED_PARM(maxz, 1);
|
||||
PROP_DOUBLE_PARM(minz, 0);
|
||||
PROP_DOUBLE_PARM(maxz, 1);
|
||||
defaults->FallingScreamMinSpeed = minz;
|
||||
defaults->FallingScreamMaxSpeed = maxz;
|
||||
}
|
||||
|
@ -2582,7 +2582,7 @@ DEFINE_CLASS_PROPERTY_PREFIX(player, viewheight, F, PlayerPawn)
|
|||
//==========================================================================
|
||||
DEFINE_CLASS_PROPERTY_PREFIX(player, userange, F, PlayerPawn)
|
||||
{
|
||||
PROP_FIXED_PARM(z, 0);
|
||||
PROP_DOUBLE_PARM(z, 0);
|
||||
defaults->UseRange = z;
|
||||
}
|
||||
|
||||
|
@ -2591,7 +2591,7 @@ DEFINE_CLASS_PROPERTY_PREFIX(player, userange, F, PlayerPawn)
|
|||
//==========================================================================
|
||||
DEFINE_CLASS_PROPERTY_PREFIX(player, aircapacity, F, PlayerPawn)
|
||||
{
|
||||
PROP_FIXED_PARM(z, 0);
|
||||
PROP_DOUBLE_PARM(z, 0);
|
||||
defaults->AirCapacity = z;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue