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

56 commits

Author SHA1 Message Date
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
fgenesis
62c949f640 Fix rare texture loading problems introduced in 8bd40be8aa and f0d580d873. 2016-03-13 01:37:43 +01:00
fgenesis
d8da8576e8 Fix moveToBack/moveToFront when used on objects that have a parent 2015-11-28 23:42:39 +01:00
Jan Beich
b0a144c858 BBGE: use vector glm functions
glm-0.9.5 removed scalar rotate() and translate()
2015-09-17 21:43:31 +00:00
fgenesis
9faa503f32 Use glm for matrix math instead of the OpenGL stack
Should cause less GL pipeline stalling / driver spinlocking if enabled.
Disable AQUARIA_USE_GLM (default: true) in CMake to use the old GL pipeline version.

Based on the implementation by Matt Bierner:
https://bitbucket.org/mattbierner/ios-aquaria
2015-07-12 22:16:55 +02:00
fgenesis
8bd40be8aa Fix oversight in texture loading that could cause the cape to appear as white blorb. Thx Daxar. 2015-06-10 01:49:12 +02:00
fgenesis
f0d580d873 Refactor texture loading code; should fix a crash that started appearing recently. 2015-03-24 00:06:51 +01:00
fgenesis
9973afbac6 Allow custom capes in mods 2015-03-09 04:55:03 +01:00
fgenesis
ba9c37f704 Make RenderObject::moveTo[Front|Back]() work for things that have a parent. 2015-01-14 21:42:54 +01:00
fgenesis
26dc8560b7 Fix gcc compile (broke in 300f326777) 2014-09-15 20:59:21 +02:00
fgenesis
300f326777 Use std::vector instead of std::list for RenderObject children 2014-07-21 22:21:22 +02:00
fgenesis
7fb9204e97 Minor changes & simplifications to Lua interface. 5 new functions.
This changes all typical vector interpolation functions that get
value, time, loopType, pingPong, ease as args from the Lua state;
use unified functions for all value type occurances.
This fixes the slightly annoying problem that it was not possible to
pass a boolean true to pingPong or ease, because lua_tonumber() would
always return 0 in that case.

Also changed:
- obj_getWorldPosition() now takes optional x,y-vector

New:
- obj_getWorldPositionAndRotation() is a more efficient shortcut,
	as often both position and rotation are retrieved together,
	and the underlying matrix chain operation is rather expensive.
- entity_getEmitter()
- entity_getNumEmitters()
- setSceneColor2()
- getSceneColor2()
2013-07-20 17:44:27 +02:00
fgenesis
12ea97f051 Disable all glEnable/glDisable() calls for GL_CULL_FACE, except one glDisable() during renderer init.
GL_CULL_FACE is effectively always disabled, except for quad strip
rendering, and keeping GL_CULL_FACE disabled there does not seem
to cause any visual artifacts.
Instead, it enhances skeletal animation possibilities
(e.g. flipping bone strips over without it disappearing)
2013-05-02 04:31:07 +02:00
fgenesis
1350876b3d Restore & correct collision radius rendering. Enabled toggling the debug console on Mac.
Collision rendering is now mapped to Ctrl+Shift+Return instead of capslock.
Also fixed one float->int truncation in script interface,
and removed useless debug message when particle effect "" was supposed
to be spawned (but does never exist).
2012-05-05 17:00:46 +02:00
fgenesis
9b63b400d5 Misc code cleanups, little SkeletalSprite loading improvement.
- Removed some unused member variables.

- The BBGE_BUILD_WIDESCREEN define is now gone.

- Added an TiXMLDocument cache to prevent parsing the same file
once for each entity on the map with the same skeletal.

- Removed Lua func entity_warpToPathStart, which was essentially a no-op
because Entity::followingPath was always NULL. Removed related code.

- Set texture wrap only when required.

(Some changes taken from https://bitbucket.org/mattbierner/ios-aquaria,
special thanks for changeset 72d6460d9e60)
2012-02-19 04:57:04 +01:00