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
Lioncash
3e4731bf7f
CWallCrawlerSwarm: Minor tidying changes
...
- Amends formatting according to clang-format.
- Makes use of const where applicable
- More consistent bracing
2020-03-30 19:05:48 -04:00
Lioncash
e5a0959ef0
CWallCrawlerSwarm: Make use of size_t where applicable
...
Avoids unnecessary upper register clearing.
2020-03-30 19:05:48 -04:00
Lioncash
e1273faa68
CWallCrawlerSwarm: Eliminate some sign conversion warnings
...
Same behavior, less warnings.
2020-03-30 19:05:48 -04:00
Luke Street
cc8603fbec
Merge pull request #286 from lioncash/const-cast
...
CIOWin: Make Draw() non-const
2020-03-30 18:40:40 -04:00
Lioncash
7ff3d29794
CWallCrawlerSwarm: Mark static const data as constexpr
...
Same behavior, but allows elision of initializers. While we're at it, we
can convert an array over to std::array.
2020-03-30 05:44:35 -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
Lioncash
312b8f219a
CWorld: Dehardcode magic number in CheckWorldComplete()
...
Same behavior, no magic number.
2020-03-30 00:58:03 -04:00
Lioncash
802ac13812
CWorld: Make use of std::array where applicable
2020-03-30 00:54:38 -04:00
Lioncash
79b1e26052
IGameArea: Amend formatting of EChain
...
Makes for nicer visual scanning.
2020-03-30 00:47:29 -04:00
Lioncash
6ae935924b
IRenderer/CBooRenderer: Add parameter names to function prototypes
...
Makes the interface more self-documenting and allows IDEs to perform
better parameter introspection
2020-03-30 00:34:38 -04:00
Lioncash
111f0c3d3a
IRenderer: Convert typedef to using alias
...
Same behavior, but nicer to read.
2020-03-30 00:18:38 -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
Lioncash
0d3bab4c14
CScanDisplay: Remove use of const_cast
...
The draw function is essentially not fully const in behavior, so we can
remove the const qualifiers where necessary.
2020-03-29 21:44:10 -04:00
Lioncash
2d8e94911a
CGuiTextSupport: Eliminate the use of const_cast
...
We can supply a const and non-const variant to eliminate the need to
const_cast here.
2020-03-29 21:37:11 -04:00
Lioncash
f3afcf7299
CGuiTextPane: Remove stray unnecessary const_cast in Draw()
...
Draw() isn't const qualified, so there's no need to cast away const
here.
2020-03-29 21:25:47 -04:00
Lioncash
1d725587e5
CSortedLists: Remove const_cast in all BuildNearList() implementations
...
Same behavior, but nicer to read.
2020-03-29 21:22:52 -04:00
Lioncash
0a366855bc
CSortedLists: Add names to all function prototypes
...
More self-documenting and allows parameter inspection in IDEs to
function nicer.
2020-03-29 21:18:18 -04:00
Lioncash
eecd03428d
CSortedLists: Remove use of const_cast in AddToLinkedList()
...
Same behavior, but nicer to read.
2020-03-29 21:17:59 -04:00
Lioncash
6d2ef0360f
CGameState: Resolve sign conversion warnings in PutTo()
...
Same behavior, but makes conversions explicit.
2020-03-29 21:03:24 -04:00
Lioncash
45ea19040d
CGameState: Make use of std::array where applicable
2020-03-29 20:58:31 -04:00
Lioncash
24fe7ec499
CGameState: Remove use of const_cast
...
Same behavior, but nicer to read.
2020-03-29 20:52:34 -04:00
Lioncash
603942daaf
CTextRenderBuffer: Remove use of const_cast in Render()
...
Makes for much less casting.
2020-03-29 20:27:04 -04:00
Lioncash
04a42980ab
Revert "Revert "CTextRenderBuffer: Forward declare structs where applicable""
...
This reverts commit 16745f3a7b
.
We can simply default the move constructor and move assignment operator
to make this work.
2020-03-29 20:09:16 -04:00
Phillip Stephens
16745f3a7b
Revert "CTextRenderBuffer: Forward declare structs where applicable"
2020-03-29 16:35:02 -07:00
Phillip Stephens
f3721844b9
Merge pull request #282 from lioncash/struct
...
CTextRenderBuffer: Forward declare structs where applicable
2020-03-29 16:04:32 -07:00
Lioncash
232ae12802
CGuiTextPane: Make use of std::array where applicable
...
Same behavior, but with stronger typing and allows removing of a
hardcoded array size.
2020-03-29 08:00:40 -04:00
Lioncash
0aff4dc21e
CTextRenderBuffer: Remove use of const_cast within Render()
...
Same behavior but way less casting.
2020-03-29 04:42:58 -04:00
Lioncash
20b74c4818
CTextRenderBuffer: Forward declare structs where applicable
...
These are only used internally, so we can completely hide these structs
from external view.
This allows their implementation to be changed without needing to
recompile all the headers that include it.
2020-03-29 03:54:29 -04:00
Luke Street
4ada5a00cb
CElitePirate: Nearly complete implementation
2020-03-29 03:28:14 -04:00
Jack Andersen
3e07a06355
Merge branch 'master' of ssh://git.axiodl.com:6431/AxioDL/urde
2020-03-28 21:21:53 -10:00
Jack Andersen
d1c2ae71c2
Ensure consistent override usage in TCachedToken
2020-03-28 21:20:44 -10:00
Jack Andersen
eefb975f23
Merge branch 'noexcept' of https://github.com/lioncash/urde
2020-03-28 21:08:43 -10:00
Lioncash
fda08db9b1
CHudVisorBeamMenu: Dehardcode array sizes
...
Same behavior, but queries the container for the size rather than
hardcoding it in loop bounds.
2020-03-29 03:08:41 -04:00
Lioncash
413483a996
CHudFreeLookInterfaceXRay: Assign free look and control held flags in SetFreeLookState()
...
GM8Ev0 does this.
2020-03-29 02:08:51 -04:00
Lioncash
ad07b993c8
CHudFreeLookInterface: Collapse conditional within SetFreeLookState()
...
Same behavior, less code.
2020-03-29 02:03:20 -04:00
Lioncash
59fbefbd58
CGuiWidget: Provide names for all function prototypes
...
Makes parameter introspection nicer with IDEs and also renames ambiguous
"v" names to something more self-descriptive.
2020-03-29 01:52:23 -04:00
Lioncash
764dac0adc
CToken: Add missing override specifiers
2020-03-28 05:55:17 -04:00
Phillip Stephens
0db6f96a17
Merge pull request #279 from lioncash/constexpr
...
CScannableParameters: Mark CScannableParameters as constexpr
2020-03-27 23:54:26 -07:00
Lioncash
54c6122cbd
CToken: Mark move assignment operator as noexcept
...
Allows containers and anything using std::move_if_noexcept to perform a
move instead of a copy.
2020-03-27 20:56:04 -04:00
Lioncash
2558da714e
Runtime: Remove unnecessary smart pointer .get() calls
...
Same behavior, less code to read.
2020-03-27 20:50:45 -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
05988ce31c
CScannableParameters: Mark CScannableParameters as constexpr
...
This only contains a single member, so this can trivially be marked
constexpr.
2020-03-27 20:07:33 -04:00
Phillip Stephens
e0fe365dfd
Merge pull request #278 from lioncash/explicit
...
General: Make use of explicit constructors where applicable
2020-03-27 14:10:19 -07: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
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
Lioncash
fcf70aeb2a
CGuiWidgetIdDB: Remove redundant std::make_pair funcs
...
Same behavior, less code.
2020-03-26 03:55:28 -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
Lioncash
be6b5406a9
CPatterned/ScriptLoader: Convert function typedefs to using aliases
...
Same thing, but more readable.
2020-03-26 03:09:56 -04:00
Lioncash
d9a9e0f51e
CEnvFxManager: Take std::vector by value and std::move
...
Same behavior, but allows calling code to move into the parameter,
avoiding copies.
2020-03-26 02:56:10 -04:00
Lioncash
dd76e73e11
ITweak: Default virtual destructor
...
Same behavor, but allows the destructor to be trivial.
2020-03-26 01:14:41 -04:00
Lioncash
51afa94e8c
Add missing includes where applicable
...
Resolves a few required dependencies
2020-03-26 01:10:55 -04:00
Lioncash
4169e3d91d
CSnakeWeedSwarm: Mark several member functions as const
...
These don't alter instance state, so they can be const member functions.
2020-03-26 01:05:32 -04:00
Lioncash
43e0d16c5d
CSnakeWeedSwarm: Use emplace_back in CreateBoid()
...
Same behavior, but with in-place construction instead.
2020-03-26 01:00:29 -04:00
Lioncash
2164854e87
CVisorFlare: Pass flares by value and use std::move
...
Same behavior, but allows calling code to move into the parameter and
avoid copies entirely.
2020-03-26 00:32:49 -04:00
Lioncash
477c5770c6
rstl: Add [[nodiscard]] to interface functions where applicable
...
Not using the result of these functions is considered a bug and should
be signified as such by a compiler.
2020-03-25 23:43:20 -04:00
Lioncash
f4b3fb947e
CScanDisplay: Make constructor explicit
...
Prevents error-prone implicit construction from occurring.
2020-03-25 20:46:08 -04:00
Lioncash
3c17336fb0
CSaveWorld: Make constructor explicit
...
Prevents error-prone implicit constructions from occurring.
2020-03-25 20:42:21 -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
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
Lioncash
cda5a48970
CRelayTracker: Add names to function prototypes
...
Allows IDE introspections at call sites to function nicer.
2020-03-25 15:53:49 -04:00
Lioncash
c5c888daa6
CRippleManager: Rename Ripples() to GetRipples()
...
Allows const overloading to work and prevents compilation errors from
occurring if the constness ever changes.
2020-03-25 04:22:34 -04:00
Lioncash
4f9e53933e
CPathFindArea: Amend bitset size
...
The previous commit meant to contain this size.
2020-03-25 04:15:55 -04:00
Lioncash
d0292fdc5d
CPathFindArea: Make use of std::bitmap with CPFBitSet
...
Same behavior, but without the need to roll the operations ourselves.
2020-03-25 04:12:55 -04:00
Lioncash
81dcc0604b
CParticleElectric: Make use of std::array where applicable
...
Prevents array to pointer decay.
2020-03-25 03:58:37 -04:00
Lioncash
c61bee13db
CParticleElectric: Add parameters to function prototypes
...
Makes the interface more self-documenting.
2020-03-25 03:58:37 -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
Lioncash
90d61ae7ed
CAutoMapper: Add names to function prototypes
2020-03-25 03:03:24 -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
20548ddeaa
CCameraSpline: Make constructor explicit
...
Same behavior, but prevents error-prone implicit constructions from
occurring.
2020-03-25 02:41:07 -04:00
Lioncash
f1fce0f631
CCameraSpline: Add names to prototypes
...
More self-documenting from the interface alone.
2020-03-25 02:40:03 -04:00
Lioncash
7bced5308b
CCameraManager: Add names to parameters in prototypes
...
More self documenting and allows IDE inspections to be better.
2020-03-25 02:33:34 -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
Luke Street
556f870dc8
Merge branch 'pr-277'
2020-03-25 02:09:09 -04:00
Luke Street
f91536ebee
Merge branch 'pr-276'
2020-03-25 02:09:05 -04:00
Luke Street
8314d5b6ef
Merge branch 'pr-255'
2020-03-25 02:09:02 -04:00
Luke Street
3734a09ed3
CGuiWidget: Make GetIsFinishedLoading non-const
2020-03-25 02:01:47 -04:00
Lioncash
40fc3f9dd8
CModelBoo: Remove usages of const_cast
...
Many functions are modifying internals of CBooModel and const-casting
is performed in order to work around functions being const when they
really shouldn't be.
This amends the function signatures in order to allow these functions to
exist without const_cast, making code much nicer to read.
2020-03-25 02:01:46 -04:00
Lioncash
e38d86fe59
CPhysicsActor: Amend constructor names for CPhysicsState
...
These were previously undescriptive names despite the member variables
being fully named. We can amend the parameters here.
2020-03-25 01:56:58 -04:00
Lioncash
81ae6bdda2
CPhysicsActor: Add names to parameters in prototypes
...
Allows better introspection in IDEs and makes the interface itself more
self-documenting.
2020-03-25 01:54:17 -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
ab6c45c7a8
CWorld: Provide parameter names for prototypes
...
More self-documenting from the interface alone and allows IDE
inspections at callsites to be better.
2020-03-25 01:27:56 -04:00
Lioncash
985b85d9db
CAudioGroupSet: Eliminate undefined behavior within LoadData()
...
Eliminates aliasing violations.
2020-03-25 01:14:27 -04:00
Lioncash
855fc0ced9
CAreaOctTree: Add names to parameters in prototypes
...
Allows IDEs to perform better inspections at call sites.
2020-03-25 00:45:33 -04:00
Lioncash
f2b1e44ee1
CEntity: Rename ConnectionList() to GetConnectionList()
...
Allows const overloading to function, preventing compilation errors from
occuring across constness changes.
2020-03-24 21:29:44 -04:00
Lioncash
8644b8393b
CEntity: Add parameter names to interface
...
Allows IDEs to perform better parameter inspection.
2020-03-24 21:28:15 -04:00
Lioncash
f323638fb7
CCollisionActor: Provide parameter names in interface where applicable
...
Makes the interface more self-documenting at a glance and allows IDEs to
do better parameter inspection at call sites.
2020-03-24 21:16:30 -04:00
Phillip Stephens
e8f0d29a3b
Merge pull request #275 from lioncash/const-over
...
CPlayerState: Rename HealthInfo() to GetHealthInfo()
2020-03-24 17:45:59 -07:00
Phillip Stephens
01a0c68db9
Merge pull request #274 from lioncash/health
...
CGameState: Set HP value in LoadGameFileState()
2020-03-24 17:45:43 -07:00
Phillip Stephens
c72f388929
Merge pull request #273 from lioncash/team-uninit
...
CTeamAiMgr: Initialize x90_timeSinceMelee and x90_timeSinceRanged to 0.0f in constructor
2020-03-24 17:45:29 -07:00
Phillip Stephens
9aece39445
Merge pull request #272 from lioncash/uninit
...
CFluidPlane: Always initialize mul to 0.0f in CalculateRippleIntensity()
2020-03-24 17:45:15 -07:00
Lioncash
ef93a601eb
CPlayerState: Rename HealthInfo() to GetHealthInfo()
...
Allows const overloading to function and prevents compilation errors
from occurring if constness changes through future changes of any sort.
2020-03-24 06:20:37 -04:00
Lioncash
9fba0bf50b
CGameState: Set HP value in LoadGameFileState()
...
GM8E v0 stores the HP value of the loaded player state into the returned
GameFileStateInfo instance.
This prevents the health member from being returned uninitialized.
2020-03-24 06:14:26 -04:00
Lioncash
64d0563872
CTeamAiMgr: Initialize x90_timeSinceMelee and x90_timeSinceRanged to 0.0f in constructor
...
Makes all class members have a deterministic initial state.
2020-03-24 05:19:05 -04:00
Lioncash
f416a814a1
CFluidPlane: Always initialize mul to 0.0f in CalculateRippleIntensity()
...
Avoids a -Wmaybe-uninitialized warning.
2020-03-24 05:14:01 -04:00
Lioncash
35ea097028
CPlayer: Add parameter names to prototypes
...
Makes them more self-documenting from the interface alone and also
allows IDEs to perform better parameter and argument inspection.
2020-03-24 04:33:54 -04:00
Phillip Stephens
fc87bd8022
Merge pull request #270 from lioncash/brace
...
CPlayer: Un-nest code within FinishNewScan()
2020-03-23 23:29:59 -07:00
Phillip Stephens
af2738c7b1
Merge pull request #269 from lioncash/sconv
...
CParticleSwoosh: Resolve sign-conversion warnings
2020-03-23 23:29:44 -07:00
Phillip Stephens
00691c1175
Merge pull request #268 from lioncash/intconst
...
CIntElement: Remove const_cast
2020-03-23 23:29:26 -07:00
Phillip Stephens
d62c163086
Merge pull request #267 from lioncash/iface
...
CAnimData: Give names to function prototype parameters
2020-03-23 23:29:12 -07:00
Phillip Stephens
bb9359c579
Merge pull request #266 from lioncash/make
...
CParticleElectric: Use std::make_unique where applicable
2020-03-23 23:28:59 -07:00
Phillip Stephens
498df6588b
Merge pull request #265 from lioncash/type
...
RetroTypes: Minor adjustments
2020-03-23 23:28:38 -07:00
Phillip Stephens
734f1d2db5
Merge pull request #264 from lioncash/move
...
General: Remove unnecessary std::move calls
2020-03-23 23:28:24 -07:00
Phillip Stephens
425f8d4cc8
Merge pull request #263 from lioncash/array3
...
CDecal: Make use of std::array where applicable
2020-03-23 23:28:08 -07: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
Phillip Stephens
1c841d10f8
Merge pull request #261 from lioncash/const7
...
CBomb: Make file-scope material filter constexpr
2020-03-23 23:27:39 -07:00
Phillip Stephens
dc6954491b
Merge pull request #260 from lioncash/array2
...
CPlayerState: Make g_typeNameMap a compile-time array
2020-03-23 23:27:19 -07:00
Phillip Stephens
4dc73e56a0
Merge pull request #259 from lioncash/default
...
CPlayerState: Default CPowerUp constructor and also remove undefined behavior
2020-03-23 23:27:06 -07:00
Phillip Stephens
2e43266714
Merge pull request #258 from lioncash/emplaced
...
General: Make use of emplace_back where applicable
2020-03-23 23:26:51 -07:00
Phillip Stephens
6c7fdc11a0
Merge pull request #257 from lioncash/virt
...
CWorld: Rename IMapWorld to IGetMapWorld()
2020-03-23 23:26:35 -07:00
Phillip Stephens
6c9d6bc38b
Merge pull request #256 from lioncash/binding
...
CActorContraption: Make use of structured bindings where applicable
2020-03-23 23:26:19 -07:00
Lioncash
70c51c3a86
CPlayer: Un-nest code within FinishNewScan()
...
Makes this function much nicer to read.
2020-03-23 02:44:44 -04:00
Lioncash
7a29f4bf52
CParticleSwoosh: Resolve sign-conversion warnings
...
Resolves trivial warnings within loop condition checks.
2020-03-23 00:38:23 -04:00
Lioncash
a2517a504e
CIntElement: Remove const_cast
...
CIESampleAndHold caches values internally for use later in a non-visible
manner to the user of the class. This is a good place for mutable to be
used.
This improves the readability of the GetValue() implementation.
2020-03-22 06:05:59 -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
Lioncash
34a0e9f23d
CParticleElectric: Use std::make_unique where applicable
...
Makes it obvious that std::unique_ptr instances are being created within the
implementation code.
2020-03-22 05:27:49 -04:00
Lioncash
8cd27ac822
RetroTypes: Take types in comparisons by value where applicable
...
CAssetId, TEditorId, and TUniqueId are all small enough to fit within
registers as is, so we can take these types by value, which allows for
eliminating unnecessary memory referencing.
2020-03-22 04:44:45 -04:00
Lioncash
6ed2415f6f
RetroTypes: Mark return types as [[nodiscard]] where applicable
...
Given the types within this header are quite widely used within the
codebase, it's worth it in this scenario to annotate functions that
expect their return value to be used with the [[nodiscard]] attribute.
2020-03-22 04:43:26 -04:00
Lioncash
0e54861455
General: Remove unnecessary std::move calls
...
There's no real need to std::move a primitive type. A copy will be
performed either way. We can remove std::move in this case to improve
readability.
2020-03-22 00:56:04 -04:00
Lioncash
2b4b7c36a5
CDecal: Make use of std::array where applicable
...
Same behavior, but with stronger-typing and no implicit array to pointer
decay.
2020-03-21 01:53:41 -04: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
Lioncash
83c9af9153
CPlayerState: Make g_typeNameMap a compile-time array
...
While useful as a map, this causes an allocation that occurs during
program start and lasts until the program terminates, even if the
relevant code is never executed.
Given the total number of elements is quite small, we can convert this
into a compile-time array and perform the lookup with that instead.
While we're at it, we can eliminate an unnecessary second lookup into
said array by reusing the iterator from the first find.
2020-03-21 00:57:05 -04:00
Lioncash
ff703b1189
CPlayerState: Remove undefined behavior within CPlayerState constructor
...
Type-punning via a union is currently undefined behavior according to
the C++ standard, so we can use std::memcpy instead to accomplish the
same thing.
2020-03-21 00:39:40 -04:00
Lioncash
ba6f55a928
CPlayerState: Default CPowerUp constructor
...
Same behavior but allows the constructor to be considered trivial.
While we're at it, we can make the constructors constexpr, considering
the data structure only holds two primitives.
2020-03-21 00:34:16 -04:00
Lioncash
fc4df76afc
General: Make use of emplace_back where applicable
...
Allows for in-place construction. Also results in less code to read in
certain usages.
2020-03-21 00:30:12 -04:00
Lioncash
8a9e76a345
CWorld: Rename IMapWorld to IGetMapWorld()
...
Allows const overloading to function properly and prevents potential
compilation errors from occurring if constness on functions is ever
changed.
2020-03-20 23:27:07 -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