Commit Graph

32 Commits

Author SHA1 Message Date
bjorn 7dc54cc264 Add lovrCheck macro;
lovrCheck is a new way of performing runtime assertions.

It's identical to lovrAssert, except it's compiled out if
LOVR_UNCHECKED is defined.

It is meant to be used for non-mission-critical validation, for
example proper usage of types passed to the Lua API.  lovrAssert
should still be used to check return values from platform APIs.
2021-06-05 11:12:00 -06:00
bjorn fa47ecbdd3 v0.15.0; 2021-04-11 08:57:11 -06:00
bjorn 2d43620d3c rm LOVR_ALIGN;
It isn't very portable, the effects aren't significant.
2021-03-15 18:56:02 -06:00
bjorn 1d1a2de124 Only use CTZL in audio; 2021-02-24 14:11:49 -07:00
bjorn 75fda2336f Enforce strict limit of 64 active sources;
If 64 sources are playing and a new one is started, Source:play will
return false.

Instead of a linked list, a static list of 64 Sources is used.

Bit scanning intrinsics are used to efficiently iterate the list,
using a mask (still deciding on this).
2021-02-17 20:46:33 -07:00
bjorn 72284c2c5b Merge branch 'master' into dev 2021-02-12 08:16:36 -07:00
bjorn 023067ec27 util.h no longer uses atomics; 2021-02-11 16:37:55 -07:00
bjorn 7db979b655 Fix arr_free;
realloc(NULL, 0) isn't valid.
2021-02-09 08:15:43 -07:00
bjorn 84f65c26e4 Move utf8 back into util; 2021-02-08 20:55:51 -07:00
bjorn 6d92d54079 Try having arr_t in util; 2021-02-08 18:25:05 -07:00
bjorn bc4cde1653 Adjust lovrRelease signature; 2021-02-08 17:52:26 -07:00
bjorn 3ded60948f rm core/ref; rm lovrAlloc; util does refcounting; 2021-02-08 17:26:44 -07:00
bjorn 3bc2c00b79 api doesn't include util; 2020-12-25 12:50:26 -07:00
bjorn 9bdceb0094 rm LOVR_INLINE;
Just use the inline keyword which is C99.  Getting util.h out of
maf.h is nice.
2020-12-25 12:29:22 -07:00
bjorn 5f0542cc43 Fix util declspec spacing; 2020-11-12 18:08:05 -07:00
bjorn 1e7749a58a Fix MSVC warnings;
It's that time of year.
2020-11-12 18:08:05 -07:00
bjorn 85cc82d8cb v0.14.0; 2020-10-05 16:40:27 -06:00
bjorn 83ff4783c2 ALIGN macro aligns up instead of down;
So you don't have to add (n - 1).  Hopefully this turns out to be
the common case.
2020-08-04 12:23:45 -06:00
bjorn 9abed055d8 lovr.log;
lovr.log is a new callback that is invoked whenever LÖVR wants to
send the project a message.  For example, this could be a performance
warning from the graphics module, an error message from one of the
headset backends, or an API deprecation notice.

The callback's signature is (message, level, tag).  The message is a
string containing the message to log, level is a string that is currently
one of "debug", "info", "warn", "error", and tag is an optional string
that is used to indicate the source of the message for grouping purposes.

The default implementation of the callback just prints the message,
but the callback can be overridden to do things like filter messages,
write them to a file, or even render them in VR.  Projects can also
invoke the callback directly to log their own messages.
2020-07-06 16:20:55 -06:00
bjorn 75e26f0051 Move core/hash to core/util; 2020-05-19 13:49:40 -06:00
bjorn bfd63e3515 Use restrict modifier in curve evaluation;
Allows compiler to emit SIMD, way smaller/faster.
2019-12-05 13:39:04 -08:00
bjorn e32c3ea2df v0.13.0; 2019-10-14 18:21:07 -07:00
bjorn 8d4760167f luax is now api; 2019-08-21 15:27:26 -07:00
bjorn 7c8a44cc57 Cleanup function pointer typedefs; 2019-08-21 14:44:54 -07:00
bjorn 879c789a08 Polyfill M_PI;
It technically isn't part of C, which is causing problems on some systems.
2019-06-20 21:43:40 -07:00
bjorn 31e086edaf Inline all the maf functions; 2019-06-03 07:19:25 -07:00
bjorn dc34ed4570 Start to trend towards 4-element arrays for vec3;
It will be important for enabling more SIMD.
2019-06-02 20:35:52 -07:00
bjorn c7a2e513d3 Inline hash function; 2019-06-02 04:15:46 -07:00
bjorn 22fe333150 Update refcounting (again);
- Ref struct only stores refcount now and is more general.
- Proxy stores a hash of its type name instead of an enum.
- Variants store additional information instead of using a vtable.
- Remove the concept of superclasses from the API.
- Clean up some miscellaneous includes.
2019-06-02 01:02:26 -07:00
bjorn 67b76e08c2 Details; 2019-05-20 04:15:24 -07:00
bjorn e368723248 Improve platform-specific defines; 2019-05-20 04:05:39 -07:00
bjorn 7645f4c014 Add core folder; 2019-05-20 02:47:33 -07:00
Renamed from src/util.h (Browse further)