Skip to content

Commit

Permalink
- Clean up some GCC const warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjr4077au committed Nov 5, 2023
1 parent 85bbf80 commit 9e1ce2b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions source/core/coreplayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ class DCorePlayer : public DObject

// All overridable methods.
virtual DCoreActor* GetActor() = 0;
virtual const bool canSlopeTilt() const { return false; }
virtual const unsigned getCrouchFlags() const = 0;
virtual bool canSlopeTilt() const { return false; }
virtual unsigned getCrouchFlags() const = 0;
virtual double GetMaxInputVel() const = 0;
virtual const DVector2& GetInputVelocity() const { return actor->vel.XY(); }
virtual const double GetMaxInputVel() const = 0;

// Angle prototypes.
void doPitchInput();
Expand Down
6 changes: 3 additions & 3 deletions source/games/blood/src/bloodactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,19 +300,19 @@ class DBloodPlayer final : public DCorePlayer
return static_cast<DBloodActor*>(actor);
}

const double GetMaxInputVel() const override
double GetMaxInputVel() const override
{
return (36211. / 3000.);
}

const bool canSlopeTilt() const override
bool canSlopeTilt() const override
{
const auto pActor = static_cast<DBloodActor*>(actor);
const int florhit = pActor->hit.florhit.type;
return pActor->xspr.height < 16 && (florhit == kHitSector || florhit == 0);
}

const unsigned getCrouchFlags() const override
unsigned getCrouchFlags() const override
{
const bool swimming = posture == kPostureSwim;
return (CS_CANCROUCH * !swimming) | (CS_DISABLETOGGLE * swimming);
Expand Down
6 changes: 3 additions & 3 deletions source/games/duke/src/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ class DDukePlayer final : public DCorePlayer
void checkhardlanding();
void playerweaponsway(double xvel);

const double GetMaxInputVel() const override
double GetMaxInputVel() const override
{
return (117351124. / 10884538.);
}
Expand Down Expand Up @@ -405,7 +405,7 @@ class DDukePlayer final : public DCorePlayer
}
}

const bool canSlopeTilt() const override
bool canSlopeTilt() const override
{
return aim_mode == 0 && on_ground && cursector->lotag != ST_2_UNDERWATER;
}
Expand All @@ -420,7 +420,7 @@ class DDukePlayer final : public DCorePlayer
cmd.ucmd.setItemUsed(num - 1);
}

const unsigned getCrouchFlags() const override
unsigned getCrouchFlags() const override
{
const int sectorLotag = insector() ? cursector->lotag : 0;
const int crouchable = sectorLotag != ST_2_UNDERWATER && (sectorLotag != ST_1_ABOVE_WATER || spritebridge) && !jetpack_on;
Expand Down
4 changes: 2 additions & 2 deletions source/games/exhumed/src/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ class DExhumedPlayer final : public DCorePlayer
return static_cast<DExhumedActor*>(actor);
}

const double GetMaxInputVel() const override
double GetMaxInputVel() const override
{
return 15.25;
}

const unsigned getCrouchFlags() const override
unsigned getCrouchFlags() const override
{
return (CS_CANCROUCH * !bUnderwater) | (CS_DISABLETOGGLE * bUnderwater);
}
Expand Down
6 changes: 3 additions & 3 deletions source/games/sw/src/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -1851,7 +1851,7 @@ class DSWPlayer final : public DCorePlayer

uint8_t WpnReloadState;

const double GetMaxInputVel() const override
double GetMaxInputVel() const override
{
return (380401538. / 36022361.);
}
Expand All @@ -1861,7 +1861,7 @@ class DSWPlayer final : public DCorePlayer
return vect;
}

const bool canSlopeTilt() const override
bool canSlopeTilt() const override
{
return (cmd.ucmd.actions & SB_AIMMODE) && !(Flags & (PF_FLYING|PF_SWIMMING|PF_DIVING|PF_CLIMBING|PF_JUMPING|PF_FALLING));
}
Expand All @@ -1876,7 +1876,7 @@ class DSWPlayer final : public DCorePlayer
GetActor()->spr.pos.Z = val - GetActor()->viewzoffset;
}

const unsigned getCrouchFlags() const override
unsigned getCrouchFlags() const override
{
const bool crouchable = true;
const bool disableToggle = (Flags & (PF_JUMPING|PF_FALLING|PF_CLIMBING|PF_DIVING|PF_DEAD)) || sop;
Expand Down

0 comments on commit 9e1ce2b

Please sign in to comment.