Commit graph

41 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
f73b1d6891
Abandon standard C conformance and require GNU extensions
Removed the use_gnu_ext option as well as fallback paths for compilers
that don't support GNU extensions. To my knowledge, none of those
compilers support C11 to a sufficient extent to compile Taisei anyway,
and those fallbacks are very poorly tested.

Pedantic warnings are now disabled, and extensions that are common to
reasonably recent versions of GCC and clang are permitted to be relied
on (list of allowed extensions TBA).
2021-08-31 23:33:16 +03:00
Andrei Alexeyev
b902e90229
Add alist_merge_tail to efficiently merge two lists
Empties the "source" list, moving its contents to the tail of the
"destination" list.
2020-03-31 22:16:10 +03:00
Andrei Alexeyev
6834796262
emscripten compatibility fixes 2019-12-18 15:33:36 +02:00
Andrei Alexeyev
8bdaa529df
fix for platforms where alignof(max_align_t) < 16
i686 windows in particular
2019-09-24 22:59:12 +03:00
Andrei Alexeyev
2e9904e83c
New system to manage auto-resized framebuffers 2019-08-25 02:52:39 +03:00
Andrei Alexeyev
10d3e4226b
add attr_returns_allocated for functions that allocate new objects 2019-08-04 01:29:41 +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
387d16d66a
fix build without GNU extensions 2019-04-12 11:50:20 +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
14f0a170c8
WIP: accelerate build with precompiled headers
Also got rid of rwops_pipe; we don't use it and PCHs make passing the
required feature macro for the posix implementation too complicated.
2019-02-09 12:29:54 +02:00
Andrei Alexeyev
e959fbc5f7
Fix a lot of warnings with -O3 and 32bit builds 2019-02-02 13:25:06 +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
83a8961df6
use "anchored" lists for most game objects
these have a pointer to the last element, thus appending is fast
2018-06-01 21:40:18 +03:00
Andrei Alexeyev
59cf8f6300
Rendering system rewrite, tons of refactoring, optimizations, and other cool stuff (#116) 2018-04-12 17:08:48 +03:00
Andrei Alexeyev
513d613387
Consistent indentation: indent with tabs, align with spaces (#104)
I would've preferred to just go with 4-spaces for indent and no tabs,
but lao is a bit conservative about it. :^)

Still, this is a ton better than mixing different styles all over the
place, especially within the same file.
2018-01-12 20:26:07 +02:00
Andrei Alexeyev
d73f8d28a3
add head version of list_insert_at_priority, use it for proj_insert_colorprio (slightly faster) 2018-01-09 21:54:03 +02:00
Andrei Alexeyev
485c9a8ed6
Happy New Year! 2018-01-04 19:14:31 +02:00
Andrei Alexeyev
e355e57fb5
make the list api require less insane casts all over the place
by sealing the spirit of insanity in its header file, that is
2017-12-24 08:16:25 +02:00
Andrei Alexeyev
de31a20497
objectpool: dynamic extents and other improvements 2017-12-24 05:00:19 +02:00
Andrei Alexeyev
29acd5f58a meson: intel intrinsics, various improvements 2017-12-21 03:58:54 +01:00
Andrei Alexeyev
db8dd8ad7c
desperate optimizations
i even used a profiler
2017-11-23 18:23:30 +02:00
Andrei Alexeyev
7b53d9e731
redesign list api 2017-11-21 16:45:01 +02:00
makise-homura
2b35177cb4 Removed excess and added missing newlines at end of files 2017-10-10 21:10:35 +03:00
laochailan
c2b3747d95
Animation player manager Pro (tm) 2k17 2017-10-03 17:25:38 +02:00
Andrei Alexeyev
ef67a16867
WIP event system rewrite. text input missing 2017-10-01 00:43:18 +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
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
fdd4633e19 Implemented a simple general-purpose hashtable 2017-02-28 19:28:15 +02:00
Andrei "Akari" Alexeyev
4acfc71887 Clean up all refs when a stage ends, print a warning if some leaked 2017-02-28 16:38:02 +02:00
Andrei "Akari" Alexeyev
e4bcf929f9 Ensured newline at the end of files 2017-02-23 12:43:45 +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
laochailan
b0dbe755f9 Improved youmu homing
also:
+ master spark sound
* only one of a sound per frame
* references are more efficient
2011-07-07 14:34:30 +02:00
laochailan
91b3b7d65e reference system
added some kind of reference system (see list.h) to ensure particles/projectiles/enemies storing pointers to each other that they will not access a borked address.
2011-05-13 19:03:02 +02:00
laochailan
d9fdc2aa0e Dialogs! conversational~
fun fact: taisei might build with -Wall -Werror now.
2011-05-08 13:48:25 +02:00
laochailan
3f2885e185 fix: memleaks
there were some memleaks I left out of laziness. fixed.
2011-04-26 22:39:50 +02:00
Lukas Weber
f35130ad1c openth becomes seiyou
After this short break, I have to announce that this project is no longer called openth. The name was stereotypical and conflicted with Open Theme Hospital. Thus, gentlemen, we are now working on Seiyou (西洋). Thanks to lachs0r for this wonderful suggestion.

Also the lincense has changed. Farewell, gnutardedness, hello MIT. I feel somehow relieved now after freeing the project of nearly one thousand lines.
2011-03-05 13:44:21 +01:00
Lukas Weber
a4a2d9a1a1 killed list double code
yay. look, i cut some of that annoying list code repetitions you always have with linked lists in C. let's just pretend C had templates, put some void-pointers in, add the necessary (void *) casts to show that you are really serious about this and wazaah, you created another funny piece of (C++)--
2010-10-27 19:51:49 +02:00