summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/stage.c8
-rw-r--r--src/stage.h4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/stage.c b/src/stage.c
index 8a540a8..b072050 100644
--- a/src/stage.c
+++ b/src/stage.c
@@ -88,18 +88,18 @@ static void _stage_free(stage_t *stage)
/* returns a new stage, attached at the specified layer under parent if supplied */
/* layer has no effect when parent == NULL */
-/* if adopt is set, parent must be set and is instead replaced internally and returned */
+/* if replace is set, conf.stage must be set, its internals are replaced and it's returned as new */
stage_t * stage_new(const stage_conf_t *conf, const stage_ops_t *ops, void *object)
{
stage_t *stage;
assert(conf);
assert(conf->parent || !conf->layer);
- assert(conf->parent || !conf->adopt);
+ assert(conf->stage || !conf->replace);
assert(conf->layer < STAGE_LAYERS_MAX);
- if (conf->adopt)
- return stage_replace(conf->parent, conf->name, ops, object);
+ if (conf->replace)
+ return stage_replace(conf->stage, conf->name, ops, object);
stage = _stage_new(conf->name, ops, object);
if (!stage)
diff --git a/src/stage.h b/src/stage.h
index 785ddf5..40f2057 100644
--- a/src/stage.h
+++ b/src/stage.h
@@ -33,14 +33,14 @@ typedef struct stage_ops_t {
} stage_ops_t;
typedef struct stage_conf_t {
- stage_t *parent;
+ stage_t *parent, *stage;
int layer;
const char *name;
float alpha;
unsigned active:1;
unsigned locked:1;
unsigned dirty:1;
- unsigned adopt:1;
+ unsigned replace:1;
} stage_conf_t;
stage_t * stage_new(const stage_conf_t *conf, const stage_ops_t *ops, void *object);
© All Rights Reserved