Commit Graph

88 Commits

Author SHA1 Message Date
Phillip Stephens e331c5d5c6
Add Player Transform tools 2021-07-11 17:59:05 -07:00
Luke Street e9008c9e25 Move all submodules to extern 2021-04-06 15:07:45 -04:00
Jack Andersen 6a8714c1f3 Update fmtlib 2020-04-11 12:48:11 -10:00
Lioncash 57fa706311 hecl: Allow Time instances to be constexpr
Some constructors accept primitive values. These can be made constexpr.
2020-04-05 09:35:31 -04:00
Lioncash eebb25a39c hecl/hecl: Allow CaseInsensitiveCompare to be used with heterogenous lookup
It's quite common to see maps or sets that make use of a string->object
association, usually as <std::string, T>. However, this can result in
inefficient code when performing lookups or indexing, as something like:

std::map<std::string, T> some_map;

...

auto iter = some_map.find("Name");

...

will result in a std::string instance being constructed around "Name",
which is less than ideal.

With a heterogenous comparator, however (such as std::less<>), like:

std::map<std::string, T, std::less<>>

we allow the container to do automatic type deduction and comparisons.
This allows types comparable to the key type to be used in find calls,
etc, without actually needing to construct the key type around the other
type.

The main way to enable containers to perform such behavior is by
defining a type named is_transparent within the comparator type.
2020-02-24 04:31:55 -05:00
Jack Andersen 88e68e8aa3 Merge branch 'master' of ssh://git.axiodl.com:6431/AxioDL/hecl 2019-09-30 21:30:17 -10:00
Jack Andersen 8a73a8ee48 Code style improvements 2019-09-30 21:23:35 -10:00
Lioncash 5e66bee28c General: Include necessary includes
Ensures all necessary includes are included and also removes headers
that aren't necessary
2019-09-04 19:23:55 -04:00
Lioncash 4ca9a57540 hecl/hecl: Remove windows ifdef in CaseInsensitiveCompare
This is technically still usable for non-Windows systems, given there's
nothing directly Windows-specific about the operator overload
2019-08-25 21:22:44 -04:00
Phillip Stephens 52f9922820 Merge pull request #18 from lioncash/noexcept
hecl/hecl: noexcept correctness changes
2019-08-24 00:47:45 -07:00
Lioncash 7088235bc4 hecl: Correct fmt formatting specifiers
These should be using {}-style formatting specifiers instead of printf
style. While we're at it, std::move the std::string instances where
applicable to potentially avoid reallocations.
2019-08-24 03:21:16 -04:00
Lioncash a7bd496698 hecl/hecl: Remove pointer casts from Hash constructor interface
The interface accepts const void* as the input type, so there's no need
to explicitly pointer cast the input data.
2019-08-24 02:55:09 -04:00
Lioncash e127fed0fd hecl/hecl: Mark Hash interface as noexcept
These are utilized within some hash implementations, which shouldn't
throw, so these member functions can be marked as noexcept.
2019-08-24 02:52:27 -04:00
Lioncash 09fe937bc3 hecl/hecl: Make hash_combine_impl noexcept
This is used to implement hashes, and since hash implementations
shouldn't throw, these shouldn't as well.
2019-08-24 02:46:47 -04:00
Lioncash f957dd594b hecl/hecl: Mark byte swapping functions as noexcept
These are frequently used within hash implementations, which should be
noexcept by default. Given it doesn't make sense to throw exceptions
from these functions anyways, they can be made noexcept.
2019-08-24 02:46:44 -04:00
Phillip Stephens e691b95cbf Merge pull request #15 from lioncash/file
hecl/hecl: Introduce FopenUnique
2019-08-21 23:16:25 -07:00
Lioncash 7bb3912d39 General: Make operator bool() explicit where applicable
Makes conversions to bool slightly less error-prone by requiring them to
be explicit in non-obvious contexts.
2019-08-22 01:15:38 -04:00
Lioncash 9dcf7e7f08 hecl/hecl: Add smart pointer variant of Fopen
Provides a wrapper API over Fopen in order to prevent resource leaks.
2019-08-21 19:28:14 -04:00
Phillip Stephens 23551de349 Merge pull request #3 from lioncash/str
hecl/hecl: Minor changes and improvements to string utilities
2019-08-15 07:47:17 -07:00
Lioncash 9ec19d99cd hecl/hecl: Make hash constructors explicit where applicable 2019-08-15 03:06:56 -04:00
Lioncash 06548409f8 hecl/hecl: Make Hash constexpr 2019-08-15 03:00:42 -04:00
Lioncash b63d848846 hecl/hecl: Amend lingering formatting inconsistencies
Amends formatting issues that were pre-existing to get them out of the
way.
2019-08-15 02:28:09 -04:00
Lioncash 485782e3a7 hecl/hecl: Convert typedefs to using aliases
Same thing, but slightly nicer to read.
2019-08-15 02:26:12 -04:00
Lioncash eb872cdf88 hecl/hecl: Assign ResourceLock's good member in the initializer list
Same behavior, but more idiomatic. While we're at it, we can make said
constructor and the conversion operator explicit to make the class a
little less error-prone.
2019-08-15 02:26:12 -04:00
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
Jack Andersen 7b05b41d34 Windows build fixes 2019-07-27 15:19:48 -10:00
Jack Andersen 6988f86672 Massive fmtlib refactor 2019-07-19 18:22:58 -10:00
Jack Andersen 387f8fa864 Blender Python API updates and better CMake dependency handling 2019-06-11 16:01:19 -10:00
Jack Andersen 5c59acddf2 Blender 2.8 refactor 2019-05-07 17:47:34 -10:00
Jack Andersen 1f04f7ae12 Add closefrom call to RunProcess 2019-02-26 19:13:19 -10:00
Jack Andersen 72193079ae New code style refactor 2018-12-07 19:18:42 -10:00
Jack Andersen 61a50aa57e Windows sync fixes for API changes 2018-10-14 10:09:15 -10:00
Jack Andersen aef455e1ab Attachment model support in blender addon 2018-10-11 10:48:13 -10:00
Jack Andersen d1f0450401 Convert to pragma once 2018-10-06 17:38:44 -10:00
Jack Andersen 56a0661d33 Update boo 2018-06-01 14:02:20 -10:00
Jack Andersen 77f814192e Windows build fixes 2018-05-24 20:34:58 -10:00
Jack Andersen 396790181a Minimized shader hash generation; more compatible MultiProgressPrinter 2018-04-07 10:52:35 -10:00
Jack Andersen c9f61eb9da Fixes for GameCube targeting 2018-03-27 22:06:34 -10:00
Jack Andersen d1a66e15d4 Add parallel progress printing 2018-03-23 11:40:12 -10:00
Jack Andersen 06797cd9fc Add PATH .blend file type 2018-02-23 20:15:12 -10:00
Jack Andersen aae0dc56b7 Huge compile performance refactor 2017-12-28 21:56:31 -10:00
Phillip Stephens 0e4310903d Update boo; Add initial GUI mode support 2017-12-15 18:13:20 -08:00
Jack Andersen 559096feeb UWP support 2017-12-05 17:22:31 -10:00
Jack Andersen d4ce1d4913 ProjectPath bug fixes 2017-12-01 19:49:45 -10:00