Commit Graph

2007 Commits

Author SHA1 Message Date
Lioncash 6e921e3258 CPauseScreenBase: Mark colors as constexpr within UpdateSideTable()
Same behavior, but allows eliding construction at runtime.
2020-03-15 21:26:47 -04:00
Lioncash a9082bc445 CCollisionActor: Mark gkDefaultCollisionActorMaterials as constexpr
While we're at it, change the g to s, since it's internally linked.
2020-03-15 20:04:15 -04:00
Luke Street eeb09f512d
Merge pull request #220 from lioncash/array
CHud*: Make use of std::array where applicable
2020-03-15 19:56:33 -04:00
Luke Street 79f6dbac73
Merge pull request #228 from lioncash/time
CCharAnimTime: Make constructors constexpr where applicable
2020-03-15 19:46:39 -04:00
Luke Street 76f12c5c38
Merge pull request #227 from lioncash/pair
CAnimSourceReader: Minor cleanup
2020-03-15 19:46:21 -04:00
Luke Street 797c583ed7
Merge pull request #226 from lioncash/clamp
CAnimSource: Simplify ClampZeroToOne()
2020-03-15 19:45:37 -04:00
Luke Street 70c60ecf2f
Merge pull request #225 from lioncash/bool
CArchitectureQueue: Make operator bool explicit
2020-03-15 19:45:22 -04:00
Luke Street 04c226e645
Merge pull request #224 from lioncash/explicit2
CMemoryCardSys: Make CardResult's conversion operator explicit
2020-03-15 19:45:13 -04:00
Luke Street 5804032fb4
Merge pull request #223 from lioncash/ref
CGameHintInfo: Take CVParamTransfer parameter by const reference
2020-03-15 19:45:02 -04:00
Luke Street 4eaed95c11
Merge pull request #222 from lioncash/view
CGameOptions: Make use of std::string_view where applicable
2020-03-15 19:44:47 -04:00
Luke Street e1d622d47b
Merge pull request #221 from lioncash/emplace
CFontImageDef: Make use of emplace_back where applicable
2020-03-15 19:44:23 -04:00
Lioncash 1926966d21 CCharAnimTime: Make constructors constexpr where applicable
These can be made constexpr to allow use at compile-time, given these
only hold an enum and a floating point value.
2020-03-15 19:41:54 -04:00
Lioncash 15db1b2647 CAnimSourceReader: Make use of std::find_if where applicable 2020-03-15 18:55:30 -04:00
Lioncash 9541ed1919 CAnimSourceReader: Make use of emplace() where applicable
Same behavior, but with less code.
2020-03-15 18:42:19 -04:00
Lioncash 7c1528688b CAnimSource: Simplify ClampZeroToOne()
We can make use of std::clamp instead of std::min and std::max
2020-03-15 18:30:58 -04:00
Lioncash ff92b72f91 CMemoryCardSys: Make CardResult's conversion operator explicit
Prevents implicit error-prone conversions to bool
2020-03-14 22:18:42 -04:00
Lioncash e6812a7cd9 CArchitectureQueue: Make operator bool explicit
Prevents potentially error-prone implicit conversion contexts.
2020-03-14 21:42:38 -04:00
Lioncash f5cc056a9e CGameHintInfo: Take CVParamTransfer parameter by const reference
Avoids trivial unnecessary copies.
2020-03-14 21:28:46 -04:00
Lioncash 659b8a43d3 CGameOptions: Make use of std::string_view where applicable
Enforces the use of valid strings in the interface. Also reduces c_str()
noise a little bit.
2020-03-14 20:09:23 -04:00
Lioncash e64dfe76b2 CFontImageDef: Make use of emplace_back where applicable
Same behavior, but constructs the instances directly within the
container.
2020-03-14 18:45:37 -04:00
Lioncash e0392d69c4 CHudEnergyInterface: Make use of std::array where applicable 2020-03-14 17:59:39 -04:00
Lioncash c4796ed090 CHudMissileInterface: Make use of std::array where applicable 2020-03-14 17:57:05 -04:00
Lioncash 9fafb24fb9 CHudVisorBeamMenu: Make use of std::array where applicable 2020-03-14 17:52:30 -04:00
Lioncash 07542ff335 CHudThreatInterface: Make use of std::array where applicable
Same behavior, but with stronger typing.
2020-03-14 17:38:57 -04:00
Phillip Stephens f7fdbc07ba
Merge pull request #219 from lioncash/false
CPathCamera: Change 0 to false in CPathCamera constructor
2020-03-13 15:30:59 -07:00
Phillip Stephens 6567ae8d42
Merge pull request #218 from lioncash/emplace
Runtime: Collapse emplace_back() calls where applicable
2020-03-13 15:30:43 -07:00
Phillip Stephens 55955973a1
Merge pull request #217 from lioncash/sign
AutoMapper/*: Resolve sign conversion warnings
2020-03-13 15:30:24 -07:00
Phillip Stephens 0c17e4fdd7
Merge pull request #216 from lioncash/line
CLineRenderer: Silence -Wmaybe-uninitialized warning
2020-03-13 15:30:14 -07:00
Phillip Stephens 75c184d710
CHierarchyPoseBuilder corrections 2020-03-13 15:29:20 -07:00
Lioncash 92fb31fd40 CPathCamera: Change 0 to false in CPathCamera constructor
Same thing, but without implicit conversion to bool
2020-03-13 17:38:14 -04:00
Lioncash 097d4a4422 Runtime: Collapse emplace_back() calls where applicable
Same behavior, but with less code.
2020-03-13 17:14:44 -04:00
Lioncash 7c1e468d31 CMapWorldInfo: Rename IsAreaVisted -> IsAreaVisted
Same thing, but without the typo.
2020-03-13 16:19:02 -04:00
Lioncash ddcbf51260 CMapUniverse: Resolve sign conversion warning in Draw()
Resolves a trivial implicit sign conversion warning.
2020-03-13 16:11:40 -04:00
Lioncash 014601cf67 CMapWorldInfo: Resolve sign conversion warnings
Resolves trivial implicit sign conversion warnings.
2020-03-13 16:10:23 -04:00
Lioncash 4601abf5df CMapArea: Resolve sign conversion warning in Draw()
Resolves a trivial sign-conversion warning.
2020-03-13 16:07:41 -04:00
Lioncash c37b3df27b CLineRenderer: Silence -Wmaybe-uninitialized warning
We can just initialize maxTriVerts to zero to prevent warnings from
occurring.
2020-03-12 19:15:51 -04:00
Phillip Stephens df4487bae8
Merge pull request #215 from lioncash/none
CFrontEndUI: Default initialize SFrontEndFrame's x4_action to EAction::None
2020-03-12 15:11:11 -07:00
Phillip Stephens eb38d96d9a
Merge pull request #214 from lioncash/virtual
CGunWeapon: Make destructor virtual
2020-03-12 15:11:02 -07:00
Phillip Stephens 97e33bdf11
Merge pull request #213 from lioncash/unique
CProjectileWeaponDataFactory: Make GetGeneratorDesc() return a unique_ptr
2020-03-12 15:10:49 -07:00
Phillip Stephens 7601888e34
Merge pull request #212 from lioncash/power-color
CPowerBomb: Make kFadeColor internally linked
2020-03-12 15:10:40 -07:00
Phillip Stephens 8badbd3f35
Merge pull request #211 from lioncash/init
CPlayerEnergyDrain: Initialize x10_energyDrainTime on construction
2020-03-12 15:10:28 -07:00
Phillip Stephens ce5ce35743
Merge pull request #210 from lioncash/bob
CPlayerCameraBob: Minor cleanup
2020-03-12 15:10:19 -07:00
Phillip Stephens 2a2b471671
Merge pull request #209 from lioncash/cast
CPlayerGun: Minor cleanup
2020-03-12 15:10:07 -07:00
Phillip Stephens ac46b898bc
Merge pull request #208 from lioncash/wave
CWaveBuster: Implement GetTouchBounds()
2020-03-12 15:09:57 -07:00
Phillip Stephens 196a545f9a
Merge pull request #207 from lioncash/get
CElectricBeamProjectile: Remove unnecessary get() calls in PreRender()
2020-03-12 15:09:47 -07:00
Phillip Stephens bb8e33461d
Merge pull request #206 from lioncash/gen
CElementGen: Minor cleanup
2020-03-12 15:09:36 -07:00
Phillip Stephens 5f2db40528
Merge pull request #205 from lioncash/fn
CFactoryMgr: Minor cleanup
2020-03-12 15:09:11 -07:00
Phillip Stephens 12ad192436
Merge pull request #204 from lioncash/move
Character/*: std::move constructor parameters where applicable
2020-03-12 15:09:00 -07:00
Phillip Stephens 3a37be9d27
Minor CFlaahgra fixes 2020-03-12 15:06:01 -07:00
Lioncash 90e866d2d5 CFrontEndUI: Default initialize SFrontEndFrame's x4_action to EAction::None
This is the initial value that GM8E v0 assigns to this member variable.
Previously it was being left uninitialized on construction.
2020-03-12 17:35:36 -04:00
Lioncash 2c091ac124 CGunWeapon: Make destructor virtual
This class is used as polymorphic type, so the destructor should be
marked as virtual to prevent any potential undefined behavior.

This also more closely matches the GM8E v0 binary itself.
2020-03-12 17:20:45 -04:00
Lioncash 05bccae70e CDecalDataFactory: Make GetGeneratorDesc() return a unique_ptr
Same behavior, but with safer memory management.
2020-03-12 14:46:02 -04:00
Lioncash 1f42b9be93 CParticleElectricDataFactory: Make GetGeneratorDesc() return a unique_ptr
Same behavior, but with safer memory management.
2020-03-12 14:20:48 -04:00
Lioncash 59bbbdf41c CParticleSwooshDataFactory: Make GetGeneratorDesc() return a unique_ptr
Same behavior, but with safer memory management.
2020-03-12 14:17:42 -04:00
Lioncash 93121c38f7 CProjectileWeaponDataFactory: Make GetGeneratorDesc() return a unique_ptr
Same behavior, but with safer memory management.
2020-03-12 14:00:23 -04:00
Lioncash ee952b9c99 CPowerBomb: Make kFadeColor internally linked
Hides the name from external view entirely and allows the color instance
to be constexpr.
2020-03-12 10:13:37 -04:00
Lioncash d51518dc57 CPlayerEnergyDrain: Make constructor explicit
Prevents error-prone implicit constructions from occurring.
2020-03-12 10:01:31 -04:00
Lioncash e628cbf1be CPlayerEnergyDrain: Initialize x10_energyDrainTime on construction
GM8E v0 initializes this to zero when constructing the class. This also
makes the entire class have a consistent initial state.
2020-03-12 09:57:43 -04:00
Luke Street cfd568bb39 Merge branch 'chozoghosts' 2020-03-11 17:17:00 -04:00
Phillip Stephens 190c369aeb
Fix crashes with FusionSuit active 2020-03-11 06:48:30 -07:00
Luke Street 860f7c7f33 CChozoGhost: Minor fixes & renaming 2020-03-11 02:16:55 -04:00
Luke Street 123ddfd33a CChozoGhost: InPosition -> ShouldAttack 2020-03-11 00:22:03 -04:00
Luke Street 155cd3759f CChozoGhost: Minor FindBestAnchor fixes 2020-03-10 23:47:14 -04:00
Lioncash 179d19412b CPlayerCameraBob: Make static non-const member variables private
Prevents accidental modification of the values from occurring in code
that makes use of them. Many of these constants aren't even used outside
of the class itself in the first place.
2020-03-09 20:55:12 -04:00
Lioncash f622ed364d CPlayerCameraBob: Make use of std::array where applicable 2020-03-09 20:33:37 -04:00
Lioncash 73f11a6132 CPlayerGun: Make use of std::array where applicable 2020-03-09 16:33:10 -04:00
Lioncash 1838e43078 CPlayerGun: Relocate file-static variables and constants into a single anonymous namespace
Keeps all file-static variables organized together.
2020-03-09 16:15:55 -04:00
Lioncash 3abaccb238 CPlayerGun: Resolve trivial implicit sign conversion warnings 2020-03-09 16:04:13 -04:00
Lioncash 9e5dc627ea CWaveBuster: Implement GetTouchBounds()
Implements GetTouchBounds() according to the implementation within the
GM8E v0 binary.

Fills out the implementation of CWaveBuster a little bit.
2020-03-09 14:51:04 -04:00
Lioncash 06dfc3406e CElectricBeamProjectile: Remove unnecessary get() calls in PreRender()
Same behavior, less code.
2020-03-09 13:55:26 -04:00
Lioncash 15dce1683e CElementGen: std::move TToken instance in constructor
Allows the parameter to be moved into via calling code.
2020-03-09 13:07:53 -04:00
Lioncash af2a82b5a7 CElementGen: Make GetSystemCount() a const member function
This doesn't modify internal member state, so this can be made a const
member function.
2020-03-09 13:03:42 -04:00
Lioncash a8486cf479 CElementGen: Resolve sign-conversion warnings in loops
Prevents implicit truncation to int from occurring.
2020-03-09 13:01:42 -04:00
Lioncash 9db07b037a CElementGen: Make use of std::array where applicable 2020-03-09 12:53:28 -04:00
Lioncash 35adfe8abf CElementGen: Alphabetize forward declarations
Makes them nicer to visually scan over.
2020-03-09 12:33:24 -04:00
Luke Street 985daa3092 CCharAnimTime: Re-add algorithm include 2020-03-09 12:21:08 -04:00
Lioncash 0a158af0cb CFactoryMgr: Resolve variable shadowing warning in MakeObjectFromMemory()
Resolvable with a trivial variable renaming.
2020-03-09 12:19:58 -04:00
Lioncash 91a2562fff CFactoryMgr: Make use of std::array
Same behavior, with stronger typing. We can also leverage the iterator
member functions directly.
2020-03-09 12:17:18 -04:00
Luke Street 24817d6b01 CCharAnimTime: Fixes & cleanup 2020-03-09 12:09:54 -04:00
Lioncash 34eb507a9d CFactoryMgr: std::move function instances in AddFactory()
std::function is allowed to allocate on the heap, so this potentially
prevents unnecessary allocations.

We can also use insert_or_assign() to prevent unnecessary default
initialization of std::function that immediately get overridden.
2020-03-09 12:04:51 -04:00
Lioncash 39b561b089 CTransitionManager: std::move constructor parameters where applicable
Allows calling code to move into the constructor
2020-03-09 11:58:10 -04:00
Lioncash 3a96c574b2 CTransitionDatabaseGame: std::move constructor parameters where applicable
Same behavior, but allows the parameters to be moved into from calling
code.
2020-03-09 11:58:10 -04:00
Lioncash 815f492e0f CSequenceHelper: std::move constructor parameters where applicable
Same behavior, but allows for calling code to move into the interface.
2020-03-09 11:58:10 -04:00
Lioncash cff12f0986 TAnimSourceInfo: std::move constructor parameter where applicable
Allows calling code to move into the constructor.
2020-03-09 11:58:10 -04:00
Lioncash 9fe671af99 CAnimTreeSequence: std::move constructor parameters where applicable
Allows the constructor arguments to be moved into the constructor.
2020-03-09 11:58:07 -04:00
Lioncash fa23d0bb9c CAnimTreeLoopIn: std::move constructor parameters where applicable
Allows the constructor parameters to be moved into.
2020-03-09 11:31:53 -04:00
Lioncash ab17c1cf2f CAnimationManager: std::move parameters to constructor where applicable
Allows calling code to move into the respective arguments.
2020-03-09 11:27:36 -04:00
Lioncash e289643742 CAnimData: std::move constructor arguments where applicable
Same behavior, but allows calling code to move into the respective
parameters now.
2020-03-09 11:25:23 -04:00
Lioncash 79565d7f52 CAnimSourceInfo: std::move TSubAnimTypeToken instance in constructor
Provides the same behavior, but allows calling code to move into the
constructor.
2020-03-09 11:11:27 -04:00
Lioncash 3cec19437a CAnimSysContext: std::move TToken instance in constructor
Provides the same interface, but allows for calling code to move into
the constructor.
2020-03-09 11:08:17 -04:00
Lioncash 280e4ce07d CAnimTreeAnimReaderContainer: std::move shared_ptr in constructor
Provides the same behavior, but without a redundant atomic reference
count increment and decrement.
2020-03-09 11:06:20 -04:00
Luke Street 5c9dd55b80 CChozoGhost: Fix IsOnGround 2020-03-09 10:41:34 -04:00
Luke Street 830db8772d Merge remote-tracking branch 'origin/master' into chozoghosts 2020-03-09 10:12:40 -04:00
Phillip Stephens d93df18a37
Fix `CScriptDistanceFog::AcceptScriptMessage` 2020-03-08 23:18:57 -07:00
Luke Street 7b9a037c95
Merge pull request #203 from lioncash/identical
CBallCamera: Collapse identical switch cases within AvoidGeometry()
2020-03-08 23:45:52 -04:00
Luke Street 6e9a80de5d CVisorFlare: Rename "near" to avoid MSVC conflict 2020-03-08 23:44:44 -04:00
Lioncash 363386cbd9 CBallCamera: Collapse identical switch cases within AvoidGeometry()
Same behavior, but less code.

This is identical in behavior to the code within the GM8E v0 binary.
2020-03-08 23:40:22 -04:00
Lioncash 45c1bc9652 CStaticRes: Make use of CAssetId's IsValid() member function within operator bool
We should be testing against IsValid() here to handle all cases that
indicate invalid values, as opposed to only handling the zero case.
2020-03-08 22:49:33 -04:00
Lioncash 209cd4a54e CStaticRes: Make operator bool explicit
Prevents potentially error-prone conversions to bool. Similar to the
changes recently made to CToken.
2020-03-08 21:20:08 -04:00
Lioncash 2233a78fe2 CToken: Add HasReference() member function
Has the same semantics of operator bool(), but explains at the call site
what is actually being tested for in the relation to the object itself.

Aims to make readability slightly better (and removed the need for
casts).
2020-03-08 21:13:37 -04:00