1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-25 17:53:47 +00:00
Commit graph

403 commits

Author SHA1 Message Date
fgenesis
b74c5a2986 Invert Quad::renderGrid() draw loop to be more cache friendly 2022-09-14 05:36:46 +02:00
fgenesis
4b64147914 MSVC optimizer doesn't like refs to primitive types 2022-09-14 05:21:25 +02:00
fgenesis
a1005dafe2 Make Bone::ANIM_* a bitmask. This also changes Lua constant ANIM_ALL from 10 to 3. 2022-09-14 05:20:37 +02:00
fgenesis
8e979e0e05 simplify Quad::drawGrid 2022-09-14 05:11:56 +02:00
fgenesis
29fd4ec44e clean up interpolators; WIP towards bspline support in anim editor 2022-09-13 18:38:44 +02:00
fgenesis
55689228bf Attempt to fix crash when instantiating Core alone but this is definitely not enough 2022-09-12 00:12:41 +02:00
fgenesis
0afd09dc75 bspline wip more 2022-09-05 17:19:34 +02:00
fgenesis
214590742d wip splines 2022-09-04 17:16:35 +02:00
fgenesis
a494a3f411 ignore mouse motion events generated by SDL_WarpMouse().
Also fix bug that mouse.change got stuck on a tiny value and constantly
move the camera in editor mode.
This is a continuation of 764d106d50 and seems to fix the
previous issues with SDL2 >= 2.0.17

Also remove some unused vars.
2022-08-24 14:16:25 +02:00
fgenesis
9e2c640b51 attempt to fix crash when loading a saved game on a map with an already collected health upgrade
This problem might have been introduced in 06270eaac0 but not sure.
The crash could happen due to a use-after-free memory access:
When deleting an entity with skel in postInit(), deletion would be
delayed by 1 frame because that is how entity_delete() works.
During deletion, RenderObject::children were removed and deleted
but SkeletalSprite::bones still had those pointers.
Additionally an object would delete its children in onUpdate() after
safeKill(), and still proceed to run scripts, which would then possibly
access freed memory too.
This fix causes children to not be deleted until we're out of the update()
cycle, and instead delete children together with the root object.
2022-07-18 23:00:22 +02:00
fgenesis
d7ff053efd Rewrite SceneEditor level generation and skinning, use light pink to designate areas that should not be skinned
This also fixes a long-standing off-by-one with the generated ObsRows:
Before this commit, the game would (upon F11) eat every black pixel from
the map template that was directly left of a white pixel, eg.
#### ## # ## ... would become
###  #    #  ...

GENERATED MAPS ARE NOW DIFFERENT!
With this bug gone, dumping obs (F8) and loading that back in as a map
template (F11) should now be fully round-trip compatible and not lose
pixels anymore.

Extra feature:
(R>=200, G in [128..199], B>=200) in the map template now designate zones
that should not be obstructed but also not generate border rocks when
skinned (F12). Makes editing energy temple styled maps much easier since
we don't have to manually erase tiles on layer "5" anymore, all the time.
2022-07-06 08:59:55 +02:00
fgenesis
71ceac4d22 oops 2022-07-02 21:04:18 +02:00
fgenesis
cfba5d7d4a update RenderObject::gravity like the rest of the InterpolatedVectors 2022-06-20 18:39:08 +02:00
fgenesis
614f987df2 Make Game::fillGridFromQuad() and RenderObject::getInvRotPosition() use glm instead of the GL matrix stack 2022-06-20 18:36:49 +02:00
fgenesis
baa1170e6f remove RenderObject::isPieceFlippedHorizontal() + tiny cleanup 2022-06-20 17:46:37 +02:00
fgenesis
21c51e06cb git gud 2022-06-20 04:35:51 +02:00
fgenesis
f01db61292 show better errors when we fail to start up 2022-06-20 04:25:18 +02:00
fgenesis
60dd1d7bc7 fix build on osx? 2022-06-19 03:59:54 +02:00
fgenesis
e960b238be revert part of 72f2b44620, now rendering of entities that are just simple quads is ok again 2022-06-10 03:51:26 +02:00
fgenesis
72f2b44620 Tiny simplification in render pass logic 2022-06-09 02:32:19 +02:00
fgenesis
a2e7e4a670 undo prev. commit and fix this properly. i'm just blind. 2022-06-06 01:41:50 +02:00
fgenesis
8b3c00dc76 fix quad coloring when overridden by parent (eg. entity damage flash) 2022-06-05 23:40:26 +02:00
fgenesis
b4ae208886 remove now unused constant OVERRIDE_NONE 2022-05-25 21:19:14 +02:00
fgenesis
4e9e0acb4a correct rendering entities that have no skel 2022-05-25 21:18:55 +02:00
fgenesis
f91d66a0e0 bind texture only when we're really about to render 2022-05-25 01:05:52 +02:00
fgenesis
f466e1e7c8 remove overrideRenderPass completely
Also removes Lua functions:
- obj_setOverrideRenderPass()
* entity_setRenderPass() is now the same as obj_setRenderPass(),
  without the special case alternate name in Lua
2022-05-25 00:40:47 +02:00
fgenesis
1a90625979 refactor rendering logic to be a lot less wasteful
Observations:
- Entity::renderPass was never set to RENDER_ALL -> can simplify some things
- The initial pass check in RenderObject::render() was constant for each pass
-> All logic that is per-pass-constant can be moved to a renderability pre-check
- Core::overrideStartLayer, Core::overrideEndLayer, Core::rlayer were never used
- Should be possible eventually to prepare & render layers in parallel

I am not sure if the changes in this commit are 100% correct, but layer passes
are still working and the hug looks like it should.

Thinking about it, the overrideRenderPass functionality should never have existed.
The game scripts don't actually use entity_setRenderPass
(which in turn calls Entity::setOverrideRenderPass())
so I might remove that function in a future commit,
together with the rest of the "override" functionality.
2022-05-22 17:26:16 +02:00
fgenesis
da23098692 remove PostProcessingFX
It was broken on modern graphics cards anyway and should rather be re-introduced
in a cleaner way once the renderer is ready for it
2022-05-21 18:56:27 +02:00
fgenesis
693223552d remove Quad::createStrip(), related members, and cleanup Bone strip handling
Saves some work when rendering EVERY SINGLE QUAD in the game
2022-05-21 17:31:50 +02:00
fgenesis
80d23900de Don't cache blend type while glBlendFunc() is still called elsewhere 2022-05-21 16:31:38 +02:00
fgenesis
5c558c122f Remove RenderObject::setColorMult() hack and related members 2022-05-21 16:31:10 +02:00
fgenesis
cec6bc5ebf Remove Quad::repeatingTextureToFill 2022-05-20 04:05:54 +02:00
fgenesis
5c419efd79 Remove RenderObject::updateAfterParent; simplify + clarify ParentManaged logic
SkeletalSprite was the only thing using it.
Instead of PM_STATIC it's now added to its Entity as PM_NONE.
PM_NONE is not auto-updated so SkeletalSprite::update() is now called
at the end of Entity::onUpdate()

(There's now a bug that during spirit form the screen stays black,
probably added that in an earlier commit. Will fix.)

(On second tought, maybe ParentManaged should be boolean.
Instead add a noAutoUpdate flag. But i'll save that for another time when i get around
to move all RenderObject bools into a bitmask.)
2022-05-20 03:27:15 +02:00
fgenesis
68b3c61852 Add RenderState to be passed through the scene graph
This will eventually handle all mutable state during rendering
2022-05-20 01:04:19 +02:00
fgenesis
b6fb6944f6 first step towards making the render process const 2022-05-19 05:17:00 +02:00
fgenesis
46010244f5 remove RenderObject::blendEnabled and cleanup the blend code a bit 2022-05-19 01:34:31 +02:00
fgenesis
06270eaac0 remove RenderObject::childGarbage 2022-05-19 00:01:27 +02:00
fgenesis
140f750d00 More RenderObject slimming; reorder members, split out motion blur data + collideRadius, add new CollideQuad type
CollideQuad is now base class for Shot, Entity, Bone
2022-05-18 19:44:42 +02:00
fgenesis
ac80b3461a simplify RenderObject::renderCall() a bit 2022-05-18 04:04:44 +02:00
fgenesis
4db7990ac2 remove displaylist support
i'd rather trim all possible fat off the renderer and then modularize it
into multiple backends. gotta start somewhere.
2022-05-18 03:39:33 +02:00
fgenesis
c82aab1e51 Move RenderObject::positionSnapTo to PauseQuad
And another RenderObject member less...
2022-05-18 02:52:30 +02:00
fgenesis
046b98c725 delete some unused code 2022-05-18 02:38:53 +02:00
fgenesis
111cd43805 Move members related to collision mask from RenderObject to Bone 2022-05-18 02:15:19 +02:00
fgenesis
e33bde0a89 Small extension to bone:
+ attrib c="0" in the anim XML to turn off all collision for a bone
  even if collide radius or collision mask is set
+ Lua func: bone_toggleCollision() to change the above setting at runtime
+ Lua func: bone_spawnParticlesFromCollisionMask()
- Fix int truncation in entity_collideSkeletalVsLine()
2022-05-18 01:18:27 +02:00
fgenesis
e1f78aaca7 QuadGrid now working 2022-05-14 05:14:08 +02:00
fgenesis
fa35ee41bd some work on quadgrid, still untested 2022-05-13 17:13:27 +02:00
fgenesis
ad36f6cf99 remove unused QuadTrail 2022-05-12 17:35:39 +02:00
fgenesis
e357a22784 another temp commit 2022-05-07 02:47:59 +02:00
fgenesis
ce4ca7f794 Temp commit, some WIP things:
- QuadGrid draft
- Fix minimap_setHealthBarTex accidentally calling MiniMapRender::setAvatarTex
- don't trunkcate to int in entity_rotateTo*() functions
2022-05-06 19:14:47 +02:00
fgenesis
764d106d50 Work around issues with SDL_WarpMouse() in SDL > 2.0.20
Without this and using an affected SDL version, the song circle
is all jittery; the mouse cursor appears to really like to stick
to notes in the left half of the circle.

This issue first appeared in SDL commit 82793ac279d19b5 and caused
the entire game to hang (infinitely firing mouse motion events);
SDL commit 31f8c3ef4409a93fa fixed the hang but instead made
SDL_WarpCursor() jittery.
(Also see SDL commit 331859079674465 for a follow-up)
2022-05-04 03:04:26 +02:00