Commit Graph

384 Commits

Author SHA1 Message Date
Lioncash f96ea81d69 CPASDatabase: Resolve sign-conversion warnings
We can leverage size_t here to resolve sign-conversion warnings.

While we're in the same area, we can remove a use of at() for
std::vector, given a bounds check already precedes it.
2020-04-06 13:21:06 -04:00
Lioncash 8dcd6b3109 CBodyState: Make use of HasAnims()
We can replace the usages of GetNumAnims with this now.
2020-04-06 13:17:19 -04:00
Lioncash 891fd05442 CPASAnimState: Add HasAnims()
GetNumAnims() is only used in two places to do existence checking. We
can just provide a dedicated function for this and also have size
querying as well.
2020-04-06 13:15:13 -04:00
Lioncash 6381f021b7 CPASAnimState: Make use of size_t for GetAnimParmData()
Given the rest of the interface now uses size_t, we can convert this
over. While we're at it, we can also take the result of the at() call
inside of it in order to avoid any copies of data altogether.
2020-04-06 13:10:43 -04:00
Lioncash 17c1582ba2 CPASAnimState: Make PickRandomAnimation() private
This isn't used externally anywhere.
2020-04-06 13:06:31 -04:00
Lioncash 0b74a3e995 CPASAnimState: Make use of size_t for indices
Same behavior, but plays nicer with containers.

This can technically result in less zero-extensions with regards to
memory indexing and registers, but this wasn't the underlying reason for the change.
2020-04-06 13:02:22 -04:00
Lioncash 4043b63721 CPASAnimState: Make computation functions private
These are currently only used internally.
2020-04-06 12:56:29 -04:00
Lioncash 0e0ca4caa9 CAnimSource: Eliminate variable shadowing
Gets rid of two -Wshadow warnings.
2020-04-06 07:04:49 -04:00
Lioncash 741adfe45c CPASAnimParm: Make constexpr capable
Allows the type to be used in constexpr scenarios and allows for
compile-time elimination of initializers.
2020-04-06 02:55:05 -04:00
Lioncash f77fb2089b General: Pass std::nullopt to CAnimData::Render instead of {}
Prevents some implementations (libstdc++ and libc++) from completely zeroing out the underlying
buffer and instead sets a single byte flag.

Eliminates unnecessary memsets.
2020-04-05 08:24:42 -04:00
Lioncash 0a7ccace44 CCharacterFactory: Eliminate usages of const_cast within CreateCharacter()
We can simply make this member function non-const and eliminate the need
for casts like this.
2020-04-05 08:11:51 -04:00
Lioncash 852dd5c6bf CParticleGenInfo: Collapse TCastToPtr into conditions
Same behavior, but more compact.
2020-04-05 05:10:28 -04:00
Lioncash 39e8ee9a80 CBodyState: Return 1.0f directly in UpdateLocomotionAnimation()
Same behavior, but less verbose.
2020-04-05 03:24:56 -04:00
Lioncash 71e3fb1817 CBodyState: Eliminate usages of const_cast
This is clearly modifying the command, so we should allow for modifying
of command instances if necessary.
2020-04-05 03:21:33 -04:00
Lioncash 1fb28a03a3 CBodyState: Mark reference parameters as const where applicable
Makes the parameters explicit about whether or not they're modified.
2020-04-05 03:10:35 -04:00
Lioncash 9ddb726155 CBodyState: Make use of const where applicable
Same behavior, but makes read-only intent explicit.
2020-04-05 02:58:22 -04:00
Luke Street ca6b3dd3f6
Merge pull request #294 from lioncash/cseg
CSegStatementSet: Minor changes
2020-04-02 02:32:00 -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
Lioncash 233b2ccbbf CSegStatementSet: Make use of std::array
Same behavior, but without implicit array to pointer decay.
2020-04-01 00:36:50 -04:00
Lioncash c02d5a91b8 CSegStatementSet: Make x4_segData private
Accessors already exist to access the data individually, so we can just
use those instead.
2020-04-01 00:34:12 -04:00
Lioncash 7117e298d9 IVaryingAnimationTimeScale: Add virtual destructor
This is used in a polymorphic context, so we should be specifying a
virtual destructor to prevent undefined behavior when deleting instances
from the base class.
2020-03-31 23:55:15 -04:00
Lioncash 91f75a4c60 IAnimReader: Add missing override specifiers 2020-03-31 06:11:08 -04:00
Lioncash 2f0d774ed8 General: Make use of emplace_back where applicable 2020-03-31 05:33:10 -04:00
Lioncash 7b9018dbf0 CModelData: Initialize m_drawInstCount to zero
Allows for deterministic initial state to make debugging nicer.
2020-03-31 04:53:04 -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
Phillip Stephens d167293552
Merge pull request #291 from lioncash/name
IAnimReader: Make use of std::string_view where applicable
2020-03-31 01:20:20 -07:00
Phillip Stephens 7b0c043721
Merge pull request #288 from lioncash/explicit
Runtime: Add more usages of explicit
2020-03-31 01:19:40 -07: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
Lioncash 2c36b0bb83 IAnimReader: Make use of std::string_view where applicable
Same behavior, but allows interoperating with different string types in
a more straightforward manner.
2020-03-31 03:13:02 -04:00
Lioncash aa8d147350 CAnimTreeDoubleChild: Correct call to VGetBoolPOIState() in VGetInt32POIState()
Like the previous change, it's awfully suspect to be interpreting all
integer values as bools.
2020-03-31 02:43:48 -04:00
Lioncash 03c0a8a5f6 CAnimTreeAnimReaderContainer: Correct call to VGetBoolPOIState() within VGetInt32POIState()
It seems quite suspect to read all integral values as bools.
2020-03-31 02:06:56 -04:00
Lioncash 260dbaca7d CAnimData: Rename IceModel() to GetIceModel()
Allows const overloading to work and prevents compilation errors from
occuring if the const qualifier on an instance changes over refactoring.
2020-03-31 01:26:00 -04:00
Luke Street 4ada5a00cb CElitePirate: Nearly complete implementation 2020-03-29 03:28:14 -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
Lioncash 51afa94e8c Add missing includes where applicable
Resolves a few required dependencies
2020-03-26 01:10:55 -04:00
Luke Street 7ee2a3b912
Merge pull request #254 from AxioDL/flyingpirate
CFlyingPirate implementation
2020-03-25 03:01:10 -04:00
Lioncash a862b792de CBoneTracking: Make use of parameter in SetActive()
GM8E v0 makes use of the parameter and doesn't always set the value to
true.
2020-03-25 02:12:56 -04:00
Lioncash 22036859db CPASDatabase: Add names to parameters in prototypes
Makes IDE introspection better.
2020-03-25 01:43:27 -04:00
Lioncash fad980dc19 CBodyController: Make HasBodyInfo() accept a const reference
This only queries state and doesn't actually modify it.
2020-03-25 01:39:08 -04:00
Lioncash f875bdf024 CBodyController: Add names to parameters in interface
Makes the interface more self-documenting and allows IDEs to perform
better introspection at call sites.
2020-03-25 01:36:54 -04:00
Lioncash cd184daeba CAnimData: Give names to function prototype parameters
Provides at least some form of name for all functions in the interface.
This allows IDEs to perform proper name inspection (as well as being
slightly more informative to the reader in some cases).
2020-03-22 05:42:11 -04:00
Luke Street 851304ded9 CFlyingPirate: Finish Think implementation 2020-03-18 02:53:53 -04:00
Luke Street 932615593e CFlyingPirateRagDoll: Implement PreRender, Prime 2020-03-18 01:20:24 -04:00
Luke Street 26ae8beb74 CFlyingPirate: Small fixes 2020-03-18 01:19:23 -04:00
Luke Street 13d8c3fdd1 CFlyingPirate: First draft almost done 2020-03-18 01:18:48 -04:00
Luke Street fcf7044bf2 Merge remote-tracking branch 'github/recovery' 2020-03-18 00:45:49 -04:00
Lioncash f45e2362c5 CPoseAsTransforms: Make use of std::array where applicable 2020-03-16 16:08:25 -04:00
Lioncash cc6d50a1aa CPoseAsTransforms: Mark constructor as explicit
Prevents potentially error-prone implicit constructions.
2020-03-16 16:05:52 -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