Commit Graph

256 Commits

Author SHA1 Message Date
Lioncash 2b2edfa871 CGrappleArm: Invert conditionals where applicable
Makes early-exit conditions nicer to follow and also unindents some
code.
2020-04-23 01:57:18 -04:00
Luke Street fc7e8d4993 CElectricBeamProjectile: Finish implementation 2020-04-21 22:04:37 -04:00
Luke Street 5f66ab2219 CMagdolite: Minor cleanup 2020-04-21 01:32:16 -04:00
Phillip Stephens d1c796f2a9 Initial CMagdolite imps 2020-04-21 01:06:52 -04:00
Luke Street d3a44259c3
Merge pull request #315 from lioncash/init
RuntimeCommonB: Make use of bitfield initializers where applicable
2020-04-21 00:56:39 -04:00
Lioncash 554893ef85 RuntimeCommonB: Make use of bitfield initializers where applicable
Given that we now target C++20, we can make use of bitfield initializers
where applicable.
2020-04-20 15:57:25 -04:00
Luke Street 7b1e041123
Merge pull request #301 from AxioDL/omegapirate
OmegaPirate implementation
2020-04-20 03:21:04 -04:00
Lioncash dca87e7dce CPlayerGun: Convert missed literal to a boolean literal
whoops.
2020-04-19 23:39:04 -04:00
Lioncash 1f8f3726e6 CPlayerGun: Make use of bool literal where appropriate
Avoids a conversion to bool from int.
2020-04-19 23:35:07 -04:00
Luke Street 32c44cbf05 Merge branch 'master' into omegapirate
# Conflicts:
#	Runtime/GuiSys/CAuiImagePane.cpp
2020-04-19 22:12:18 -04:00
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
Luke Street 30f2ac3f26 Merge branch 'master' into omegapirate 2020-04-18 18:14:51 -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
Luke Street 6b814262fc Merge remote-tracking branch 'origin/master' into omegapirate 2020-04-09 20:06:33 -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
Luke Street a4b1e7f85f COmegaPirate: Implement Faint, Growth, JumpBack, Suck; continue Think implementation 2020-04-06 16:56:10 -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