Commit graph

2887 commits

Author SHA1 Message Date
Andrei Alexeyev
b3ce65d5ac
Improve high-DPI handling (#213)
SDL_WINDOW_ALLOW_HIGHDPI is now used. On platforms where SDL supports
this flag, the window size units are interpreted as abstract scaled
points rather than raw pixels, and may not match the underlying
framebuffer resolution if the display scaling factor is not 1. The
scaling factor and the effective framebuffer resolution are now
displayed in the options menu to reflect this fact.

In addition, the hidden "fullscreen_desktop_mode" setting has been
removed and the behavior is now always as if the value was "1" (the
default). Exclusive fullscreen with modesetting is not very useful,
and does not work well on some platforms (X11 in particular). That code
is not worth maintaining together with the frankly ridiculous complexity
of dancing around with the DPI scaling shenanigans of various operating
systems.

On platforms that do not support SDL_WINDOW_ALLOW_HIGHDPI, the window
size is assumed to correspond to raw pixels, and an effort is made to
disable the operating system's DPI upscaling mechanism, when possible.

This commit also fixes the Windows manifest, broken by
dc57f78d89 thanks to microshaft's amazing
documentation.

Closes #211
2020-04-16 19:25:54 +03:00
Andrei Alexeyev
ae06fd09f4
Coroutinize YoumuA (#212)
* WIP coroutinize YoumuA

bomb not implemented yet

* implement YoumuA bomb

* YoumuA: define constants for shot dmg/delays

still not balanced

* gotta go fast
2020-04-14 01:54:42 +03:00
Andrei Alexeyev
cdcea06ba6
stagedraw: add postprocessing events 2020-04-13 14:27:57 +03:00
Andrei Alexeyev
d9d6f66458
Make cnormalize return 0 instead of nan 2020-04-13 14:27:56 +03:00
Andrei Alexeyev
f1dfa3cdfe
add LIKELY and UNLIKELY macros to annotate branches 2020-04-13 14:27:56 +03:00
Andrei Alexeyev
c0e0e0970e
our headers are not C++ 2020-04-10 07:19:54 +03:00
Andrei Alexeyev
0928f0be98
update for building with latest emscripten 2020-04-10 06:09:36 +03:00
Andrei Alexeyev
72c61462a3
Fix vfs_dir_list_sorted reporting bogus error when dir is empty
Regression introduced in 0cbc86c6

Fixes #210
2020-04-09 20:35:58 +03:00
Andrei Alexeyev
e9085a7a4d
add PFLAG_INDESTRUCTIBLE and PFLAG_NOAUTOREMOVE 2020-04-08 08:39:45 +03:00
Andrei Alexeyev
45a4283225
use custom ents for Reimu; cleanup Marisa; etc. 2020-04-06 04:34:55 +03:00
Andrei Alexeyev
4223b023dc
CANCEL_TASK macro 2020-04-06 04:34:55 +03:00
Andrei Alexeyev
fe3aabcdc1
Add TASK_HOST_CUSTOM_ENT and TASK_HOST_EVENTS APIs (#208)
TASK_HOST_CUSTOM_ENT(type) allocates a custom entity from a reserved
region on the task's stack (same as TASK_MALLOC) and registers it. The
entity will be automatically unregistered when the task terminates for
any reason. Only one entity can be hosted by any particular task. This
macro returns a pointer to the hosted entity.

TASK_HOST_EVENTS(events) associates a custom array of events (created
with COEVENTS_ARRAY) with the task. All events in the array are
automatically initialized when this macro is called, and cancelled when
the task terminates for any reason. Only one array of events can be
hosted by any particular task.
2020-04-06 04:34:13 +03:00
Andrei Alexeyev
7fbe987b94
Add API for task-bound dynamic memory allocation (#201)
TASK_MALLOC(size) allocates a memory region with a lifetime bound to the
active task. It can't be free'd manually.

Allocation requests are served from a dedicated region on the task's
stack whenever possible, which is fast and essentially free. If there is
not enough free space to serve the request, then the memory is allocated
on the heap. Such heap allocations are automatically free'd when the
task expires.

The allocated memory is zero-initialized and aligned as strictly as
max_align_t.
2020-04-06 04:30:52 +03:00
Andrei Alexeyev
54030d17ba
fix clang warnings 2020-04-05 07:41:34 +03:00
Andrei Alexeyev
0cbc86c66e
Add generic type-safe facility for dynamic arrays (#207)
Replace most ad-hoc opencoded dynamic arrays across the codebase
2020-04-05 05:51:00 +03:00
Andrei Alexeyev
54c93d8923
Disable -Wimplicit-fallthrough for now
Unfortunately with clang10 this generates lots of spurious warnings from
SDL headers, even though they have fallthrough comments.
2020-04-04 02:54:00 +03:00
Martin Herkt
f60e0b1df3
Update email 2020-04-02 18:40:55 +02:00
Andrei Alexeyev
431237f0f2
Coroutinize MarisaA (#206) 2020-04-01 23:08:40 +03:00
Andrei Alexeyev
7b445fbc77
ent->spawn_id must not overflow 2020-04-01 02:15:13 +03:00
Andrei Alexeyev
40a604a6a5
Add 'use_gnu_ext' option
Controls the USE_GNU_EXTENSIONS define in compat.h
2020-03-31 22:51:31 +03:00
Andrei Alexeyev
b902e90229
Add alist_merge_tail to efficiently merge two lists
Empties the "source" list, moving its contents to the tail of the
"destination" list.
2020-03-31 22:16:10 +03:00
Andrei Alexeyev
09d1a65faf
Fixup scheduling order of tasks
Previously tasks that were invoked by an initial invocation of another
task were scheduler before that parent task. Now they are scheduled
after the parent task, following the sequential order of invocation
2020-03-31 22:16:04 +03:00
Andrei Alexeyev
55eaa3556a
Update wraps: SPIRV-Cross, SPIRV-Headers, SPIRV-Tools, glslang 2020-03-30 09:25:57 +03:00
Andrei Alexeyev
dc57f78d89
Prevent OS DPI scaling on windows (untested) 2020-03-30 02:04:46 +03:00
Andrei Alexeyev
07b6e0950c
Add r_framebuffer_get_size; abstract away SDL_GL_GetDrawableSize 2020-03-30 01:41:29 +03:00
Andrei Alexeyev
c5b28b2b15
Determine window size options dynamically 2020-03-30 00:47:07 +03:00
Alice D
77246397c3
Video resolution improvements/high-DPI quirks (#204) 2020-03-30 00:03:38 +03:00
Andrei Alexeyev
a54d1dcf32
ReimuA: use event-based bomb mechanism (like ReimuB) 2020-03-26 19:57:40 +02:00
Andrei Alexeyev
7b0d288cbe
ReimuB cleanup 2020-03-26 19:57:18 +02:00
Andrei Alexeyev
b6a6496c39
Coroutinize ReimuB (#205) 2020-03-25 08:52:18 +02:00
Andrei Alexeyev
b56f3eeb54
fix broken logic 2020-03-21 04:26:18 +02:00
Andrei Alexeyev
5086211a57
disable more stuff we don't need 2020-03-19 09:02:33 +02:00
Andrei Alexeyev
5435971a08
bunch of emscripten crap 2020-03-19 08:58:51 +02:00
Andrei Alexeyev
051f061b93
Update SDL2 wrap to 2.0.12 2020-03-19 08:58:33 +02:00
Andrei Alexeyev
186257cee6
Update libzip wrap to 1.6.1 2020-03-19 06:30:21 +02:00
Andrei Alexeyev
197cd93ef6
Update libwebp wrap to 1.1.0 2020-03-19 06:29:41 +02:00
Andrei Alexeyev
de0813151d
Update gamecontrollerdb 2020-03-19 05:51:39 +02:00
Andrei Alexeyev
02eb72608e
Fix various warnings 2020-03-19 05:04:11 +02:00
Andrei Alexeyev
c6f75c07ea
fix r_shader_uniform 2020-03-18 05:23:25 +02:00
Andrei Alexeyev
9aecad7aaa
inline get_ani 2020-03-17 11:47:14 +02:00
Andrei Alexeyev
a239d18cbe
Disable koishi thread safety by default
We don't run coroutines in parallel, so the TLS access only adds
pointless overhead.
2020-03-17 11:00:34 +02:00
Andrei Alexeyev
89579646b5
update koishi 2020-03-17 10:58:32 +02:00
Andrei Alexeyev
0fdea86be1
Implement Robin Hood hashing (#200)
* Implement Robin Hood hashing

This replaces the previous separate chaining implementation. This
approach is more memory-efficient, cache-friendly, and puts much less
stress on the memory allocator.

* Replace crc32 with fnva1

Also attempt to make the compiler pre-hash as much stuff as possible at
build time.
2020-03-17 10:09:49 +02:00
Andrei Alexeyev
15593ab207
ent_shutdown: panic if any live entities detected
In case this still happens in a release, log the error and try to at
least not corrupt the object pools.
2020-03-15 06:57:57 +02:00
Andrei Alexeyev
6df777b4b8
log: add LOG_FATAL_IF_DEBUG pseudo-level
This if LOG_FATAL in developer builds, LOG_ERROR otherwise
2020-03-15 06:57:04 +02:00
Andrei Alexeyev
d9ac1cfd92
ReimuA: fix subtle entity corruption (some trail particles not unregistered)
This is a simple & stupid fix, so it blows up the number of running
tasks into 200s, but premature optimization is indeed the root of all
evil.
2020-03-15 06:50:55 +02:00
Andrei Alexeyev
389a406a62
preliminary ReimuA balance attempt 2020-03-13 23:44:59 +02:00
Andrei Alexeyev
01e7ea8a33
Coroutinize ReimuA (#199) 2020-03-13 22:54:07 +02:00
Andrei Alexeyev
76a60d92a9
Fix stagetext_add_numeric
Pass correct buffer size, get rid of NUM_PLACEHOLDER nonsense.
Also update format_huge_num signature to identify buf as char[bufsize]
2020-03-09 03:31:17 +02:00
Andrei Alexeyev
adeca742ec
Fix CoEvents overflowing with zombie subscribers 2020-03-08 23:25:37 +02:00