Commit graph

695 commits

Author SHA1 Message Date
Sebastian Krzyszkowiak
886034e596
use ALLEGRO_NO_PRESERVE_TEXTURE on SDL2
seems there's no reason not to; it even fixes some stuff
2019-02-13 22:54:49 +01:00
Sebastian Krzyszkowiak
26a32fd083
destroy and recreate voice on suspend and resume 2019-02-07 04:11:40 +01:00
Sebastian Krzyszkowiak
9e0a1ddb36
IsOnCharacter: properly support subbitmaps (for instance spritesheets) 2019-02-01 05:45:26 +01:00
Sebastian Krzyszkowiak
10164293ba
add ability to enable multisampling via init params 2019-02-01 03:37:15 +01:00
Sebastian Krzyszkowiak
45d36870ad
PrintConsole: print current time when in verbose mode 2019-01-17 02:42:33 +01:00
Sebastian Krzyszkowiak
a6b6062be4
recompress flac to opus and images to lossy webp for emscripten and android builds, with asset cache 2019-01-13 18:45:17 +01:00
Sebastian Krzyszkowiak
6211dcbf57
precache glyphs in fonts 2019-01-13 18:19:44 +01:00
Sebastian Krzyszkowiak
ef77bedeae
clean up 2019-01-11 15:26:12 +01:00
Sebastian Krzyszkowiak
1334fc6b1d
fix a NULL pointer dereference in ResizeGamestates 2019-01-11 15:25:24 +01:00
Sebastian Krzyszkowiak
9006427278
clean up a duplicated framebuffer of the loading gamestate 2019-01-11 12:28:08 +01:00
Sebastian Krzyszkowiak
2333ff1187
emscripten: pause the mainloop during loading
Fixes blinks of a blank screen when async calls are made.
2019-01-11 02:34:22 +01:00
Sebastian Krzyszkowiak
08ee8f142c
loading screen drawing tweaks 2019-01-11 02:33:48 +01:00
Sebastian Krzyszkowiak
0d32d00890
emscripten: detach/attach the voice during loading
Should prevent audio artifacts when the browser is busy...

...when Emscripten gets it fixed, that is :P
2019-01-11 02:33:17 +01:00
Sebastian Krzyszkowiak
f5604b95fb
emscripten: output wasm submodules to .wasm.so files, so preload plugins can find them 2019-01-10 06:31:28 +01:00
Sebastian Krzyszkowiak
fe9b6f5384
emscripten: use __attribute__(used) in code instead of EXPORTED_FUNCTIONS in cmake 2019-01-10 06:04:29 +01:00
Sebastian Krzyszkowiak
871cdf115e
emscripten: fix a crash when onvisibilitychange fired during loading 2019-01-10 06:03:57 +01:00
Sebastian Krzyszkowiak
8c7068b48d
PrintConsole: use emscripten_log; don't use printf on Android and Emscripten; unify outputs 2019-01-10 02:32:23 +01:00
Sebastian Krzyszkowiak
d55fbebe4d
add more drawing (and sleeping in emscripten) to improve responsiveness around loading 2019-01-08 05:21:41 +01:00
Sebastian Krzyszkowiak
f07b075052
emscripten: install a callback for visibility changes
Fixes an issue where focus blur event was being dispatched only after
the game has been focused again.
2019-01-08 04:57:30 +01:00
Sebastian Krzyszkowiak
2ad77b071f
move autopause feature out of debug events 2019-01-08 04:54:53 +01:00
Sebastian Krzyszkowiak
d0316cd789
don't use timer for ticking; rely on delta instead
Timer was causing an infinite loop in cases where ticking took
more time than 1/60 sec.
2019-01-08 04:53:13 +01:00
Sebastian Krzyszkowiak
f648d661e6
emscripten: set ALLEGRO_NO_PRESERVE_TEXTURE
Doesn't seem to break anything there despite of using SDL2 backend.
2019-01-07 00:40:01 +01:00
Sebastian Krzyszkowiak
fdb4a29a13
emscripten_seek_audio_stream_secs: return end position after the sample has ended
Samples in Allegro return 0.0 in this case, while streams return the stream length.
2019-01-07 00:39:06 +01:00
Sebastian Krzyszkowiak
5fb99a97f8
emscripten: revise compiler settings and add a pre-js file with audio autoplay workaround 2019-01-07 00:37:34 +01:00
Sebastian Krzyszkowiak
f357d75591
emscripten: use emterpreter for displaying loading screen 2019-01-03 23:22:26 +01:00
Sebastian Krzyszkowiak
7d9adc8d14
emscripten: fix a typo in al_get_audio_stream_length_secs stub 2019-01-03 06:57:26 +01:00
Sebastian Krzyszkowiak
dbd047c64e
emscripten: force fullscreen as off on init 2018-12-22 02:21:46 +01:00
Sebastian Krzyszkowiak
cb0f4f6ba7
audio: always try INT16 depth first and use FLOAT32 as a fallback 2018-12-18 20:32:09 +01:00
Sebastian Krzyszkowiak
6e69d5410e
fix building with LIBSUPERDERPY_SINGLE_THREAD 2018-12-18 14:34:27 +01:00
Sebastian Krzyszkowiak
1b9b16cf15
more member name cleanup 2018-12-18 14:29:48 +01:00
Sebastian Krzyszkowiak
db096e7e97
GetDataFilePath: add "maemo5" directory handling similar to what's already done for android 2018-12-18 13:19:16 +01:00
Sebastian Krzyszkowiak
4da588cbb2
API consistency tweaks 2018-12-16 15:35:53 +01:00
Sebastian Krzyszkowiak
df1790d242
doxygen tweaks 2018-12-16 15:15:38 +01:00
Sebastian Krzyszkowiak
09e6b321b6
streamline the ability to access internal fields a bit 2018-12-15 05:29:32 +01:00
Sebastian Krzyszkowiak
b9b231a438
put debug config into public config struct 2018-12-15 01:09:44 +01:00
Sebastian Krzyszkowiak
ce66ba8060
reorganize Game structure, deprecate access to _priv fields 2018-12-15 00:59:34 +01:00
Sebastian Krzyszkowiak
d8f975300d
PrintConsole/DrawConsole: guard console data usage with mutexes 2018-12-14 02:18:05 +01:00
Sebastian Krzyszkowiak
4f438400fb
TestDataFilePath: accomodate also QtCreator's build directories 2018-12-13 03:56:23 +01:00
Sebastian Krzyszkowiak
fe23d33273
character: support advanced atlases in spritesheets 2018-12-12 01:46:16 +01:00
Sebastian Krzyszkowiak
f1933fc7ba
GetDataFilePath: support launching straight from the build directory 2018-12-11 01:20:57 +01:00
Sebastian Krzyszkowiak
ee058b439a
more warnings fixed 2018-12-11 00:54:43 +01:00
Sebastian Krzyszkowiak
5fcb55591c
fix cppcheck warnings 2018-12-11 00:26:51 +01:00
Sebastian Krzyszkowiak
d17a927a82
tween: add HasTweenEnded function 2018-12-10 21:24:59 +01:00
Sebastian Krzyszkowiak
f82dc24a88
don't use warning suppression on Maemo
"#pragma GCC diagnostic not allowed inside functions"
2018-12-08 06:27:51 +01:00
Sebastian Krzyszkowiak
b737d64ce8
improve SUPPRESS_WARNING macro 2018-12-08 05:50:27 +01:00
Sebastian Krzyszkowiak
d42955789c
clean up cmake files and import include templates into the engine 2018-12-08 03:30:09 +01:00
Sebastian Krzyszkowiak
37bf1ca1c6
particle: remove the destructor concept from FaderParticle, it's unnecessary 2018-12-07 07:11:18 +01:00
Sebastian Krzyszkowiak
3faa50165c
update imgui and clean up the allegro5 impl 2018-12-07 07:11:00 +01:00
Sebastian Krzyszkowiak
ad26fe14ad
add a separate flag to indicate that the loading screen is being shown 2018-12-07 06:14:52 +01:00
Sebastian Krzyszkowiak
0ebb85a660
make audio sample rate configurable 2018-12-06 05:37:51 +01:00
Sebastian Krzyszkowiak
f0910b63f7
remove phantom (never implemented) viewport option 2018-12-05 02:40:27 +01:00
Sebastian Krzyszkowiak
bffe816037
don't export functions from imgui integration implementation 2018-12-05 02:31:53 +01:00
Sebastian Krzyszkowiak
3586f49762
ensure that the game operates on UTF-8 on Windows
Should fix issues with Unicode filenames.
2018-12-05 02:09:06 +01:00
Sebastian Krzyszkowiak
178b45968d
utils: fix DrawCentered* function to take float for bitmap position 2018-12-02 03:16:12 +01:00
Sebastian Krzyszkowiak
2179d6cdc2
synchronize with the main thread on BSoD 2018-12-02 00:26:33 +01:00
Sebastian Krzyszkowiak
d5d923daa6
don't go into infinite loop when loading a gamestate fails 2018-12-02 00:25:08 +01:00
Sebastian Krzyszkowiak
58cb054a18
add missing al_destroy_mixer 2018-12-02 00:24:31 +01:00
Sebastian Krzyszkowiak
a961845698
code model, clang-tidy related tweaks and fixes 2018-11-30 04:20:35 +01:00
Sebastian Krzyszkowiak
c8ee56fc2c
utils: add StrToLower and StrToUpper functions 2018-11-30 02:45:39 +01:00
Sebastian Krzyszkowiak
2149c11ace
imgui: handle touch input, set style and don't call al_set_mouse_cursor, which isn't implemented on some platforms 2018-11-29 21:09:20 +01:00
Sebastian Krzyszkowiak
71fec20936
clean up 2018-11-29 04:39:51 +01:00
Sebastian Krzyszkowiak
440e6c41e6
Dear ImGui integration 2018-11-29 04:37:08 +01:00
Sebastian Krzyszkowiak
52030b67e3
particle: fix tint preservation in FaderParticle 2018-11-27 04:44:15 +01:00
Sebastian Krzyszkowiak
91180024a1
add CopyCharacter util function 2018-11-27 04:43:58 +01:00
Sebastian Krzyszkowiak
97495fa2aa
require the compositor to clear the screen by itself 2018-11-27 03:08:21 +01:00
Sebastian Krzyszkowiak
48189e7715
make depth buffer creation configurable 2018-11-27 03:06:43 +01:00
Sebastian Krzyszkowiak
9611be3267
add ClearToColor util for clearing whole target bitmap, not just the clipping rectangle
Clearing the clipping rectangle can be very costly, while clearing a whole texture is often free.
2018-11-27 02:50:16 +01:00
Sebastian Krzyszkowiak
d20eb28814
particle: add missing SYMBOL_EXPORTs 2018-11-26 18:32:56 +01:00
Sebastian Krzyszkowiak
e5937537df
initial draft of particle engine 2018-11-26 09:18:28 +01:00
Sebastian Krzyszkowiak
9ecd29a7c3
include allegro_color and platform specific headers already in libsuperderpy.h, clean up 2018-11-26 01:40:19 +01:00
Sebastian Krzyszkowiak
de46cff0a4
character: add an ability to tint subcharacters by their parent's color 2018-11-25 05:00:42 +01:00
Sebastian Krzyszkowiak
63f7ae39b9
character: support custom frame duration 2018-11-25 04:49:26 +01:00
Sebastian Krzyszkowiak
a74aa55409
character: allow creating characters with NULL name
Useful for shared characters that are going to be swapped between
their archetypes.
2018-11-25 04:17:00 +01:00
Sebastian Krzyszkowiak
a7d2ed55c0
character: don't log destroying shared characters
Usually leads to too much noise for no value.
2018-11-25 04:09:41 +01:00
Sebastian Krzyszkowiak
93f2be37d8
draw compositors, postdraw hooks and consoles on whole screen in full resolution (breaking change) 2018-11-22 21:01:35 +01:00
Sebastian Krzyszkowiak
56eb5a6ef4
loading: fix resetting showLoading var too early 2018-11-22 20:31:13 +01:00
Sebastian Krzyszkowiak
6c59ef1049
add support for routing the loading gamestate through compositor 2018-11-22 04:53:51 +01:00
Sebastian Krzyszkowiak
7f7c522b3c
make SetFramebufferAsTarget work also for the loading gamestate 2018-11-22 03:40:41 +01:00
Sebastian Krzyszkowiak
a6abd01ec2
libsuperderpy_start: load shaders before loading the loading gamestate
Allows the loading gamestate to use shaders created in common resources.
2018-11-22 03:37:32 +01:00
Sebastian Krzyszkowiak
80f59721f2
fix a clang warning 2018-11-20 22:01:39 +01:00
Sebastian Krzyszkowiak
a68e15e274
tween: add ability to store a custom tweening function with the Tween object 2018-11-20 20:30:48 +01:00
Sebastian Krzyszkowiak
9d9d23dfe8
tween: pre/post-delay support, StaticTween helper 2018-11-17 12:06:05 +01:00
Sebastian Krzyszkowiak
4754d8dd4e
shader: don't try to build a shader that already failed to be attached 2018-11-15 17:41:56 +01:00
Sebastian Krzyszkowiak
e04a52ea35
init: set libsuperderpy's default mixer as Allegro's default one 2018-11-02 06:10:15 +01:00
Sebastian Krzyszkowiak
f922ffe997
android: log into logcat 2018-11-02 06:07:49 +01:00
Sebastian Krzyszkowiak
bbba7da52f
AllocateGamestate: fix uninitialized memory
Fixes a segfault when resizing a window in between allocating and
loading the gamestate.
2018-11-01 23:56:37 +01:00
Sebastian Krzyszkowiak
b67d146cdb
maemo: rewrite mouse events into touch ones 2018-10-30 18:05:54 +01:00
Sebastian Krzyszkowiak
de835593c8
set the default window size according to the viewport aspect ratio 2018-10-27 05:18:02 +02:00
Sebastian Krzyszkowiak
e12bc10840
cmake: add an option to build libsuperderpy as a static library
Might be useful when packaging games for distribution repositories.
2018-10-23 03:53:54 +02:00
Sebastian Krzyszkowiak
7c30291d95
Load shaders created before libsuperderpy_start already when starting 2018-10-11 06:15:07 +02:00
Sebastian Krzyszkowiak
d20b81d104
update clang-tidy diagnostics 2018-10-10 21:37:54 +02:00
Sebastian Krzyszkowiak
532727b15c
Add some missing guards and debug messages for gamestate handling 2018-09-10 04:36:18 +02:00
Sebastian Krzyszkowiak
3e7d9812a3
Refactor the engine's main loop. 2018-09-10 03:22:45 +02:00
Sebastian Krzyszkowiak
c5fcba57cb
Fix a segfault when there's no postdraw handler 2018-09-10 03:12:19 +02:00
Sebastian Krzyszkowiak
916094b371
debug: decouple livereload from autopause 2018-08-09 00:42:53 +02:00
Sebastian Krzyszkowiak
7d4575308d
add config switches for various debug options 2018-08-09 00:05:25 +02:00
Sebastian Krzyszkowiak
e5dd715eb2
fix and update debug function keys 2018-08-08 23:59:38 +02:00
Sebastian Krzyszkowiak
6684847424
send filename, line number and function name to PrintConsole and FatalError for verbose debug output 2018-08-08 22:19:50 +02:00
Sebastian Krzyszkowiak
942fd043fd
lock the timeline debug view to debug mode 2018-08-07 00:43:42 +02:00
Sebastian Krzyszkowiak
b3a9186c6a
character: don't include frame offset in character's transform
Fixes handling of subcharacters.
2018-08-05 04:27:26 +02:00