From 6aa5347f343927b68d4ab445724a0dec272432ce Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sat, 9 Jun 2018 16:33:13 -0700 Subject: libstage: simplify set active and locked node api Just pass in the boolean setting rather than having different functions. --- src/stage.c | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) (limited to 'src/stage.c') diff --git a/src/stage.c b/src/stage.c index c52e5b1..2a8a5a5 100644 --- a/src/stage.c +++ b/src/stage.c @@ -215,33 +215,20 @@ void stage_node_get_origin(const stage_t *stage, const stage_node_t *node, v2f_t } -/* set a node to active (participates in rendering) */ -void stage_node_set_active(const stage_t *stage, stage_node_t *node) +/* set a node's active state (participates in rendering) */ +void stage_node_set_active(const stage_t *stage, stage_node_t *node, int active) { - node->active = 1; + node->active = active; } -/* set a node to inactive (doesn't participate in rendering) */ -void stage_node_set_inactive(const stage_t *stage, stage_node_t *node) +/* set a node's locked state (doesn't get freed by clears) */ +void stage_node_set_locked(const stage_t *stage, stage_node_t *node, int locked) { - /* TODO: should this discard the potentially cached texture? */ - node->active = 0; + node->locked = locked; } -/* set a node to locked (doesn't get freed by clears) */ -void stage_node_set_locked(const stage_t *stage, stage_node_t *node) -{ - node->locked = 1; -} - - -/* set a node to unlocked (default, gets freed by clears) */ -void stage_node_set_unlocked(const stage_t *stage, stage_node_t *node) -{ - node->locked = 0; -} /* set a node's layer */ -- cgit v1.2.3