Commit graph

2435 commits

Author SHA1 Message Date
Andrei Alexeyev
cc6514151a
Implement seeking in zip files without reading everything to memory
In particular, this greatly reduces memory usage for music tracks.
2019-03-16 22:11:37 +02:00
Andrei Alexeyev
c23c1239fe
vfs: improve read-only guarantees 2019-03-16 00:17:42 +02:00
Andrei Alexeyev
a82375993a
shut up warning 2019-03-15 23:45:18 +02:00
Andrei Alexeyev
3ee8ec3c42
options: finer volume step 2019-03-15 23:03:06 +02:00
Andrei Alexeyev
4755d566ff
fix buffer overflow 2019-03-15 22:24:31 +02:00
Andrei Alexeyev
b9766fcf59
music room improvements: allow playing locked tracks with confirmation 2019-03-15 22:19:49 +02:00
Andrei Alexeyev
bd5bcf7b03
Lower minimum meson version back to 0.45.0
Note that some configurations (e.g. an emscripten build) will definitely
fail on this version. The minimum recommended version is 0.48.0, and a
warning will be printed if using something older.
2019-03-12 02:05:35 +02:00
Andrei Alexeyev
f2b11c19f8
remove sha256 endianness check, it actually works fine on big endian
i am an idiot i'm sorry
2019-03-12 01:56:30 +02:00
Andrei Alexeyev
c2c1794c14
fix bogus sort stabilization 2019-03-11 19:20:38 +02:00
Andrei Alexeyev
620651a128
optimize prefix_get_sprite and prefix_get_tex 2019-03-11 17:45:15 +02:00
Andrei Alexeyev
add8469b06
refactor crazy memory allocations in events 2019-03-11 17:45:15 +02:00
Andrei Alexeyev
82a9a0223b
refactor crazy memory allocations in 3d background code 2019-03-11 17:08:54 +02:00
Andrei Alexeyev
53b97d5230
fix warning 2019-03-11 13:18:35 +02:00
Andrei Alexeyev
78edef358b
oops! 2019-03-11 12:43:12 +02:00
Andrei Alexeyev
a63e8f4a69
Add a basic music room 2019-03-11 01:21:43 +02:00
Andrei Alexeyev
b314cbd7d7
Enable gamepad input by default 2019-03-10 17:28:45 +02:00
Andrei Alexeyev
75ee08535b
fix a few memory leaks 2019-03-09 23:58:42 +02:00
Andrei Alexeyev
ef6b0fd944
fix non-pch build 2019-03-09 23:24:54 +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
c8e281bc02
fix all items being autocollected immediately 2019-03-09 18:25:34 +02:00
Andrei Alexeyev
fc41ebf89c
Replace RNG with xoshiro256+; update replay format
Support for writing older replay versions has been removed.
2019-03-09 18:19:42 +02:00
Andrei Alexeyev
4669ef291f
lower sfx volume to 50% by default 2019-03-06 14:23:50 +02:00
Andrei Alexeyev
309dc220a8
Don't try to use mir video driver by default
It's no longer supported by SDL2 as of 2.0.9, and appears to cause
problems with older versions. See #162
2019-03-06 12:08:09 +02:00
Andrei Alexeyev
abe4ddf260
refactor audio (module system like that of renderer) 2019-03-05 21:43:01 +02:00
Andrei Alexeyev
68111e6ccb
improve the Post Death Experience (and code) 2019-03-05 13:50:29 +02:00
Andrei Alexeyev
f87ac189ef
replace item spawning functions with type-safe versions 2019-03-03 13:53:45 +02:00
Andrei Alexeyev
616f7efa56
Fix bogus voltage spawn on enemy death by discharge
This was particularly bad on emscripten as it would hang the game
forever.
2019-03-03 13:18:21 +02:00
Andrei Alexeyev
65d890751a
Gastari special: allow grazing 10% of the bullets in benchmark spell 2019-03-01 18:16:40 +02:00
Andrei Alexeyev
715dec0373
show enemy/boss hitboxes in hitbox display mode 2019-03-01 18:10:49 +02:00
Andrei Alexeyev
e522a099ee
implement Gastari's quit shortcut suggestion 2019-03-01 17:55:32 +02:00
Andrei Alexeyev
55be769052
unscrew the log file 2019-02-28 21:56:16 +02:00
Andrei Alexeyev
f8cd9a119a
fix infinite recursion 2019-02-28 12:10:03 +02:00
Andrei Alexeyev
c5936a0bfd
pause powersurge during dialogs; fix double-cancel at end of stage 2019-02-28 12:00:35 +02:00
Andrei Alexeyev
89e9a7b8d7
Update cglm ref 2019-02-25 00:18:36 +02:00
Andrei Alexeyev
f52fa4e2e6
add submodule helper scripts, update readme 2019-02-22 23:46:54 +02:00
Andrei Alexeyev
0edce45dc9
Use absolute URLs for submodules 2019-02-22 23:46:54 +02:00
Andrei Alexeyev
aaf09dadd6
Move gamecontrollerdb to submodule and update it 2019-02-22 23:46:54 +02:00
Andrei Alexeyev
5f24e63523
Move CGLM to submodule and update it 2019-02-22 23:46:54 +02:00
Andrei Alexeyev
cce82d13d5
gl: defer ibo initialization for webgl compatibility 2019-02-22 09:45:49 +02:00
Andrei Alexeyev
4a440ab79b
OpenGL (mostly GLES) spec compliance fixes 2019-02-22 08:37:52 +02:00
Andrei Alexeyev
c8e057e388
basic emscripten compat and various fixes 2019-02-22 01:56:48 +02:00
Andrei Alexeyev
8fc5abb78a
The Powersurge game mechanic and scoring system (#159) 2019-02-22 01:56:03 +02:00
Andrei Alexeyev
7e3b5b1326
awful hack to 'fix' sdl brokenness on wayland 2019-02-20 21:47:50 +02:00
Andrei Alexeyev
4eb0185b8a
Workaround for Meson bug mesonbuild/meson#4947 2019-02-18 05:06:08 +02:00
Andrei Alexeyev
fcf08dcac7
workaround ANGLE's brokenness 2019-02-17 23:35:11 +02:00
Andrei Alexeyev
77f3e44f0a
use SSE fp math even on 32-bit x86 to ensure consistency 2019-02-17 23:25:16 +02:00
Andrei Alexeyev
c2949c47d8
log: fix colorless console formatter 2019-02-17 21:21:26 +02:00
Andrei Alexeyev
089b74cfae
opengl: fix missing ext vendor (APPLE) 2019-02-17 20:44:43 +02:00
Andrei Alexeyev
aa4d74b656
typo 2019-02-17 19:16:43 +02:00
Andrei Alexeyev
e2fe1af8fd
add file that has been forgotten for several months... facepalm 2019-02-17 01:18:43 +02:00