Commit Graph

3238 Commits

Author SHA1 Message Date
Luke S be51b0323f
Merge pull request #169 from lioncash/array
ITweakPlayerRes: Make use of std::array where applicable
2020-02-28 10:35:57 -05:00
Luke S 1cfe88fab1
Merge pull request #168 from lioncash/bind
SpecBase: Remove redundant std::bind
2020-02-28 10:35:30 -05:00
Luke S c8809f0ed3
Merge pull request #167 from lioncash/flatten
SpecBase: Flatten loop within flattenDependenciesBlend()
2020-02-28 10:35:15 -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
Lioncash 3f3b0e6ba8 ITweakPlayerRes: Make use of std::array where applicable
Performs the same changes that were recently applied to ITweakGunRes for
consistency. Also eliminates some sign conversion warnings and
deduplicates some array sizes.
2020-02-28 01:50:32 -05:00
Lioncash be4252127b SpecBase: Remove redundant std::bind
std::thread can already execute the supplied function as is without the
assistance of std::bind.
2020-02-28 01:25:14 -05:00
Lioncash fc3ef2fddd SpecBase: Flatten loop within flattenDependenciesBlend()
We can use insert() with make_move_iterator() to perform the same
behavior, minus unnecessary copies.

While we're at it, we can collapse the code within the Area case, since
it's the exact same as the Mesh code.
2020-02-26 14:52:20 -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
Luke S e192a44ed7
Merge pull request #164 from lioncash/midi
CMidiManager: std::move sequencer within SetAudioSysHandle()
2020-02-26 13:17:08 -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
Lioncash b608a72aad ITweakGunRes: Remove unnecessary c_str() calls
These functions already return the data type that GetResourceIdByName()
expects. Has the side-effect of also eliminating unnecessary strlen
calls.
2020-02-25 15:34:22 -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 S c098169e90
Merge pull request #160 from lioncash/mismatch
ITweakPlayerRes: Fix mismatched icon retrievals within ResolveResources()
2020-02-25 14:19:13 -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
Luke Street 051a547c42 Update hecl/extern/boo (MSAN fix) 2020-02-25 02:33:49 -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
Lioncash a92bc16265 ITweakPlayerRes: Remove unnecessary calls to .data()
All of these functions return a string_view, which is accepted by
GetResourceIdByName(), so this avoids several unnecessary std::strlen
calls.
2020-02-25 02:09:45 -05:00
Lioncash 189b03c001 ITweakPlayerRes: Fix mismatched icon retrievals within ResolveResources()
Previously, all of these icons were using the first top icon, rather
than their own respective icons.

This amends that.
2020-02-25 02:07:15 -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 a194e71fac
Merge pull request #158 from lioncash/file-static
DNAMP1/ScriptObjects: Remove ~127 runtime static constructors and relevant heap allocations
2020-02-24 13:41:11 -05:00
Lioncash 5ff100fdd1 DNAMP1/ScriptObjects: Convert SCRIPT_OBJECT_DB into a std::array
Now that all elements of the std::vector would otherwise be constexpr,
we can use a std::array here instead, given they're all able to
deterministically be available at compile-time.

This gets rid of a runtime static heap allocation at program start.
2020-02-24 03:42:24 -05:00
Lioncash 2ec236fc45 DNAMP1/ScriptObjects: Trim headers in ScriptObjects.hpp
All of these can be migrated into the cpp file, since they're only used
there.

Greatly reduces the amount of work the preprocessor has to do in files
that include this one.
2020-02-24 03:42:05 -05:00
Lioncash e27ac1e2a1 DNAMP1/ScriptObjects: Eliminate several runtime static constructors
All of these entries make use of captureless lambdas, so there's no need
to make use of std::function. We can just use a regular function
pointer, which allows making all of the file-static entries within
IScriptObject constexpr. Eliminating all of their runtime static
constructors.
2020-02-24 03:20:39 -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