Commit Graph

1959 Commits

Author SHA1 Message Date
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
Phillip Stephens fc5170ede9
Merge pull request #200 from lioncash/temp
CLogBookScreen: Remove unconditional return true in IsScanComplete()
2020-03-08 18:03:54 -07:00
Phillip Stephens a28b7a8df7
Merge pull request #199 from lioncash/octree
CPVSVisOctree: Use static qualifying name for ReadBoundingBoxBig()
2020-03-08 18:03:44 -07:00
Phillip Stephens f07d4e9630
Merge pull request #198 from lioncash/move
CResFactory: Resolve use-after-move in AddToLoadList()
2020-03-08 18:03:28 -07:00
Phillip Stephens b492c91ccf
Merge pull request #197 from lioncash/cond
CFontRenderState: Collapse common switch cases in RefreshColor()
2020-03-08 18:03:17 -07:00
Phillip Stephens b01fa0c5bf
Merge pull request #196 from lioncash/saveable
CSaveableState: Initialize vectors in the constructor initializer list
2020-03-08 18:03:01 -07:00
Phillip Stephens dd54f93da4
Merge pull request #195 from lioncash/unused
CPlayer: Make use of unused CCollidableAABox in ProcessInput()
2020-03-08 18:02:52 -07:00
Phillip Stephens 3011a839eb
Merge pull request #194 from lioncash/init
CProjectileInfo: Initialize result variable to false within PredictInterceptPos
2020-03-08 18:02:41 -07:00
Phillip Stephens 51bb2244da
Merge pull request #193 from lioncash/explicit
CToken: Make operator bool explicit
2020-03-08 18:02:30 -07:00
Phillip Stephens 3e59f7a455
Prepare for pr-193 2020-03-08 18:01:29 -07:00
Lioncash 2a1df559a9 CLogBookScreen: Remove unconditional return true in IsScanComplete()
This was temporarily added in for debugging purposes in the past but was
never removed.
2020-03-08 11:15:13 -04:00
Phillip Stephens f06c26e7d6
Fix infinite loop in CObjectList, and add an assert to detect invalid assignments 2020-03-07 09:14:07 -08:00
Lioncash 8d42eb4287 CPVSVisOctree: Initialize in-class member variables where applicable
Provides a deterministic initial state for the default constructor.
2020-03-07 05:01:29 -05:00
Lioncash 4034e3b31f CPVSVisOctree: Make use of std::array where applicable
Makes the arrays strongly typed.
2020-03-07 04:50:19 -05:00
Lioncash 969bcdba35 CPVSVisOctree: Use static qualifying name for ReadBoundingBoxBig()
It looks very odd using the name of the object being initialized to call
through to a static member function. We can disambiguate this by making
use of the qualifying name directly.
2020-03-07 04:46:19 -05:00
Lioncash 0a47e623fd CResFactory: Resolve use-after-move in AddToLoadList()
The behavior on the right hand side would occur before the actual
assignment, making the tag value invalidated. Instead, we copy the tag
before the move is performed to keep the data valid when inserting it
into the map.
2020-03-07 03:56:16 -05:00
Lioncash a490eaf8ff CFontRenderState: Collapse common switch cases in RefreshColor()
Same behavior, less code.
2020-03-07 03:44:54 -05:00
Lioncash 815a38288a CSaveableState: Initialize vectors in the constructor initializer list
Initializes the vectors in place, rather than constructing them and then
resizing.
2020-03-06 22:47:39 -05:00
Lioncash 830e1c59d2 CPlayer: Make nearby variables const
Makes nearby variables from the previous change const to make their
immutability explicit.
2020-03-06 22:08:56 -05:00
Lioncash a2b6b4515d CPlayer: Make use of unused CCollidableAABox in ProcessInput()
GM8E v0 makes use of the temporary collidable AA box. This amends the
code to make use of it.
2020-03-06 22:06:44 -05:00
Lioncash 27fb2008dc CProjectileInfo: Initialize result variable to false within PredictInterceptPos()
GM8E v0 sets this to false before performing any further calculations.
This also prevents accidental uninitialized usages from occurring if
this is ever changed in the future.

While we're in the same area we can make bracing consistent.
2020-03-06 21:57:39 -05:00
Lioncash a6367c0688 CToken: Make operator bool explicit
Prevents potential error-prone conversions from occurring
2020-03-06 21:42:07 -05:00
Phillip Stephens 052aa80bac
Fix initial AI issues 2020-03-06 18:03:13 -08:00
Phillip Stephens 4daa8ac374
CModelBoo: Fix missing cast 2020-03-06 16:27:33 -08:00
Phillip Stephens 17f25457c5
CGameArea::CAreaObjectList fix 2020-03-06 16:20:52 -08:00
Phillip Stephens 76e0a1f8f5
Merge pull request #192 from lioncash/init
CEyeball: Eliminate unnecessary runtime initializer in Think()
2020-03-06 16:15:15 -08:00
Phillip Stephens 7358570d51
Merge pull request #191 from lioncash/const
CObjectList: Make IsQualified() a const member function
2020-03-06 16:14:59 -08:00
Phillip Stephens 24baafb996
Merge pull request #190 from lioncash/render
CBooRenderer: Minor cleanup
2020-03-06 16:14:47 -08:00
Phillip Stephens ae25392d19
Merge pull request #189 from lioncash/model
CModelBoo: Make static data constexpr where applicable
2020-03-06 16:14:05 -08:00
Phillip Stephens f8e40e600f
Merge pull request #188 from lioncash/class
CModelShaders: Make EExtendedShader an enum class
2020-03-06 16:13:54 -08:00
Phillip Stephens b44e43c7c0
Merge pull request #187 from lioncash/make
CThardus: Minor tidying changes
2020-03-06 16:13:42 -08:00
Phillip Stephens ab65fae969
Merge pull request #186 from lioncash/array
CInGameGuiManager: Make use of std::array where applicable
2020-03-06 16:13:33 -08:00
Phillip Stephens c9e7b2c2ff
Merge pull request #185 from lioncash/reference2
CParticleGenInfo: Fix missing ampersand in GetParticleSystem() member function
2020-03-06 16:13:22 -08:00
Phillip Stephens 915a0785a5
Merge pull request #184 from lioncash/reference
CHierarchyPoseBuilder: Fix missing ampersand in CharLayoutInfo() return value
2020-03-06 16:13:05 -08:00
Phillip Stephens 96af6157bd
Merge pull request #183 from lioncash/move
CThardus: std::move vector instances in constructor
2020-03-06 16:12:53 -08:00
Phillip Stephens 4b13f8768b
Merge pull request #181 from lioncash/ref
CInGameGuiManager: Take std::shared_ptr by const reference in DoStateTransition()
2020-03-06 16:12:35 -08:00
Phillip Stephens 1cccaac115
Final CChozoGhost imps 2020-03-06 07:16:55 -08:00
Lioncash 00ff91eece CEyeball: Remove unnecessary .get() call
Dereferencing is already supported on smart pointers, so we don't need
to call .get() here.
2020-03-06 07:30:27 -05:00
Lioncash c3809162bf CEyeball: Eliminate unnecessary runtime initialzer in Think()
We can just fold the result into the constant directly, which allows us
to avoid the need for a static runtime initializer. This is bit-exact
with what the result would be, so this is fine.
2020-03-06 07:30:05 -05:00
Lioncash 80e2e97dc4 CObjectList: Make IsQualified() a const member function
None of the implementations modify object instance state, so this can be
made const qualified.
2020-03-06 04:36:39 -05:00
Lioncash b1426867bf CBooRenderer: Make use of std::array where applicable
Makes the data strongly typed and allows eliminating some hardcoded
sizes.
2020-03-06 02:25:40 -05:00
Lioncash 4f7f5cf09a CBooRenderer: Make Buckets class mostly internal
This is only ever functionally used within this translation unit, so we
can hide the class internally.
2020-03-06 01:16:02 -05:00
Lioncash 3c4e25062d CModelBoo: Make static data constexpr where applicable
Gets rid of potential runtime-initializers.
2020-03-06 00:46:30 -05:00
Lioncash d9664d165f CModelShaders: Make EExtendedShader an enum class
Prevents pollution of the urde namespace with general names like Flat,
etc.
2020-03-06 00:16:31 -05:00
Lioncash 3717480eeb CThardus: Make use of std::array where applicable
Dehardcodes some sizes and gets rid of two instances of implicit sign
conversions.
2020-03-05 23:22:30 -05:00
Lioncash 3b6218fa67 CThardus: Make use of std::make_unique where applicable
Same thing, but more straightforward.
2020-03-05 23:15:24 -05:00
Lioncash 84fde9ceca CInGameGuiManager: Make use of std::array where applicable
Allows us to eliminate some hardcoded array sizes.
2020-03-05 22:02:29 -05:00
Lioncash 40277bedac CParticleGenInfo: Fix missing ampersand in GetParticleSystem() member function
Previously the particle system shared pointer would always be returned
by value, rather than by reference.
2020-03-05 21:36:04 -05:00
Lioncash 4c90adf074 CHierarchyPoseBuilder: Fix missing ampersand in CharLayoutInfo() return value
Previously this function was always returning by value, rather than by
reference, like what its contained called function does.
2020-03-05 21:28:23 -05:00