Commit graph

37 commits

Author SHA1 Message Date
Andrei Alexeyev
8b37d1cbf2
src: the great #include massacre of 2024 2024-05-17 14:11:48 +02:00
Andrei Alexeyev
be7905d6a3
src: run upkeep 2024-05-17 04:58:47 +02:00
Andrei Alexeyev
858398f556
watchdog: return to main menu and reset config after inactivity in kiosk mode 2024-05-04 20:07:12 +02:00
Andrei Alexeyev
b57445900f
gamepad: overhaul analog stick handling
* 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
2023-07-12 00:13:19 +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
e629d927ba
filewatch: add filewatch module for basic file monitoring
Currently only an inotify-based backend is implemented.
2022-01-02 08:28:11 +02:00
Andrei Alexeyev
9f58b8a7c3
camcontrol: F8 to toggle mouse grab; ungrab on pause 2021-11-24 09:36:41 +02:00
Andrei Alexeyev
8d2ee76710
replace include guards with #pragma once 2021-08-31 23:34:46 +03:00
Andrei Alexeyev
d126eba2d2
events: reduce processing overhead
This is mostly aimed at speeding up TAISEI_SKIP_TO_BOOKMARK mode

- Store global handlers in a dynamic array
- Merge global and local handlers more efficiently, and only do it once
  per events_poll() call
- Do not pump SDL events while skipping through stages
- Avoid expensive system call when pushing custom events to the queue
- Process SDL events in batches; do not pump after every event
- Simplify handling of EventPriority enum - EPRIO_DEFAULT equals to 0,
  no remapping required
2021-05-06 12:41:40 +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
ae8194ae78
Various fixes & improvements for concurrent loading (#235)
- RESF_UNSAFE is removed.
- Resources that don't have to be finalized on the main thread can load
completely asynchronously.
- A thread waiting for a concurrent task to complete can start executing
that task itself if it hasn't started yet.
- Refactor the resource loading interface, add support for load-time
dependencies.
- Main-thread finalization of asynchronously loaded resources is now
spread out across multiple frames to mitigate frametime spikes.
- Remove some archaisms from the resource management code.
- Fix potential hashtable synchronization issue.
- Fix some deadlock edge cases.
- Don't spawn more worker threads than there are CPU cores (degrades
performance).
- Add TAISEI_AGGRESSIVE_PRELOAD env variable to attempt to aggressively
discover and preload every possible resource.
- Make r_texture_fill{,_region} expect optimal pixmaps, so that it's
never forced to convert them on the main thread. The optimal format may
be queried with the new r_texture_optimal_pixmap_format_for_type API.
These functions will also no longer needlessly copy the entire image
into a staging buffer - previously they did this even if no conversion
was needed.
- Other random changes to facilitate the stuff above.

The overall effect is somewhat faster load times.

Of course it's still all terrible and full of lock contention because I
suck at concurrent programming, but it's not worse than it was.
Probably.
2020-06-09 03:01:53 +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
Andrei Alexeyev
4159ea1249
'upkeep' target for maintenance tasks; back to include guards; happy new year! 2019-01-23 22:10:43 +02:00
Andrei Alexeyev
ebd8344382
workaround to allow safely unregistering event handlers from within event handlers
fixes #153
2018-11-10 02:58:37 +02:00
Andrei Alexeyev
b16f402040
Refactor framebuffer-related stuff (#130)
* Renderer: rename render targets to framebuffers

* Refactor framebuffer pair helper and some of the video API

* Remove hardcoded dimensions from draw_framebuffer_tex

* Make viewport a per-framebuffer property rather than a global one

* Handle config updates via the events system. React to viewport fg/bg quality change requests.
2018-07-04 11:36:16 +03:00
Andrei Alexeyev
b48248ef7a
gamepad: support input repeat for analog sticks as well as buttons 2018-01-18 11:13:25 +02:00
Andrei Alexeyev
78e9d3cb9e
gamepad: implement button repeat 2018-01-16 13:51:19 +02:00
Andrei Alexeyev
513d613387
Consistent indentation: indent with tabs, align with spaces (#104)
I would've preferred to just go with 4-spaces for indent and no tabs,
but lao is a bit conservative about it. :^)

Still, this is a ton better than mixing different styles all over the
place, especially within the same file.
2018-01-12 20:26:07 +02:00
Andrei Alexeyev
485c9a8ed6
Happy New Year! 2018-01-04 19:14:31 +02:00
Andrei Alexeyev
29acd5f58a meson: intel intrinsics, various improvements 2017-12-21 03:58:54 +01:00
Andrei Alexeyev
f21e35f459
minor options menu improvements 2017-10-22 02:50:15 +03:00
Andrei Alexeyev
696ddf5e85
gave input translation higher priority
fixes rebinding of gamepad controls
2017-10-01 01:20:14 +03:00
Andrei Alexeyev
4e2e050baa
basic utf8 text input, with clipboard support 2017-10-01 00:43:22 +03:00
Andrei Alexeyev
ef67a16867
WIP event system rewrite. text input missing 2017-10-01 00:43:18 +03:00
laochailan
03a2426012
update to use #pragma once 2017-09-27 14:14:53 +02:00
Andrei "Akari" Alexeyev
8aa6f8ea64
video hacks 2017-09-19 15:13:04 +03:00
Andrei "Akari" Alexeyev
c199ce6fa6
use desktop mode fullscreen by default
also fixed the userevent in resources to use the correct id
2017-09-18 14:19:50 +03:00
Andrei "Akari" Alexeyev
7c9e54a71d
update copyright and credits 2017-09-12 04:28:15 +03:00
Andrei "Akari" Alexeyev
dacbf96427 moved util functions from global to where they make a bit more sense 2017-03-06 03:24:47 +02:00
Andrei "Akari" Alexeyev
671f3b8d3a gamepad options menu improvements 2017-02-28 00:58:47 +02:00
Andrei "Akari" Alexeyev
9a7a874783 Use the standard bool type instead of that stupid enum
Also removed all of the annoying trailing tabs/whitespaces
2017-02-11 05:56:47 +02:00
Andrew "Akari" Alexeyew
1f06d4f377 GUIfied the rest of the gamepad options (controls) 2012-08-17 01:41:33 +03:00
Andrew "Akari" Alexeyew
4754e6c76e Optional free axis mode 2012-08-15 17:36:39 +03:00
Andrew "Akari" Alexeyew
effda6c4c3 removed some garbage declarations 2012-08-15 03:47:39 +03:00
Andrew "Akari" Alexeyew
30befb3960 basic gamepad/joystick support 2012-08-15 03:41:21 +03:00
Andrew "Akari" Alexeyew
cf72d8dee3 event abstraction layer 2012-08-13 18:50:28 +03:00