Commit Graph

243 Commits

Author SHA1 Message Date
Luke Street 24acb585f8 MSVC & zeus fixes; update hecl-gui 2020-04-19 21:09:30 -04:00
Lioncash ec5d680be0 CBurstFire: Unindent conditionals where applicable
Makes it nicer to read early-exit conditions.
2020-04-19 00:40:46 -04:00
Luke Street e50d363e88 CPlayerGun: Rename EMissileState; minor CMotionState::Update fix 2020-04-19 00:26:53 -04:00
Lioncash 76f0b57340 General: Use bool literals where applicable
More indicative of the passed in type compared to raw values.
2020-04-17 17:43:56 -04:00
Lioncash c14721611b CEnergyProjectile: Make use of const where applicable
While we're at it, make use of consistent bracing, given some
conditionals traveled over one line.
2020-04-14 15:47:45 -04:00
Lioncash 2ad45e481f CAuxWeapon: Use names for sound IDs
Same behavior, but slightly more self-documenting on what they actually
are.
2020-04-13 10:36:38 -04:00
Lioncash ff123f7820 General: Make use of static_cast within point generators
The more restrictive static_cast is permissable when casting from void*.
2020-04-12 13:29:34 -04:00
Lioncash a433a7852f CIceBeam/CPhazonBeam: Make use of std::array where applicable
Same behavior, stronger typing.
2020-04-12 11:34:59 -04:00
Lioncash b631b5f3a1 CGunWeapon: Mark skShootAnim as constexpr
Enforce it as constexpr. The initializer is likely optimized away
anyways, given the array only contains primitives, but this is more
consistent.
2020-04-12 11:31:28 -04:00
Lioncash 9e168d3497 CPlasmaProjectile: Make PlayerEffectResource instances contain CAssetIds
Uses the wrapper type instead of the raw type.
2020-04-12 07:30:00 -04:00
Luke Street 56cebfbacd
Merge pull request #308 from AxioDL/fmtlib-update
Update fmtlib
2020-04-12 03:06:46 -04:00
Luke Street 9f8064b4a1
Merge pull request #307 from lioncash/constexpr7
CModel: Mark CModelFlag instances as constexpr where applicable
2020-04-12 03:06:12 -04:00
Lioncash 1fff540102 CAnimPlaybackParms: Make class constexpr constructible
Allows for removal of some trivial runtime initializers.
2020-04-11 20:55:46 -04:00
Lioncash 54dededb9b CNewFlameThrower: Make constructor take a std::array by reference
Same behavior, but enforces the size requirement instead of accepting
any arbitrary const CAssetId* pointer.
2020-04-11 19:37:42 -04:00
Lioncash fa0dcf5b12 WeaponCommon: Use string_view with get_asset_id_from_name()
Internal functions expect a std::string_view, so we can just make the
parameter a string_view as well to push the responsibility outwards into
the caller.
2020-04-11 19:33:00 -04:00
Jack Andersen 5b4441ac36 Update fmtlib 2020-04-11 12:51:39 -10:00
Lioncash 75c07677ed CModel: Mark CModelFlag instances as constexpr where applicable
Allows more runtime initializes to potentially be elided.
2020-04-11 16:56:13 -04:00
Lioncash 75d8988ee8 CRandom16: Make constructor explicit
Same behavior, minus the implicit conversions upon construction.
2020-04-11 16:15:05 -04:00
Luke Street 22880abb7e Runtime/Weapon: Replace bitfield unions with constructor initializers 2020-04-11 00:49:02 -04:00
Lioncash 1bacb69fc2 CPlasmaProjectile: Remove mutable specifier from m_renderObjs
Now that Render() is non-const, this is no longer necessary.
2020-04-09 21:17:20 -04:00
Lioncash 4834720bb0 CGrappleArm: Remove usage of const_cast in RenderXRayModel()
This is no longer necessary.
2020-04-09 20:18:45 -04:00
Lioncash 0c1b47faf8 CProjectileWeapon: Remove usages of const_cast
Now that the base Render() function was made non-const, it's trivial to
apply this to the other classes like CProjectileWeapon.
2020-04-09 20:09:14 -04:00
Lioncash bfd17e4513 CActor: Make Render() a non-const function
A few implementations of Render() contain const-casts nested within its
their call hierarchy to get around the fact that this function is marked
const. We can just make the member function non-const to allow removal
of these casts in follow up changes.
2020-04-09 14:32:20 -04:00
Luke Street 7774bc06ca
Merge pull request #297 from lioncash/render
CActor: Make AddToRenderer() non-const
2020-04-09 10:55:16 -04:00
Luke Street 74bce8458b
Merge pull request #299 from lioncash/const2
CGunWeapon: Eliminate usages of const_cast
2020-04-09 10:46:52 -04:00
Lioncash ad1f56bfda CPowerBeam: Make use of std::array where applicable
Same behavior, stronger typing.

We can also narrow the scope of the array.
2020-04-07 13:57:06 -04:00
Lioncash 5405dad069 CWeaponMgr: Make use of size_t in IncrCount()
Keeps this function consistent with the previous change.
2020-04-07 13:40:14 -04:00
Lioncash 8ba2af9b5a CWeaponMgr: Avoid unnecessary repeated std::map lookups
Avoids trivial redundant std::map indexes by doing the lookup once and
then referring to the looked up object instead of doing repeated
lookups.
2020-04-07 13:38:36 -04:00
Lioncash 2e6bd0f05e CGunWeapon: Eliminate usages of const_cast
Eliminates trivial usages of const_cast by making Draw related functions
non-const. This also allows removing the mutable specifiers from several
shader data members.
2020-04-06 00:52:47 -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 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
Phillip Stephens 28853f5ea6
Merge branch 'constexpr5' of https://github.com/lioncash/urde into lioncash-constexpr5 2020-04-05 05:10:42 -07:00
Lioncash b122fd30a8 CGameProjectile: Return std::nullopt in GetTouchBounds()
Same behavior, but doesn't potentially unnecessary zero out the entirety
of the buffer within the optional and only sets a single byte.
2020-04-03 02:07:54 -04:00
Lioncash d47f8c2784 CGameProjectile: Make use of TCastToConstPtr before
Same behavior, but more indiciative of read-only semantics.
2020-04-03 01:58:00 -04:00
Lioncash d240e40a17 CCameraShakeData: Make classes and structs constexpr where applicable
Same behavior, but allows eliminating file-scope initializers needing to
be run on program start.
2020-04-02 21:40:19 -04:00
Lioncash f1e28a1290 CPlasmaBeam: Make use of std::array where applicable
Same behavior, no implicit array to pointer decay.
2020-04-02 21:10:51 -04:00
Lioncash a8594d144b CPlasmaProjectile: Make use of std::array where applicable
Allows dehardcoding array sizes.
2020-04-02 20:55:28 -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 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 2e3d1c980b CElitePirate: Implement AttractProjectiles; fix CGameProjectile material list 2020-03-30 23:10:51 -04:00
Lioncash 194cdf145f Runtime: Use nullptr where applicable
Same behavior, but no magic 0 value.

While we're in the same area, we can do minor cosmetic changes.
2020-03-27 20:18:54 -04:00
Lioncash 241a66dc0a General: Make use of explicit constructors where applicable
Gets rid of potential error prone implicitly constructing constructors.
2020-03-27 06:00:17 -04:00
Lioncash 98b9556f3e CProjectileWeapon: Return std::nullopt instead of {} where applicable
Prevents some implementations from zeroing out their internal buffer
unnecessarily (libstdc++ and libc++).
2020-03-25 16:03:09 -04:00
Lioncash 6365f2ee1c CPowerBomb: Return std::nullopt in GetTouchBounds()
Avoids unnecessary zeroing of the internal buffer of std::optional in
some implementations (libstdc++ and libc++).
2020-03-25 15:56:59 -04:00
Luke Street 7ee2a3b912
Merge pull request #254 from AxioDL/flyingpirate
CFlyingPirate implementation
2020-03-25 03:01:10 -04:00
Phillip Stephens dbbf9e33fd
Merge pull request #262 from lioncash/nullopt
CBeamProjectile: Explicitly return std::nullopt in GetTouchBounds()
2020-03-23 23:27:54 -07:00
Lioncash bf590dd855 CBeamProjectile: Explicitly return std::nullopt in GetTouchBounds()
Allows some implementations to completely avoid zeroing out the internal
buffer within the std::optional instance.
2020-03-21 01:46:59 -04:00
Lioncash 5b7e440ff7 CBomb: Make file-scope material filter constexpr
Allows the data to be placed into the read-only segment.
2020-03-21 01:42:46 -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