Commit graph

35 commits

Author SHA1 Message Date
Andrei Alexeyev
be7905d6a3
src: run upkeep 2024-05-17 04:58:47 +02:00
Andrei Alexeyev
8d2ee76710
replace include guards with #pragma once 2021-08-31 23:34:46 +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
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
4159ea1249
'upkeep' target for maintenance tasks; back to include guards; happy new year! 2019-01-23 22:10:43 +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
makise-homura
2b35177cb4 Removed excess and added missing newlines at end of files 2017-10-10 21:10:35 +03:00
Andrei Alexeyev
4e2e050baa
basic utf8 text input, with clipboard support 2017-10-01 00:43:22 +03:00
laochailan
03a2426012
update to use #pragma once 2017-09-27 14:14:53 +02:00
Andrei "Akari" Alexeyev
7c9e54a71d
update copyright and credits 2017-09-12 04:28:15 +03:00
Andrei "Akari" Alexeyev
644757a65a
gamepad settings improvements
GUIDs are now used to identify devices. this allows reliable persistent
configuration on multi-gamepad systems.

changed the way the device listing in the options menu works. it's
inactive when the gamepad system is disabled, and dynamically updated
when it's enabled. as a result, the "bare" init state is now finally
gone. this should work with minimal or no changes when the hotplugging
events are properly handled.

the "enable gamepad support" toggle is now effective immediately. the
gamepad system is no longer restarted every time the user leaves the
gamepad menu, unless they have changed the device.
2017-08-28 14:56:43 +03:00
Andrei "Akari" Alexeyev
3f1119340e dynamic quality scaling for fonts
not sure if i'm actually doing it right. but seems to look okay, unless
i manually resize the window to something weird, then it can get blurry.
2017-04-16 01:00:43 +03:00
Andrei "Akari" Alexeyev
edf584b9f3 WIP rendering quality (resolution) settings.
Rewrote a lot of the stage drawing and FBO handling code. Introduced
some WTFs, hence the WIP.
2017-04-07 12:59:23 +03:00
Andrei "Akari" Alexeyev
ca16c30966 large refactoring WIP
windows & osx untested
bgm untested
too many changes to comment on
2017-03-05 00:39:17 +02:00
Andrei "Akari" Alexeyev
f051a3afd9 Disable resizable window by default, added an option to enable it back
Not everyone needs a freely resizable window and it causes problems on
some systems.
2017-03-01 02:25:52 +02:00
Andrei "Akari" Alexeyev
671f3b8d3a gamepad options menu improvements 2017-02-28 00:58:47 +02:00
Andrei "Akari" Alexeyev
57053210dd Refactored and improved menus and transitions 2017-02-24 23:58:27 +02:00
Andrei "Akari" Alexeyev
802cacb799 Config callback system
No more hacks in options menu code to update stuff when a setting
changes
2017-02-17 20:23:22 +02:00
Andrei "Akari" Alexeyev
81fe93a033 fixed a buffer overflow in options menu 2017-02-15 00:33:10 +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
makise-homura
0ad5a46c75 Volume controls changed to sliders from "0..10" value list 2017-01-31 00:55:53 +03:00
Andrew "Akari" Alexeyew
1f06d4f377 GUIfied the rest of the gamepad options (controls) 2012-08-17 01:41:33 +03:00
Andrew "Akari" Alexeyew
3058c971f9 Some gamepad options. TODO: controls 2012-08-17 00:35:48 +03:00
Andrew "Akari" Alexeyew
c8542adc99 Some options menu refactoring 2012-08-16 19:15:46 +03:00
Andrew "Akari" Alexeyew
779ff58684 Fixed all the () prototypes, changed to (void) 2012-08-10 23:08:51 +03:00
Andrew "Akari" Alexeyew
a322371b5f Introduced playername option, fancied up the replayview menu, etc 2012-07-29 23:39:52 +03:00
Andrew "Akari" Alexeyew
3d59ba51e4 user-adjustable resolution, fuck yeah 2012-07-28 23:53:53 +03:00
Andrew "Akari" Alexeyew
7fb8b25732 improved the no-stage-bg feature, and extended the options menu functionality while I was at it 2012-07-13 23:42:35 +03:00
Akari
757dda7715 Allowed the user to customize controls 2011-07-03 18:55:31 +03:00
Akari
9e35feadad Added keybinds and config saving (TODO: allow the user to actually customize the keys) 2011-07-03 18:37:18 +03:00
Akari
3e4413ca1c Added copyright comments to src/menu/options.* 2011-07-03 17:09:28 +03:00
Akari
39d6d9bccf A bit of cleanup and various fixes 2011-07-03 17:05:52 +03:00
Akari
599d5a8d82 Added a basic options menu. Doesn't save to the config yet. 2011-07-03 16:11:18 +03:00