Commit graph

100 commits

Author SHA1 Message Date
Andrei Alexeyev
139ac03d5c
config: change default bomb and surge gamepad buttons
LT and RT respectively
2024-06-04 16:17:26 +02:00
Andrei Alexeyev
7548e4892d
gamepad: direction snapping; more flexible configuration options
- 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.
2024-05-27 19:23:59 +02:00
Andrei Alexeyev
be7905d6a3
src: run upkeep 2024-05-17 04:58:47 +02:00
Andrei Alexeyev
b95a541479
config: read defaults from optional "config.default" file in resources
Not included by default, intended for custom distributions (for DoKomi
in particular)

Also improve the upgrade mechanism by ignoring settings that were not
changed in the config being parsed.
2024-05-03 04:20:45 +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
8bff89e1c1
player,config: add option to auto-activate surge at 6 power (on by default) 2023-06-19 23:39:11 +02:00
Andrei Alexeyev
46e0dccc86
config: set mixer_chunksize to 512
512 is close enough to 400 (sample_rate/(2 * FPS)), so the mixing
callback should run at least once per frame now, improving timing
precision.
2023-06-08 04:34:54 +02:00
Andrei Alexeyev
63ef832031
config: set practice_power to 400 by default 2023-05-29 01:40:46 +02:00
Andrei Alexeyev
3041836f68
config: enable fullscreen by default 2023-05-29 01:37:35 +02:00
Andrei Alexeyev
351f91a573
stage: add replay-based quicksave/quickload functionality
Disabled in story mode on non-developer builds
2022-01-09 14:11:26 +02:00
Andrei Alexeyev
b39c9ba78e
resource: partial support for resource reloading 2022-01-02 08:28:02 +02:00
Andrei Alexeyev
8d2ee76710
replace include guards with #pragma once 2021-08-31 23:34:46 +03:00
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
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
b3a0128be6
gamepad: support hotplug, any-device option 2019-04-19 14:28:32 +03:00
Andrei Alexeyev
58b964baba
add display option for multi-monitor systems 2019-04-18 22:56:16 +03:00
Andrei Alexeyev
488ff43f85
add optional floating scoring text 2019-04-07 01:55:13 +03:00
Andrei Alexeyev
b314cbd7d7
Enable gamepad input by default 2019-03-10 17:28:45 +02:00
Andrei Alexeyev
180f9e3856
Emscripten compatibility (#161)
* Major refactoring of the main loop(s) and control flow (WIP)

run_at_fps() is gone 🦀

Instead of nested blocking event loops, there is now an eventloop API
that manages an explicit stack of scenes. This makes Taisei a lot more
portable to async environments where spinning a loop forever without
yielding control simply is not an option, and that is the entire point
of this change.

A prime example of such an environment is the Web (via emscripten).
Taisei was able to run there through a terrible hack: inserting
emscripten_sleep calls into the loop, which would yield to the browser.
This has several major drawbacks: first of all, every function that
could possibly call emscripten_sleep must be compiled into a special
kind of bytecode, which then has to be interpreted at runtime, *much*
slower than JITed WebAssembly. And that includes *everything* down the
call stack, too! For more information, see
https://emscripten.org/docs/porting/emterpreter.html

Even though that method worked well enough for experimenting, despite
suboptimal performance, there is another obvious drawback:
emscripten_sleep is implemented via setTimeout(), which can be very
imprecise and is generally not reliable for fluid animation. Browsers
actually have an API specifically for that use case:
window.requestAnimationFrame(), but Taisei's original blocking control
flow style is simply not compatible with it. Emscripten exposes this API
with its emscripten_set_main_loop(), which the eventloop backend now
uses on that platform.

Unfortunately, C is still C, with no fancy closures or coroutines.
With blocking calls into menu/scene loops gone, the control flow is
reimplemented via so-called (pun intended) "call chains". That is
basically an euphemism for callback hell. With manual memory management
and zero type-safety. Not that the menu system wasn't shitty enough
already. I'll just keep telling myself that this is all temporary and
will be replaced with scripts in v1.4.

* improve build system for emscripten + various fixes

* squish menu bugs

* improve emscripten event loop; disable EMULATE_FUNCTION_POINTER_CASTS

Note that stock freetype does not work without
EMULATE_FUNCTION_POINTER_CASTS; use a patched version from the
"emscripten" branch here:

    https://github.com/taisei-project/freetype2/tree/emscripten

* Enable -Wcast-function-type

Calling functions through incompatible pointers is nasal demons and
doesn't work in WASM.

* webgl: workaround a crash on some browsers

* emscripten improvements:

    * Persist state (config, progress, replays, ...) in local IndexDB
    * Simpler HTML shell (temporary)
    * Enable more optimizations

* fix build if validate_glsl=false

* emscripten: improve asset packaging, with local cache

Note that even though there are rules to build audio bundles, audio
does *not* work yet. It looks like SDL2_mixer can not work without
threads, which is a problem. Yet another reason to write an OpenAL
backend - emscripten supports that natively.

* emscripten: customize the html shell

* emscripten: force "show log" checkbox unchecked initially

* emscripten: remove quit shortcut from main menu (since there's no quit)

* emscripten: log area fixes

* emscripten/webgl: workaround for fullscreen viewport issue

* emscripten: implement frameskip

* emscripter: improve framerate limiter

* align List to at least 8 bytes (shut up warnings)

* fix non-emscripten builds

* improve fullscreen handling, mainly for emscripten

* Workaround to make audio work in chromium

emscripten-core/emscripten#6511

* emscripten: better vsync handling; enable vsync & disable fxaa by default
2019-03-09 21:32:32 +02:00
Andrei Alexeyev
4669ef291f
lower sfx volume to 50% by default 2019-03-06 14:23:50 +02:00
Andrei Alexeyev
8fc5abb78a
The Powersurge game mechanic and scoring system (#159) 2019-02-22 01:56:03 +02: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
69079f245a
dubious timing optimizations; try to sleep between frames; skip at constant speed 2019-01-09 05:25:10 +02:00
Andrei Alexeyev
49d0d54a2e
Lots of disorganized (mostly) visual overhaul (#156)
* WIP some projectile effects

* fix segfault

* Laser smoothing and glow via post-processing blur magic

TODO: make it optional

* fix memory corruption

* fix memory corruption for realsies now

* fix color_get_hsl for out-of-range colors

* some more bullet flare tweaks

* some lame clear effect workarounds

* spawn bullet flares after frame 0; looks better and fixes some problems

* New baryon explosion; fix petal_explosion; leanify everything

* Add missing bullet flare sprite, rebuild main atlas

* improve batching efficiency with bullet spawn flares

* forgot git add

* Group projectiles/particles by shader where possible

* Another take on baryon explosion; make fg framebuffers 16bit

* WIP some settings for toasters

* remove stupid debug log

* microoptimization that probably does nothing anyway

* somewhat more intuitive quality settings

* Whitelist more particles (MarisaB is on hold)

* Whitelist (and fix) some more stage6 particles (mostly ToE)

* Add a spell name background

* Experimental radial healthbar for bosses

* healthbar tweaks

* thiccer healthbars in response to feedback

* remove healthbar survival timer; just fade out on survivals

* Add linear healthbars option; WIP other boss HUD tweaks

* Use the proper spell card name format

* New font and some random garbage to go along with it

* Generate static font outlines for use in text shaders

* Use outlines in overlay text shader

* Complete boss HUD/healthbar fading logic

* fix boss timer limit

* stage5 bombs explosion effect

* split PFLAG_NOSPAWNZOOM into PFLAG_NOSPAWNFLARE and PFLAG_NOSPAWNFADE;

introduce PFLAG_NOSPAWNEFFECTS which disables both (it's just the two
values OR'd together)

simplify vampiric vapor bullet spawning effect

* Remove spawn fade-in from super-fast stage5 fairy projectiles (limiters)

* lower particle density in v.vapor in minimal mode

* graze effect tweaks

* fix text shortening, tweak replay menu layout

* stupid debug spam

* revisit grazing effects again

* dumb debug spam again

* improve boss attack timer

* overlay effect for boss deaths (similar to the player one)

* spice up spellcard declaration (HUD)

* don't spawn boss death overlay if fleed

* modify Exo2 font to use tabular figures

* adjust replay menu for the font change

* draw timer & power with standard font (phasing out the numbers font)

* WIP new HUD; random fixes/tweaks

* hud: move difficulty indicator

* hud: move debug stuff around

* preloads, mostly

* fix youmuA batching conflict

* shitty workaround for the shitty screenshake shit

* remove extraspell lag by stopping to draw stagebg sooner

which is possible because extra spells have a different spellcard_intro timing. Fun fact of the day: the duration of spellcard_intro is always ATTACK_START_DELAY_EXTRA even for normal spells!

* new stain particle

*  i disabled background rendering…

* "batch" marisa_b masterspark draws

* remove these once a new atlas is generated

* make toe quick again

* hopefully fix all occurences of changed stain and ScaleFade behavior

* tweaking reimu_a and toe boson launch effects

* make lhc fast again

* softer involnerability effect

* fix stage 1 snow on the water bug (and improve performance)

translated the time to the future a bit because it only seemed to be an issue for small time values

* remove unnecessary spawnflare from toe

* tone down extra spell start effect

* experimental ReimuB gap shader optimization

* fix python3 shebangs

* generate simple blur shaders w/ hardcoded kernels

* New loading screen

* lasers: fix incorrect draw hook registration

* add webp support for atlas generator

* Use ImageMagick for atlas composition (adds 16-bit support)

* Atlas maintenance

* make the vampiric vapor bullets less prone to invisibility

* Revert a few particles to the quadratic fade curve

* experimental baryon effect

* improve baryon sprites

* disable the baryon effect on minimal postprocessing setting
2019-01-05 00:59:39 +02:00
holycleugh
10046ff9c7 Add option and keybinding to toggle audio mute. (#147) 2018-09-15 18:48:03 +03:00
Andrei Alexeyev
56f066ca3e
Add optional FXAA for the 3D views; fix nasty rendering bug 2018-08-17 01:32:58 +03: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
004ef04384
debug: add key to toggle display of real collision boundaries 2018-05-08 16:03:12 +03:00
Andrei Alexeyev
59cf8f6300
Rendering system rewrite, tons of refactoring, optimizations, and other cool stuff (#116) 2018-04-12 17:08:48 +03:00
Andrei Alexeyev
2925cf5dd6
adjustable power in practice mode. closes #107 2018-01-20 17:55:31 +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
f4cd177b1a
add option to disable most particle effects. use PFLAG_REQUIREDPARTICLE to ignore it 2018-01-11 22:40:46 +02:00
Andrei Alexeyev
485c9a8ed6
Happy New Year! 2018-01-04 19:14:31 +02:00
Andrei Alexeyev
5b7de7d8a2
gamepad: basic support for trigger buttons (analog and digital) 2017-12-30 17:39:42 +02:00
Andrei Alexeyev
03cfc05397
add restart/quit game shortcuts 2017-12-28 03:35:53 +02:00
Andrei Alexeyev
48b13cd83a
frameskip option for slow GPUs 2017-12-26 13:07:40 +02:00
Andrei Alexeyev
d66793a117
add option to swap buffers after waiting for next frame
also restructured loop_at_fps a bit. it now handles FPS counter updates
and buffer swaps.
2017-12-26 10:56:21 +02:00
Andrei Alexeyev
29acd5f58a meson: intel intrinsics, various improvements 2017-12-21 03:58:54 +01:00
Andrei Alexeyev
538b6e17cb
set gamepad deadzone to 10% by default 2017-12-18 18:07:02 +02:00
Andrei Alexeyev
de2223d800
add option to disable pause on focus loss
ping @makise-homura
2017-11-24 16:39:07 +02:00
Andrei Alexeyev
3413bd92e7
many vfs improvements
* There's no distinction between "temp" and "perm" nodes anymore.
    All nodes are allocated with 1 reference belonging to the
    vfs_alloc() caller.

    * VFSNode pointers retrieved by any API that returns one (most
    notably vfs_locate) are guaranteed to have exactly one reference
    belonging to the caller. What this means is that you must always
    decref them when you're done using them.

    If you're implementing such an API (e.g. a custom locate), remember
    to incref any persistent nodes you return.

    * Passing a VFSNode* to anything that successfully consumes one (for
    example, vfs_mount) transfers ownership of the reference to the
    consumer. In other words, consumers do not incref your nodes, but
    they will decref them once they don't need them anymore. If you want
    to keep the node around, then you must incref it first.

    * Bunch of other stuff.

"Ownership" is an abstract concept in this context. Basically it just
means "cleanup responsibility".
2017-11-10 21:49:54 +02:00
Andrei Alexeyev
e978d97614
add a "shoot by default" setting 2017-10-31 11:48:30 +02:00
Andrei Alexeyev
4bdfe5f408
dialogue text autowrapping, fpslimit off key, fixes 2017-10-23 13:10:40 +03:00
makise-homura
2b35177cb4 Removed excess and added missing newlines at end of files 2017-10-10 21:10:35 +03:00
laochailan
03a2426012
update to use #pragma once 2017-09-27 14:14:53 +02:00
Andrei "Akari" Alexeyev
0dba761251
config changes
* Added a versioned upgrade mechanism
    * Made values of vsync 66% less confusing
    * Defaulted vsync to off, since it seems to cause input delays for
    some people.
    * Don't shout warnings when the config file doesn't exist, this is
    not something to panic about.
2017-09-27 01:03:16 +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