Commit Graph
37 Commits
Author SHA1 Message Date
leo60228 be2b1564a8 Call FS.syncfs on Emscripten (#838)
Also, add a sync parameter to avoid calling syncfs too often.

Calling syncfs twice in a row is both inefficient and leads to errors
displaying twice. This allows us to bypass it when saving unlock.vvv as
part of savestatsandsettings.
2021-09-02 13:19:51 -04:00
leo60228 14c24069fd Fix indentation consistency 2021-08-31 15:37:52 -07:00
leo60228 52fceb3f69 Allow any player entity to be on the ground/roof to flip
This re-adds the midair flip glitch.
2021-08-31 15:37:52 -07:00
leo60228 1e8b5a6ba7 Actually move checks out of loop
How did this ever work?
2021-08-31 15:37:52 -07:00
leo60228 cd4ce05cb3 Split out tap_left and tap_right from player input loop
The game will freeze the player immediately if they release a
directional button within 3 frames of pressing it. Similar to flipping,
this involves global state, and will only apply to the first player
entity.
2021-08-31 15:37:52 -07:00
leo60228 1eb8570329 Split flip logic from player input logic
Closes #484

Flipping only applies momentum to the player entity currently being
processed. This normally wouldn't be a problem. However, flipping
involves global state, and only one flip can occur per frame. This means
that additional player entities don't get this boost of momentum, which
feels somewhat unnatural during gameplay.

This commit fixes this by splitting flip logic out of the loop over
player entities, and applying the flip momentum to all player entities.
2021-08-31 15:37:52 -07:00
leo60228 b132f4fc6c Change physfsrwops.h SDL.h include, again 2021-08-31 15:30:23 -07:00
leo60228 de0998ca34 Compile physfsrwops with VVVVVV because of SDL dependency 2021-08-31 15:30:23 -07:00
leo60228 668c3d91d6 Return false from unPackBinary if no tracks are valid 2021-08-31 15:30:23 -07:00
leo60228 f86a67456b Remove data/ from track name list, refactor music loading, and support loose ogg music
(these should be separate commits but they're annoying to split after
the fact, oh well)
2021-08-31 15:30:23 -07:00
leo60228 5b6c4b6b28 Add physfsrwops 2021-08-31 15:30:23 -07:00
leo60228 1cbc3bdc7c Treat __unix__ define as generic Unix 2021-08-31 10:35:20 -07:00
leo60228andMisa 6abf87f1e4 Explicitly use void in emscriptenloop declaration
Co-authored-by: Misa <infoteddy@infoteddy.info>
2021-08-31 10:28:55 -07:00
leo60228 46ee84d6ef Disable unfocus on Emscripten 2021-08-31 10:28:55 -07:00
leo60228 0063e1c3bc Use Emscripten's main loop
On Emscripten, SDL_Delay is implemented as a busy loop. In addition,
everything happens on a single thread. This effectively means that
you have to let Emscripten manage the main loop, since if you do it
yourself the browser will just be frozen.
2021-08-31 10:28:55 -07:00
leo60228 7baf143a6b Add necessary Emscripten linker flags 2021-08-31 10:28:55 -07:00
leo60228 6d57ccc25b Support Emscripten in FileSystemUtils 2021-08-31 10:28:55 -07:00
leo60228 a689c3ab96 Support Emscripten's SDL2
Emscripten defaults to using SDL 2.0.10, but
`export EMCC_LOCAL_PORTS=sdl2=/path/to/SDL2` seems to work.
2021-08-31 10:28:55 -07:00
leo60228 c1950037c2 Use SDL_OpenURL in FILESYSTEM_openDirectory (#623)
The recently released SDL 2.0.14 adds a native function for opening URIs
from the host system, superseding the OS-specific implementations of
FILESYSTEM_openDirectory.
2021-02-19 21:16:19 -05:00
leo60228 b5ef10cae5 Consistently use Screen::GetWindowSize 2021-01-18 13:10:22 -05:00
leo60228 46d8599f62 Use SDL_GetRendererOutputSize instead of SDL_GetWindowSize
SDL_GetRendererOutputSize will always return the actual size, even in
some obscure HiDPI/macOS cases.
2021-01-18 13:10:06 -05:00
leo60228 d9fff2a8c3 Set SDL window as DPI-aware
This works on macOS, Wayland, and a few more esoteric platforms. X11
doesn't have a concept of DPI-awareness. Note that with this flag
SDL_GetWindowSize() isn't guaranteed to return the actual window size.
2021-01-18 13:09:47 -05:00
leo60228 89886e6c52 Run CI on CentOS 7 (#574) 2021-01-11 00:30:15 -05:00
leo60228 6795856431 Use SDL_fabsf where std::abs was previously used 2021-01-01 22:37:46 -05:00
leo60228 91c3e6cbc5 Revert "Document SDL_abs vs. SDL_fabs"
This reverts commit 8c472ed73d.
2021-01-01 22:37:46 -05:00
leo60228 8c472ed73d Document SDL_abs vs. SDL_fabs 2021-01-01 21:10:16 -05:00
leo60228 c4893a133f Use SDL_abs instead of std::abs
This prevents issues when calling std::abs with a float on some older
compilers. While it would normally be promoted to an int, std::abs is
special due to being overloaded despite being a C function. This can
cause errors due to the compiler being unable to find a float overload.
SDL_abs doesn't have this problem, since it's a normal C function.
2021-01-01 21:10:16 -05:00
leo60228 a99e976402 Support hex entities in metadata 2020-06-15 20:32:10 -04:00
leo60228 dd5c50c94c Fix some leaks 2020-06-07 22:40:03 -04:00
leo60228 887c1fbf96 Don't leak flipbfont 2020-06-07 22:40:03 -04:00
leo60228 abbf6bafb9 Don't leak sounds/music 2020-06-07 22:40:03 -04:00
leo60228 f3b26904ec Don't leak binaryBlob 2020-06-07 22:40:03 -04:00
leo60228 9b91047bba Find SDL_mixer.h instead of assuming it's in the same location as SDL.h 2020-06-07 22:40:03 -04:00
leo60228 d193caac98 Revert "Add destructor for SoundTrack/MusicTrack (and explicitly define move constructor to prevent double-free)"
This reverts commit 2f760af439.
2020-06-07 22:40:03 -04:00
leo60228 098fb77611 Set C++ standard to C++98 2020-06-07 22:40:03 -04:00
leo60228 e71f47f1c9 Clear soundTracks and musicTracks on musicclass::init 2020-06-07 00:04:42 -04:00
leo60228 2f760af439 Add destructor for SoundTrack/MusicTrack (and explicitly define move constructor to prevent double-free) 2020-06-07 00:04:42 -04:00