Luke Street
1f55b5f92e
CGrenadeLauncher: Fix UpdateFollowPlayer
2020-04-07 19:26:22 -04:00
Phillip Stephens
784e956819
Drone: Remove redundant include
2020-04-07 16:13:11 -07:00
Phillip Stephens
37c8b9d33c
Drone: Implement Think
2020-04-07 16:11:50 -07:00
Luke Street
1dc90f78d3
CScriptPlatform: Fix AddRider assign to copy
2020-04-07 15:41:26 -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
db0091e9cd
CWordBreakTables: Make use of std::array where applicable
...
Same behavior, but allows directly querying iterators. We can also make
these arrays constexpr.
2020-04-07 13:24:23 -04:00
Lioncash
fe32cea8fc
CRainSplashGenerator: Always initialize x24_generateInterval
...
Provides a deterministic consistent initial state.
2020-04-07 13:02:02 -04:00
Lioncash
3ea8eb21cf
CInterpolationCamera: Always initialize x1d8_24_sinusoidal
...
Provides a deterministic consistent initial state.
2020-04-07 12:58:47 -04:00
Lioncash
db9a52fae3
CBodyState: Resolve sign conversion warnings in GetLocoAnimation()
2020-04-07 12:56:29 -04:00
Lioncash
ce710a94f6
CBodyState: Always initialize x3c8_primeTime
...
Provides a deterministic consistent state upon construction
2020-04-07 12:55:41 -04:00
Lioncash
45dca4a25b
CStreamAudioManager: Always initialize x74_oneshot
...
Provides deterministic consistent state when constructing the class.
2020-04-07 12:53:05 -04:00
Lioncash
3865dfbfe5
CSfxManager: Always initialize x1a_reverb and x55_cachedMaxVol
...
Provides a deterministic initial state.
2020-04-07 12:49:43 -04:00
Lioncash
2ab59eec52
CSfxManager: Make use of std::array where applicable
...
Same behavior, but with stronger typing.
2020-04-07 12:47:57 -04:00
Lioncash
d677d2ac1d
CSfxManager: Always initialize m_isEmitter
...
Provides a deterministic initial state.
While we're at it, we can remove an unnecessary initializer.
2020-04-07 12:42:03 -04:00
Lioncash
18ad2595cf
CCameraFilter: Always initialize m_shape
...
Provides a deterministic initial state and prevents any potential
uninitialized reads.
2020-04-07 12:36:45 -04:00
Lioncash
5fe494f683
CLayoutDescription: Always initialize xc_scale
...
Provides a total deterministic initial state for the data member.
2020-04-07 12:34:15 -04:00
Lioncash
c3ddbfae89
CBodyState: Always initialize x8_jumpType
...
Provides a deterministic initial state for the member.
2020-04-07 12:32:06 -04:00
Lioncash
56f48e8745
CAdditiveBodyState: Dehardcode array size
2020-04-07 12:31:33 -04:00
Lioncash
2b1a86794b
CAdditiveBodyState: Make use of std::array where applicable
...
Same behavior, stronger typing.
2020-04-07 12:27:47 -04:00
Lioncash
139d290d7d
CWorldTransManager: Mark lightPos as constexpr in UpdateLights()
...
Allows the compiler to optimize the initialization away if it chooses to
do so.
2020-04-07 07:23:14 -04:00
Lioncash
7ba5a5b183
CWorldLight: Explicitly default copy assignment, move assignment and move constructor
...
Makes the interface consistent with how the constructor is specified.
2020-04-07 07:19:50 -04:00
Lioncash
18c0111edb
CModelData: Give all function prototype parameters names
...
Makes the interface more self-documenting and allows IDE introspection
to function better.
2020-04-07 07:13:18 -04:00
Lioncash
cf7d5be6c1
CTryclops: Fix incorrect transform being passed to Teleport() in LaunchPlayer()
...
GM8E v0 makes use of tmpXf here with Teleport(), not the passed in
transform.
2020-04-07 06:58:41 -04:00
Lioncash
40f184bfac
ICollisionFilter: Add virtual destructor
...
Prevents any potential undefined behavior from occurring through
polymorphic use.
2020-04-07 06:06:56 -04:00
Lioncash
f0ff83e39a
CTransitionDatabase: Add virtual destructor
...
Prevents any undefined behavior from occurring through polymorphic
usage.
2020-04-07 06:04:58 -04:00
Lioncash
8182688b34
CAnimationDatabase: Add virtual destructor
...
Given this class is used polymorphically, this is cautionary to prevent
any potential undefined behavior from occurring through refactors over
time.
2020-04-07 06:03:14 -04:00
Lioncash
f17042ab77
CStreamAudioManager: Make use of std::array where applicable
...
Dehardcodes a lot of repeated array sizes.
2020-04-07 06:01:14 -04:00
Phillip Stephens
4c3caa2a7f
Drone: Initial Think imp
2020-04-06 13:58:39 -07:00
Phillip Stephens
e4c3248ad8
Drone: Start implementing state functions
2020-04-06 13:58:39 -07:00
Phillip Stephens
08b1dbcf4f
Drone: Implement AcceptScriptMsg
2020-04-06 13:58:39 -07:00
Phillip Stephens
ff0cf969c2
Initial CDrone imps
2020-04-06 13:58:36 -07:00
Luke Street
4d3050cac4
COmegaPirate: Add call to AvoidStaticCollisionWithinRadius
2020-04-06 16:57:48 -04:00
Phillip Stephens
d033ddeb1d
Initial CDrone imp
2020-04-06 13:57:36 -07:00
Luke Street
ab8e00880e
CPhazonHealingNodule: Add missing functions
2020-04-06 16:56:10 -04:00
Luke Street
61444da8ff
COmegaPirate: Implement all functions
2020-04-06 16:56:10 -04:00
Luke Street
a4b1e7f85f
COmegaPirate: Implement Faint, Growth, JumpBack, Suck; continue Think implementation
2020-04-06 16:56:10 -04:00
Luke Street
46afe6eae8
COmegaPirate: Implement DoubleSnap & finish DoUserAnimEvent
2020-04-06 16:56:10 -04:00
Luke Street
802849c711
CPhazonPool: Implementation
2020-04-06 16:56:10 -04:00
Luke Street
c9f96d47d2
CPhazonPool: Initial structure
2020-04-06 16:56:10 -04:00
Luke Street
80b383b68f
CPhazonHealingNodule: Add DEFINE_PATTERNED
2020-04-06 16:56:10 -04:00
Luke Street
4d48febca2
CPhazonHealingNodule: Implementation
2020-04-06 16:56:10 -04:00
Luke Street
0bef9104b5
CPhazonHealingNodule: Create class
2020-04-06 16:56:10 -04:00
Luke Street
93751972ac
COmegaPirate: Implement AcceptScriptMsg & collision setup
2020-04-06 16:56:10 -04:00
Luke Street
fb9765656c
COmegaPirate: Start implementation
2020-04-06 16:56:10 -04:00
Luke Street
9dd77d6a10
CGameCollision: Add AvoidStaticCollisionWithinRadius
2020-04-06 16:53:54 -04:00
Lioncash
cfa6299704
CShockWave: Resolve sign conversion warning
...
int was being used when size_t should have been.
2020-04-06 13:25:30 -04:00
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
92d65462b9
CCameraSpline: Resolve sign-conversion warnings
...
All call sites are already compatible with these changes, so they can
safely be made.
2020-04-06 12:50:28 -04:00
Lioncash
dd7d9c024f
CGameLight: Add parameter names to function prototypes
...
Same behavior, but more self-documenting from interface alone. Also
allows better parameter introspection.
2020-04-06 08:46:38 -04:00
Lioncash
5f7a33e2ec
CThardus: convert 0 literal to false
...
Same behavior, but matches the type of the parameter.
2020-04-06 08:43:41 -04:00
Lioncash
0a0ac955b5
CThardus: std::move std::vector instance in constructor
...
Same behavior, no reallocations.
2020-04-06 08:41:18 -04:00
Lioncash
6e7e761126
CCollidableOBBTree: Don't cast away const in constructor
...
Same behavior, minus a cast.
2020-04-06 07:11:34 -04:00
Lioncash
0e0ca4caa9
CAnimSource: Eliminate variable shadowing
...
Gets rid of two -Wshadow warnings.
2020-04-06 07:04:49 -04:00
Lioncash
f7962cb3f7
CRasterFont: Extend CFontInfo buffer to 64 characters
...
GM8E v0 seems to be using at least a buffer 64 characters in size, not
40.
2020-04-06 06:59:22 -04:00
Lioncash
296cb3df2b
CMemoryCardDriver: Make use of std::array where applicable
...
Stronger typing and also allows eliminating several hardcoded data
sizes.
2020-04-06 06:23:48 -04:00
Lioncash
c97fedd989
CCollisionSurface: Return std::array by reference from GetVerts()
...
Same behavior, facilitates better static analysis for out-of-bounds
accesses, and also even allows size querying if necessary.
2020-04-06 06:02:52 -04:00
Lioncash
ecf3cfdb49
CCollisionSurface: Collapse separate CVector3f instances into std::array
...
Will allow converting GetVertices() over to returning a reference to
std::array, rather than simply a pointer.
2020-04-06 05:54:24 -04:00
Lioncash
41c2ede092
CScriptWater: Make private const data internally linked
...
Same behavior, but allows completely hiding it from external view and
also allows making the data constexpr.
2020-04-06 05:42:15 -04:00
Lioncash
c9e8b3366d
CFluidPlane: Resolve constness related compile errors that slipped through
...
Gotta love Find References not, in fact, finding all the references.
2020-04-06 05:31:09 -04:00
Lioncash
f0eadfe56c
CMetroidAreaCollider: Make use of std::array where applicable
...
Makes arrays strongly typed and allows eliminating some hardcoded array
sizes. We can also use it to make input data to some data types and
functions significantly more informative.
This also makes it easier for static analysis tools to track out of
bounds accesses if they ever occur.
2020-04-06 05:19:13 -04:00
Lioncash
d708337e90
CScriptDamageableTrigger: Make member variables private
...
Previously, everything about the class was made public.
2020-04-06 04:48:10 -04:00
Lioncash
27f3078c8a
CScriptDamageableTrigger: Mark x254_fluidPlane as mutable
...
A temporary stop-gap to hold over until Render is made non-const.
2020-04-06 04:45:33 -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
402216447a
CFluidPlane: Make Render() non-const
...
Allows making the shader instances non-mutable.
2020-04-06 02:18:14 -04:00
Lioncash
22eb5c837e
CollisionUtil: Make use of const where applicable
...
Makes it explicit which variables are mutating within algorithms, making
them nicer to follow.
2020-04-06 02:02:52 -04:00
Lioncash
39f5fddd63
CollisionUtil: Make use of std::array where applicable
...
Same behavior, stronger typing. Also allows dehardcoding some array
sizes.
2020-04-06 01:41:16 -04:00
Lioncash
80c6424fd0
CCollidableOBBTree: Eliminate variable shadowing
...
Resolves a -Wshadow warning.
2020-04-06 01:23:08 -04:00
Lioncash
c3ba3927db
CCollidableOBBTree: Make use of std::array where applicable
...
Same behavior, stronger typing.
2020-04-06 01:21:20 -04:00
Lioncash
e76804079d
COBBTree: Return std::array from GetTriangleVertexIndices() directly
...
While the game binary uses an out pointer here, we can slightly modify
it in this case in order to make it more difficult to misuse the
call-sites by returning the data directly as a std::array.
2020-04-06 01:17:24 -04:00
Lioncash
248a4e57c9
COBBTree: Always initialize x4c_hit
...
Same behavior, but provides deterministic state on construction, which
can make debugging much nicer.
2020-04-06 01:05:29 -04:00
Lioncash
c6952442c7
COBBTree: Remove use of operator bool directly
...
Same behavior, but more idiomatic.
2020-04-06 01:01:44 -04:00
Lioncash
e34db8c0e6
COBBTree: Eliminate sign conversion warnings
...
Multiplying a u16 results in an int.
2020-04-06 01:00:58 -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
19cfb92d5d
COBBTree: Simplify make_unique call
...
We can use nullptr here instead of typing out the name of the type.
2020-04-06 00:51:04 -04:00
Luke Street
58adce472a
CMappableObject: Fix call to data()
2020-04-06 00:03:34 -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
786634e181
Merge branch 'master' of ssh+git://git.axiodl.com:6431/AxioDL/urde
2020-04-05 05:13:14 -07:00
Phillip Stephens
eab08cbe2d
Merge branch 'lioncash-find'
2020-04-05 05:12:25 -07: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
Phillip Stephens
5fc8f2ccd2
Merge branch 'find' of https://github.com/lioncash/urde into lioncash-find
2020-04-05 05:11:20 -07: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
6ba0641b79
CCameraFilter: Make Draw() non-const
...
Eliminates another usage of const_cast.
2020-04-05 08:05:04 -04:00
Lioncash
b99122dae8
CFrontEndUI: Remove use of const_cast in Draw()
...
These casts are no longer necessary.
2020-04-05 07:12:07 -04:00
Lioncash
4d2e51c0b9
CSamusHud: Make Draw() non-const
...
Allows eliminating usages of const_cast.
2020-04-05 07:09:13 -04:00
Lioncash
3e9e434d96
CPlayerVisor: Make Draw() non-const
...
Allows eliminating const_cast usages.
2020-04-05 07:00:40 -04:00
Lioncash
be4e7f8ff7
CMFGame: Remove unnecessary const_cast
...
This is no longer necessary, considering that Draw() isn't const
qualified anymore.
2020-04-05 06:52:19 -04:00
Lioncash
a952ff1110
CCollisionEdge: Make constructors constexpr
...
Makes the default and non-stream iterator constexpr, which allows for
elimination of a runtime initializer.
2020-04-05 06:46:03 -04:00
Lioncash
af6e3b21f8
COBBTree: Make use of std::array where applicable
2020-04-05 06:41:22 -04:00
Lioncash
039e43c511
CMapWorldInfo: Actually add the mutable specifiers
...
Note to self, actually stage changes before pushing.
2020-04-05 06:36:17 -04:00
Lioncash
42c560b9df
CMapWorldInfo: Remove use of const_cast
...
Same behavior, but explicitly marks the member variables as mutable.
This is fine given they act as an underlying cache and don't directly
alter the behavior of the interface.
2020-04-05 06:30:25 -04:00
Lioncash
2755f3f4f8
CMapWorldInfo: Eliminate truncation and sign conversion warnings
2020-04-05 06:29:27 -04:00
Lioncash
755529b67a
CMappableObject: Make use of std::array where applicable
...
Same behavior, but also allows eliminating hardcoded array sizes.
2020-04-05 06:15:18 -04:00
Lioncash
94264f6fe6
CRasterFont: Collapse loop into a std::find_if in InternalGetGlyph()
...
Same behavior, less code.
2020-04-05 06:01:29 -04:00
Lioncash
1279be5e56
CGraphics: Mark internal file-scope matrices as constexpr
...
Same behavior, but allows omission of runtime initializers.
2020-04-05 05:48:54 -04:00
Lioncash
95199848d3
CGraphics: Make use of std::array where applicable
2020-04-05 05:46:07 -04:00
Lioncash
8808a3a324
CFireFlea: Unindent FindSafeRoute()
...
Makes the function much nicer to follow by using guard clauses to
unindent the code.
2020-04-05 05:36:28 -04:00
Lioncash
99c564cfe4
CFireFlea: Make colors constexpr internal details
...
Same behavior, but makes the color constants fully internal details.
2020-04-05 05:25:47 -04:00
Lioncash
a49d26f800
CParticleElectric: Return std::nullopt in GetBounds()
...
Same behavior, but avoids zeroing out the internal buffer in some
implementations of std::optional.
2020-04-05 05:12:25 -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
Lioncash
1b01b232e6
CCinematicCamera: Make use of const where applicable
...
Makes read-only intent explicit.
2020-04-05 01:45:08 -04:00
Lioncash
4e55edf0fe
CCameraSpline: Make use of TCastToConstPtr where applicable
...
Makes the read-only intent explicit.
2020-04-05 01:25:55 -04:00
Lioncash
7d8bcfbd5e
CCameraManager: Make use of TCastToConstPtr where applicable
...
Makes the read-only behavior explicit.
2020-04-05 01:19:51 -04:00
Lioncash
75cd9b6cf3
CBallCamera: Make use of TCastToConstPtr where applicable
...
Same behavior, but makes the read-only nature explicit.
2020-04-05 00:54:40 -04:00
Lioncash
8a732194a6
CGameCollision: Eliminate the use of const_cast
2020-04-05 00:30:58 -04:00
Lioncash
4c6ab60110
CGameOptions: Eliminate type punning in CHintOptions constructor and PutTo()
...
Type punning with unions is undefined behavior.
2020-04-03 02:19:28 -04: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
eb1209b492
CFlameWarp: Dehardcode container sizes
...
Same behavior, less magic numbers.
2020-04-03 01:10:22 -04:00
Lioncash
ad30f0c61c
CActorModelParticles: Make GetParticleDGRPTokens take a std::string_view
...
Same behavior, but provides a more type-safe interface. All internal
functions called within the function operate on std::string_view
anyways.
2020-04-03 00:36:53 -04:00
Lioncash
75aa359855
CActorModelParticles: Use static_cast instead of reinterpret_cast in PointGenerator()
...
Casting from void* to a concrete type is permitted with static_cast.
2020-04-03 00:28:14 -04:00
Lioncash
a80838b2df
CActorModelParticles: Don't cast away const in SetupHook()
...
Now that we have a non-const overload, we don't need to cast away const
any longer, removing a cast-qual warning.
2020-04-03 00:26:35 -04:00
Lioncash
9ac1a94a5f
CActorModelParticles: Add non-const overload of FindSystem()
...
Same behavior but returns a non-const iterator, which will be used in a
following change.
2020-04-03 00:24:52 -04:00
Lioncash
b33fcf9e02
CActorModelParticles: Collapse FindSystem() into a find_if call
...
Same behavior, less code.
2020-04-03 00:22:37 -04:00
Lioncash
c913502d90
CActorModelParticles: Dehardcode container sizes where applicable
2020-04-03 00:08:09 -04:00
Lioncash
93dd28988d
CGameArea: Make use of std::make_unique where applicable
2020-04-02 22:02:57 -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
Lioncash
66711ce023
CSamusHud: Dehardcode sizes where applicable
2020-04-02 08:34:38 -04:00
Lioncash
013b715c63
CSamusHud: Make use of std::array where applicable
...
Same behavior without any array->pointer decay.
2020-04-02 08:25:52 -04:00
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
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
Luke Street
ffd94d1106
COmegaPirate: Stub
2020-03-31 14:17:47 -04:00
Lioncash
47555c725b
CAutoMapper: Eliminate usages of const_cast
...
Same behavior, but makes it explicit from the interface that
modifications are clearly going on from within the class.
2020-03-31 06:57:07 -04:00
Lioncash
12e42ba58a
CMapWorld: Make use of std::array where applicable
...
Same behavior, stronger typing.
2020-03-31 06:18:58 -04:00
Lioncash
92833b185a
CMapWorld: Move internally linked entities into an anonymous namespace
...
Same behavior, but prevents any potential ODR violations from occurring.
2020-03-31 06:16:07 -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
Luke Street
b43d4eaddc
CElitePirate: Implement SpecialAttack, CShockWave
2020-03-31 03:29:00 -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
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
Phillip Stephens
eb9efbf8c3
Initial PATH support for MP2
2020-03-17 23:12:43 -07:00
Luke Street
642bf379ce
CFlyingPirate: Add CPathFindSearch flags
2020-03-18 01:39:32 -04:00
Luke Street
6f89dbb240
CFlyingPirate: More small fixes
2020-03-18 01:20:24 -04:00
Luke Street
932615593e
CFlyingPirateRagDoll: Implement PreRender, Prime
2020-03-18 01:20:24 -04:00
Luke Street
57386e6269
CFlyingPirate: Small fixes
2020-03-18 01:19:23 -04:00
Luke Street
8897d38c6a
CFlyingPirate: Fix Lurk state delay
2020-03-18 01:19:23 -04:00
Luke Street
651e28e921
CFlyingPirate: Fix TargetPatrol
2020-03-18 01:19:23 -04:00
Luke Street
26ae8beb74
CFlyingPirate: Small fixes
2020-03-18 01:19:23 -04:00
Luke Street
1bcd0916ca
CFlyingPirate: Fixes; implement all functions
2020-03-18 01:18:48 -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
Luke Street
d4982270e8
CFlyingPirate: Start implementing methods
2020-03-18 01:18:48 -04:00
Luke Street
5765fd8951
CFlyingPirate: Method definitions & CFlyingPirateRagDoll constructor
2020-03-18 01:18:48 -04:00
Luke Street
e925dc2628
CFlyingPirate: Start implementation
2020-03-18 01:18:48 -04:00
Luke Street
36ac0a8d78
CStateManager: Fix CMapWorld const reference
2020-03-18 01:18:00 -04:00
Luke Street
9e05819f05
Merge pull request #253 from lioncash/const4
...
CRelayTracker: Make HasRelay() a const member function
2020-03-18 01:09:31 -04:00
Luke Street
f6e2f196ce
Merge pull request #252 from lioncash/resize2
...
CRumbleVoice: Resize vectors within constructor initializer list
2020-03-18 01:09:09 -04:00
Luke Street
92c9ec02e5
Merge pull request #251 from lioncash/rumble
...
CInputGenerator: Make use of std::array where applicable
2020-03-18 01:08:12 -04:00
Luke Street
dcf96e9826
Merge pull request #250 from lioncash/statemgr
...
CStateManager: Make use of std::array where applicable
2020-03-18 01:07:21 -04:00
Luke Street
93be0fbc72
Merge pull request #249 from lioncash/list
...
CObjectList: Make use of std::array where applicable
2020-03-18 01:05:42 -04:00
Luke Street
44325a5ad4
Merge pull request #248 from lioncash/slider
...
CGuiSliderGroup: Make use of std::array where applicable
2020-03-18 01:05:30 -04:00
Luke Street
a7b2ad15dc
Merge pull request #247 from lioncash/sign-mismatch
...
CFlameThrower: Resolve sign-conversion warnings in DoCollisionCheck()
2020-03-18 01:05:16 -04:00
Luke Street
66c321d4a8
Merge pull request #246 from lioncash/def
...
CCollisionInfoList: Simplify definition of begin() and end()
2020-03-18 01:04:19 -04:00
Luke Street
b13a6b491b
Merge pull request #245 from lioncash/drawstring
...
CDrawStringOptions: Resize vector within constructor
2020-03-18 01:04:08 -04:00
Luke Street
7c8de88fd7
Merge pull request #244 from lioncash/pane
...
CAui*: Make use of std::array where applicable
2020-03-18 01:03:50 -04:00
Lioncash
cb4884fcef
CRelayTracker: Make HasRelay() a const member function
...
While we're at it, we can make use of HasRelay() internally where
applicable to simplify code a little bit.
2020-03-18 01:03:35 -04:00
Luke Street
dcc7affb8f
Merge pull request #243 from lioncash/light
...
CLight: Minor cleanup
2020-03-18 01:03:04 -04:00
Luke Street
b3b8c33006
Merge pull request #242 from lioncash/const2
...
CMapWorld: Minor changes
2020-03-18 01:01:45 -04:00
Luke Street
cecac3472a
Merge pull request #241 from lioncash/float
...
CMapArea: Minor changes
2020-03-18 01:00:20 -04:00
Luke Street
a1c8867e83
Merge pull request #240 from lioncash/move
...
CMainFlow: std::move shared_ptr in SetGameState
2020-03-18 00:59:24 -04:00
Luke Street
18ef68df2a
Merge pull request #239 from lioncash/line
...
CLineRenderer: Minor changes
2020-03-18 00:58:46 -04:00
Luke Street
dc0c721af7
Merge pull request #238 from lioncash/array2
...
CFogVolumeFilter: Make use of std::array where applicable
2020-03-18 00:58:28 -04:00
Luke Street
fcf7044bf2
Merge remote-tracking branch 'github/recovery'
2020-03-18 00:45:49 -04:00
Lioncash
488e377374
CRumbleVoice: Collapse repeated std::max calls in GetIntensity()
...
We can make use of the std::max overload that takes an initializer list.
2020-03-18 00:34:29 -04:00
Lioncash
71399d0944
CRumbleVoice: Correct bool->s16 conversion
...
Given the return type of the function is an s16, we can just use 0
directly here.
2020-03-18 00:32:51 -04:00
Lioncash
2701f060ee
CRumbleVoice: Resize vectors within constructor initializer list
...
Same behavior, but constructs in place with the size, rather than
constructing and then resizing.
x20_handleIds cannot be done the same way unfortunately, as
reserved_vector doesn't have a constructor accepting a size argument
like std::vector does.
2020-03-18 00:28:44 -04:00
Lioncash
e83d5caea6
CInputGenerator: Make use of std::array where applicable
...
Allows removing hardcoded array sizes.
2020-03-17 23:29:11 -04:00
Lioncash
bf11be46ad
CStateManager: Make use of std::array where applicable
...
Same behavior, but allows dehardcoding array sizes and makes the array
types more strongly typed.
2020-03-17 23:10:41 -04:00
Lioncash
9e6f86cb16
CObjectList: Make use of std::array where applicable
...
Same behavior, but with stronger typing.
2020-03-17 22:38:21 -04:00
Lioncash
9d5857e139
CGuiSliderGroup: Make use of std::array where applicable
...
Same behavior, stronger typing.
2020-03-17 22:22:06 -04:00
Lioncash
fc466ff062
CFlameThrower: Resolve sign-conversion warnings in DoCollisionCheck()
...
Resolves trivial sign conversion warnings and also makes some variables
const where applicable.
2020-03-17 21:55:24 -04:00
Lioncash
457c116275
CCollisionInfoList: Simplify definition of begin() and end()
...
Same behavior, but without a verbose return type.
2020-03-17 21:41:54 -04:00
Lioncash
1d6354ba26
CDrawStringOptions: Resize vector within constructor
...
Same behavior, but constructs the vector with the necessary size, rather
than constructing and resizing after the fact.
2020-03-17 21:35:08 -04:00
Lioncash
fa6006003d
CAuiEnergyBarT01: Make use of std::array where applicable
...
Same behavior, but allows dehardcoding array sizes.
2020-03-17 21:26:57 -04:00
Lioncash
e534f00706
CAuiEnergyBarT01: Convert typedef into using alias
...
Same behavior, but nicer to read.
2020-03-17 21:24:01 -04:00
Lioncash
15e4d4aa01
CAuiImagePane: Make use of std::array where applicable
...
Same behavior, stronger typing.
2020-03-17 21:22:17 -04:00
Lioncash
ec7bca8c20
CLight: Collapse std::max calls into one
...
We can use the overload that takes an initializer list to make it easier
to read.
2020-03-17 20:54:56 -04:00
Lioncash
e821f736de
CLight: Mark caching member variables as mutable
...
Member variables acting as caches is one of the areas where marking
variables as mutable makes sense.
We can do this to allow for the elimination of const_cast in some member
functions.
2020-03-17 20:47:12 -04:00
Lioncash
9483b64c91
CLight: Mark kDefaultPosition and kDefaultDirection as constexpr
...
Same behavior, but allows runtime constructors to be elided.
2020-03-17 20:44:22 -04:00
Lioncash
17a1f90a89
CLight: Prevent implicit double->float truncations
...
We can just mark these literals as floats to keep the arithmetic
operating on floats instead of doubles.
2020-03-17 20:42:39 -04:00
Lioncash
1dd1542106
CLight: Remove unnecessary initializer list initializers
...
These are already initialized within the class definition, so they don't
need to be respecified here.
2020-03-17 20:39:29 -04:00
Lioncash
6077814a0e
CMapWorld: Provide parameter names in header for functions
...
Makes it more self-documenting from the interface alone and also allows
IDE inspections to be more convenient.
2020-03-17 20:12:32 -04:00
Lioncash
1fa74087fc
CMapWorld: Remove usages of const_cast
...
Internals of this class are definitely being modified through some of
these calls, so they should be made non-const. This allows the
modifications to have their const_cast calls removed, making the code a
little nicer to read.
2020-03-17 20:00:14 -04:00
Lioncash
03f7047549
CMapArea: Make use of std::array where applicable
2020-03-17 19:36:19 -04:00
Lioncash
62682fe19f
CMapArea: Resolve variable name shadowing
2020-03-17 19:22:13 -04:00
Lioncash
b570168359
CMapArea: Remove type-punning undefined behavior within PostConstruct()
...
Casting up from unsigned char or char to an unrelated type isn't
permitted by the C++ standard in the manner it's currently being done.
We can utilize std::memcpy to mitigate this.
2020-03-17 19:20:37 -04:00
Lioncash
b52e8dc6aa
CMainFlow: std::move shared_ptr in SetGameState
...
Same behavior, but without a redundant atomic reference count
increment/decrement.
2020-03-17 19:15:09 -04:00
Lioncash
e5e4a6482c
CLineRenderer: Make use of std::array where applicable
...
Same behavior, but without the potential for unintentional array to
pointer decay.
2020-03-17 19:07:27 -04:00
Lioncash
858162e0c1
CLineRenderer: Remove unnecessary casts to bool
...
These constructs function identically without the need for casting.
2020-03-17 19:04:01 -04:00
Lioncash
b1e5bf72b6
CFogVolumeFilter: Make use of std::array where applicable
...
Makes data strongly typed and also allows for the removal of some
hardcoded array sizes.
2020-03-17 18:52:47 -04:00
Luke Street
6ddbd15cfc
Merge pull request #237 from lioncash/state
...
CStateManager: Casting-related cleanups
2020-03-16 20:19:31 -04:00
Luke Street
488614563e
Merge pull request #236 from lioncash/sign
...
CGrappleArm: Minor changes
2020-03-16 20:18:31 -04:00
Lioncash
179f0b5f08
CStateManager: Remove instances of const_cast where applicable
...
Eliminates trivial casts that don't require much modifications to other
existing interfaces.
2020-03-16 20:16:15 -04:00
Luke Street
87eeafe0b0
CSnakeWeedSwarm: Renaming & cleanup
2020-03-16 20:15:22 -04:00
Lioncash
58b112dbe6
CStateManager: Convert reinterpret_cast instances over to static_cast
...
Conversions from void* can be done with static_cast.
2020-03-16 20:05:41 -04:00
Lioncash
0ae2364b24
CStateManager: Remove unnecessary casts
2020-03-16 20:01:57 -04:00
Lioncash
258409bc7d
CGrappleArm: Remove const_cast within RenderXRayModel()
...
Same behavior, but without a cast.
2020-03-16 19:53:04 -04:00
Lioncash
9063b16d36
CGrappleArm: Convert reinterpret_cast to static_cast in PointGenerator()
...
It's permissible to use static_cast when converting from void* to
another type.
2020-03-16 19:16:46 -04:00
Lioncash
0cbfc6d169
CGrappleArm: Move skDependencyNames into BuildSuitDependencyList()
...
Same behavior, but narrows the visible scope of the array.
2020-03-16 19:12:55 -04:00
Lioncash
d0d6210ccd
CGrappleArm: Resolve sign mismatch warnings in loops
2020-03-16 19:11:16 -04:00
Luke Street
dc77fb0c41
Merge pull request #234 from lioncash/puddle
...
CPuddleSpore: Make static const class data internally linked
2020-03-16 19:11:04 -04:00
Lioncash
ff8e4c18a1
CPuffer: Make use of std::array where applicable
...
Allows direct size querying, which allows removing the use of direct
hardcoded array sizes.
2020-03-16 16:37:40 -04:00
Lioncash
2ae02eefb0
CPuddleSpore: Make static const class data internally linked
...
Makes the data an implementation detail and also allows for the
string_view array to be declared constexpr.
2020-03-16 16:26:19 -04:00
Luke Street
7039232a95
Merge pull request #233 from lioncash/pos
...
CPoseAsTransforms: Make use of std::array where applicable
2020-03-16 16:14:40 -04:00
Luke Street
4a64d92433
Merge pull request #232 from lioncash/blur2
...
CPhazonSuitFilter: Convert define into local variable
2020-03-16 16:14:25 -04:00
Luke Street
2f7e2dd85e
Merge pull request #231 from lioncash/blur
...
CPauseScreenBlur: Remove const_cast in Draw()
2020-03-16 16:14:03 -04:00
Luke Street
6ea64becb4
Merge pull request #230 from lioncash/pause2
...
CPauseScreenBase: Minor cleanup
2020-03-16 16:13:42 -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
Lioncash
b9be092635
CPauseScreenBlur: Remove const_cast in Draw()
...
Draw() clearly modifies the internals of the class in a non-caching
manner, so this member function should really not have a const qualifier
on it.
2020-03-16 16:00:12 -04:00
Lioncash
bb075d51ed
CPhazonSuitFilter: Convert define into local variable
...
Same behavior, but with a more localized scope.
2020-03-16 15:57:21 -04:00
Phillip Stephens
574fc9b840
CJellyZap fixes
2020-03-15 19:00:52 -07:00
Lioncash
1a7ad1a7f6
CPauseScreenBase: Make use of std::array in GetImagePaneName()
...
We can make use of std::array here and also make the array constexpr.
This can also be moved into the function in order to hide its scope.
2020-03-15 21:26:59 -04:00
Lioncash
6e921e3258
CPauseScreenBase: Mark colors as constexpr within UpdateSideTable()
...
Same behavior, but allows eliding construction at runtime.
2020-03-15 21:26:47 -04:00
Lioncash
a9082bc445
CCollisionActor: Mark gkDefaultCollisionActorMaterials as constexpr
...
While we're at it, change the g to s, since it's internally linked.
2020-03-15 20:04:15 -04:00
Luke Street
eeb09f512d
Merge pull request #220 from lioncash/array
...
CHud*: Make use of std::array where applicable
2020-03-15 19:56:33 -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
Luke Street
797c583ed7
Merge pull request #226 from lioncash/clamp
...
CAnimSource: Simplify ClampZeroToOne()
2020-03-15 19:45:37 -04:00
Luke Street
70c60ecf2f
Merge pull request #225 from lioncash/bool
...
CArchitectureQueue: Make operator bool explicit
2020-03-15 19:45:22 -04:00
Luke Street
04c226e645
Merge pull request #224 from lioncash/explicit2
...
CMemoryCardSys: Make CardResult's conversion operator explicit
2020-03-15 19:45:13 -04:00
Luke Street
5804032fb4
Merge pull request #223 from lioncash/ref
...
CGameHintInfo: Take CVParamTransfer parameter by const reference
2020-03-15 19:45:02 -04:00
Luke Street
4eaed95c11
Merge pull request #222 from lioncash/view
...
CGameOptions: Make use of std::string_view where applicable
2020-03-15 19:44:47 -04:00
Luke Street
e1d622d47b
Merge pull request #221 from lioncash/emplace
...
CFontImageDef: Make use of emplace_back where applicable
2020-03-15 19:44:23 -04:00
Lioncash
1926966d21
CCharAnimTime: Make constructors constexpr where applicable
...
These can be made constexpr to allow use at compile-time, given these
only hold an enum and a floating point value.
2020-03-15 19:41:54 -04:00
Lioncash
15db1b2647
CAnimSourceReader: Make use of std::find_if where applicable
2020-03-15 18:55:30 -04:00
Lioncash
9541ed1919
CAnimSourceReader: Make use of emplace() where applicable
...
Same behavior, but with less code.
2020-03-15 18:42:19 -04:00
Lioncash
7c1528688b
CAnimSource: Simplify ClampZeroToOne()
...
We can make use of std::clamp instead of std::min and std::max
2020-03-15 18:30:58 -04:00
Lioncash
ff92b72f91
CMemoryCardSys: Make CardResult's conversion operator explicit
...
Prevents implicit error-prone conversions to bool
2020-03-14 22:18:42 -04:00
Lioncash
e6812a7cd9
CArchitectureQueue: Make operator bool explicit
...
Prevents potentially error-prone implicit conversion contexts.
2020-03-14 21:42:38 -04:00
Lioncash
f5cc056a9e
CGameHintInfo: Take CVParamTransfer parameter by const reference
...
Avoids trivial unnecessary copies.
2020-03-14 21:28:46 -04:00
Lioncash
659b8a43d3
CGameOptions: Make use of std::string_view where applicable
...
Enforces the use of valid strings in the interface. Also reduces c_str()
noise a little bit.
2020-03-14 20:09:23 -04:00
Lioncash
e64dfe76b2
CFontImageDef: Make use of emplace_back where applicable
...
Same behavior, but constructs the instances directly within the
container.
2020-03-14 18:45:37 -04:00
Lioncash
e0392d69c4
CHudEnergyInterface: Make use of std::array where applicable
2020-03-14 17:59:39 -04:00
Lioncash
c4796ed090
CHudMissileInterface: Make use of std::array where applicable
2020-03-14 17:57:05 -04:00
Lioncash
9fafb24fb9
CHudVisorBeamMenu: Make use of std::array where applicable
2020-03-14 17:52:30 -04:00
Lioncash
07542ff335
CHudThreatInterface: Make use of std::array where applicable
...
Same behavior, but with stronger typing.
2020-03-14 17:38:57 -04:00
Phillip Stephens
f7fdbc07ba
Merge pull request #219 from lioncash/false
...
CPathCamera: Change 0 to false in CPathCamera constructor
2020-03-13 15:30:59 -07:00
Phillip Stephens
6567ae8d42
Merge pull request #218 from lioncash/emplace
...
Runtime: Collapse emplace_back() calls where applicable
2020-03-13 15:30:43 -07:00
Phillip Stephens
55955973a1
Merge pull request #217 from lioncash/sign
...
AutoMapper/*: Resolve sign conversion warnings
2020-03-13 15:30:24 -07:00
Phillip Stephens
0c17e4fdd7
Merge pull request #216 from lioncash/line
...
CLineRenderer: Silence -Wmaybe-uninitialized warning
2020-03-13 15:30:14 -07:00
Phillip Stephens
75c184d710
CHierarchyPoseBuilder corrections
2020-03-13 15:29:20 -07:00
Lioncash
92fb31fd40
CPathCamera: Change 0 to false in CPathCamera constructor
...
Same thing, but without implicit conversion to bool
2020-03-13 17:38:14 -04:00
Lioncash
097d4a4422
Runtime: Collapse emplace_back() calls where applicable
...
Same behavior, but with less code.
2020-03-13 17:14:44 -04:00
Lioncash
7c1e468d31
CMapWorldInfo: Rename IsAreaVisted -> IsAreaVisted
...
Same thing, but without the typo.
2020-03-13 16:19:02 -04:00
Lioncash
ddcbf51260
CMapUniverse: Resolve sign conversion warning in Draw()
...
Resolves a trivial implicit sign conversion warning.
2020-03-13 16:11:40 -04:00
Lioncash
014601cf67
CMapWorldInfo: Resolve sign conversion warnings
...
Resolves trivial implicit sign conversion warnings.
2020-03-13 16:10:23 -04:00
Lioncash
4601abf5df
CMapArea: Resolve sign conversion warning in Draw()
...
Resolves a trivial sign-conversion warning.
2020-03-13 16:07:41 -04:00
Lioncash
c37b3df27b
CLineRenderer: Silence -Wmaybe-uninitialized warning
...
We can just initialize maxTriVerts to zero to prevent warnings from
occurring.
2020-03-12 19:15:51 -04:00
Phillip Stephens
df4487bae8
Merge pull request #215 from lioncash/none
...
CFrontEndUI: Default initialize SFrontEndFrame's x4_action to EAction::None
2020-03-12 15:11:11 -07:00
Phillip Stephens
eb38d96d9a
Merge pull request #214 from lioncash/virtual
...
CGunWeapon: Make destructor virtual
2020-03-12 15:11:02 -07:00
Phillip Stephens
97e33bdf11
Merge pull request #213 from lioncash/unique
...
CProjectileWeaponDataFactory: Make GetGeneratorDesc() return a unique_ptr
2020-03-12 15:10:49 -07:00
Phillip Stephens
7601888e34
Merge pull request #212 from lioncash/power-color
...
CPowerBomb: Make kFadeColor internally linked
2020-03-12 15:10:40 -07:00
Phillip Stephens
8badbd3f35
Merge pull request #211 from lioncash/init
...
CPlayerEnergyDrain: Initialize x10_energyDrainTime on construction
2020-03-12 15:10:28 -07:00
Phillip Stephens
ce5ce35743
Merge pull request #210 from lioncash/bob
...
CPlayerCameraBob: Minor cleanup
2020-03-12 15:10:19 -07:00
Phillip Stephens
2a2b471671
Merge pull request #209 from lioncash/cast
...
CPlayerGun: Minor cleanup
2020-03-12 15:10:07 -07:00
Phillip Stephens
ac46b898bc
Merge pull request #208 from lioncash/wave
...
CWaveBuster: Implement GetTouchBounds()
2020-03-12 15:09:57 -07:00
Phillip Stephens
196a545f9a
Merge pull request #207 from lioncash/get
...
CElectricBeamProjectile: Remove unnecessary get() calls in PreRender()
2020-03-12 15:09:47 -07:00
Phillip Stephens
bb8e33461d
Merge pull request #206 from lioncash/gen
...
CElementGen: Minor cleanup
2020-03-12 15:09:36 -07:00
Phillip Stephens
5f2db40528
Merge pull request #205 from lioncash/fn
...
CFactoryMgr: Minor cleanup
2020-03-12 15:09:11 -07:00
Phillip Stephens
12ad192436
Merge pull request #204 from lioncash/move
...
Character/*: std::move constructor parameters where applicable
2020-03-12 15:09:00 -07:00
Phillip Stephens
3a37be9d27
Minor CFlaahgra fixes
2020-03-12 15:06:01 -07:00
Lioncash
90e866d2d5
CFrontEndUI: Default initialize SFrontEndFrame's x4_action to EAction::None
...
This is the initial value that GM8E v0 assigns to this member variable.
Previously it was being left uninitialized on construction.
2020-03-12 17:35:36 -04:00
Lioncash
2c091ac124
CGunWeapon: Make destructor virtual
...
This class is used as polymorphic type, so the destructor should be
marked as virtual to prevent any potential undefined behavior.
This also more closely matches the GM8E v0 binary itself.
2020-03-12 17:20:45 -04:00
Lioncash
05bccae70e
CDecalDataFactory: Make GetGeneratorDesc() return a unique_ptr
...
Same behavior, but with safer memory management.
2020-03-12 14:46:02 -04:00
Lioncash
1f42b9be93
CParticleElectricDataFactory: Make GetGeneratorDesc() return a unique_ptr
...
Same behavior, but with safer memory management.
2020-03-12 14:20:48 -04:00
Lioncash
59bbbdf41c
CParticleSwooshDataFactory: Make GetGeneratorDesc() return a unique_ptr
...
Same behavior, but with safer memory management.
2020-03-12 14:17:42 -04:00
Lioncash
93121c38f7
CProjectileWeaponDataFactory: Make GetGeneratorDesc() return a unique_ptr
...
Same behavior, but with safer memory management.
2020-03-12 14:00:23 -04:00
Lioncash
ee952b9c99
CPowerBomb: Make kFadeColor internally linked
...
Hides the name from external view entirely and allows the color instance
to be constexpr.
2020-03-12 10:13:37 -04:00
Lioncash
d51518dc57
CPlayerEnergyDrain: Make constructor explicit
...
Prevents error-prone implicit constructions from occurring.
2020-03-12 10:01:31 -04:00
Lioncash
e628cbf1be
CPlayerEnergyDrain: Initialize x10_energyDrainTime on construction
...
GM8E v0 initializes this to zero when constructing the class. This also
makes the entire class have a consistent initial state.
2020-03-12 09:57:43 -04:00
Luke Street
cfd568bb39
Merge branch 'chozoghosts'
2020-03-11 17:17:00 -04:00
Phillip Stephens
190c369aeb
Fix crashes with FusionSuit active
2020-03-11 06:48:30 -07:00
Luke Street
860f7c7f33
CChozoGhost: Minor fixes & renaming
2020-03-11 02:16:55 -04:00
Luke Street
123ddfd33a
CChozoGhost: InPosition -> ShouldAttack
2020-03-11 00:22:03 -04:00
Luke Street
155cd3759f
CChozoGhost: Minor FindBestAnchor fixes
2020-03-10 23:47:14 -04:00
Lioncash
179d19412b
CPlayerCameraBob: Make static non-const member variables private
...
Prevents accidental modification of the values from occurring in code
that makes use of them. Many of these constants aren't even used outside
of the class itself in the first place.
2020-03-09 20:55:12 -04:00
Lioncash
f622ed364d
CPlayerCameraBob: Make use of std::array where applicable
2020-03-09 20:33:37 -04:00
Lioncash
73f11a6132
CPlayerGun: Make use of std::array where applicable
2020-03-09 16:33:10 -04:00
Lioncash
1838e43078
CPlayerGun: Relocate file-static variables and constants into a single anonymous namespace
...
Keeps all file-static variables organized together.
2020-03-09 16:15:55 -04:00
Lioncash
3abaccb238
CPlayerGun: Resolve trivial implicit sign conversion warnings
2020-03-09 16:04:13 -04:00
Lioncash
9e5dc627ea
CWaveBuster: Implement GetTouchBounds()
...
Implements GetTouchBounds() according to the implementation within the
GM8E v0 binary.
Fills out the implementation of CWaveBuster a little bit.
2020-03-09 14:51:04 -04:00
Lioncash
06dfc3406e
CElectricBeamProjectile: Remove unnecessary get() calls in PreRender()
...
Same behavior, less code.
2020-03-09 13:55:26 -04:00
Lioncash
15dce1683e
CElementGen: std::move TToken instance in constructor
...
Allows the parameter to be moved into via calling code.
2020-03-09 13:07:53 -04:00
Lioncash
af2a82b5a7
CElementGen: Make GetSystemCount() a const member function
...
This doesn't modify internal member state, so this can be made a const
member function.
2020-03-09 13:03:42 -04:00
Lioncash
a8486cf479
CElementGen: Resolve sign-conversion warnings in loops
...
Prevents implicit truncation to int from occurring.
2020-03-09 13:01:42 -04:00
Lioncash
9db07b037a
CElementGen: Make use of std::array where applicable
2020-03-09 12:53:28 -04:00
Lioncash
35adfe8abf
CElementGen: Alphabetize forward declarations
...
Makes them nicer to visually scan over.
2020-03-09 12:33:24 -04:00
Luke Street
985daa3092
CCharAnimTime: Re-add algorithm include
2020-03-09 12:21:08 -04:00
Lioncash
0a158af0cb
CFactoryMgr: Resolve variable shadowing warning in MakeObjectFromMemory()
...
Resolvable with a trivial variable renaming.
2020-03-09 12:19:58 -04:00
Lioncash
91a2562fff
CFactoryMgr: Make use of std::array
...
Same behavior, with stronger typing. We can also leverage the iterator
member functions directly.
2020-03-09 12:17:18 -04:00
Luke Street
24817d6b01
CCharAnimTime: Fixes & cleanup
2020-03-09 12:09:54 -04:00
Lioncash
34eb507a9d
CFactoryMgr: std::move function instances in AddFactory()
...
std::function is allowed to allocate on the heap, so this potentially
prevents unnecessary allocations.
We can also use insert_or_assign() to prevent unnecessary default
initialization of std::function that immediately get overridden.
2020-03-09 12:04:51 -04:00
Lioncash
39b561b089
CTransitionManager: std::move constructor parameters where applicable
...
Allows calling code to move into the constructor
2020-03-09 11:58:10 -04:00
Lioncash
3a96c574b2
CTransitionDatabaseGame: std::move constructor parameters where applicable
...
Same behavior, but allows the parameters to be moved into from calling
code.
2020-03-09 11:58:10 -04:00
Lioncash
815f492e0f
CSequenceHelper: std::move constructor parameters where applicable
...
Same behavior, but allows for calling code to move into the interface.
2020-03-09 11:58:10 -04:00
Lioncash
cff12f0986
TAnimSourceInfo: std::move constructor parameter where applicable
...
Allows calling code to move into the constructor.
2020-03-09 11:58:10 -04:00
Lioncash
9fe671af99
CAnimTreeSequence: std::move constructor parameters where applicable
...
Allows the constructor arguments to be moved into the constructor.
2020-03-09 11:58:07 -04:00
Lioncash
fa23d0bb9c
CAnimTreeLoopIn: std::move constructor parameters where applicable
...
Allows the constructor parameters to be moved into.
2020-03-09 11:31:53 -04:00
Lioncash
ab17c1cf2f
CAnimationManager: std::move parameters to constructor where applicable
...
Allows calling code to move into the respective arguments.
2020-03-09 11:27:36 -04:00
Lioncash
e289643742
CAnimData: std::move constructor arguments where applicable
...
Same behavior, but allows calling code to move into the respective
parameters now.
2020-03-09 11:25:23 -04:00
Lioncash
79565d7f52
CAnimSourceInfo: std::move TSubAnimTypeToken instance in constructor
...
Provides the same behavior, but allows calling code to move into the
constructor.
2020-03-09 11:11:27 -04:00
Lioncash
3cec19437a
CAnimSysContext: std::move TToken instance in constructor
...
Provides the same interface, but allows for calling code to move into
the constructor.
2020-03-09 11:08:17 -04:00
Lioncash
280e4ce07d
CAnimTreeAnimReaderContainer: std::move shared_ptr in constructor
...
Provides the same behavior, but without a redundant atomic reference
count increment and decrement.
2020-03-09 11:06:20 -04:00
Luke Street
5c9dd55b80
CChozoGhost: Fix IsOnGround
2020-03-09 10:41:34 -04:00
Luke Street
830db8772d
Merge remote-tracking branch 'origin/master' into chozoghosts
2020-03-09 10:12:40 -04:00
Phillip Stephens
d93df18a37
Fix `CScriptDistanceFog::AcceptScriptMessage`
2020-03-08 23:18:57 -07:00
Luke Street
7b9a037c95
Merge pull request #203 from lioncash/identical
...
CBallCamera: Collapse identical switch cases within AvoidGeometry()
2020-03-08 23:45:52 -04:00
Luke Street
6e9a80de5d
CVisorFlare: Rename "near" to avoid MSVC conflict
2020-03-08 23:44:44 -04:00
Lioncash
363386cbd9
CBallCamera: Collapse identical switch cases within AvoidGeometry()
...
Same behavior, but less code.
This is identical in behavior to the code within the GM8E v0 binary.
2020-03-08 23:40:22 -04:00
Lioncash
45c1bc9652
CStaticRes: Make use of CAssetId's IsValid() member function within operator bool
...
We should be testing against IsValid() here to handle all cases that
indicate invalid values, as opposed to only handling the zero case.
2020-03-08 22:49:33 -04:00
Lioncash
209cd4a54e
CStaticRes: Make operator bool explicit
...
Prevents potentially error-prone conversions to bool. Similar to the
changes recently made to CToken.
2020-03-08 21:20:08 -04:00
Lioncash
2233a78fe2
CToken: Add HasReference() member function
...
Has the same semantics of operator bool(), but explains at the call site
what is actually being tested for in the relation to the object itself.
Aims to make readability slightly better (and removed the need for
casts).
2020-03-08 21:13:37 -04:00
Phillip Stephens
fc5170ede9
Merge pull request #200 from lioncash/temp
...
CLogBookScreen: Remove unconditional return true in IsScanComplete()
2020-03-08 18:03:54 -07:00
Phillip Stephens
a28b7a8df7
Merge pull request #199 from lioncash/octree
...
CPVSVisOctree: Use static qualifying name for ReadBoundingBoxBig()
2020-03-08 18:03:44 -07:00
Phillip Stephens
f07d4e9630
Merge pull request #198 from lioncash/move
...
CResFactory: Resolve use-after-move in AddToLoadList()
2020-03-08 18:03:28 -07:00
Phillip Stephens
b492c91ccf
Merge pull request #197 from lioncash/cond
...
CFontRenderState: Collapse common switch cases in RefreshColor()
2020-03-08 18:03:17 -07:00
Phillip Stephens
b01fa0c5bf
Merge pull request #196 from lioncash/saveable
...
CSaveableState: Initialize vectors in the constructor initializer list
2020-03-08 18:03:01 -07:00
Phillip Stephens
dd54f93da4
Merge pull request #195 from lioncash/unused
...
CPlayer: Make use of unused CCollidableAABox in ProcessInput()
2020-03-08 18:02:52 -07:00
Phillip Stephens
3011a839eb
Merge pull request #194 from lioncash/init
...
CProjectileInfo: Initialize result variable to false within PredictInterceptPos
2020-03-08 18:02:41 -07:00
Phillip Stephens
51bb2244da
Merge pull request #193 from lioncash/explicit
...
CToken: Make operator bool explicit
2020-03-08 18:02:30 -07:00
Phillip Stephens
3e59f7a455
Prepare for pr-193
2020-03-08 18:01:29 -07:00
Lioncash
2a1df559a9
CLogBookScreen: Remove unconditional return true in IsScanComplete()
...
This was temporarily added in for debugging purposes in the past but was
never removed.
2020-03-08 11:15:13 -04:00
Phillip Stephens
f06c26e7d6
Fix infinite loop in CObjectList, and add an assert to detect invalid assignments
2020-03-07 09:14:07 -08:00
Lioncash
8d42eb4287
CPVSVisOctree: Initialize in-class member variables where applicable
...
Provides a deterministic initial state for the default constructor.
2020-03-07 05:01:29 -05:00
Lioncash
4034e3b31f
CPVSVisOctree: Make use of std::array where applicable
...
Makes the arrays strongly typed.
2020-03-07 04:50:19 -05:00
Lioncash
969bcdba35
CPVSVisOctree: Use static qualifying name for ReadBoundingBoxBig()
...
It looks very odd using the name of the object being initialized to call
through to a static member function. We can disambiguate this by making
use of the qualifying name directly.
2020-03-07 04:46:19 -05:00
Lioncash
0a47e623fd
CResFactory: Resolve use-after-move in AddToLoadList()
...
The behavior on the right hand side would occur before the actual
assignment, making the tag value invalidated. Instead, we copy the tag
before the move is performed to keep the data valid when inserting it
into the map.
2020-03-07 03:56:16 -05:00
Lioncash
a490eaf8ff
CFontRenderState: Collapse common switch cases in RefreshColor()
...
Same behavior, less code.
2020-03-07 03:44:54 -05:00
Lioncash
815a38288a
CSaveableState: Initialize vectors in the constructor initializer list
...
Initializes the vectors in place, rather than constructing them and then
resizing.
2020-03-06 22:47:39 -05:00
Lioncash
830e1c59d2
CPlayer: Make nearby variables const
...
Makes nearby variables from the previous change const to make their
immutability explicit.
2020-03-06 22:08:56 -05:00
Lioncash
a2b6b4515d
CPlayer: Make use of unused CCollidableAABox in ProcessInput()
...
GM8E v0 makes use of the temporary collidable AA box. This amends the
code to make use of it.
2020-03-06 22:06:44 -05:00
Lioncash
27fb2008dc
CProjectileInfo: Initialize result variable to false within PredictInterceptPos()
...
GM8E v0 sets this to false before performing any further calculations.
This also prevents accidental uninitialized usages from occurring if
this is ever changed in the future.
While we're in the same area we can make bracing consistent.
2020-03-06 21:57:39 -05:00
Lioncash
a6367c0688
CToken: Make operator bool explicit
...
Prevents potential error-prone conversions from occurring
2020-03-06 21:42:07 -05:00
Phillip Stephens
052aa80bac
Fix initial AI issues
2020-03-06 18:03:13 -08:00
Phillip Stephens
4daa8ac374
CModelBoo: Fix missing cast
2020-03-06 16:27:33 -08:00
Phillip Stephens
17f25457c5
CGameArea::CAreaObjectList fix
2020-03-06 16:20:52 -08:00
Phillip Stephens
76e0a1f8f5
Merge pull request #192 from lioncash/init
...
CEyeball: Eliminate unnecessary runtime initializer in Think()
2020-03-06 16:15:15 -08:00
Phillip Stephens
7358570d51
Merge pull request #191 from lioncash/const
...
CObjectList: Make IsQualified() a const member function
2020-03-06 16:14:59 -08:00
Phillip Stephens
24baafb996
Merge pull request #190 from lioncash/render
...
CBooRenderer: Minor cleanup
2020-03-06 16:14:47 -08:00
Phillip Stephens
ae25392d19
Merge pull request #189 from lioncash/model
...
CModelBoo: Make static data constexpr where applicable
2020-03-06 16:14:05 -08:00
Phillip Stephens
f8e40e600f
Merge pull request #188 from lioncash/class
...
CModelShaders: Make EExtendedShader an enum class
2020-03-06 16:13:54 -08:00
Phillip Stephens
b44e43c7c0
Merge pull request #187 from lioncash/make
...
CThardus: Minor tidying changes
2020-03-06 16:13:42 -08:00
Phillip Stephens
ab65fae969
Merge pull request #186 from lioncash/array
...
CInGameGuiManager: Make use of std::array where applicable
2020-03-06 16:13:33 -08:00
Phillip Stephens
c9e7b2c2ff
Merge pull request #185 from lioncash/reference2
...
CParticleGenInfo: Fix missing ampersand in GetParticleSystem() member function
2020-03-06 16:13:22 -08:00
Phillip Stephens
915a0785a5
Merge pull request #184 from lioncash/reference
...
CHierarchyPoseBuilder: Fix missing ampersand in CharLayoutInfo() return value
2020-03-06 16:13:05 -08:00
Phillip Stephens
96af6157bd
Merge pull request #183 from lioncash/move
...
CThardus: std::move vector instances in constructor
2020-03-06 16:12:53 -08:00
Phillip Stephens
4b13f8768b
Merge pull request #181 from lioncash/ref
...
CInGameGuiManager: Take std::shared_ptr by const reference in DoStateTransition()
2020-03-06 16:12:35 -08:00
Phillip Stephens
1cccaac115
Final CChozoGhost imps
2020-03-06 07:16:55 -08:00
Lioncash
00ff91eece
CEyeball: Remove unnecessary .get() call
...
Dereferencing is already supported on smart pointers, so we don't need
to call .get() here.
2020-03-06 07:30:27 -05:00
Lioncash
c3809162bf
CEyeball: Eliminate unnecessary runtime initialzer in Think()
...
We can just fold the result into the constant directly, which allows us
to avoid the need for a static runtime initializer. This is bit-exact
with what the result would be, so this is fine.
2020-03-06 07:30:05 -05:00
Lioncash
80e2e97dc4
CObjectList: Make IsQualified() a const member function
...
None of the implementations modify object instance state, so this can be
made const qualified.
2020-03-06 04:36:39 -05:00
Lioncash
b1426867bf
CBooRenderer: Make use of std::array where applicable
...
Makes the data strongly typed and allows eliminating some hardcoded
sizes.
2020-03-06 02:25:40 -05:00
Lioncash
4f7f5cf09a
CBooRenderer: Make Buckets class mostly internal
...
This is only ever functionally used within this translation unit, so we
can hide the class internally.
2020-03-06 01:16:02 -05:00
Lioncash
3c4e25062d
CModelBoo: Make static data constexpr where applicable
...
Gets rid of potential runtime-initializers.
2020-03-06 00:46:30 -05:00
Lioncash
d9664d165f
CModelShaders: Make EExtendedShader an enum class
...
Prevents pollution of the urde namespace with general names like Flat,
etc.
2020-03-06 00:16:31 -05:00
Lioncash
3717480eeb
CThardus: Make use of std::array where applicable
...
Dehardcodes some sizes and gets rid of two instances of implicit sign
conversions.
2020-03-05 23:22:30 -05:00
Lioncash
3b6218fa67
CThardus: Make use of std::make_unique where applicable
...
Same thing, but more straightforward.
2020-03-05 23:15:24 -05:00
Lioncash
84fde9ceca
CInGameGuiManager: Make use of std::array where applicable
...
Allows us to eliminate some hardcoded array sizes.
2020-03-05 22:02:29 -05:00
Lioncash
40277bedac
CParticleGenInfo: Fix missing ampersand in GetParticleSystem() member function
...
Previously the particle system shared pointer would always be returned
by value, rather than by reference.
2020-03-05 21:36:04 -05:00
Lioncash
4c90adf074
CHierarchyPoseBuilder: Fix missing ampersand in CharLayoutInfo() return value
...
Previously this function was always returning by value, rather than by
reference, like what its contained called function does.
2020-03-05 21:28:23 -05:00
Lioncash
6917132a94
CThardus: std::move vector instances in constructor
...
Previously the std::move calls wouldn't do anything, as the parameters
were constant references, so we can take them by value and move into the
constructor and then move the parameters into the member variables.
While we're at it, we can initialize the vectors in place instead of
constructing and then assigning to them.
2020-03-05 21:19:32 -05:00
Lioncash
50f8f3e17e
CInGameGuiManager: Take std::shared_ptr by const reference in DoStateTransition()
...
Trivially avoids an atomic reference count increment and decrement.
2020-03-05 20:47:07 -05:00
Phillip Stephens
e43bfe1e58
More CChozoGhost imps
2020-03-05 07:42:12 -08:00
Phillip Stephens
58cca6ffa8
More chozoghost imps
2020-03-05 01:56:04 -08:00
Phillip Stephens
50a20d7322
More CChozoGhost imps
2020-03-04 18:41:11 -08:00
Phillip Stephens
9d77d7313c
More ChozoGhost imps
2020-03-04 18:41:10 -08:00
Phillip Stephens
d91e86a94a
Initial CChozoGhost stubs
2020-03-04 18:41:10 -08:00
Phillip Stephens
2f9dd38bbe
Silence discard errors
2020-03-04 18:40:03 -08:00
Luke Street
74d01debe1
Merge pull request #180 from lioncash/flamethrower
...
CFlameThrower: Amend virtual interface discrepancies
2020-03-04 13:42:21 -05:00
Lioncash
88cb5acdca
CFlameThrower: Amend virtual interface discrepancies
...
GM8E v0 overrides Render(), GetTouchBounds() and Touch() and does
nothing within them. This updates the interface to match it.
2020-03-04 06:52:50 -05:00
Lioncash
f0c3903951
CSpacePirate: Make use of std::array with constexpr data
...
Makes data strongly typed, making pointer decay explicit.
2020-03-04 04:44:54 -05:00
Lioncash
4b3d48ebc1
CSpacePirate: Make static const data internally linked
...
Makes the symbols fully internally linked and also allows marking them
constexpr.
2020-03-04 04:33:11 -05:00
Phillip Stephens
09f7096913
Disable variable delta time
2020-03-03 16:50:25 -08:00
Phillip Stephens
80dbc1920c
Update submodules
2020-03-03 16:49:13 -08:00
Phillip Stephens
366d6b96ee
Merge pull request #178 from lioncash/data
...
CScriptGunTurret: Remove unnecessary data() call in AcceptScriptMsg()
2020-03-03 16:43:43 -08:00
Phillip Stephens
abfd77c3ba
Merge pull request #177 from lioncash/burst
...
CScriptGunTurret: Move static const data into the cpp file
2020-03-03 16:43:34 -08:00
Lioncash
70c3a7ddf5
CScriptGunTurret: Remove unnecessary data() call in AcceptScriptMsg()
...
We can use append() instead of data(). This allows the size of the
string view instance to be used directly instead of redundantly doing a
string size lookup.
2020-03-03 06:30:20 -05:00
Luke Street
9e0e053906
CScriptSpecialFunction: Further ThinkSpinnerController implementation
2020-03-03 03:31:58 -05:00
Lioncash
245a8145c7
CScriptGunTurret: Make use of std::array with file-static data
2020-03-03 03:12:35 -05:00
Lioncash
f4fc17bee0
CScriptGunTurret: Move static const data into the cpp file
...
Makes the data fully internally linked and also allows making said data
constexpr.
2020-03-03 03:05:02 -05:00
Luke Street
316128b7af
Use bintoc_compress; reduce URDE/HECL binary sizes
2020-03-02 02:02:57 -05:00
Luke Street
12393d4c4d
CSnakeWeedSwarm: Fix lighting
2020-03-01 03:05:16 -05:00
Luke Street
17b9813b3e
CSnakeWeedSwarm: Rendering & state fixes
2020-03-01 02:52:17 -05:00
Luke Street
f064bc2f7b
CSnakeWeedSwarm: Initialize bitfields; some more cleanup
2020-03-01 01:59:12 -05:00
Luke Street
046fbe7760
CSnakeWeedSwarm: Cleanup, renaming & fixes
2020-03-01 01:59:12 -05:00
Luke Street
34a80aab81
CSnakeWeedSwarm: Implement ApplyRadiusDamage
2020-03-01 01:59:12 -05:00
Luke Street
f50f5cedef
CSnakeWeedSwarm: Implement remaining methods
2020-03-01 01:59:12 -05:00
Phillip Stephens
9f5f0abab4
More CThardus imps, add reference CTevPass imps
2020-02-29 17:11:41 -08:00
Luke S
617844efce
Merge pull request #175 from lioncash/fixme
...
CFlaahgraTentacle: Remove FIXME comment in ShouldAttack()
2020-02-29 16:56:50 -05:00
Lioncash
5e705515ed
CFlaahgraTentacle: Remove FIXME comment in ShouldAttack()
...
GM8E v0 does exactly this, so we can consider this double-checked
2020-02-29 06:18:30 -05:00
Lioncash
9434be8562
CFlaahgraTentacle: Amend floating point value within Play case in AcceptScriptMsg()
...
GM8E v0 sets this to 0.04f.
2020-02-29 05:54:38 -05:00
Luke S
58a2f6aeb2
Merge pull request #173 from lioncash/c_str
...
Runtime: Remove unnecessary c_str() calls
2020-02-28 11:16:57 -05:00
Luke S
e0b84df5de
Merge pull request #172 from lioncash/move
...
CCharacterInfo: Minor allocation related changes
2020-02-28 10:39:35 -05:00
Luke S
e7de5311c2
Merge pull request #171 from lioncash/const
...
CPAS*: Minor cleanup
2020-02-28 10:37:36 -05:00
Luke S
55521fb5df
Merge pull request #170 from lioncash/collision
...
CollisionUtil: Replace FINDMINMAX macro with std::minmax()
2020-02-28 10:36:46 -05:00
Lioncash
f1256faeb7
Runtime: Remove unnecessary c_str() calls
...
Makes for less noisy code and also gets rid of unnecessary std::strlen
calls in the case things are passed to a std::string_view parameter.
2020-02-28 05:26:41 -05:00
Lioncash
718d8d5d6f
CPASParmInfo: Make data members private
...
These aren't used outside of the class, we only need to make
EWeightFunction public.
2020-02-28 05:00:16 -05:00
Lioncash
9524208cd2
CCharacterInfo: Remove unnecessary top-level const in return value of GetAnimationIndex()
...
Same behavior, less code.
2020-02-28 04:56:45 -05:00
Lioncash
63cf485f27
CCharacterInfo: std::move std::string instance where applicable
...
Avoids potentially reallocating strings where it's not necessary to do
so.
2020-02-28 04:55:09 -05:00
Lioncash
435a6ea1d4
CCharacterInfo: Make use of emplace_back() where applicable
...
We can construct these elements in place. While we're at it, we can mark
the count variables at const to be explicit.
2020-02-28 04:51:18 -05:00
Lioncash
d2c86f98d1
CCharacterInfo: std::move vectors in CParticleResData's constructor
...
Same behavior, but allows the caller to move into the constructor,
potentially avoiding copies altogether.
2020-02-28 04:49:07 -05:00
Lioncash
d79b9d925e
CPAS*: Make constructors explicit
...
Prevents undesirable implicit constructions from occurring.
2020-02-28 04:38:23 -05:00
Lioncash
fe05c42be4
CPASAnimState: Remove const_cast usages
...
A cache is typically a use case for mutable (as the outside user of the
class wouldn't directly rely on the cache as part of the API, this would
only function to assist the API perform better), so we can mark the
selection cache as mutable and make the code nicer to read overall.
2020-02-28 04:33:42 -05:00
Lioncash
9cb5d11405
CollisionUtil: Replace FINDMINMAX macro with std::minmax()
...
Same thing, but already provided by the language.
2020-02-28 02:27:24 -05:00
Luke S
751838f00e
Merge pull request #166 from lioncash/redundant
...
CGroundMovement: Collapse 'dampUnderwater ? 0.2f : 0.2f' conditional
2020-02-26 13:19:22 -05:00
Luke S
5fa244a058
Merge pull request #165 from lioncash/elastic
...
CGroundMovement: Set optsCopy's wall elastic constant to 0.03f
2020-02-26 13:17:18 -05:00
Lioncash
62330903cc
CGroundMovement: Collapse 'dampUnderwater ? 0.2f : 0.2f' conditional
...
The conditional itself aside, in GM8E v0, this is always assigned as
0.2f.
2020-02-26 04:18:58 -05:00
Lioncash
6afcf634b0
CGroundMovement: Set optsCopy's wall elastic constant to 0.03f
...
In GM8E v0, the wall elastic constant of the copied SMovementOptions
instance is set to 0.03f.
2020-02-26 04:12:09 -05:00
Lioncash
2b4888dcb6
CMidiManager: std::move sequencer within SetAudioSysHandle()
...
Provides the same behavior but without a redundant reference count
increment and then decrement.
2020-02-26 03:16:11 -05:00
Luke S
08604d770a
Merge pull request #163 from lioncash/data
...
ITweakGunRes: Minor cleanup
2020-02-25 22:32:25 -05:00
Lioncash
e80d9c7192
ITweakGunRes: Make use of std::array where applicable
...
Deduplicates a few array sizes and makes the member variables more
strongly typed.
2020-02-25 15:50:37 -05:00
Luke S
83507f0226
Merge pull request #162 from lioncash/false
...
CAuxWeapon: Replace always false condition with false in Fire()
2020-02-25 14:42:14 -05:00
Luke S
5454fc213b
Merge pull request #161 from lioncash/return
...
CPlayer: Add missing return within UpdateOrbitModeTimer()
2020-02-25 14:19:32 -05:00
Luke Street
ae591d4817
Add MP1_VARIABLE_DELTA_TIME option (for high refresh rates; buggy)
2020-02-25 14:15:53 -05:00
Lioncash
450bcd019e
CAuxWeapon: Replace always false condition with false in Fire()
...
Given we already check if chargeState is Normal previously, there's no
way that this can also be Charged at the same time.
2020-02-25 04:36:10 -05:00
Lioncash
79c409c5e0
CPlayer: Add missing return within UpdateOrbitModeTimer()
...
Previously, any call to this function would always reset the timer to
0.0, rather than potentially decrement it.
GM8E v0 always returns within the conditional.
2020-02-25 02:17:22 -05:00
Luke S
4ae3bca176
Merge pull request #159 from lioncash/constexpr
...
CJellyZap: Make kPlayerFilter constexpr
2020-02-24 21:35:54 -05:00
Lioncash
c3294977ff
CJellyZap: Make kPlayerFilter constexpr
...
This can be trivially made constexpr. We can also make this a fully
internally linked identifier.
2020-02-24 20:12:58 -05:00
Luke S
97ab8a56d9
Merge pull request #157 from lioncash/optional-goo
...
CScriptVisorGoo: Use std::make_optional where applicable
2020-02-24 03:12:17 -05:00
Luke S
1d9224f55c
Merge pull request #156 from lioncash/moving
...
CSkinnedModel: std::move constructor arguments where applicable
2020-02-24 03:00:59 -05:00
Luke S
551be30b9e
Merge pull request #155 from lioncash/initializer
...
CGraphics: Silence missing initializer warning
2020-02-24 03:00:31 -05:00
Luke S
c8291ee3dc
Merge pull request #154 from lioncash/constexpr
...
CSamusDoll: Minor changes
2020-02-24 03:00:11 -05:00
Lioncash
b3b71a2e76
CScriptVisorGoo: Use std::make_optional where applicable
...
Same behavior, but without a verbose type name.
2020-02-24 02:57:47 -05:00
Lioncash
6c6df4d4ee
CSkinnedModel: std::move constructor arguments where applicable
...
Fairly straightforward change. We can move the elements here to make use
of the move constructor over the copy constructor.
2020-02-24 02:36:44 -05:00
Lioncash
35ae2c2981
CGraphics: Silence missing initializer warning
...
Makes the initializer field for the aspect member explicit along with
the rest of the supplied values.
2020-02-24 02:28:27 -05:00
Lioncash
7e2ef9c8ea
CSamusDoll: Eliminate variable shadowing in Draw()
2020-02-24 01:50:44 -05:00
Lioncash
9042dddc8c
CSamusDoll: Make use of std::array where applicable
...
Makes the data strongly typed and also allows tooling runtime checks for
debug builds if implementations support it (which MSVC, libstdc++ and
libc++ all support).
2020-02-24 01:48:13 -05:00
Lioncash
61dff4367d
CSamusDoll: Make use of an anonymous namespace
...
Makes a separate area for internally linked data.
2020-02-24 01:39:23 -05:00
Lioncash
08ebecdaaf
CSamusDoll: Mark skInitialOffset as constexpr
...
Allows the vector to be initialized at compile-time.
2020-02-24 01:34:59 -05:00
Luke Street
16586c200b
Merge branch 'pr-153'
2020-02-21 13:46:52 -05:00
Luke Street
f1dd82066a
Start implementing CSnakeWeedSwarm
2020-02-20 23:27:12 -05:00
Luke Street
a978b030c3
Fix infra model for CWallCrawlerSwarm
2020-02-20 21:50:54 -05:00
Jcw87
e835528fe8
MSVC compile fixes.
2020-02-16 00:10:08 -08:00
Phillip Stephens
f251c73e6a
Merge branch 'pr-151'
2020-02-13 14:17:40 -08:00
Lioncash
da4dde2437
CAtomicBeta: Correct division arithmetic error in Think()
...
This is supposed to be a multiplication, not a division (at least this
is what v0-00 does).
2020-02-12 04:57:07 -05:00
Phillip Stephens
0bdad38175
Merge branch 'pr-150'
2020-02-11 20:05:07 -08:00
Lioncash
88f445c94d
CParasite: Make static CMaterialList instances constexpr where applicable
...
Same behavior, but allows the data to be stored within the read-only
segment.
2020-02-11 09:33:58 -05:00
Lioncash
1edcbf7ec6
CMetaree: Set locomotion type to crouched if deactivated in InActive()
...
v0-00 sets this locomotion type when the deactivation flag is set.
2020-02-07 19:32:51 -05:00
Phillip Stephens
61f9adfa70
Merge branch 'pr-148'
2020-02-07 14:25:31 -08:00
Phillip Stephens
6501d56baa
Merge branch 'pr-147'
2020-02-07 14:24:21 -08:00
Phillip Stephens
60f8dfb9d1
Final CCollisionInfoList imps
2020-02-07 14:20:04 -08:00
Lioncash
16f7925652
CFireFlea: Set CPathFindSearch's padding to 50.0f within AcceptScriptMsg()
...
v0-00 sets the padding member of CPathFindSearch here to 50.0, not a
member variable that's part of the CFireFlea class.
2020-02-07 16:27:56 -05:00
Lioncash
d4245b016f
CPuddleToadGamma: Migrate static constants into the cpp file
...
Makes the data fully internally-linked. This also allows declaring
skBellyOffset as constexpr.
While we're at it, we can also make the solid filter constexpr as well,
given it isn't modified anywhere. This allows the data to be placed
within the read-only segment and potentially gets rid of a runtime
static constructor.
2020-02-07 15:55:23 -05:00
Lioncash
0dd7e3e7bf
CFlickerBat: Add missing SetMuted() call within Death()
...
v0-00 contains a call to SetMuted(false) in game code.
2020-02-07 09:38:56 -05:00
Phillip Stephens
330a1bff76
Merge pull request #145 from lioncash/blood-collision
...
CBloodFlower: Implement GetCollisionResponseType
2020-02-03 14:45:21 -08:00
Phillip Stephens
67e4c2e135
Merge pull request #144 from lioncash/blood-const
...
CBloodFlower: Mark sFireEffects as constexpr
2020-02-03 14:45:02 -08:00
Phillip Stephens
28ee845564
Merge pull request #143 from lioncash/steering
...
CWarWasp: Amend damping radius value within ApplyNormalSteering()
2020-02-03 14:44:39 -08:00
Phillip Stephens
569886de6a
Merge pull request #142 from lioncash/decay
...
CScriptPlatform: Amend delta time value in AcceptScriptMsg for deletion
2020-02-03 14:44:21 -08:00
Phillip Stephens
48570cd956
Merge pull request #141 from lioncash/dock-aa
...
CScript*: Return std::nullopt in GetTouchBounds()
2020-02-03 14:43:58 -08:00
Phillip Stephens
06d7a3e00a
Merge pull request #140 from lioncash/enum-class
...
CScriptDock: Make EDockState an enum class
2020-02-03 14:43:28 -08:00
Lioncash
d1a714cf1a
CBloodFlower: Implement GetCollisionResponseType
...
CBloodFlower seems to be missing the implementation from v0-00. This
change adds in its equivalent behavior.
2020-02-03 10:42:26 -05:00
Lioncash
855841607b
CBloodFlower: Mark sFireEffects as constexpr
...
Allows the strings to be put into the read-only section of the binary
(and makes it explicit that the strings aren't modified).
While we're at it we can make use of std::array.
2020-02-03 10:14:19 -05:00
Lioncash
f675bc3857
CWarWasp: Amend damping radius value within ApplyNormalSteering()
...
GM8E v0-00 uses 2.5 for the second Arrival() damping radius value, not 3.0.
2020-02-01 16:37:23 -05:00
Lioncash
3147d39cd9
CScript*: Return std::nullopt in GetTouchBounds()
...
In some implementations, returning via default construction for
std::optional can cause the entire inner buffer to be zeroed out.
Returning with std::nullopt causes only the internal validity flag to be
set and nothing more.
2020-02-01 01:06:43 -05:00
Lioncash
c944d04614
CScriptPlatform: Amend delta time value in AcceptScriptMsg for deletion
...
Game code makes use of 1.66666675f here, not 0.0f.
2020-01-31 23:53:39 -05:00
Lioncash
9a8f99faa5
CScriptDock: Make EDockState an enum class
...
Makes the enum type strongly typed. All usages currently allow for this
anyways.
2020-01-31 21:34:10 -05:00
Lioncash
458ff8949a
IGameArea: Make Dock's reference count variable signed
...
In all usage cases, this variable is used with functions that expect a
signed value. This eliminates quite a few signed mismatch warnings.
2020-01-31 21:29:53 -05:00
Lioncash
a3ebe8727f
CScriptSound: Remove active check within AcceptScriptMsg() deactivate path
...
Game code doesn't check for active status within this branch, and
there's no comment indicating whether or not this difference was intentional.
2020-01-31 17:37:46 -05:00
Lioncash
495ff19aad
CDamageInfo: Make certain constructors constexpr
...
Allows eliminating potential runtime static constructors by allowing
file-scope instances to be declared constexpr.
2020-01-31 02:06:14 -05:00
Phillip Stephens
918f1a9fcb
Merge pull request #136 from lioncash/rainsplash
...
CRainSplashGenerator: Amend lower bound constant for speed in SSplashLine::Update()
2020-01-30 20:12:11 -08:00
Phillip Stephens
968c3394c6
Merge pull request #135 from lioncash/dash-elements
...
CPlayer: Add missing element to skDashStrafeDistances
2020-01-30 20:12:00 -08:00
Phillip Stephens
d7f475166f
Merge pull request #134 from lioncash/function-error
...
CPlayer: Fix function call mismatch within SidewaysDashAllowed()
2020-01-30 20:11:49 -08:00
Phillip Stephens
b1322a5613
Merge pull request #133 from lioncash/trunc-float
...
CTextParser: Resolve double->float truncation within ParseTag()
2020-01-30 20:11:39 -08:00
Phillip Stephens
0116e56332
Merge pull request #132 from lioncash/static-instance
...
CRealElement: Remove redundant instance() call in CRELifetimeTween::GetValue()
2020-01-30 20:11:24 -08:00
Phillip Stephens
11352ef042
Merge pull request #131 from lioncash/top-const
...
CActor: Remove top-level const from GetScaledLocatorTransform() and GetLocatorTransform()
2020-01-30 20:11:12 -08:00
Phillip Stephens
9eb69dfd8b
Merge pull request #130 from lioncash/naming
...
CAutoMapper: Make SAutoMapperRenderState constructor parameter names more informative
2020-01-30 20:10:54 -08:00
Phillip Stephens
004d8bab22
Merge pull request #129 from lioncash/emplace
...
CGuiTextSupport: Make use of emplace_back() in AddText()
2020-01-30 20:10:41 -08:00
Lioncash
1aa24bd287
CRainSplashGenerator: Amend lower bound constant for speed in SSplashLine::Update()
...
Game code actually uses a constant of 4.0f as the lower bound for speed, not
0.015625f.
2020-01-30 22:20:49 -05:00
Lioncash
29ca2b6062
CPlayer: Add missing element to skDashStrafeDistances
...
This was previously missing the initial element within the array,
causing all the elements in the table to be shifted to the left by one.
This corrects that.
2020-01-29 03:51:50 -05:00
Lioncash
264c897bb5
CPlayer: Fix function call mismatch within SidewaysDashAllowed()
...
This function actually calls GetPressInput() here, not
GetDigitalInput().
2020-01-29 03:18:36 -05:00
Lioncash
03f2ebc768
CTextParser: Resolve double->float truncation within ParseTag()
...
This should be prepended with the f suffix to prevent double to float
implicit truncation.
2020-01-29 02:26:50 -05:00
Lioncash
13afd9b033
CRealElement: Remove redundant instance() call in CRELifetimeTween::GetValue()
...
This only needs to be called once.
2020-01-29 02:07:55 -05:00
Lioncash
edf5511af4
CActor: Remove top-level const from GetScaledLocatorTransform() and GetLocatorTransform()
...
Same behavior, less code.
2020-01-29 01:50:31 -05:00
Lioncash
88cecd80ec
CAutoMapper: In-class initialize SAutoMapperRenderState member variables
...
Simplifies the parameterized constructor a little bit and provides a
consistent initial state for the default constructor.
2020-01-28 13:29:59 -05:00
Lioncash
50fbd2ad42
CAutoMapper: Make SAutoMapperRenderState constructor parameter names more informative
2020-01-28 13:26:48 -05:00
Lioncash
7f20cd0883
CGuiTextSupport: Make use of emplace_back() in AddText()
...
Same behavior, less code.
2020-01-28 00:22:19 -05:00
Lioncash
3d5ed90d1a
CWeaponMode: Make constexpr capable
...
Given this is such a simple type, this can be made usable with
constexpr. This allows the type to be usable at file-scope without
potentially incurring a runtime constructor.
2020-01-23 23:12:18 -05:00
Phillip Stephens
516ea136f4
Merge pr-127
2020-01-20 20:05:21 -08:00
Phillip Stephens
8d90edd55f
Initial CChozoGhost imp
2020-01-20 20:00:40 -08:00
Lioncash
b847930a85
CCameraManager: Collapse loop into std::find_if in RemoveCameraShaker
...
We can collapse the loop into a find_if call here, since it only does a
look up and nothing more.
2020-01-20 12:57:23 -05:00
Lioncash
b3fcbf9a89
CCameraManager: Resolve signed/unsigned mismatch in RemoveCameraShaker
...
An unsigned value is passed into RemoveCameraShaker at its only usage
spot. This also resolves unsigned/signed comparisons within the function
itself.
2020-01-20 12:51:52 -05:00
Luke Street
72e068419f
Merge branch 'pr-126'
2020-01-17 19:57:50 -05:00
Luke Street
a66a965437
Merge branch 'pr-125'
2020-01-17 19:57:48 -05:00
Lioncash
9ce652bfd6
CNewIntroBoss: Correct base class call to DoUserAnimEvent()
...
This function actually calls CPatterned's implementation of
DoUserAnimEvent(), not CActor's.
2020-01-15 15:32:18 -05:00
Lioncash
ab2ad38220
CPatterned: Mark CMaterialList instance in CollidedWith as constexpr
...
This isn't ever modified, so we can mark it constexpr to eliminate
potential runtime initializers.
2020-01-15 14:48:21 -05:00
Lioncash
1cb289f243
RuntimeCommon: Normalize cpp inclusions
...
Normalizes the headers for the cpp files in the RuntimeCommon target.
Now all headers and source files within the RuntimeCommon/RuntimeCommonB
targets are normalized and consistent with one another.
2020-01-15 09:15:47 -05:00
Phillip Stephens
677687f228
Merge branch 'master' of ssh+git://git.axiodl.com/AxioDL/urde
2020-01-05 20:25:21 -08:00
Phillip Stephens
841996a872
More work on CThardus
2020-01-05 20:24:54 -08:00
Luke Street
67d0fa55df
Fix shriekbat damage
2020-01-02 19:54:59 -05:00
Lioncash
221cc5c6b8
RuntimeCommonB: Normalize cpp file includes
...
Like the prior changes normalizing the inclusions within headers, this
tackles the cpp files of the RuntimeCommonB target, making these source
files consistent with their headers.
2019-12-22 18:12:04 -05:00
Phillip Stephens
21159e604e
More CThardus
2019-12-14 15:50:29 -08:00
Phillip Stephens
8689d599c5
GCC Fixes
2019-12-14 01:14:58 -08:00
Phillip Stephens
70747e23d5
Fix font rendering and world teleporter in MPT and PAL
2019-12-11 10:55:19 -08:00
Phillip Stephens
b507799478
Add texture info lookup
2019-12-11 00:37:30 -08:00
Phillip Stephens
1a13f7e4ee
Update submodules, initial CTextureCache
2019-12-10 20:51:33 -08:00
Phillip Stephens
4e5921c952
Update submodules
2019-12-10 20:51:23 -08:00
Phillip Stephens
34e78a2dd0
Move CParticleGlobals from the executable and onto the heap, minor fixes, update wiki link
2019-12-03 00:47:05 -08:00
Phillip Stephens
697a100bca
Implement CScriptSpecialFunction::ThinkAreaDamage, and more CThardus
2019-11-24 07:32:45 -08:00
Phillip Stephens
655dc01a06
Add support for override paks
2019-11-21 07:37:08 -08:00
Phillip Stephens
b23575f2aa
Stop GCC's whining
2019-11-19 15:15:45 -08:00
Phillip Stephens
8b6dff70b4
Properly cleanup Xorg in visigen, various fixes and cleanups in URDE, more CRidley imps
2019-11-19 15:06:25 -08:00
Phillip Stephens
4762c7b832
Finish Ridley's AI function implementations
2019-11-14 08:39:20 -08:00
Phillip Stephens
e059f224d4
Fix behavior translation, still needs work
2019-11-13 10:44:43 -08:00
Phillip Stephens
8881376195
Some ridley fixes
2019-11-13 09:58:49 -08:00
Phillip Stephens
a1c7692d36
More CRidley imps
2019-11-12 12:25:21 -08:00
Phillip Stephens
3b101267f8
Merge pull request #88 from lioncash/radar
...
Graphics/Shaders: Minor changes
2019-11-10 08:03:42 -08:00
Lioncash
940ab1f662
World/CFluidPlaneGPU: Name variable to be more meaningful in RenderStripWithRipples()
2019-11-09 20:22:16 -05:00
Lioncash
136a229a1a
Graphics/Shaders: Use std::array where applicable
...
Makes the arrays strongly typed and impervious to array->pointer decay.
This also allows simplifying some operations (such as being able to call
fill() instead of needing to use std::fill, etc).
2019-11-09 20:22:16 -05:00
Lioncash
417506572c
Graphics/Shaders/CCameraBlurFilter: Move Vert definition into cpp file
...
This is private and not used anywhere in the exposed interface, so this
can be moved into the cpp file to make it an implementation detail and
allow moving a zeus header into the cpp file.
2019-11-09 20:22:16 -05:00
Lioncash
902f4fb5c5
Graphics/Shaders: Use forward declarations where applicable
...
Now, with all of the headers normalized, we can safely convert some
headers into forward declarations without needing to worry about
potentially breaking code in other headers or source files.
2019-11-09 20:22:09 -05:00
Phillip Stephens
21ed1b6660
Merge branch 'master' of ssh+git://git.axiodl.com/AxioDL/urde
2019-11-09 15:49:09 -08:00
Phillip Stephens
6c1f682e0f
Initial CRidley implementation
2019-11-09 15:48:46 -08:00
Lioncash
0546553f2d
IOStreams: Replace CZipSupport with lambda functions
...
We can safely replace the class with direct lambda functions, given they
don't need to capture any state.
2019-11-09 02:57:39 -05:00
Lioncash
9a728a38d6
IOStreams: Use 1U when shifting bitmasks
...
Otherwise this is technically shifting a signed value, which can lead to
warnings. While we're at it, we can use UINT32_MAX instead of
0xFFFFFFFF to mean the same thing.
2019-11-08 19:05:45 -05:00
Lioncash
95a0b0e559
IOStreams: Remove reinterpret_casts where applicable
...
We can simply make use of writeBytes() where applicable, which does it
for us, which makes the code a slight bit less verbose.
2019-11-08 18:55:13 -05:00
Lioncash
3894c0539e
IOStreams: Use fmt where applicable
...
Eliminates the use of printf and instead uses fmt so types can
automatically be formatted without the use of casts.
While we're at it, we can resolve a sign-conversion warning in
PrintBinary().
2019-11-08 18:51:07 -05:00
Lioncash
cf8fe1861f
IOStreams: Normalize cpp file inclusions
2019-11-08 18:45:31 -05:00
Phillip Stephens
f2c207b85e
Fix regression
2019-11-06 10:12:20 -08:00
Phillip Stephens
297513c8d4
Fix Impact Crater causing an infinite loop for simply not having a skybox
2019-11-06 09:33:45 -08:00
Phillip Stephens
77b61b0e68
Fix saves sending you to incorrect rooms, fix triggers
2019-11-05 09:18:14 -08:00
Phillip Stephens
1a5179feb2
Fix CSpacePirate activating too early
2019-11-05 02:22:14 -08:00
Phillip Stephens
b87f94802d
Merge pull request #120 from lioncash/collision
...
CCollisionResponseData: Minor changes
2019-10-30 01:13:40 -07:00
Phillip Stephens
ec7f6804cb
Merge pull request #119 from lioncash/constexpr
...
CollisionPrimitive: Make collision primitive types constexpr capable
2019-10-30 01:13:31 -07:00
Lioncash
fff7b90c85
CCollisionResponseData: In-class initialize primitives
...
Avoids needing to give them their own entry within the constructor
initializer list.
2019-10-29 19:43:23 -04:00
Lioncash
156c0e8cd0
CCollisionResponseData: Name parameters in function declarations
...
Allows IDEs and other introspection tools to be more useful when
indicating parameters in function calls.
2019-10-29 19:41:53 -04:00
Lioncash
9c391f90e3
CCollisionResponseData: Join vector initializations into constructor initializer list
...
Generally provides marginally better code generation.
We can also fill x10_sfx with the invalid SFX constant at the same time
instead of performing a resize and then filling it again.
2019-10-29 19:41:53 -04:00
Lioncash
3d67088697
CCollisionResponseData: Make use of std::array where applicable
...
Allows us to replace some heap allocating file-scope std::vector
instances with constexpr std::arrays, eliminating quite a few static
constructors.
2019-10-29 19:41:48 -04:00
Lioncash
c1beec5bb0
CCollisionResponseData: Organize cpp inclusions
...
Organizes them alphabetically to make for better human reading.
2019-10-29 19:27:21 -04:00
Lioncash
d7dd256d38
CollisionPrimitive: Make use of constexpr types where applicable
...
We can now mark some usages of these types as constexpr and also make
them fully internal to the translation unit.
2019-10-29 18:36:26 -04:00
Lioncash
5c7bb9e7d7
CollisionPrimitive: Make collisition primitive types and comparisons constexpr capable
...
Allows them to be used within constexpr contexts.
2019-10-29 18:36:21 -04:00
Phillip Stephens
e5c8592d5a
Merge pull request #118 from lioncash/seg
...
CSegId: Minor changes
2019-10-26 19:51:08 -07:00
Lioncash
660d092cad
CSegId: Add member functions for querying validity
...
Allows querying validity of segment IDs without hardcoding the magic
value that signifies an invalid ID.
2019-10-26 22:43:11 -04:00
Phillip Stephens
118fb22ce0
Merge pull request #117 from lioncash/layout
...
CCharLayoutInfo: Minor changes
2019-10-26 18:37:59 -07:00
Lioncash
30af6f0bfb
CSegId: Make constexpr capable
...
Allows the class to be used within constexpr contexts, given it's such a
small class.
2019-10-26 21:36:30 -04:00
Lioncash
69831b4a13
CCharLayoutInfo: Make constructors explicit
...
Makes constructions of the types visibly explicit, given they aren't
conversion constructors.
2019-10-26 21:27:03 -04:00
Lioncash
bb9da96870
CCharLayoutInfo: Invert conditional within GetFromParentUnrotated()
...
Inverts the conditional to be in terms of the true case, making it a
little nicer to read.
2019-10-26 21:24:10 -04:00
Lioncash
9193f4c4d7
CCharLayoutInfo: Make use of const where applicable
...
Makes trivial variables const to make it explicit that they aren't
modified.
2019-10-26 21:21:57 -04:00
Lioncash
293d19cf13
CCharLayoutInfo: std::move std::string instance in CCharLayoutInfo constructor
...
Avoids performing a copy (and by extension also avoids redundant
allocations).
2019-10-26 21:19:57 -04:00
Lioncash
e7b0470f55
CCharLayoutInfo: Use heterogenous lookup with std::map
...
Allows using std::string_view with std::map without the need to
construct a completely new std::string instance. Making the lookups via
GetSegIdFromString() completely non-allocating.
Notably, this also allows it to properly function with
non-null-terminated string_view instances.
2019-10-26 21:17:49 -04:00
Phillip Stephens
0042e44521
Merge pull request #116 from lioncash/name
...
CParticleGenInfo: Use slightly more full names for parameters where applicable
2019-10-26 17:51:57 -07:00
Phillip Stephens
83c0ad1e72
Merge pull request #114 from lioncash/model
...
CModel: Implement CModelFlags' operator!= in terms of operator==
2019-10-26 17:51:40 -07:00
Phillip Stephens
5865552d7f
Merge pull request #113 from lioncash/artifact
...
CArtifactDoll: Minor changes
2019-10-26 17:51:30 -07:00
Lioncash
bbdfe3d962
CParticleGenInfo: Provide slightly more full names for parameters where applicable
...
Makes Intellisense and any function highlighting systems a little more
informative.
2019-10-26 20:37:35 -04:00
Lioncash
a82dd4f11f
CParticleGenInfo: Name bool parameter for SetParticleEmission
...
Allows the parameter name to be visible in code completion and
highlighting.
2019-10-26 20:32:44 -04:00
Lioncash
8f28786048
CModel: Implement CModelFlags' operator!= in terms of operator==
...
Same behavior, less code.
2019-10-26 14:58:38 -04:00
Lioncash
c4ad797953
CArtifactDoll: Collapse loop into std::all_of
...
Same thing, but directly stores to a variable.
2019-10-26 14:57:21 -04:00
Lioncash
7a8edc8d5e
CArtifactDoll: Make use of std::array where applicable
2019-10-26 14:57:21 -04:00
Lioncash
26b24d604a
CArtifactDoll: Make use of an anonymous namespace
...
Provides a unified section to place internally linked data.
2019-10-26 14:57:21 -04:00
Lioncash
bea9c5bb74
CArtifactDoll: Organize cpp includes
2019-10-26 14:57:17 -04:00
Phillip Stephens
5efd827e99
Merge pull request #115 from lioncash/const
...
CAnimData: Remove usage of const_cast within Touch()
2019-10-24 22:47:14 -07:00
Phillip Stephens
246e233dce
Cleanup CPathFindArea
2019-10-24 22:44:37 -07:00
Lioncash
eae1a1d06d
CAnimData: Remove usage of const_cast within Touch()
...
We can just call the function normally without the need for a
const_cast.
2019-10-23 20:44:19 -04:00
Phillip Stephens
18382e5bb6
Merge pull request #112 from lioncash/emplace
...
rstl: Return reference to emplaced element in emplace_back()
2019-10-20 18:33:06 -07:00
Lioncash
18f64dac8d
rstl: Amend unrelated clang-format discrepancies
...
Avoids others being hit by these if any changes in the header ever need
to be made in the future.
2019-10-19 02:06:33 -04:00
Lioncash
15e856404d
rstl: Return reference to emplaced element in emplace_back()
...
Follows the behavior of the C++17 variant of emplace_back, which returns
a reference to the emplaced element.
This allows eliminating cases like:
container.emplace_back(some, things, arguments);
container.back().blah();
... // subsequent modifications to the element
given we can just retrieve the reference from the emplace_back call.
2019-10-19 02:05:09 -04:00
Lioncash
26a9ceab60
CGunWeapon: Eliminate const_cast usages in DrawMuzzleFx()
...
We can just make the temporary variable non-const to eliminate the need
for const_casts.
2019-10-19 01:11:19 -04:00
Lioncash
271ee6d8c3
CGunWeapon: Make use of algorithms where applicable
...
We can leverage these to also eliminate some hardcoded sizes.
2019-10-19 01:11:05 -04:00
Lioncash
c228baf5f7
CGunWeapon: Make use of std::array where applicable
...
Makes the arrays strongly typed and also allows us to dehardcode some
loop boundary constants.
2019-10-19 01:07:01 -04:00
Lioncash
c36e6a85b9
CGunWeapon: Organize cpp includes
...
Makes the source file consistent with the header.
2019-10-19 00:03:38 -04:00
Phillip Stephens
6a3eba0091
Merge pull request #103 from lioncash/unique
...
CParticleDataFactory: Use unique_ptr where applicable
2019-10-18 01:01:40 -07:00
Phillip Stephens
c63ee167da
Merge pull request #110 from lioncash/override
...
MkCastTo: Use override where applicable
2019-10-18 01:00:31 -07:00
Lioncash
853df176ed
MkCastTo: Use override where applicable
...
Generates the derived classes with the override specifier to prevent
warnings.
2019-10-17 22:15:25 -04:00
Lioncash
3a0daa3ab9
CLogBookScreen: Use forward declarations where applicable
...
Allows for avoiding the over exposing of types through the header when
included in other translation units or headers.
2019-10-15 10:25:43 -04:00
Lioncash
5b8f3f6693
CLogBookScreen: Organize cpp includes
...
Tidies them up to be consistent with its header.
2019-10-15 10:13:30 -04:00
Lioncash
4db0e49851
CLogBookScreen: Invert conditional within UpdateBodyText()
...
Allows unindenting the contained code by one level.
2019-10-15 10:05:53 -04:00
Lioncash
b93f7a4ceb
CLogBookScreen: Use std::u16string's append() member instead of operator+
...
Appends to the existing buffer instead of constructing a superfluous
temporary.
2019-10-15 10:03:54 -04:00
Lioncash
d64824d3e5
CLogBookScreen: Make use of std::any_of within IsScanCategoryReady()
...
Same thing but collapses into a single return.
2019-10-15 10:00:15 -04:00
Lioncash
251a2a7723
CLogBookScreen: Make use of structured bindings where applicable
...
Allows decomposing long pair names into their constituent elements
2019-10-15 09:57:24 -04:00
Lioncash
f21ee0786a
CLogBookScreen: Make signed/unsigned/FP conversions explicit
...
Silences warnings relating to signed/unsigned comparisons and
conversions to floating-point types.
2019-10-15 09:36:10 -04:00
Lioncash
3951a07bfa
CLogBookScreen: Dehardcode constants where applicable
...
We can just query the containers for the iteration value
2019-10-15 09:16:13 -04:00
Lioncash
4b78d51a85
CLogBookScreen: Use emplace_back where applicable
...
Allows simplifying code and constructing elements in place instead of
copying them (which is what would occur with the defautl move
constructor).
2019-10-15 07:22:01 -04:00
Phillip Stephens
76f90569ca
Merge pull request #108 from lioncash/case
...
CAutoMapper: Collapse case statements in ProcessMapZoomInput()
2019-10-13 13:12:20 -07:00
Lioncash
040c724a8a
CAutoMapper: Collapse case statements in ProcessMapZoomInput()
...
Same behavior as the game executable, but without the code duplication.
2019-10-12 13:57:01 -04:00
Phillip Stephens
668f8da97d
Merge pull request #106 from lioncash/find
...
CCollisionPrimitive: Simplify the InitAdd* member functions
2019-10-12 07:29:13 -07:00
Phillip Stephens
6996ebfbec
Merge pull request #105 from lioncash/collision
...
CCollisionPrimitive: Minor cleanup
2019-10-12 07:29:04 -07:00
Phillip Stephens
aa956fff55
Merge pull request #104 from lioncash/cuv
...
CUVElement: Provide initial value for cv in GetValueUV()
2019-10-12 07:28:54 -07:00
Lioncash
21c1ed2940
CBallCamera: Use bool instead of float for holding boolean value
...
Using a float is very suspect and also more expensive in terms of
code-gen to access and modify the variable.
2019-10-12 02:25:24 -04:00
Lioncash
5f4aba60e1
CCollisionPrimitive: Simplify the InitAdd* member functions
...
We can extract the duplicated behavior out into its own member function
and then reuse it in order to deduplicate repeated behavior.
This allows simplifying the member functions in a manner that allows
declaring most of the variables const. The lack of mutable behavior
within these functions makes it much nicer to read.
2019-10-12 00:27:18 -04:00
Lioncash
d2a44dbc0b
CollidableAABox: Default destructor
...
Same behavior, but remains consistent with the rest of the codebase.
2019-10-11 22:53:01 -04:00
Lioncash
da4a33f01a
CCollisionPrimitive: Default virtual destructor
...
Same behavior, but more consistent with the existing interface, given
a constructor is defaulted.
2019-10-11 22:39:58 -04:00
Lioncash
9cbe8ba885
CCollisionPrimitive: Use using for type aliases where applicable
...
Same behavior, better readability.
2019-10-11 22:36:57 -04:00
Lioncash
af7d8e9095
CUVElement: Provide initial value for cv in GetValueUV()
...
The game executable itself sets this variable to an initial value of 1
prior to calling cycleFrames' GetValue() member function.
2019-10-11 17:05:26 -04:00
Lioncash
35fb0e4911
CUVElement: Use const where applicable
...
While we're at it, we can also make conversions to float explicit.
2019-10-11 17:05:23 -04:00
Lioncash
7430b70b73
CParticleDataFactory: Use unique_ptr where applicable
...
Same behavior, but makes the functions a little safer in terms of memory
management.
2019-10-11 15:16:13 -04:00
Lioncash
8b58cdc268
CIntElement: Add class to handle RTOI int elements
...
Within the int element handling code, there seems to be a missing
implementation (with the FourCC 'RTOI'), which seems to take two 32-bit
floating point values, multiplies them, then converts the result to a 32-bit
integer.
2019-10-06 08:52:41 -04:00
Phillip Stephens
5f0f3ea45c
More tweak CVars
2019-10-05 07:07:13 -07:00
Lioncash
ff940612bc
CIntElement: Make use of std::clamp within CIEClamp's overrides
...
Same behavior, less code.
2019-10-04 19:51:38 -04:00
Lioncash
3407a59ad7
CIntElement: Simplify CIEKeyframeEmitter's GetMaxValue()
...
We can just use std::max_element here to collapse the loop into an
assignment.
2019-10-04 19:46:36 -04:00
Lioncash
af0c2c41e3
CIntElement: Organize cpp includes
2019-10-04 19:38:31 -04:00
Lioncash
83873b580e
CIntElement: Join variable declarations with assignments where applicable
2019-10-04 19:38:26 -04:00
Lioncash
d4b9124b9f
rstl: Allow move constructors and assignment operators to be conditionally noexcept
...
Makes the constructors and assignment operators for reserved_vector
noexcept, allowing them to play nicely with standard facilities and
avoid needing to copy construct where avoidable.
2019-10-04 01:28:27 -04:00
Lioncash
b2d9283b3c
rstl: Provide full set of type aliases in reserved_vector
...
Allows for better integration with standard library facilities and
templates, now that types can be queried.
2019-10-04 00:43:47 -04:00
Lioncash
00a4df5aa6
rstl: Make use of variable templates where applicable
...
While we're at it, we can use if constexpr on some conditional checks.
2019-10-04 00:20:31 -04:00
Lioncash
cbcba6f184
rstl: Organize headers
...
We can also make includes a little nicer for the compiler by only
including logvisor headers when performing debug builds.
2019-10-04 00:08:46 -04:00
Phillip Stephens
b9b9eddd1e
Merge pull request #99 from lioncash/typo
...
CElementGen: Correct FourCC in SetTranslation()
2019-10-03 07:01:31 -07:00
Lioncash
66b198d1a4
CElementGen: Correct FourCC in SetTranslation()
...
The game executable checks for a FourCC of ELSC within this function,
not SELC.
2019-10-03 09:45:26 -04:00
Lioncash
67cd0d44c6
CAtomicBeta: Make skBombLocators an internal array
...
Like with CAtomicAlpha, we can also fully hide this array from external
view by making it internally linked.
2019-10-03 01:34:45 -04:00
Lioncash
abe8b9510b
CAtomicBeta: Organize cpp includes
2019-10-03 01:30:04 -04:00
Lioncash
e0e38b569e
CAtomicAlpha: Remove .data() call in SBomb constructor
...
We can just use the std::string_view constructor for std::string, which
eliminates an unnecessary strlen call.
2019-10-03 01:26:50 -04:00
Lioncash
18eb2b73b1
CAtomicAlpha: Use emplace_back where applicable
...
Simplifies the construction of the SBomb instances, while also
constructing in place.
2019-10-03 01:26:50 -04:00
Lioncash
c882003d37
CAtomicAlpha: Make skBombLocators an internal array
...
This is only used within the cpp file, so we can relocate its definition
there to make it fully internally-linked.
2019-10-03 01:26:50 -04:00
Lioncash
ee791d6a37
CAtomicAlpha: Organize cpp includes
2019-10-03 01:26:42 -04:00
Lioncash
44306ab528
CAutoMapper: Eliminate cases of variable shadowing
...
Silences two variable shadowing warnings.
2019-10-01 22:43:23 -04:00
Lioncash
3383e65761
CAutoMapper: Use size_t instead of u32 as loop variable type where applicable
...
Uses the same sized type as the .size() call to prevent potential
overflow false-positives.
2019-10-01 22:40:13 -04:00
Lioncash
eca34bede5
CAutoMapper: Use emplace_back where applicable
...
Allows for in-place construction.
2019-10-01 22:37:52 -04:00
Lioncash
23ca919c18
CAutoMapper: Use std::array where applicable
2019-10-01 22:31:07 -04:00
Lioncash
a5d18002be
CAutoMapper: Organize cpp includes
2019-10-01 22:12:15 -04:00
Phillip Stephens
b38ba6b636
Revert static_cast in MkCastTo.py
2019-10-01 07:27:20 -07:00
Phillip Stephens
df9b8bc05d
Merge pull request #90 from lioncash/noexcept
...
RetroTypes: Make functions noexcept where applicable
2019-10-01 06:44:39 -07:00
Phillip Stephens
60ecede3fd
Merge pull request #91 from lioncash/string
...
CAudioSys: Minor cleanup
2019-10-01 06:44:26 -07:00
Phillip Stephens
be2da2f363
Merge pull request #92 from lioncash/fwd
...
ICollisionFilter: Use forward declarations where applicable
2019-10-01 06:44:08 -07:00
Phillip Stephens
7d2ad7b1b2
Merge pull request #93 from lioncash/loop
...
CSlideShow: Use ranged for loops in constructor
2019-10-01 06:43:56 -07:00
Phillip Stephens
6bcdf98eeb
Merge pull request #94 from lioncash/default
...
CIOWin: Default the virtual destructor
2019-10-01 06:43:45 -07:00
Phillip Stephens
4d94923a23
Merge pull request #95 from lioncash/gen
...
MkCastTo: Use '_v' variants of type traits where applicable
2019-10-01 06:43:33 -07:00
Phillip Stephens
d2e9495686
Merge pull request #96 from lioncash/array2
...
CFinalInput, ControlMapper: Use std::array where applicable
2019-10-01 06:43:23 -07:00
Phillip Stephens
d5277b4d91
Remove invalid include
2019-10-01 06:41:55 -07:00
Jack Andersen
e1d46755a3
Merge branch 'master' of ssh://git.axiodl.com:6431/AxioDL/urde
2019-09-30 21:41:42 -10:00
Jack Andersen
16ca0d24c2
Explicit Asset ID refactor
2019-09-30 21:38:03 -10:00
Lioncash
f0186e7ceb
ControlMapper: Use std::array where applicable
2019-10-01 02:11:02 -04:00
Lioncash
dc565969e6
CFinalInput: Use std::array where applicable
...
Allows simplifying copies and gets rid of hardcoded size values.
2019-10-01 01:59:56 -04:00
Lioncash
91bdfa86f6
MkCastTo: Use static_cast instead of reinterpret_cast
...
If the type is convertible to the other one, then a static_cast will be
able to perform the conversion (assuming the type itself is
constructible). If it isn't, then nullptr will just be converted to a
null version of T*.
2019-09-30 22:22:12 -04:00
Lioncash
bf65456a2c
MkCastTo: Use '_v' variants of type traits where applicable
...
Same thing, but less typing, slightly shrinking the file size.
2019-09-30 22:15:53 -04:00
Lioncash
99a7e64a8a
CIOWin: Default the virtual destructor
...
No functional change. Just maintains consistency with the rest of the
codebase.
2019-09-30 18:20:11 -04:00
Lioncash
2eb5e7c446
CSlideShow: Use emplace_back where applicable
...
Same behavior, but constructs in place instead of potentially copying.
2019-09-30 18:07:34 -04:00
Lioncash
b7e0dbd354
CSlideShow: Use ranged for loops in constructor
...
Same behavior, but without hard-coded magic size values.
2019-09-30 18:06:33 -04:00
Lioncash
4442421586
ICollisionFilter: Use forward declarations where applicable
...
With the headers all normalized, we can safely convert the only
ICollisionFilter include into a forward declaration.
2019-09-30 17:20:59 -04:00
Lioncash
9af64d3895
CAudioSys: Convert file-scope std::string into a constexpr string_view.
...
Eliminates a static constructor that needs to run at program start.
2019-09-30 11:03:47 -04:00
Lioncash
dea89e7664
CAudioSys: Remove construction of pairs in emplace calls
...
The purpose of emplace is to construct the pair within the map. While
using make_pair will result in the same behavior, it's a tad more
verbose than it needs to be.
2019-09-30 11:00:49 -04:00
Lioncash
f1d08c4fbf
CAudioSys: Place file-scope locals within an anonymous namespace
...
Prevents any potential violations of the ODR from occuring.
2019-09-30 10:59:31 -04:00
Lioncash
c77153b03c
RetroTypes: Make SObjectTag's operator bool explicit
...
Prevents potentially error-prone implicit conversions to bool.
2019-09-30 09:00:17 -04:00
Lioncash
8176bf75ef
RetroTypes: Make functions noexcept where applicable
...
Given these are used quite frequently, it's better to explicitly mark
these as noexcept so that they may be used within noexcept contexts.
2019-09-30 08:58:34 -04:00
Lioncash
c17b268c57
IVParamObj: Make default constructor of CVParamTransfer constexpr
...
std::shared_ptr's default constructor is constexpr, so we can apply it
to CVParamTransfer to allow using it within constexpr contexts, granting
more flexibility to the type.
2019-09-30 02:56:00 -04:00
Lioncash
cdf6361d6c
IVParamObj: Make rest of interface noexcept where applicable
...
Allows a few of these member functions to be used within noexcept
contexts.
2019-09-30 02:55:39 -04:00
Lioncash
026de44611
IVParamObj: Explicitly supply copy and move constructor/assingnment operators
...
Since the copy constructor is provided, we should explicitly specify the
others to make behavior explicit (and prevent the copy constructor from
being considered over the move constructor in certain scenarios).
2019-09-30 02:55:25 -04:00
Lioncash
541adb02d2
CToken: std::move buildParams within CObjectReference's constructor
...
CVParamTransfer contains a std::shared_ptr, so a copy here performs an
unnecessary reference count increment and decrement. We can std::move
here to avoid this.
2019-09-30 02:34:10 -04:00
Lioncash
2014650d58
CToken: Mark CToken's move constructor noexcept
...
The move constructor doesn't perform any behavior that would result in
an exception being thrown. Marking it as noexcept allows the type to
play nicely with facilities that make use of std::is_move_constructible
to determine whether copies can be avoided or not in certain
circumstances (e.g. the standard library; notably, std::vector).
We can't mark the move assignment operator as noexcept currently,
however, as it calls into interfaces outside of CToken.
2019-09-30 02:32:29 -04:00
Phillip Stephens
79ac5d76df
Update hecl, more CVar imps
2019-09-29 08:17:55 -07:00
Lioncash
6ad5de497f
CSeedling: Make skNeedleLocators an array of std::string_view
...
Makes the strings non-allocating. This also eliminates 12 runtime static
constructors that need to execute on program start.
2019-09-28 20:22:31 -04:00
Lioncash
3f743d5c9f
CSeedling: Use std::array with skNeedleLocators
...
Makes the array strongly-typed and impervious to implicit array to
pointer decay.
2019-09-28 20:21:24 -04:00
Lioncash
2a34b6be68
CSeedling: Move skNeedleLocators into the cpp file
...
This can be entirely hidden from external view, making it an
implementation detail.
2019-09-28 20:15:39 -04:00
Lioncash
08d4addc70
CSeedling: Organize source file includes
...
Tidies it up a little.
2019-09-28 20:08:45 -04:00
Phillip Stephens
00cff89141
Merge pull request #86 from lioncash/header
...
General: Normalize RuntimeCommon include paths
2019-09-28 08:02:35 -07:00
Phillip Stephens
b60ad339d5
Fix CStringExtras::CompareCaseInsensitive, `std::lexicographical_compare` does not have the intended behavior
2019-09-28 08:00:49 -07:00
Lioncash
a633b8e8fd
General: Normalize RuntimeCommon include paths
...
Performs the same normalizing done to the RuntimeCommonB target, now all
of the runtime headers have normalized include paths.
2019-09-28 04:14:29 -04:00
Lioncash
359f505787
CCameraManager: Collapse private static variables into functions
...
Four of the five variables aren't modified, so they can be specified
directly within the functions and just be reused in place of the
variable names. This allows the constants to be elided or put into
read-only memory if necessary. It also makes the mutable value explicit.
2019-09-27 22:46:59 -04:00
Phillip Stephens
3a8d669b68
Merge pull request #84 from lioncash/emplace
...
CBooRenderer: Use emplace_back() where applicable
2019-09-26 06:54:57 -07:00
Phillip Stephens
a914d5499a
Merge pull request #83 from lioncash/driver
...
CMemoryCardDriver: Correct erroneous fallthrough within HandleCardError
2019-09-26 06:54:46 -07:00
Lioncash
178e0e2cbc
CBooRenderer: Use emplace_back() where applicable
...
Given the appended types consist of trivial types, it's more efficient
in this context to construct the data in place over using push_back,
which will cause a redundant copy (move semantics on trivial types are a
copy).
2019-09-24 22:51:38 -04:00
Lioncash
027c10464f
CMemoryCardDriver: Correct erroneous fallthrough within HandleCardError()
...
In the game executable itself, there exists no fallthrough here (which
makes sense, given all IO errors would be reported as character set
errors, otherwise).
2019-09-24 16:36:43 -04:00