summaryrefslogtreecommitdiff
path: root/src/stage.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stage.c')
-rw-r--r--src/stage.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/stage.c b/src/stage.c
index 7871f8f..35d6835 100644
--- a/src/stage.c
+++ b/src/stage.c
@@ -38,6 +38,7 @@ struct stage_node_t {
stage_cached_t cached;
aabb_t aabb; /* node coordinates expressed in the space of -1.0...1.0 */
v2f_t position; /* position of node, optionally used to move aabb as a whole */
+ v2f_t origin; /* origin of node, 0,0 being center of aabb (the default) this determines how position relates to aabb. -1...1 being aabb.min ... aabb.max */
float alpha; /* alpha for the texture when composited */
double angle; /* angle for the texture when composited */
unsigned active:1; /* node is active */
@@ -199,6 +200,21 @@ void stage_node_get_position(const stage_t *stage, const stage_node_t *node, v2f
}
+/* set the origin for a node */
+void stage_node_set_origin(const stage_t *stage, stage_node_t *node, v2f_t *origin)
+{
+ node->origin = *origin;
+}
+
+
+/* get the origin for a node */
+void stage_node_get_origin(const stage_t *stage, const stage_node_t *node, v2f_t *res_origin)
+{
+
+ *res_origin = node->origin;
+}
+
+
/* set a node to active (participates in rendering) */
void stage_node_set_active(const stage_t *stage, stage_node_t *node)
{
© All Rights Reserved