This commit changes a bunch of internal rendering logic to
use FBOs in a way that doesn't violate the GL spec.
The water surface FBO's output texture was bound for reading
while at the same time rendering the water surface back into the
same FBO! Depending on the card/driver/load/zoom factor/moon phase,
this could lead to water surface flickering, chessboard effects,
and other visual glitches.
In order to fix this an extra FBO is needed.
In theory this is a simple fix but in practice this is the Aquaria
codebase and everything is more complicated than it has any right to be.
Couple other things:
- FBOs no longer have a depth renderbuffer. Aquaria never uses the depth
buffer for anything, so this can go to save some memory.
Also remove renderbuffer GL function pointers.
- Make FBOs multi-"paged". This is supposedly more efficient on desktop GL,
if glDrawBuffer() supports GL_COLOR_ATTACHMENTn. This is currently checked
via the presence of glDrawBuffersARB().
- Main core FBO now has 2 pages becaus it's needed for the water surface.
The same 2 pages are later used by the after effect manager to ping-pong
postprocessing shaders. Remove private after effect FBO.
TODO:
- There's still a bug in the one-fbo-multiple-binding-points code path.
-> for now glDrawBuffersARB must be NULL to work properly.
- no longer uses GL matrix stack manipulation, all matrix math is done locally
- use fixed rotation matrixes for fh/fv
- don't touch GL buffers (fixes crash with prev. commit)
rq=0 used to hide the base head gfx to only show frames.
but rq=0 is not what we want after consolidating those extra quads into the base quad.
so in order to keep backwards compat, unhide a bone if it has frame tiles.
rq=0 used to hide the base head gfx to only show frames.
but rq=0 is not what we want after consolidating those extra quads into the base quad.
so in order to keep backwards compat, unhide a bone if it has frame tiles.
- bone frames are no longer separate quads. this is probably a leftover
from when crossfading was planned, but this was never implemented.
now it's a simple texture swap.
- remove anim resetPassOnEnd attrib
- instead, add resetOnEnd that applies to everything that was changed via bone command
- resetOnEnd=true is the new default
This is related to a494a3f411 and should hopefully
fix the last issues with this for good.
Seems fine with SDL versions from 2022 and 2023 on windows;
untested on linux.
(The second window->handleInput() that got removed broke the sing circle
if it was there. It was previously added as a mitigation and is no longer
needed.)
This was caused by early deletion of entities.
If new ones were spawned upon further editing of a map, it could re-use
entity IDs and cause both new and old entities to be spawned in the position
of the new entity (due to EntitySaveData of the old one still intact).
This is now prevented by not touching the ID range of map entities.
Should probably make an offline tool to recompress entity IDs...
- correctly sort ElementTemplate by idx, not by pointer. oops.
- selecting tiles works again (new: including wraparound)
- don't display layer tile borders when switching to other edit modes
- make sure that tile selection wraparound doesn't pick up font letter tiles
+ entity_exertHairSegmentForce
+ entity_setHairTextureFlip
+ entity_setHairWidth
Sadly obj_fh() doesn't work on hairs for some reason and it just turns invisible
this should now be correct and much simpler to maintain from now on.
downside is that it breaks the appearance of quads with tex repeat on,
but i don't think anyone ever used this ever since i've added the Lua functions;
so i'm just calling it broken in older versions and move on.