2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-05-13 21:11:21 +00:00

35 Commits

Author SHA1 Message Date
Lioncash
5d209c8dc8 General: Mark a handful of deduced const variables as const explicitly
Same behavior, but makes it explicit to the reader that these are const.

Prevents cases where the reader might assume that just because the
variable isn't const qualified that it must be mutable, when it actually
isn't.
2020-05-08 18:41:29 -04:00
Lioncash
bea6709cc4 CScriptGunTurret: Brace conditionals where applicable 2020-05-07 13:25:29 -04:00
Lioncash
554893ef85 RuntimeCommonB: Make use of bitfield initializers where applicable
Given that we now target C++20, we can make use of bitfield initializers
where applicable.
2020-04-20 15:57:25 -04:00
Jack Andersen
5b4441ac36 Update fmtlib 2020-04-11 12:51:39 -10:00
e23c3d3705 Runtime: Wrap fmt::print calls in #ifndef NDEBUG 2020-04-11 02:25:41 -04:00
bb7e94f304 Runtime/World: Replace bitfield unions with constructor initializers 2020-04-11 01:50:10 -04:00
Lioncash
bfd17e4513 CActor: Make Render() a non-const function
A few implementations of Render() contain const-casts nested within its
their call hierarchy to get around the fact that this function is marked
const. We can just make the member function non-const to allow removal
of these casts in follow up changes.
2020-04-09 14:32:20 -04:00
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
366d6b96ee
Merge pull request #178 from lioncash/data
CScriptGunTurret: Remove unnecessary data() call in AcceptScriptMsg()
2020-03-03 16:43:43 -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
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
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
adf9610138 CBurstFire: Tidy up includes
Includes all necessary headers and uses a forward declaration where
applicable. Ensures inclusion changes in other headers don't break the compilation
of these headers and source files.
2019-09-22 09:45:01 -04:00
68e2fad74f
Fix TCastTo.hpp inclusions, add comment to warn against modifying include path 2019-09-21 06:07:13 -07:00
Lioncash
f9079f0215 Runtime: Make use of std::make_unique where applicable
Makes use of the C++14 make_unique allocation function to allocate class
instances where applicable instead of a reset with a new operator within
it.

This doesn't touch cases where buffers are allocated, given make_unique
would zero-initialize them.
2019-09-12 04:09:48 -04:00
Lioncash
afab3e0327 Runtime: Make const/non-const getters have the same name
Makes for a more consistent interface, as getters won't have different
names to remember based off whether or not they're const qualified.
2019-08-14 12:45:57 -04:00
Jack Andersen
7a3da1f7a6 Massive fmtlib refactor 2019-07-19 18:27:21 -10:00
Jack Andersen
e218b8aeb5 CActorContraption fixes, better CMake dependency handling 2019-06-11 16:05:17 -10:00
Jack Andersen
99b1a8ef49 Lots of bug fixes 2019-03-12 17:46:20 -10:00
Jack Andersen
8df0a4913c zeus constexpr refactor and thermal visor fixes 2019-02-23 21:15:54 -10:00
Jack Andersen
48eaa2545b Working CScriptGunTurret 2019-02-17 19:47:46 -10:00
Jack Andersen
ad2681f857 Windows fixes 2019-01-28 22:28:35 -10:00
Jack Andersen
ec1cb75b25 Finish CSpacePirate implementation 2018-12-12 21:39:16 -10:00
Jack Andersen
636c82a568 New code style refactor 2018-12-07 19:30:43 -10:00
Jack Andersen
7c7da6671a SIMD refactor 2018-12-07 15:49:15 -10:00
Jack Andersen
9c88971df6 Initial CSpacePirate and rag doll imps 2018-11-23 22:09:35 -10:00
ea4848196a Implement CNewIntroBoss 2018-11-16 21:05:57 -08:00
Jack Andersen
660e7cd239 Work on CParasite 2018-11-12 23:20:11 -10:00
89ece2e9b2 Proper CRandom16 usage
More CScriptGunTurret imps
2018-11-09 18:48:06 -08:00
dd30f51761 Initial CScriptGun implementation, more loaders 2018-10-27 17:20:30 -07:00
cb2b9fa8bd Initial CScriptGunTurret Implementation 2018-06-04 12:15:35 -07:00
3bc1fc1160 Various area streaming fixes, implement missing object loaders 2018-05-07 19:19:09 -07:00
Jack Andersen
11d17d0fe5 Various bug fixes 2017-11-25 17:04:25 -10:00
d1b55e23db TCastToPtr adjustments 2017-01-18 14:30:02 -08:00