Commit graph

46 commits

Author SHA1 Message Date
Andrei Alexeyev
0fe465522f
menu: improve grouping in spell practice and stage select 2024-06-14 22:35:24 +02:00
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
6f25a4b7d4
menu/common: add context argument for draw_menu_list() 2022-02-16 05:09:30 +02:00
Andrei Alexeyev
00e4837827
Separate StageInfo-related APIs from game-stage code (#227) 2020-05-16 23:41:54 +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
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
a63e8f4a69
Add a basic music room 2019-03-11 01:21:43 +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
fa802dbd94
Some refactoring
* Added (and fixed) a few useful warnings
    * Removed some dead code
    * Cleaned up the build system files a bit
    * Once again separated ZIP support from data packaging
    * Converted macOS cross-compilation options into cross-file properties
2019-01-24 22:24:43 +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
e11e229b72
make benchmark spell appear last; account for extra stage in the spellstage system 2018-01-21 12:35:48 +02:00
Andrei Alexeyev
485c9a8ed6
Happy New Year! 2018-01-04 19:14:31 +02:00
Andrei Alexeyev
48b13cd83a
frameskip option for slow GPUs 2017-12-26 13:07:40 +02:00
Andrei Alexeyev
29acd5f58a meson: intel intrinsics, various improvements 2017-12-21 03:58:54 +01:00
Andrei "Akari" Alexeyev
7c9e54a71d
update copyright and credits 2017-09-12 04:28:15 +03:00
Andrei "Akari" Alexeyev
f2d385d147 Some stage-related refactoring 2017-02-26 14:17:48 +02:00
Andrei "Akari" Alexeyev
57053210dd Refactored and improved menus and transitions 2017-02-24 23:58:27 +02:00
Andrei "Akari" Alexeyev
4d039759a3 fix missing separator 2017-02-19 03:28:00 +01:00
Andrei "Akari" Alexeyev
1e6011433c Initial support for single-spell stages
Adapted all of the current spellcards into spellstages, which will
later be used in a spell practice mode a-la IN.
For now they are only accessible through the stage select menu or
by specifying their ID on the command line; both available only
if you built with -DTAISEI_DEBUG=1
2017-02-19 03:28:00 +01:00
Martin Herkt
896851fcb1
Edit story.txt and in-game texts
I’m not a native speaker, nor am I a talented writer,
so this is all I can do for now.
2017-02-19 01:35:18 +01:00
Andrei "Akari" Alexeyev
149b62c37c Pass a pointer to the MenuData structure to MenuActions 2017-02-16 18:55:46 +02:00
Andrei "Akari" Alexeyev
f06d101399 Why was the stage menu transient? fixed 2017-02-16 18:19:52 +02:00
Andrei "Akari" Alexeyev
f2485d5cb8 stupid menu bullshit 2017-02-12 05:45:19 +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
815ae7b23b Added background music subsystem. 2017-01-24 16:40:57 +03:00
Andrew "Akari" Alexeyew
5877ed960a tweaked and optimized draw_menu_list 2012-08-14 23:17:47 +03:00
laochailan
caec201e9a fixed menu quit action 2012-08-12 21:33:47 +02:00
laochailan
bee62a73fb fixed issues 2012-08-12 17:59:12 +02:00
laochailan
d3bea2f52b revisited menus 2012-08-12 16:54:48 +02:00
Andrew "Akari" Alexeyew
5ce30f8ca4 Merge branch 'master' into selections 2012-08-07 17:14:59 +03:00
Andrew "Akari" Alexeyew
174bab7ce6 fix scroll AGAIN 2012-08-07 15:40:15 +03:00
Andrew "Akari" Alexeyew
e4d0872ec6 fixed menu scrolling 2012-08-07 06:58:15 +03:00
Andrew "Akari" Alexeyew
7776443935 multistage replays 2012-08-07 06:28:41 +03:00
Andrew "Akari" Alexeyew
aea10c8404 experimental selection backgrounds for menus (ingamemenu-like) 2012-08-06 08:54:22 +03:00
Andrew "Akari" Alexeyew
610332bc2f got rid of the N. numeration in stageselect 2012-08-04 07:41:47 +03:00
Andrew "Akari" Alexeyew
b3219a3030 some ui tweaks and fixes 2012-08-04 05:57:26 +03:00
Andrew "Akari" Alexeyew
a322371b5f Introduced playername option, fancied up the replayview menu, etc 2012-07-29 23:39:52 +03:00
laochailan
45dc909b4b made min global, changes for mingw builds 2012-07-29 09:32:56 +02:00
Andrew "Akari" Alexeyew
6e58dcacf5 removed some suprt ultra verbose stuff 2012-07-16 21:03:57 +03:00
Andrew "Akari" Alexeyew
4f5eeb5300 improved the replays menu 2012-07-16 20:59:55 +03:00
Andrew "Akari" Alexeyew
4195ea94c4 basic replayview menu 2012-07-16 20:26:41 +03:00
Andrew "Akari" Alexeyew
b36c774a14 made use of the hidden flag 2012-07-14 11:48:13 +03:00
Andrew "Akari" Alexeyew
db8dfd3580 Added stageselect menu for the debug mode 2012-07-14 11:40:21 +03:00