Commit Graph

809 Commits

Author SHA1 Message Date
Lioncash cfa6299704 CShockWave: Resolve sign conversion warning
int was being used when size_t should have been.
2020-04-06 13:25:30 -04:00
Lioncash 5f7a33e2ec CThardus: convert 0 literal to false
Same behavior, but matches the type of the parameter.
2020-04-06 08:43:41 -04:00
Lioncash 0a0ac955b5 CThardus: std::move std::vector instance in constructor
Same behavior, no reallocations.
2020-04-06 08:41:18 -04:00
Lioncash 296cb3df2b CMemoryCardDriver: Make use of std::array where applicable
Stronger typing and also allows eliminating several hardcoded data
sizes.
2020-04-06 06:23:48 -04:00
Lioncash cabbfcc320 CActor: Make AddToRenderer() non-const
This member function alters instance state in a few implementations, so
it shouldn't be made const.

The state manager parameter also shouldn't be const. Retrieved data
from the post constructed instance is further modified in some
implementations. This removes the constness on this parameter in order
to fix more const_cast usages in a follow-up change.
2020-04-06 00:52:10 -04:00
Lioncash b99122dae8 CFrontEndUI: Remove use of const_cast in Draw()
These casts are no longer necessary.
2020-04-05 07:12:07 -04:00
Lioncash 4d2e51c0b9 CSamusHud: Make Draw() non-const
Allows eliminating usages of const_cast.
2020-04-05 07:09:13 -04:00
Lioncash 3e9e434d96 CPlayerVisor: Make Draw() non-const
Allows eliminating const_cast usages.
2020-04-05 07:00:40 -04:00
Lioncash be4e7f8ff7 CMFGame: Remove unnecessary const_cast
This is no longer necessary, considering that Draw() isn't const
qualified anymore.
2020-04-05 06:52:19 -04:00
Lioncash 8808a3a324 CFireFlea: Unindent FindSafeRoute()
Makes the function much nicer to follow by using guard clauses to
unindent the code.
2020-04-05 05:36:28 -04:00
Lioncash 99c564cfe4 CFireFlea: Make colors constexpr internal details
Same behavior, but makes the color constants fully internal details.
2020-04-05 05:25:47 -04:00
Lioncash 66711ce023 CSamusHud: Dehardcode sizes where applicable 2020-04-02 08:34:38 -04:00
Lioncash 013b715c63 CSamusHud: Make use of std::array where applicable
Same behavior without any array->pointer decay.
2020-04-02 08:25:52 -04:00
Luke Street 206be48b43
Merge pull request #292 from lioncash/automap
CAutoMapper: Eliminate usages of const_cast
2020-04-02 02:31:00 -04:00
Lioncash d26521b41d CElitePirate: Add missing const specifiers
Note to self: Remember to stage all of the necessary changes in commits.
2020-04-02 01:55:38 -04:00
Lioncash b562905266 CElitePirate: Mark functions const where applicable
These don't modify instance state, so we can mark these as const.
2020-04-02 00:37:24 -04:00
Lioncash b3753c6a92 CElitePirate: Make use of TCastToConstPtr where applicable
Makes read-only semantics more obvious at a glance.
2020-04-02 00:35:09 -04:00
Lioncash 60000c163b CElitePirate: Collapse indexing into back() calls where applicable
Same behavior, but more compact.
2020-04-02 00:24:24 -04:00
Lioncash 6e179bfa87 CElitePirate: Remove unnecessary reference qualifiers
Same behavior, but makes locations where copies occur much more
explicit.
2020-04-02 00:22:48 -04:00
Lioncash 6017e99aac CGrenadeLauncher: Remove stray reference qualifier on a copy operation
Same behavior, but more explicit about a copy needing to occur here.
2020-04-01 23:59:05 -04:00
Lioncash b95d84a570 CGrenadeLauncher: Resolve sign conversion warnings in constructor 2020-04-01 23:57:53 -04:00
Lioncash f10eb618bf CGrenadeLauncher: Remove reference qualifiers where unnecessary
While allowed by the standard, this obscures cases where actual copies
are occurring.
2020-04-01 23:56:07 -04:00
Lioncash e3775a8fca CRidley: qualify virtual function call in constructor
Signifies that we intentionally want to call this virtual function in
the constructor.
2020-04-01 23:09:11 -04:00
Lioncash 388e5f2e7f CRidley: Make use of std::make_unique where applicable 2020-04-01 23:08:08 -04:00
Luke Street 62e58553c5 CBouncyGrenade/CGrenadeLauncher: Explicit constructor fixes 2020-04-01 15:32:38 -04:00
Luke Street 1e15e0d1f3 Merge remote-tracking branch 'origin/master' into elitepirate
# Conflicts:
#	Runtime/World/CPatterned.hpp
2020-04-01 15:02:56 -04:00
Luke Street 0c1f4fa738 CElitePirate/etc: Use prefix increment/decrement 2020-04-01 15:01:44 -04:00
Luke Street bb7699be46 CElitePirate/CShockWave: Renaming 2020-04-01 14:54:01 -04:00
Luke Street 162b232979 CElitePirate: Fix melee & contact damage 2020-04-01 03:39:05 -04:00
Luke Street d4ff239f91 CShockWave: Implement Touch 2020-04-01 02:41:31 -04:00
Luke Street 6e5c32abfd CBouncyGrenade: Pass bounding box to CPhysicsActor 2020-04-01 01:38:48 -04:00
Luke Street deba91bfc0 CGrenadeLauncher: Fix rendering 2020-03-31 21:29:14 -04:00
Luke Street ffd94d1106 COmegaPirate: Stub 2020-03-31 14:17:47 -04:00
Lioncash 47555c725b CAutoMapper: Eliminate usages of const_cast
Same behavior, but makes it explicit from the interface that
modifications are clearly going on from within the class.
2020-03-31 06:57:07 -04:00
Lioncash 1415265ef2 Runtime: Default destructors where applicable
Same behavior, but allows the destructors to be trivial, etc.
2020-03-31 04:50:26 -04:00
Lioncash 67f6666ea1 Runtime: Add more usages of explicit
Prevents error-prone implicit conversions where applicable.

This targets the regular RuntimeCommon target this time around.
2020-03-31 03:53:49 -04:00
Luke Street b43d4eaddc CElitePirate: Implement SpecialAttack, CShockWave 2020-03-31 03:29:00 -04:00
Luke Street f0927d937a CGrenadeLauncher: Remove redundant CColor 2020-03-30 23:39:41 -04:00
Luke Street 782a13c0a4 CGrenadeLauncher: Fix CModelFlags assignment 2020-03-30 23:31:46 -04:00
Luke Street 2e3d1c980b CElitePirate: Implement AttractProjectiles; fix CGameProjectile material list 2020-03-30 23:10:51 -04:00
Luke Street 684bbd5903 CElitePirate: Bug fixes, make member variables private, cleanup 2020-03-30 20:40:38 -04:00
Luke Street ed254b460e Revert some clang-tidy changes 2020-03-30 19:42:11 -04:00
Luke Street 571050245d Add .clang-tidy and apply fixes 2020-03-30 19:31:14 -04:00
Luke Street bc1135f0cf CBouncyGrenade: Use explicit SMoverData constructor 2020-03-30 03:14:33 -04:00
Luke Street bc08792523 CBouncyGrenade implementation 2020-03-30 03:05:16 -04:00
Luke Street fbbd73db48 CGrenadeLauncher implementation 2020-03-29 23:45:55 -04:00
Lioncash 6dce70895c CIOWin: Make Draw() non-const
Allows removing several const_cast usages within the codebase.
2020-03-29 21:56:49 -04:00
Luke Street 4ada5a00cb CElitePirate: Nearly complete implementation 2020-03-29 03:28:14 -04:00
Luke Street 4f7e0a85a3 CElitePirate: More function implementations 2020-03-27 02:47:34 -04:00
Lioncash e46a37e893 MP1: Make use of std::array where applicable
Same behavior, stronger typing, and allows eliminating hardcoded sizes
in some places.
2020-03-27 01:07:29 -04:00
Lioncash a77b9cb609 MP1: Join namespaces
Same behavior, less code.
2020-03-27 01:02:35 -04:00
Luke Street 108fd502bf CElitePirate/CFlyingPirate: Updates from symbol map 2020-03-26 21:42:18 -04:00
Luke Street 0886a39d81 CElitePirate: DoUserAnimEvent; create CShockWave 2020-03-26 18:09:50 -04:00
Luke Street 6150548e91 CElitePirate: Finish implementing AcceptScriptMsg 2020-03-26 15:24:56 -04:00
Luke Street c33703bd93 CElitePirate: Start impl; create CGrenadeLauncher 2020-03-26 03:30:54 -04:00
Lioncash 74600588fa Add missing includes pt.2
Some missing includes that actually need to be present.
2020-03-26 03:14:03 -04:00
Phillip Stephens 566c356612 Initial ElitePirate imps 2020-03-25 18:14:15 -04:00
Phillip Stephens e5df609673 CElitePirate: Initial stubbing 2020-03-25 18:14:15 -04:00
Luke Street c08b5a4c98 CFlyingPirate: Fix Aqua Pirates 2020-03-25 03:48:10 -04:00
Luke Street da648b18d8 CSpankWeed: Fix collision manager null deref 2020-03-25 03:47:56 -04:00
Luke Street 7ee2a3b912
Merge pull request #254 from AxioDL/flyingpirate
CFlyingPirate implementation
2020-03-25 03:01:10 -04:00
Luke Street 815d83d843 CFlyingPirateRagDoll: Fix particles & length constraints 2020-03-25 02:57:57 -04:00
Lioncash 51c1ffecd6 CActorContraption: Add names to parameters in prototypes
Makes it more self-documenting from the interface alone.
2020-03-25 02:46:22 -04:00
Lioncash 0cc8e76d64 CActorContraption: Make use of structured bindings where applicable
Same behavior, but with better names than `first` or `second`.
2020-03-20 23:13:29 -04:00
Luke Street 6d757f021f CFlyingPirateRagDoll: Implement Update 2020-03-18 04:50:41 -04:00
Luke Street 851304ded9 CFlyingPirate: Finish Think implementation 2020-03-18 02:53:53 -04:00
Phillip Stephens eb9efbf8c3
Initial PATH support for MP2 2020-03-17 23:12:43 -07:00
Luke Street 642bf379ce CFlyingPirate: Add CPathFindSearch flags 2020-03-18 01:39:32 -04:00
Luke Street 6f89dbb240 CFlyingPirate: More small fixes 2020-03-18 01:20:24 -04:00
Luke Street 932615593e CFlyingPirateRagDoll: Implement PreRender, Prime 2020-03-18 01:20:24 -04:00
Luke Street 57386e6269 CFlyingPirate: Small fixes 2020-03-18 01:19:23 -04:00
Luke Street 8897d38c6a CFlyingPirate: Fix Lurk state delay 2020-03-18 01:19:23 -04:00
Luke Street 651e28e921 CFlyingPirate: Fix TargetPatrol 2020-03-18 01:19:23 -04:00
Luke Street 26ae8beb74 CFlyingPirate: Small fixes 2020-03-18 01:19:23 -04:00
Luke Street 1bcd0916ca CFlyingPirate: Fixes; implement all functions 2020-03-18 01:18:48 -04:00
Luke Street 13d8c3fdd1 CFlyingPirate: First draft almost done 2020-03-18 01:18:48 -04:00
Luke Street 11ea9d3aa6 CFlyingPirate: More method implementations 2020-03-18 01:18:48 -04:00
Luke Street d4982270e8 CFlyingPirate: Start implementing methods 2020-03-18 01:18:48 -04:00
Luke Street 5765fd8951 CFlyingPirate: Method definitions & CFlyingPirateRagDoll constructor 2020-03-18 01:18:48 -04:00
Luke Street e925dc2628 CFlyingPirate: Start implementation 2020-03-18 01:18:48 -04:00
Lioncash b52e8dc6aa CMainFlow: std::move shared_ptr in SetGameState
Same behavior, but without a redundant atomic reference count
increment/decrement.
2020-03-17 19:15:09 -04:00
Luke Street dc77fb0c41
Merge pull request #234 from lioncash/puddle
CPuddleSpore: Make static const class data internally linked
2020-03-16 19:11:04 -04:00
Lioncash ff8e4c18a1 CPuffer: Make use of std::array where applicable
Allows direct size querying, which allows removing the use of direct
hardcoded array sizes.
2020-03-16 16:37:40 -04:00
Lioncash 2ae02eefb0 CPuddleSpore: Make static const class data internally linked
Makes the data an implementation detail and also allows for the
string_view array to be declared constexpr.
2020-03-16 16:26:19 -04:00
Luke Street 2f7e2dd85e
Merge pull request #231 from lioncash/blur
CPauseScreenBlur: Remove const_cast in Draw()
2020-03-16 16:14:03 -04:00
Luke Street 6ea64becb4
Merge pull request #230 from lioncash/pause2
CPauseScreenBase: Minor cleanup
2020-03-16 16:13:42 -04:00
Lioncash b9be092635 CPauseScreenBlur: Remove const_cast in Draw()
Draw() clearly modifies the internals of the class in a non-caching
manner, so this member function should really not have a const qualifier
on it.
2020-03-16 16:00:12 -04:00
Phillip Stephens 574fc9b840
CJellyZap fixes 2020-03-15 19:00:52 -07:00
Lioncash 1a7ad1a7f6 CPauseScreenBase: Make use of std::array in GetImagePaneName()
We can make use of std::array here and also make the array constexpr.
This can also be moved into the function in order to hide its scope.
2020-03-15 21:26:59 -04:00
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
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 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
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
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
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 052aa80bac
Fix initial AI issues 2020-03-06 18:03:13 -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 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 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 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 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 6917132a94 CThardus: std::move vector instances in constructor
Previously the std::move calls wouldn't do anything, as the parameters
were constant references, so we can take them by value and move into the
constructor and then move the parameters into the member variables.

While we're at it, we can initialize the vectors in place instead of
constructing and then assigning to them.
2020-03-05 21:19:32 -05:00
Lioncash 50f8f3e17e CInGameGuiManager: Take std::shared_ptr by const reference in DoStateTransition()
Trivially avoids an atomic reference count increment and decrement.
2020-03-05 20:47:07 -05:00
Phillip Stephens e43bfe1e58
More CChozoGhost imps 2020-03-05 07:42:12 -08:00
Phillip Stephens 58cca6ffa8
More chozoghost imps 2020-03-05 01:56:04 -08:00
Phillip Stephens 50a20d7322
More CChozoGhost imps 2020-03-04 18:41:11 -08:00
Phillip Stephens 9d77d7313c
More ChozoGhost imps 2020-03-04 18:41:10 -08:00
Phillip Stephens d91e86a94a
Initial CChozoGhost stubs 2020-03-04 18:41:10 -08:00
Lioncash f0c3903951 CSpacePirate: Make use of std::array with constexpr data
Makes data strongly typed, making pointer decay explicit.
2020-03-04 04:44:54 -05:00
Lioncash 4b3d48ebc1 CSpacePirate: Make static const data internally linked
Makes the symbols fully internally linked and also allows marking them
constexpr.
2020-03-04 04:33:11 -05:00
Phillip Stephens 09f7096913
Disable variable delta time 2020-03-03 16:50:25 -08:00
Phillip Stephens 80dbc1920c
Update submodules 2020-03-03 16:49:13 -08:00
Luke Street 9e0e053906 CScriptSpecialFunction: Further ThinkSpinnerController implementation 2020-03-03 03:31:58 -05:00
Phillip Stephens 9f5f0abab4
More CThardus imps, add reference CTevPass imps 2020-02-29 17:11:41 -08:00
Luke S 617844efce
Merge pull request #175 from lioncash/fixme
CFlaahgraTentacle: Remove FIXME comment in ShouldAttack()
2020-02-29 16:56:50 -05:00
Lioncash 5e705515ed CFlaahgraTentacle: Remove FIXME comment in ShouldAttack()
GM8E v0 does exactly this, so we can consider this double-checked
2020-02-29 06:18:30 -05:00
Lioncash 9434be8562 CFlaahgraTentacle: Amend floating point value within Play case in AcceptScriptMsg()
GM8E v0 sets this to 0.04f.
2020-02-29 05:54:38 -05:00
Lioncash f1256faeb7 Runtime: Remove unnecessary c_str() calls
Makes for less noisy code and also gets rid of unnecessary std::strlen
calls in the case things are passed to a std::string_view parameter.
2020-02-28 05:26:41 -05:00
Luke Street ae591d4817 Add MP1_VARIABLE_DELTA_TIME option (for high refresh rates; buggy) 2020-02-25 14:15:53 -05:00
Lioncash c3294977ff CJellyZap: Make kPlayerFilter constexpr
This can be trivially made constexpr. We can also make this a fully
internally linked identifier.
2020-02-24 20:12:58 -05:00
Luke S c8291ee3dc
Merge pull request #154 from lioncash/constexpr
CSamusDoll: Minor changes
2020-02-24 03:00:11 -05:00
Lioncash 7e2ef9c8ea CSamusDoll: Eliminate variable shadowing in Draw() 2020-02-24 01:50:44 -05:00
Lioncash 9042dddc8c CSamusDoll: Make use of std::array where applicable
Makes the data strongly typed and also allows tooling runtime checks for
debug builds if implementations support it (which MSVC, libstdc++ and
libc++ all support).
2020-02-24 01:48:13 -05:00
Lioncash 61dff4367d CSamusDoll: Make use of an anonymous namespace
Makes a separate area for internally linked data.
2020-02-24 01:39:23 -05:00
Lioncash 08ebecdaaf CSamusDoll: Mark skInitialOffset as constexpr
Allows the vector to be initialized at compile-time.
2020-02-24 01:34:59 -05:00
Phillip Stephens f251c73e6a
Merge branch 'pr-151' 2020-02-13 14:17:40 -08:00
Lioncash da4dde2437 CAtomicBeta: Correct division arithmetic error in Think()
This is supposed to be a multiplication, not a division (at least this
is what v0-00 does).
2020-02-12 04:57:07 -05:00
Phillip Stephens 0bdad38175
Merge branch 'pr-150' 2020-02-11 20:05:07 -08:00
Lioncash 88f445c94d CParasite: Make static CMaterialList instances constexpr where applicable
Same behavior, but allows the data to be stored within the read-only
segment.
2020-02-11 09:33:58 -05:00
Lioncash 1edcbf7ec6 CMetaree: Set locomotion type to crouched if deactivated in InActive()
v0-00 sets this locomotion type when the deactivation flag is set.
2020-02-07 19:32:51 -05:00
Phillip Stephens 61f9adfa70
Merge branch 'pr-148' 2020-02-07 14:25:31 -08:00
Phillip Stephens 6501d56baa
Merge branch 'pr-147' 2020-02-07 14:24:21 -08:00
Lioncash 16f7925652 CFireFlea: Set CPathFindSearch's padding to 50.0f within AcceptScriptMsg()
v0-00 sets the padding member of CPathFindSearch here to 50.0, not a
member variable that's part of the CFireFlea class.
2020-02-07 16:27:56 -05:00
Lioncash d4245b016f CPuddleToadGamma: Migrate static constants into the cpp file
Makes the data fully internally-linked. This also allows declaring
skBellyOffset as constexpr.

While we're at it, we can also make the solid filter constexpr as well,
given it isn't modified anywhere. This allows the data to be placed
within the read-only segment and potentially gets rid of a runtime
static constructor.
2020-02-07 15:55:23 -05:00
Lioncash 0dd7e3e7bf CFlickerBat: Add missing SetMuted() call within Death()
v0-00 contains a call to SetMuted(false) in game code.
2020-02-07 09:38:56 -05:00
Phillip Stephens 330a1bff76
Merge pull request #145 from lioncash/blood-collision
CBloodFlower: Implement GetCollisionResponseType
2020-02-03 14:45:21 -08:00
Phillip Stephens 67e4c2e135
Merge pull request #144 from lioncash/blood-const
CBloodFlower: Mark sFireEffects as constexpr
2020-02-03 14:45:02 -08:00
Lioncash d1a714cf1a CBloodFlower: Implement GetCollisionResponseType
CBloodFlower seems to be missing the implementation from v0-00. This
change adds in its equivalent behavior.
2020-02-03 10:42:26 -05:00
Lioncash 855841607b CBloodFlower: Mark sFireEffects as constexpr
Allows the strings to be put into the read-only section of the binary
(and makes it explicit that the strings aren't modified).

While we're at it we can make use of std::array.
2020-02-03 10:14:19 -05:00