1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-26 10:13:49 +00:00
Commit graph

70 commits

Author SHA1 Message Date
fgenesis
048a787cb1 get rid of beforeScaleOffset 2023-08-26 00:58:47 +02:00
fgenesis
d31d320719 set GL textures to always repeat to avoid unnecessary calls to glTexParameteri()
Shouldn't have any visual changes because edge clamp is never actually used
2023-08-25 00:38:36 +02:00
fgenesis
bd5b2b3495 Rework + optimize map tile storage & rendering, initial working draft.
class Element is completely gone.
(The files are still there but no longer compiled in. Will delete later)

Broken still:
- support for vertical flip
- the editor
- culling
2023-07-14 00:19:33 +02:00
fgenesis
4b52730be2 Fix parallax horizontal flip rotation bug, but now maps are wrong
Unfortunatelx maps were designed with this bug present,
and now tile rotation on parallax layers is wrong for flipped tiles.
This also affected background fish swarms and anything that
was on a parallax layer and flipped horizontally.
Need to fix maps next...

See also: commit 76ba2b1211
2023-07-03 19:00:12 +02:00
fgenesis
fc76b2de12 fix hidden checks, oops
Turns out any part of the hierarchy can be hidden, not just the parent.
Esp. the game menu does this.
2023-06-01 20:19:37 +02:00
fgenesis
70b8dcdc3a Rework texture loading, part 1
Major code/logic cleanups + it has a multithreaded batch mode now.
The VFS code doesn't like multiple threads at all,
so for now there's a big lock in front of where it matters.
Changed precacher, map/tileset, and worldmap loading to batched mode.

Still TODO:
- fix broken mod preview images
- reloading resources on debug key
- make mod recache entirely unnecessary
- actually drop resources when no longer needed
2023-05-31 00:55:16 +02:00
fgenesis
74ad8f7804 Build fixes for Linux, some warnings and compatibility fixes for C++17 and up 2023-05-25 16:58:08 +02:00
fgenesis
640f08af13 simplify bonelocking, add Lua functions
- does no longer depend on collision mask
- remove global Game::lastCollideMaskIndex
- remove the horribly convoluted and now unused RenderObject::getInvRotPosition()
+ Lua func entity_getBoneLockDelay()
+ Lua func entity_setBoneLockDelay()
2023-04-18 01:42:21 +02:00
fgenesis
0a3f57486b Simplify RenderObject::followCamera math, remove branches, cleanup followCamera related code.
It also appears that a RenderObject is always on a layer when rendered.
Assert this in the code. This saves some extra branches.
2023-03-05 21:25:59 +01:00
fgenesis
81bfcb2f65 more precise comment 2023-03-02 03:42:39 +01:00
fgenesis
28766f0d5a make RenderObject::followCamera not modified during rendering
This takes out the last of the RenderObject mutables.

This also fixes the long-standing editor bug that map tiles
that are once moved to parallax layers and then back to a
normal layer keep their scroll factor until the tile is deleted
or the map saved and reloaded.
2023-03-02 03:41:00 +01:00
fgenesis
76ba2b1211 make RenderObject::rotation not modified during rendering, simplify duplicated code 2023-03-02 03:29:04 +01:00
fgenesis
f4147b99c4 make RenderObject::scale not modified during rendering 2023-03-02 02:19:48 +01:00
fgenesis
7a5a5feb39 make RenderObject::position not modified during rendering; small cleanup 2023-03-02 02:12:32 +01: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
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
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
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
5c558c122f Remove RenderObject::setColorMult() hack and related members 2022-05-21 16:31:10 +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
Valentin Ochs
f9357e7fca Merge branch 'gccwarn' into controllerfixup 2017-01-17 11:15:47 +01:00
Valentin Ochs
fe0ab0418b Get rid of a lot of gcc warnings
Mostly signed/unsigned comparisons. Also some bugs, but I don't remember
where :D
2017-01-14 18:10:20 +01:00
fgenesis
8472718fb7 Major include refactor; changes to pretty much everything
This untangles some of the gigantic kitchen sink headers
in an attempt to split things into smaller files.
Also don't include gl.h, glext.h, windows.h,
and other such nonsense *everywhere*.

Lots of cleanups on the way too. More dead/unused code removal.

Remove incrFlag(), decrFlag() Lua functions.
2016-07-09 04:18:40 +02:00
fgenesis
9bb4226626 Remove RenderObjectLayer::sort() and related 2016-05-14 17:20:13 +02:00
fgenesis
65179870a9 Fix possible crash when loading applying a skeletal twice in one frame.
Possibly a regression from 300f326777.
2016-05-12 00:25:00 +02:00
fgenesis
d6dc3a8a09 Merge branch 'experimental' into moreclean
Conflicts:
	Aquaria/Avatar.cpp
	Aquaria/BoxElement.cpp
	Aquaria/BubbleRender.cpp
	Aquaria/FFTNotes.cpp
	Aquaria/StarRenderer.cpp
	Aquaria/WaterFont.cpp
	Aquaria/resource.h
	BBGE/AnimatedSprite.cpp
	BBGE/AnimatedSprite.h
	BBGE/BloomEffect.cpp
	BBGE/CShim.cpp
	BBGE/Collision.cpp
	BBGE/Collision.h
	BBGE/Core.cpp
	BBGE/Core.h
	BBGE/Cube.cpp
	BBGE/Cutscene.cpp
	BBGE/DFSprite.cpp
	BBGE/DFSprite.h
	BBGE/Datafile.cpp
	BBGE/Datafile.h
	BBGE/Flags.h
	BBGE/Interpolator.cpp
	BBGE/Light.cpp
	BBGE/Light.h
	BBGE/LightCone.cpp
	BBGE/Model.cpp
	BBGE/Model.h
	BBGE/OggStream.cpp
	BBGE/PackRead.cpp
	BBGE/PointSprites.cpp
	BBGE/RenderObject.cpp
	BBGE/SkeletalSprite.cpp
2016-05-10 18:40:01 +02:00
False.Genesis
0ced7c1d50 Merge pull request #27 from nbraud/unifdef
More cleanups
2016-05-10 10:20:36 +02:00
fgenesis
2f0940f1df Fix yet another oopsie RenderObject::setTexture()
Didn't apply empty ("") texture when another texture was already set.
2016-05-09 08:15:41 +02:00
fgenesis
e7791c5ddc Remove RenderObject::collisionRects.
Another vector that was always empty, optionally filled when specified
by a skeletal file, but none actually did this. Should be safe to remove.

Also small related optimization in Game::collideSkeletalVsCircle().
2016-05-07 01:00:16 +02:00
fgenesis
35a3888c94 Remove RenderObject::collidePosition and related code
This was always (0, 0) and optionally used for bones if defined in skeletal files.
None of the official skeletal files used this, so this should be safe to remove.
2016-05-07 00:47:45 +02:00
Nicolas Braud-Santoni
eb128e65a4 Remove commented-out code 2016-05-05 19:57:50 +02:00
Nicolas Braud-Santoni
276265be1d Eliminating obsolete #ifdefs and friends (#26)
The following options have been applied globally, using unifdef(1):
```c
 #undef BBGE_BUILD_DIRECTX

 #define BBGE_BUILD_OPENGL 1
 #define GL_GLEXT_LEGACY   1
 #define HAVE_PUTENV       1
 #define TIXML_USE_STL     1
 #define BBGE_BUILD_SDL    1
```
2016-05-05 03:49:41 +02:00