This fixes a nasty bug that manifests on windows when building without
precompiled headers. util/stringops.h used to silently replace strdup
with a macro that's compatible with mem_free(). This header would
typically be included everywhere due to PCH, but without it the strdup
from libc would sometimes be in scope. On most platforms mem_free() is
equivalent to free(), but not on windows, because we have to use
_aligned_free() there. Attempting to mem_free() the result of a libc
strdup() would segfault in such a configuration.
Avoid the footgun by banning strdup() entirely. Maybe redefining libc
names isn't such a great idea, who knew?
- The free/restricted axis distinction is gone; the joystick always
operates in "free" mode.
- Added direction snapping functionality to help aid exact movement in
cardinal and/or diagonal directions. The snapping angle can be
adjusted from 0% (disabled) to 100% (similar to the old "restricted"
mode). The snapping angle can also be biased towards cardinals or
diagonals.
- When the maximum zone is less than or equals dead zone, moving
the character will always move at maximum speed (as in the old
"restricted" mode).
- Most of these settings are now visualized in the options menu and can
be tested there.
* Use correctly scaled radial deadzones instead of naive per-axis
deadzones
* Option to adjust the "maximum zone" (upper deadzone)
* Option to remap square input into circular. Unfortunately there's no
nice way to detect which type the controller reports. We assume
circular by default.
* A more sensible sensitivity setting
* Use a larger minimum deadzone when emulating key presses (e.g. in
menus)
* Adjusted key repeat to be less aggressive
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.
Introduces wrappers around memory allocation functions in `memory.h`
that should be used instead of the standard C ones.
These never return NULL and, with the exception of `mem_realloc()`,
zero-initialize the allocated memory like `calloc()` does.
All allocations made with the memory.h API must be deallocated with
`mem_free()`. Although standard `free()` will work on some platforms,
it's not portable (currently it won't work on Windows). Likewise,
`mem_free()` must not be used to free foreign allocations.
The standard C allocation functions are now diagnosed as deprecated.
They are, however, available with the `libc_` prefix in case interfacing
with foreign APIs is required. So far they are only used to implement
`memory.h`.
Perhaps the most important change is the introduction of the `ALLOC()`,
`ALLOC_ARRAY()`, and `ALLOC_FLEX()` macros. They take a type as a
parameter, and allocate enough memory with the correct alignment for
that type. That includes overaligned types as well. In most
circumstances you should prefer to use these macros. See the `memory.h`
header for some usage examples.
* Split replay.c into multiple files under replay/; improve logical
separation of replay-related code.
* Separate replay playback state from data.
* Get rid of global static replay struct and avoid unnecessary replay
copying.
* Replay playback and recording are now independent and may occur
simultaneously, although this functionality is not yet exposed. This
enables replay "re-recording" while synthesizing new desync check
events, possibly at a different rate from the original replay.
* Rate of recorded desync check events can now be controlled with the
TAISEI_REPLAY_DESYNC_CHECK_FREQUENCY environment variable. The default
value is 300 as before.
* Probably other stuff I forgot about.
The start game sequence didn't properly clean up when cancelling out of
a character selection menu if no difficulty selection was presented
(e.g. spell cards)
* WIP cutscenes
* cutscene tweaks
* cutscene: erase background drawing under text
* Make text outlines thicker
* Prepare an interface for adding new cutscenes
* Basic progress tracking for cutscenes
* cutscene: support specifying scene name and BGM
* cutscene: exit with transition after scene ends
* Implement --cutscene ID and --list-cutscenes CLI flags
* fix progress_write_cmd_unlock_cutscenes
* Play intro cutscene before entering main menu for the first time
Also added --intro parameter in dev builds to force playing the intro
cutscene
* Add intro cutscene
* cutscenes: update opening/01 scene
* add Reimu Good End
* remove Bonus Data
* split up a bit of dialogue, revert an image change in intro
* small typo
* most cutscenes complete
* smartquotify
* finish Extra intros
* new cutscenes routed into main game
* fix ENDING_ID
* rough 'mediaroom' menu
* fix cutscene menu crash
* derp
* PR changes
* fixing imports
* more PR fixes
* PR fixes, including updating the script to #255
* add in newlines for readability
Co-authored-by: Alice D <alice@starwitch.productions>
This replaces SDL_mixer with an internal streaming and mixing system,
relying only on basic SDL audio support. It's also a partial refactor of
the audio API, most notably BGM-related. The BGM metadata resource type
is gone, as well as the `.bgm` files. The metadata is now stored inside
the `.opus` files directly, using standard Opus tags.