1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-11-29 00:34:29 +00:00

Fix and enforce enum naming

This commit is contained in:
elsid 2025-08-29 19:28:57 +02:00
parent 39d117e362
commit d4ce5a2ac6
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40
15 changed files with 66 additions and 64 deletions

View file

@ -15,6 +15,8 @@ ExcludeHeaderFilterRegex: '_autogen/'
CheckOptions:
- key: readability-identifier-naming.ConceptCase
value: CamelCase
- key: readability-identifier-naming.EnumCase
value: CamelCase
- key: readability-identifier-naming.LocalVariableCase
value: camelBack
- key: readability-identifier-naming.NamespaceCase

View file

@ -719,10 +719,10 @@ bool CSVRender::PagedWorldspaceWidget::handleDrop(
return true;
}
CSVRender::WorldspaceWidget::dropRequirments CSVRender::PagedWorldspaceWidget::getDropRequirements(
CSVRender::WorldspaceWidget::DropRequirements CSVRender::PagedWorldspaceWidget::getDropRequirements(
CSVRender::WorldspaceWidget::DropType type) const
{
dropRequirments requirements = WorldspaceWidget::getDropRequirements(type);
DropRequirements requirements = WorldspaceWidget::getDropRequirements(type);
if (requirements != ignored)
return requirements;

View file

@ -120,7 +120,7 @@ namespace CSVRender
/// \return Drop handled?
bool handleDrop(const std::vector<CSMWorld::UniversalId>& data, DropType type) override;
dropRequirments getDropRequirements(DropType type) const override;
DropRequirements getDropRequirements(DropType type) const override;
/// \attention The created tool is not added to the toolbar (via addTool). Doing
/// that is the responsibility of the calling function.

View file

@ -365,10 +365,10 @@ std::string CSVRender::UnpagedWorldspaceWidget::getStartupInstruction()
return stream.str();
}
CSVRender::WorldspaceWidget::dropRequirments CSVRender::UnpagedWorldspaceWidget::getDropRequirements(
CSVRender::WorldspaceWidget::DropRequirements CSVRender::UnpagedWorldspaceWidget::getDropRequirements(
CSVRender::WorldspaceWidget::DropType type) const
{
dropRequirments requirements = WorldspaceWidget::getDropRequirements(type);
DropRequirements requirements = WorldspaceWidget::getDropRequirements(type);
if (requirements != ignored)
return requirements;

View file

@ -59,7 +59,7 @@ namespace CSVRender
public:
UnpagedWorldspaceWidget(const std::string& cellId, CSMDoc::Document& document, QWidget* parent);
dropRequirments getDropRequirements(DropType type) const override;
DropRequirements getDropRequirements(DropType type) const override;
/// \return Drop handled?
bool handleDrop(const std::vector<CSMWorld::UniversalId>& data, DropType type) override;

View file

@ -323,7 +323,7 @@ CSVRender::WorldspaceWidget::DropType CSVRender::WorldspaceWidget::getDropType(
return output;
}
CSVRender::WorldspaceWidget::dropRequirments CSVRender::WorldspaceWidget::getDropRequirements(DropType type) const
CSVRender::WorldspaceWidget::DropRequirements CSVRender::WorldspaceWidget::getDropRequirements(DropType type) const
{
if (type == Type_DebugProfile)
return canHandle;

View file

@ -101,7 +101,7 @@ namespace CSVRender
Type_DebugProfile
};
enum dropRequirments
enum DropRequirements
{
canHandle,
needPaged,
@ -145,7 +145,7 @@ namespace CSVRender
static DropType getDropType(const std::vector<CSMWorld::UniversalId>& data);
virtual dropRequirments getDropRequirements(DropType type) const;
virtual DropRequirements getDropRequirements(DropType type) const;
virtual void useViewHint(const std::string& hint);
///< Default-implementation: ignored.

View file

@ -45,7 +45,7 @@ CSVWorld::SceneSubView::SceneSubView(const CSMWorld::UniversalId& id, CSMDoc::Do
mLayout->setContentsMargins(QMargins(0, 0, 0, 0));
CSVRender::WorldspaceWidget* worldspaceWidget = nullptr;
widgetType whatWidget;
WidgetType whatWidget;
if (Misc::StringUtils::ciEqual(id.getId(), ESM::Cell::sDefaultWorldspaceId.getValue()))
{
@ -108,7 +108,7 @@ void CSVWorld::SceneSubView::makeConnections(CSVRender::PagedWorldspaceWidget* w
connect(widget, &CSVRender::PagedWorldspaceWidget::requestFocus, this, &SceneSubView::requestFocus);
}
CSVWidget::SceneToolbar* CSVWorld::SceneSubView::makeToolbar(CSVRender::WorldspaceWidget* widget, widgetType type)
CSVWidget::SceneToolbar* CSVWorld::SceneSubView::makeToolbar(CSVRender::WorldspaceWidget* widget, WidgetType type)
{
CSVWidget::SceneToolbar* toolbar = new CSVWidget::SceneToolbar(48 + 6, this);

View file

@ -65,13 +65,13 @@ namespace CSVWorld
void replaceToolbarAndWorldspace(CSVRender::WorldspaceWidget* widget, CSVWidget::SceneToolbar* toolbar);
enum widgetType
enum WidgetType
{
widget_Paged,
widget_Unpaged
};
CSVWidget::SceneToolbar* makeToolbar(CSVRender::WorldspaceWidget* widget, widgetType type);
CSVWidget::SceneToolbar* makeToolbar(CSVRender::WorldspaceWidget* widget, WidgetType type);
private slots:

View file

@ -181,7 +181,7 @@ namespace Compiler
class Scanner
{
enum putback_type
enum PutbackType
{
Putback_None,
Putback_Special,
@ -196,7 +196,7 @@ namespace Compiler
TokenLoc mPrevLoc;
std::istream& mStream;
const Extensions* mExtensions;
putback_type mPutback;
PutbackType mPutback;
int mPutbackCode;
int mPutbackInteger;
float mPutbackFloat;

View file

@ -44,7 +44,7 @@ namespace ESM4
struct Creature
{
enum ACBS_TES4
enum ActorBaseFlagsTes4
{
TES4_Essential = 0x000002,
TES4_WeapAndShield = 0x000004,
@ -59,7 +59,7 @@ namespace ESM4
TES4_NoCorpseCheck = 0x100000 // opposite of npc_
};
enum ACBS_FO3
enum ActorBaseFlagsFo3
{
FO3_Biped = 0x00000001,
FO3_Essential = 0x00000002,

View file

@ -44,7 +44,7 @@ namespace ESM4
struct Npc
{
enum ACBS_TES4
enum ActorBaseFlagsTes4
{
TES4_Female = 0x000001,
TES4_Essential = 0x000002,
@ -58,7 +58,7 @@ namespace ESM4
TES4_CanCorpseCheck = 0x100000 // opposite of crea
};
enum ACBS_FO3
enum ActorBaseFlagsFo3
{
FO3_Female = 0x00000001,
FO3_Essential = 0x00000002,
@ -79,7 +79,7 @@ namespace ESM4
};
// In FO4 flags seem to be the same.
enum ACBS_TES5
enum ActorBaseFlagsTes5
{
TES5_Female = 0x00000001,
TES5_Essential = 0x00000002,
@ -103,7 +103,7 @@ namespace ESM4
};
// All FO3+ games.
enum Template_Flags
enum TemplateFlags
{
Template_UseTraits = 0x0001, // Destructible Object; Traits tab, including race, gender, height, weight,
// voice type, death item; Sounds tab; Animation tab; Character Gen tabs

View file

@ -53,7 +53,7 @@ namespace ESM4
struct Quest
{
// NOTE: these values are for TES4
enum Quest_Flags
enum QuestFlags
{
Flag_StartGameEnabled = 0x01,
Flag_AllowRepeatConvTopic = 0x04,

View file

@ -48,7 +48,7 @@ namespace Nif
void bhkEntityCInfo::read(NIFStream* nif)
{
mResponseType = static_cast<hkResponseType>(nif->get<uint8_t>());
mResponseType = static_cast<HkResponseType>(nif->get<uint8_t>());
nif->skip(1); // Unused
nif->read(mProcessContactDelay);
}
@ -114,7 +114,7 @@ namespace Nif
{
if (nif->getBethVersion() >= 83)
nif->skip(4); // Unused
mResponseType = static_cast<hkResponseType>(nif->get<uint8_t>());
mResponseType = static_cast<HkResponseType>(nif->get<uint8_t>());
nif->skip(1); // Unused
nif->read(mProcessContactDelay);
}
@ -152,23 +152,23 @@ namespace Nif
if (nif->getBethVersion() != NIFFile::BethVersion::BETHVER_FO4)
nif->read(mPenetrationDepth);
}
mMotionType = static_cast<hkMotionType>(nif->get<uint8_t>());
mMotionType = static_cast<HkMotionType>(nif->get<uint8_t>());
if (nif->getBethVersion() < 83)
mDeactivatorType = static_cast<hkDeactivatorType>(nif->get<uint8_t>());
mDeactivatorType = static_cast<HkDeactivatorType>(nif->get<uint8_t>());
else
nif->read(mEnableDeactivation);
mSolverDeactivation = static_cast<hkSolverDeactivation>(nif->get<uint8_t>());
mSolverDeactivation = static_cast<HkSolverDeactivation>(nif->get<uint8_t>());
if (nif->getBethVersion() == NIFFile::BethVersion::BETHVER_FO4)
{
nif->skip(1);
nif->read(mPenetrationDepth);
nif->read(mTimeFactor);
nif->skip(4);
mResponseType = static_cast<hkResponseType>(nif->get<uint8_t>());
mResponseType = static_cast<HkResponseType>(nif->get<uint8_t>());
nif->skip(1); // Unused
nif->read(mProcessContactDelay);
}
mQualityType = static_cast<hkQualityType>(nif->get<uint8_t>());
mQualityType = static_cast<HkQualityType>(nif->get<uint8_t>());
if (nif->getBethVersion() >= 83)
{
nif->read(mAutoRemoveLevel);
@ -229,19 +229,19 @@ namespace Nif
void bhkConstraintMotorCInfo::read(NIFStream* nif)
{
mType = static_cast<hkMotorType>(nif->get<uint8_t>());
mType = static_cast<HkMotorType>(nif->get<uint8_t>());
switch (mType)
{
case hkMotorType::Motor_Position:
case HkMotorType::Motor_Position:
mPositionMotor.read(nif);
break;
case hkMotorType::Motor_Velocity:
case HkMotorType::Motor_Velocity:
mVelocityMotor.read(nif);
break;
case hkMotorType::Motor_SpringDamper:
case HkMotorType::Motor_SpringDamper:
mSpringDamperMotor.read(nif);
break;
case hkMotorType::Motor_None:
case HkMotorType::Motor_None:
default:
break;
}
@ -378,26 +378,26 @@ namespace Nif
void bhkMalleableConstraintCInfo::read(NIFStream* nif)
{
mType = static_cast<hkConstraintType>(nif->get<uint32_t>());
mType = static_cast<HkConstraintType>(nif->get<uint32_t>());
mInfo.read(nif);
switch (mType)
{
case hkConstraintType::BallAndSocket:
case HkConstraintType::BallAndSocket:
mBallAndSocketInfo.read(nif);
break;
case hkConstraintType::Hinge:
case HkConstraintType::Hinge:
mHingeInfo.read(nif);
break;
case hkConstraintType::LimitedHinge:
case HkConstraintType::LimitedHinge:
mLimitedHingeInfo.read(nif);
break;
case hkConstraintType::Prismatic:
case HkConstraintType::Prismatic:
mPrismaticInfo.read(nif);
break;
case hkConstraintType::Ragdoll:
case HkConstraintType::Ragdoll:
mRagdollInfo.read(nif);
break;
case hkConstraintType::StiffSpring:
case HkConstraintType::StiffSpring:
mStiffSpringInfo.read(nif);
break;
default:
@ -417,29 +417,29 @@ namespace Nif
void bhkWrappedConstraintData::read(NIFStream* nif)
{
mType = static_cast<hkConstraintType>(nif->get<uint32_t>());
mType = static_cast<HkConstraintType>(nif->get<uint32_t>());
mInfo.read(nif);
switch (mType)
{
case hkConstraintType::BallAndSocket:
case HkConstraintType::BallAndSocket:
mBallAndSocketInfo.read(nif);
break;
case hkConstraintType::Hinge:
case HkConstraintType::Hinge:
mHingeInfo.read(nif);
break;
case hkConstraintType::LimitedHinge:
case HkConstraintType::LimitedHinge:
mLimitedHingeInfo.read(nif);
break;
case hkConstraintType::Prismatic:
case HkConstraintType::Prismatic:
mPrismaticInfo.read(nif);
break;
case hkConstraintType::Ragdoll:
case HkConstraintType::Ragdoll:
mRagdollInfo.read(nif);
break;
case hkConstraintType::StiffSpring:
case HkConstraintType::StiffSpring:
mStiffSpringInfo.read(nif);
break;
case hkConstraintType::Malleable:
case HkConstraintType::Malleable:
mMalleableInfo.read(nif);
break;
default:

View file

@ -74,7 +74,7 @@ namespace Nif
void read(NIFStream* nif);
};
enum class hkResponseType : uint8_t
enum class HkResponseType : uint8_t
{
Response_Invalid = 0,
Response_SimpleContact = 1,
@ -84,7 +84,7 @@ namespace Nif
struct bhkEntityCInfo
{
hkResponseType mResponseType;
HkResponseType mResponseType;
uint16_t mProcessContactDelay;
void read(NIFStream* nif);
@ -147,7 +147,7 @@ namespace Nif
void read(NIFStream* nif);
};
enum class hkMotionType : uint8_t
enum class HkMotionType : uint8_t
{
Motion_Invalid = 0,
Motion_Dynamic = 1,
@ -161,14 +161,14 @@ namespace Nif
Motion_Character = 9
};
enum class hkDeactivatorType : uint8_t
enum class HkDeactivatorType : uint8_t
{
Deactivator_Invalid = 0,
Deactivator_Never = 1,
Deactivator_Spatial = 2
};
enum class hkSolverDeactivation : uint8_t
enum class HkSolverDeactivation : uint8_t
{
SolverDeactivation_Invalid = 0,
SolverDeactivation_Off = 1,
@ -178,7 +178,7 @@ namespace Nif
SolverDeactivation_Max = 5
};
enum class hkQualityType : uint8_t
enum class HkQualityType : uint8_t
{
Quality_Invalid = 0,
Quality_Fixed = 1,
@ -195,7 +195,7 @@ namespace Nif
struct bhkRigidBodyCInfo
{
HavokFilter mHavokFilter;
hkResponseType mResponseType;
HkResponseType mResponseType;
uint16_t mProcessContactDelay;
osg::Vec4f mTranslation;
osg::Quat mRotation;
@ -214,11 +214,11 @@ namespace Nif
float mMaxLinearVelocity;
float mMaxAngularVelocity;
float mPenetrationDepth;
hkMotionType mMotionType;
hkDeactivatorType mDeactivatorType;
HkMotionType mMotionType;
HkDeactivatorType mDeactivatorType;
bool mEnableDeactivation{ true };
hkSolverDeactivation mSolverDeactivation;
hkQualityType mQualityType;
HkSolverDeactivation mSolverDeactivation;
HkQualityType mQualityType;
uint8_t mAutoRemoveLevel;
uint8_t mResponseModifierFlags;
uint8_t mNumContactPointShapeKeys;
@ -244,7 +244,7 @@ namespace Nif
void post(Reader& nif);
};
enum class hkMotorType : uint8_t
enum class HkMotorType : uint8_t
{
Motor_None = 0,
Motor_Position = 1,
@ -287,7 +287,7 @@ namespace Nif
struct bhkConstraintMotorCInfo
{
hkMotorType mType;
HkMotorType mType;
bhkPositionConstraintMotor mPositionMotor;
bhkVelocityConstraintMotor mVelocityMotor;
bhkSpringDamperConstraintMotor mSpringDamperMotor;
@ -384,7 +384,7 @@ namespace Nif
void read(NIFStream* nif);
};
enum class hkConstraintType : uint32_t
enum class HkConstraintType : uint32_t
{
BallAndSocket = 0,
Hinge = 1,
@ -397,7 +397,7 @@ namespace Nif
struct bhkWrappedConstraintDataBase
{
hkConstraintType mType;
HkConstraintType mType;
bhkConstraintCInfo mInfo;
bhkBallAndSocketConstraintCInfo mBallAndSocketInfo;
bhkHingeConstraintCInfo mHingeInfo;