Andrei Alexeyev
71109fd253
transition: more robust handling of "canceled" transitions
...
Ensure callbacks are always called, but if a transition was overwritten
by another set_transition() call mid-transition, pass a non-NULL
argument as the result. This allows the callback to gracefully cancel
whatever it was meant to do, if needed.
2023-04-07 16:08:50 +02:00
Andrei Alexeyev
73af6ac9ce
stage: poll events while transitioning away
2023-04-07 16:08:50 +02:00
Andrei Alexeyev
b91c10b1f9
replay: add replay_load_vfspath
2023-04-07 16:08:50 +02:00
Andrei Alexeyev
27a1a6fc7a
transition: use the callchain system for callbacks
2023-04-07 16:08:49 +02:00
Andrei Alexeyev
886ba290a9
util/callchain: split from eventloop
2023-04-07 16:08:49 +02:00
Andrei Alexeyev
f0deb86937
events: fix events_unregister_handler()
...
It's still a stupid API, but at least it's possible to remove multiple
handlers that have the same callback address reliably.
2023-04-07 16:08:49 +02:00
Andrei Alexeyev
6242961ccc
resource/font: make possible to specify pos as cmplx in TextParams
2023-04-07 16:08:49 +02:00
Andrei Alexeyev
df6b97caf7
stageobjects,objectpool: simplify and reimplement on top of arenas
...
All pools now allocate from the same arena that is initialized once with
8MB of initial space and never deallocated, only reset between stages.
2023-04-07 16:08:49 +02:00
Andrei Alexeyev
66e5a886f0
lasers: implement rect packing for SDF texture
2023-04-03 01:53:36 +02:00
Andrei Alexeyev
b33bc192bf
lasers: optimize and simplify draw code (WIP)
...
There's an issue where partially out of bounds lasers will step over
neighbouring tiles, causing artifacts. Should be solved with a packing
algorithm.
2023-04-03 01:53:36 +02:00
Andrei Alexeyev
8b9602c402
util/rectpack: pool sections, support custom allocators
2023-04-03 01:53:36 +02:00
Andrei Alexeyev
9089a2f16e
memory/allocator: add ALLOC_VIA macros
2023-04-03 01:53:36 +02:00
Andrei Alexeyev
e555126854
memory: generic allocator interface
2023-04-03 01:53:36 +02:00
Andrei Alexeyev
8547f443b7
memory: basic arena allocator primitive
2023-04-03 01:53:36 +02:00
Andrei Alexeyev
bf7964926c
memory: move into subdir
2023-04-03 01:53:36 +02:00
Andrei Alexeyev
0d9c816fc3
build: workaround meson misdetecting posix_memalign as available on nx
2023-04-03 01:53:36 +02:00
Andrei Alexeyev
86cfceeb9c
stage1: fix stain particles
2023-04-01 05:45:38 +02:00
Andrei Alexeyev
571d2ac03f
thread: make thread_get_current() safe to call after thread_shutdown()
...
Was causing a use-after-free on shutdown
2023-03-31 03:25:16 +02:00
Andrei Alexeyev
bae08cd0a0
main: init coroutines before log
...
Without this cotask_active() is called before co_main is set, which
trips up ASan.
2023-03-31 03:25:16 +02:00
Andrei Alexeyev
f265f38adc
log: cotask support; rewrite console formatter
2023-03-30 04:37:57 +02:00
Andrei Alexeyev
10ecc9ff42
coroutine/cotask: add cotask_get_name() API
2023-03-30 04:31:22 +02:00
Andrei Alexeyev
a13e6ae7a3
coroutine/cotask: make cotask_active safe to call outside of task context
...
Returns NULL in main context. Still not entirely safe to call on
non-main thread.
The slightly faster "unsafe" version is available as cotask_active_unsafe.
The new cotask_active is currently not used by anything; it's intended
for a logging system update later.
2023-03-30 04:31:22 +02:00
Andrei Alexeyev
f5c5803b1a
util/strbuf: inline strbuf_cat
2023-03-30 03:38:07 +02:00
Andrei Alexeyev
a4717b996c
util/strbuf: make cat and ncat return number of chars written
2023-03-30 02:21:04 +02:00
Andrei Alexeyev
a78b67ad65
resource: set name before ires is put into the hashtable
...
This should fix a rare race condition in res_load_dependency where the
dep could make its way to ires_make_dependent_one without having the
name set yet, failing an assertion there.
It also gets rid of a name parameter to load_resource, since the name is
always known at that point.
2023-03-30 00:47:12 +02:00
Andrei Alexeyev
40758a5a8d
vfs/platform_paths: fix macOS build
2023-03-29 20:47:27 +02:00
Andrei Alexeyev
c197d224e7
log: log originating thread names
2023-03-29 20:47:27 +02:00
Andrei Alexeyev
e957f11790
thread: add over-engineered wrapper for thread management
2023-03-29 20:47:27 +02:00
Andrei Alexeyev
427d2ca32c
ci: trigger on *.m (objc) sources too
2023-03-29 19:31:26 +02:00
Andrei Alexeyev
3c0a538ae6
ci: run tests on staging branches
2023-03-28 23:09:02 +02:00
Andrei Alexeyev
beae2e0302
util/assert: fix static_assert
2023-03-26 14:06:05 +02:00
Andrei Alexeyev
ff532b0f33
taskmanager: introduce TAISEI_TASKMGR_NUM_THREADS env variable
...
Controls the number of worker threads spawned by the global task
manager. 0 for default (equal to number of CPU cores), -1 for max
(capped to number of CPU cores * 4)
2023-03-26 03:27:20 +02:00
Andrei Alexeyev
ce7159d630
resource: fix incorrect assumption in threaded loading
2023-03-26 03:26:19 +02:00
Andrei Alexeyev
15bdbc496b
util/compat: include assert(0) in UNREACHABLE macro
...
Stop overriding it in log.h
2023-03-26 03:14:07 +02:00
Andrei Alexeyev
6c30decd8e
util/miscmath: don't check for __GNUC__
2023-03-26 03:12:01 +02:00
Andrei Alexeyev
277e003510
util/assert: don't check for __GNUC__
2023-03-26 03:10:16 +02:00
Andrei Alexeyev
9363c6b883
util/compat: don't check for __GNUC__
2023-03-26 03:08:33 +02:00
Andrei Alexeyev
711edc218f
util/assert: add optional message to assert, assume, and static_assert
...
Removed static_assert_nomsg, since static_assert's message argument is
optional now. In C2X mode this uses the native _Static_assert
functionality, otherwise it falls back to a macro-based overload.
Additionally, rewrote the assert macro so it correctly marks the failing
branch as a dead end.
2023-03-26 01:52:41 +01:00
Andrei Alexeyev
7c19322940
log: flush buffers after assert failure
2023-03-26 01:07:17 +01:00
Andrei Alexeyev
efe8370845
resource: add loading debug prints (disabled by default)
2023-03-26 01:04:42 +01:00
Andrei Alexeyev
77dc94bb71
menu,renderer,vfs: fix -Wcast-function-type-strict on clang 16
2023-03-22 22:38:52 +01:00
Andrei Alexeyev
8b4c440bc9
stage4: merge fog and tonemap passes
2023-03-17 02:54:50 +01:00
Andrei Alexeyev
50e571e39a
shader: optimize and enhance water effects
2023-03-17 02:50:16 +01:00
Andrei Alexeyev
b0e0041015
stage6: fix -Wmaybe-uninitialized
2023-03-12 17:26:17 +01:00
Andrei Alexeyev
c10cab4776
plrmodes/reimu_b: fix -Wmaybe-uninitialized
2023-03-12 17:20:25 +01:00
Andrei Alexeyev
7bf8e84fd6
resource/postprocess: fix -Wenum-int-mismatch
2023-03-12 17:19:02 +01:00
Andrei Alexeyev
1c0c5ec336
stage1: fix -Wmaybe-uninitialized
2023-03-12 17:17:41 +01:00
Andrei Alexeyev
de7cf50441
stage6: experimental newton redesign
2023-03-12 17:08:43 +01:00
Andrei Alexeyev
7104d951a2
stage6: spin kepler main bullets; draw with half-add blending
2023-03-12 14:46:39 +01:00
Andrei Alexeyev
bde29889c4
stage6: don't stall kepler scythe task
2023-03-12 14:44:16 +01:00