* Add a general purpose multi-threaded task manager (worker pool) for background tasks
Reimplemented screenshots off-loading using the new task manager.
* Largerly rewrite resource loading internals
They use the new task manager API now and should be generally more
robust.
* Made the game playable without threads again
* wait for resource async load task instead of intermediate state change
* remove dead code
* taskmgr: if creating a worker thread fails, try to make sure the others terminate
This reduces in-game stuttering when a screenshot is taken, especially
if multiple are taken during a short time frame. The pixel transfer from
the renderer to client memory is still synchronous, so some spikes are
to be expected; however, png encoding is usually much slower.
Also, TODO: convert this code into a generic multi-threaded task
manager/worker pool (similar to python's futures), and make the
asynchronous resource loading code suck less using it. Another useful
application is asynchronous logging, but that probably should be turned
off in debug builds by default.
The only case of t==0 being skipped is if the projectile was somehow
created after the projectile processing loop for this frame has been
finished. Currently that is only possible if a particle spawns a
non-particle projectile, which, ideally, should never happen. The same
problem exists with other types of entities. For example, if you have a
funny projectile rule that spawns an Enemy, that Enemy will have the 0th
frame skipped. One way to fix this is to maintain a list of all entities
in the game and process them all in a single loop, where newly spawned
entities would be appended to the tail of the list. This is also
probably the only good way to fix this, too.
Handling of all projectile events has been made mandatory to facilitate
easier debugging of subtle and/or hard to track bugs. If t<0, then the
projectile rule MUST return ACTION_ACK, signifying that it acknowledged
the event and handled it appropriately. Otherwise, it SHOULD return
ACTION_NONE or ACTION_DESTROY. In a perfect world, those just wouldn't
be conflated in the same function with update logic.
I've also cleaned up the stage_logic routine a bit. Moved most of the
dialog handling into dialog.c and gave higher priority to boss
processing. The later is currently necessary to let boss-spawned
projectiles and particles to get called with t==0.
* Post-battle revision for Reimu
I made some minor edits to both this one and Marisa besides the new changes. I thought they would either be better or more grammatically correct. Hope they're all good.
* Reimu change
Now she tells Iku to donate to the shrine, Akari. :^)
* Kurumi dialogue line change
I kind of agree with Akari's proposition (the first one), so it's changed for now.
* Post-battle revision for Marisa
Hopefully I'm doing this formatting correctly.
* Marisa post-battle revision for Wriggle's revision
I tried buffing it and making the silly line sound more serious.
* wip projectile prototypes
* Partial fix for replay desyncs
* some YoumuA fixes
* fix various ToE problems
* fix MarisaB
* fix master spark
* fix iku slave particle position
* this timeout was somehow halved during the changes
* remove some v1.2 compat hacks
I know this is not on the reimu branch but putting them here without
integrating them with the rest of the game allows Lalasa to start
editing already.