Commit Graph

3752 Commits

Author SHA1 Message Date
Lioncash 333fee56e3 CPlayer: Const correctness and bracing consistency changes
Minor surface-level changes to make it nicer to see that certain
variables don't get modified within some operations.

Given some functions are quite large, this is generally nice to see.
2020-04-02 07:39:00 -04:00
Lioncash e7e73e8658 CPlayer: Make use of std::make_unique for x76c_cameraBob
Same behavior, but more consistent with other usages of
std::make_unique.
2020-04-02 03:48:31 -04:00
Lioncash e956402956 CPlayerEnergyDrain: Collapse loop into std::accumulate
Same behavior, less code.
2020-04-02 03:45:07 -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 206be48b43
Merge pull request #292 from lioncash/automap
CAutoMapper: Eliminate usages of const_cast
2020-04-02 02:31:00 -04:00
Lioncash 0ae638eef9 CCollisionActorManager: Make use of std::nullopt
Gets rid of unnecessary zeroing out of the internal buffer on some
implementations.
2020-04-02 02:08:15 -04:00
Lioncash 6931737aef CCollisionActorManager: Minor tidying
Bracing consistency and using const where applicable.
2020-04-02 02:06:44 -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 de59ea45eb ScriptLoader: Zero out itemCounts 2020-04-01 21:17:05 -04:00
Luke Street a4a7888338
Merge pull request #287 from AxioDL/elitepirate
Elite Pirate implementation
2020-04-01 21:13:33 -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
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 da75543c76 CRainSplashGenerator: Dehardcode line vector size in constructor
We can query the capacity instead.
2020-04-01 00:27:56 -04:00
Lioncash 254a96313a CSkinnedModel: Convert typedef into using alias
Same behavior, nicer to read.
2020-04-01 00:06:52 -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
Luke Street deba91bfc0 CGrenadeLauncher: Fix rendering 2020-03-31 21:29:14 -04:00
Lioncash 4deb785fba CMakeLists: Enable several conformance flags on MSVC
Makes MSVC more standards compliant regarding various C++ constructs.
2020-03-31 21:26:59 -04:00
Lioncash 11c40415f5 TXTR: Mark constexpr functions static
Same behavior, but makes them internally linked.
2020-03-31 20:36:45 -04:00
Lioncash d3295cbb87 TXTR: Make use of const(typedefs) where applicable
Same behavior, but signifies read-only semantics.

Also resolves a few -Wcast-qual warnings.
2020-03-31 17:36:17 -04:00
Lioncash 8132375c69 TXTR: Eliminate variable shadowing 2020-03-31 17:02:55 -04:00
Lioncash d337327b97 DNACommon: Mark hash overloads as noexcept
These functions shouldn't throw at all.

By extension, also mark the UniqueID class interfaces as noexcept.
2020-03-31 16:55:19 -04:00
Luke Street ffd94d1106 COmegaPirate: Stub 2020-03-31 14:17:47 -04:00
Lioncash 96fa7af8b5 STRG: Convert file-scope std::vector to std::array
Eliminates a runtime-static constructor and heap allocation at program
start.
2020-03-31 14:15:09 -04:00
Lioncash 16c37abf79 DNAMP3: Prevent unnecessary copies 2020-03-31 13:24:34 -04:00
Lioncash 93f107cb79 STRG: Avoid unnecessary copies
Makes several functions significantly less copy intensive. See previous
commit for reason.
2020-03-31 13:23:21 -04:00
Lioncash 3d0270cf82 DNAMP2: Prevent unnecessary copies
Auto-deduces the exact type instead of using a similar, but slightly off
pair type (which causes a copy).
2020-03-31 13:19:50 -04:00
Lioncash d8ed1a5e79 RetroDataSpec: Convert typedefs to using aliases
Same behavior, but nicer to read.
2020-03-31 13:11:24 -04:00
Lioncash 9ef2fbba5a RetroDataSpec: Make use of make_unique where applicable
Same behavior, but without a mildly wonky way of performing it.
2020-03-31 13:06:27 -04:00
Lioncash 53694481e5 SpecMP2: Make use of emplace_back()'s return value
Same behavior, less code.
2020-03-31 12:46:20 -04:00
Lioncash e6f217bf25 SpecMP2: Prevent unnecessary copies in buildPaks()
Uses auto to properly deduce the intended return type in iteration (pair
with a const string), which prevents a copy from needing to be
generated.
2020-03-31 12:43:42 -04:00
Lioncash 97fd815afa SpecMP1: Make use of emplace_back() where applicable
Same behavior, but allows in-place construction.
2020-03-31 12:40:37 -04:00
Lioncash 9af90efb7d SpecMP1: Make use of emplace_back()'s return value
Same behavior, less code.
2020-03-31 12:38:31 -04:00
Lioncash 305262eb29 SpecMP1: Prevent unnecessary copies in buildPaks
Previously the type mismatched by a single const qualifier, which meant
a copy would have to occur.

Instead, we can use auto to avoid this issue from occurring and allowing
the proper type to be automatically deduced.
2020-03-31 12:36:18 -04:00
Lioncash ac28575e9d SpecMP3: Make use of emplace_back()'s return value
Same behavior, less code.
2020-03-31 12:33:51 -04:00