Commit graph

16 commits

Author SHA1 Message Date
Andrei Alexeyev
9dade8ad33
resource: lifetime management redesign (WIP) 2023-04-29 20:01:50 +02:00
Andrei Alexeyev
ad295005db
resource: more consistent API function names 2023-04-29 20:01:50 +02:00
Andrei Alexeyev
57a08d4c7a
replay/demoplayer: automatic "demo" playback when idling in menus
Currently the game comes with no demos; place your own replays into
$userdir/resources/demos if you want to test this.
2023-04-07 16:08:50 +02:00
Andrei Alexeyev
b6978178b1
memory: use custom memory allocation wrappers
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.
2023-01-18 13:23:22 +01:00
Andrei Alexeyev
6f25a4b7d4
menu/common: add context argument for draw_menu_list() 2022-02-16 05:09:30 +02:00
Andrei Alexeyev
40a3f6ead2
Add gameover BGM by RickyRister 2020-06-24 20:51:00 +03:00
Andrei Alexeyev
8480d41b7b
Audio rewrite (#236)
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.
2020-06-22 17:41:03 +03:00
Andrei Alexeyev
89ecc0c55e
Establish more-or-less consistent resource getter functions
Deprecate old ad-hoc stuff like get_sprite, r_texture_get, etc.
2020-06-09 04:33:22 +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
9d3bf87559
Refactor matrix stack API to get rid of matrix mode (#177)
This replaces the r_mat_foo functions with specialized r_mat_{mv,tex,proj}_foo counterparts that operate explicitly on the modelview, texture, and projection matrix stacks respectively.
2019-10-12 15:02:15 +03:00
Andrei Alexeyev
5a23fb95fc
make upkeep script preserve existing copyrights 2019-08-03 20:44:22 +03:00
Andrei Alexeyev
3055901998
update my email 2019-07-03 21:00:56 +03:00
laochailan
8c4811f8bd cool new black hole menus 2019-04-20 18:06:27 +02:00
Andrei Alexeyev
649ef31ce5
fix warnings 2019-04-06 21:27:39 +03:00
Andrei Alexeyev
b9766fcf59
music room improvements: allow playing locked tracks with confirmation 2019-03-15 22:19:49 +02:00
Andrei Alexeyev
a63e8f4a69
Add a basic music room 2019-03-11 01:21:43 +02:00