From d79b9d925e9a026b0c04583a9fbfae655049a762 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 28 Feb 2020 04:35:50 -0500 Subject: [PATCH] CPAS*: Make constructors explicit Prevents undesirable implicit constructions from occurring. --- Runtime/Character/CPASAnimState.hpp | 4 ++-- Runtime/Character/CPASDatabase.hpp | 2 +- Runtime/Character/CPASParmInfo.hpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Runtime/Character/CPASAnimState.hpp b/Runtime/Character/CPASAnimState.hpp index 6d8c708ca..59701ba76 100644 --- a/Runtime/Character/CPASAnimState.hpp +++ b/Runtime/Character/CPASAnimState.hpp @@ -17,8 +17,8 @@ class CPASAnimState { mutable std::vector x24_selectionCache; public: - CPASAnimState(CInputStream& in); - CPASAnimState(int stateId); + explicit CPASAnimState(CInputStream& in); + explicit CPASAnimState(int stateId); s32 GetStateId() const { return x0_id; } s32 GetNumAnims() const { return x14_anims.size(); } CPASAnimParm GetAnimParmData(s32, u32) const; diff --git a/Runtime/Character/CPASDatabase.hpp b/Runtime/Character/CPASDatabase.hpp index db97308b9..54545395c 100644 --- a/Runtime/Character/CPASDatabase.hpp +++ b/Runtime/Character/CPASDatabase.hpp @@ -18,7 +18,7 @@ class CPASDatabase { void SetDefaultState(s32 state) { x10_defaultState = state; } public: - CPASDatabase(CInputStream& in); + explicit CPASDatabase(CInputStream& in); std::pair FindBestAnimation(const CPASAnimParmData&, s32) const; std::pair FindBestAnimation(const CPASAnimParmData&, CRandom16&, s32) const; diff --git a/Runtime/Character/CPASParmInfo.hpp b/Runtime/Character/CPASParmInfo.hpp index c26c20e43..ab737ab1b 100644 --- a/Runtime/Character/CPASParmInfo.hpp +++ b/Runtime/Character/CPASParmInfo.hpp @@ -16,7 +16,7 @@ public: CPASAnimParm::UParmValue x10_max; public: - CPASParmInfo(CInputStream& in); + explicit CPASParmInfo(CInputStream& in); CPASAnimParm::EParmType GetParameterType() const { return x0_type; } EWeightFunction GetWeightFunction() const { return x4_weightFunction; } float GetParameterWeight() const { return x8_weight; }