2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-07-07 21:25:53 +00:00

6788 Commits

Author SHA1 Message Date
Lioncash
92b87676c2 hecl/hecl: Make Entry take SystemString by value and move it
This allows callers to move into the constructor and subsequently move
into the member variable, avoiding copies altogether.
2019-08-15 02:26:12 -04:00
Lioncash
dae3e6123f hecl/hecl: Make string conv operator+ instances friend functions
Makes both operators symmetrical to one another.
2019-08-15 02:26:12 -04:00
Lioncash
c7aae83a75 hecl/hecl: Slightly improve resource usage within string conv operator+ funcs
We already construct a std::string instance, so we can just append to
it instead of creating another temporary with std::string's operator+.
We also change this to append using the string view getter functions, as
this allows the appending process to do less work. When a pointer is
passed in, a strlen call would need to be performed in order to
determine the total characters to append. However, we already know the
size (via the string view).
2019-08-15 02:26:12 -04:00
Lioncash
c513a4b61f hecl/hecl: Make use of std::char_traits with StrNCmp
Same behavior, but allows removing the use of ifdefs, unifying the code
paths.
2019-08-15 02:26:12 -04:00
Lioncash
ef6b41ea15 hecl/hecl: Amend string functions operating on string views to use interface functions
We don't really need to call out to the C functions to perform the
comparison behavior when the views already have a comparison function
as part of their interface.
2019-08-15 02:26:03 -04:00
Lioncash
e0b5a4e2f7 hecl/hecl: Cast to unsigned char before calling std::isspace
std::string_view instances can contain character values that lie outside
the range of an unsigned char (negative values). If such a value is
passed into std::isspace, then the behavior of the function is
undefined. To avoid this, we add these casts.
2019-08-15 01:21:10 -04:00
Lioncash
91ff474c44 hecl/hecl: Handle bounded strings within CaseInsensitiveCompare
std::string_view instances aren't guaranteed to be null-terminated, so
we shouldn't be treating them as if they are in these functions, and
should instead use a bounded comparison based off their sizes.

This way we prevent an edge-case from ever becoming a problem and also
remove an ifdef, making the code uniform across all implementations.
2019-08-15 01:21:04 -04:00
Lioncash
11098374a4 RetroDataSpec: Use fmt::print where applicable
Replaces uses of fprintf with fmt::print where applicable. For trivial
character insertion, we can make use of fputc instead of fprintf.
2019-08-14 22:44:49 -04:00
Lioncash
2517fac404 RetroDataSpec: Make member functions const where applicable
Marks member functions that don't modify instance state as const.
2019-08-14 22:25:15 -04:00
fa7785d024 Fix GetAreaFog 2019-08-14 12:56:46 -07:00
ea12a54a41
Merge pull request #42 from lioncash/const
Runtime: Make const/non-const getters have the same name
2019-08-14 12:47:52 -07: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
6760f78568 Update jbus 2019-08-14 07:12:09 -07:00
5980d11df0 Update submodules 2019-08-14 06:52:46 -07:00
9dc1373201 Update boo 2019-08-14 06:52:24 -07:00
2ace76e3d2
Merge pull request #41 from lioncash/const
RuntimeCommon: Use const on member functions where applicable
2019-08-14 06:36:27 -07:00
bab78f96a5
Merge pull request #40 from lioncash/constexpr
RetroTypes: Make types constexpr where applicable
2019-08-14 06:36:16 -07:00
64489c7461
Merge pull request #39 from lioncash/bind
MP1: Migrate from std::bind to lambdas
2019-08-14 06:36:06 -07:00
Lioncash
d3d629d405 RuntimeCommon: Use const on member functions where applicable
Adds missing const qualifiers on class member functions that don't
modify instance state.
2019-08-14 09:25:39 -04:00
Lioncash
1f8ed5af25 RetroTypes: Make types constexpr where applicable
These are generally used as basic tags and ID types, so these can have a
constexpr interface. This is particularly beneficial, given some of
these types are used in file-static lookup tables.

Without being constexpr, these type's constructors in that case are
technically runtime static constructors. While most compilers will
initialize the type at compile-time, this would be dependent on the
optimizer. By marking them constexpr, we allow it outright. It also
allows those arrays to be made constexpr as well.
2019-08-14 05:20:43 -04:00
Lioncash
8b7945e76f MP1: Migrate from std::bind to lambdas
Provides a more straightforward means of supplying custom behavior in
place. Lambdas also typically optimize better compared to std::bind
objects.
2019-08-14 04:55:21 -04:00
bade450431
Merge pull request #37 from lioncash/conversion
Runtime/Input/CFinalInput: Correct return value of AKey, ASpecialKey and AMouseButton
2019-08-14 01:05:05 -07:00
38ac9c12ba
Merge pull request #38 from lioncash/options
Runtime/CGameOptions: Use std::array where applicable
2019-08-14 01:04:26 -07:00
Lioncash
acb9ac92e7 Runtime/CGameOptions: Use std::array where applicable
Makes the data a little more strongly typed; preventing implicit
array->pointer decay. It also allows simplifying assignments within the
CGameState code.

While we're at it, we can also eliminate several instances of magic
numbers related to the array sizes throughout the code.
2019-08-14 03:24:00 -04:00
Lioncash
27a8274e3b Runtime/Input/CFinalInput: Make comparison operators const
While we're at it, we can also provide an inequality operator for
logical symmetry.
2019-08-14 02:11:50 -04:00
Lioncash
e9e9de26b2 Runtime/Input/CFinalInput: Correct return value of AKey, ASpecialKey and AMouseButton
The other A-prefixed functions all return a float value, however these
are truncating float values to bool. We can amend this to prevent
potential compilation warnings.
2019-08-14 02:07:02 -04:00
cf294db9eb
Merge pull request #36 from lioncash/virt-func
Runtime/Weapon/CGameProjectile: Fix misnamed virtual function
2019-08-13 23:03:40 -07:00
Lioncash
09f917a9aa Runtime/Weapon/CGameProjectile: Fix misnamed virtual function
This has a vaguely equivalent name to FluidFXThink (which has an
uppercase X). Given this function isn't explicitly called anywhere
directly, this is assumed to be a typo.
2019-08-14 02:00:09 -04:00
7eb3bce499 Update submodules, more CMetroidBeta imps 2019-08-13 14:41:15 -07:00
78e88679a9 Update boo 2019-08-13 14:40:21 -07:00
ebdcfb6b51 Initial CMetroidBeta imps 2019-08-11 08:14:52 -07:00
380e44148f Fix missed conflict 2019-08-10 20:28:19 -07:00
21266982ac Merge branch 'master' of ssh+git://git.axiodl.com:6431/AxioDL/urde 2019-08-10 20:03:14 -07:00
a572100176 Add CRipper files 2019-08-10 20:02:54 -07:00
9905496a79 Update specter 2019-08-10 19:59:29 -07:00
5307ab4107 Merge pull request #2 from lioncash/override
General: Use override where applicable
2019-08-10 19:58:47 -07:00
ee1d595655
Merge pull request #34 from lioncash/override
Editor: Use override where applicable
2019-08-10 19:57:30 -07:00
Lioncash
d336e1fc00 Editor: Use override where applicable
Continues the override modernization with the Editor code.
2019-08-10 22:18:35 -04:00
edebe93e6d
Merge pull request #35 from lioncash/goto
Editor/ProjectManager: Remove use of goto
2019-08-10 17:51:21 -07:00
ad5e395a51 Fixes for override modernization 2019-08-10 17:49:41 -07:00
a7c97b313c Update athena 2019-08-10 17:47:40 -07:00
Lioncash
a18c188f70 General: Use override where applicable
Continues the override modernizations, this time, addressing the specter
target.
2019-08-10 06:31:33 -04:00
Lioncash
a65b32892e Editor/ProjectManager: Make use of std::make_unique
Same thing with a more straightforward syntax.
2019-08-10 05:52:09 -04:00
Lioncash
43e808ff17 Editor/ProjectManager: Remove pointer cast in GetObj()
Pointer casting like this is technically undefined behavior, we can just
use a lambda and forward the arguments over to the athena read handler.
2019-08-10 05:40:52 -04:00
Lioncash
df663359c7 Editor/ProjectManager: Remove use of goto
We can wrap the behavior into a lambda function and then call it where
necessary, removing the need for goto (and allowing non-trivial types in
the codepath).
2019-08-10 05:32:31 -04:00
9d5b21fd63 Merge branch 'lioncash-override' 2019-08-09 23:02:52 -07:00
Lioncash
a5a2516138 RetroDataSpec: Use override where applicable
Continues the override modernizations, applying the keyword where
applicable to the RetroDataSpec target.
2019-08-10 00:24:30 -04:00
1e625e0995 Fix missed override declarations 2019-08-09 15:07:52 -07:00
1d3e5cdb70 Implement Oculus loader 2019-08-09 14:55:59 -07:00
Lioncash
9312eef905 RuntimeCommon: Use override where applicable
Continues the override modernization by applying it to the main
RuntimeCommon target. Resolves around 1100+ cases where override can be
used.
2019-08-09 17:39:42 -04:00