-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Adding dynamic Node support #2
base: main
Are you sure you want to change the base?
Conversation
src/color.c
Outdated
if (c & COLOR_HSV) { | ||
return snprintf(name, length, "HSV(%ld, %ld/63, %ld/63, %ld/32)", | ||
_getS(c), _getS(c), _getV(c), _getA(c)); | ||
_getS(c), _getS(c), _getV(c), alpha); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there _getH()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. :)
|
||
BoxNode *state = ffx_sceneNode_getState(node); | ||
state->size = size; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to set color as well here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the default value is 0 (alloc zeros memory), so by default colours are fully-opaque black.
But this should definitely be mentioned in the docs. :)
The existing Scene Nodes are all the exact same size, with a maximum of 2 properties allowed per Node.
This has led to rather complex AnimationNode structures, since they require 4 properties, so currently 2 Nodes are added per animation, with a careful balance of values split between them.
This also means things like TextNodes cannot have a font property as property A is used for internal state and property B as a link to the actual text data.
This PR adds support for Nodes of arbitrary size, currently using the system
malloc
andfree
, but designed around substituting in custom implementations, so that more efficient options can be added in the future.This also adds support for destructors, which allow Nodes to clean-up after themselves when they are removed.
The Animation and Render passes also no longer depend on using the standard Node objects, allowing them to allocate and store custom state, which is cleaned up automatically when animations complete and render passes finish.