diff options
Diffstat (limited to 'src/stage.c')
-rw-r--r-- | src/stage.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/stage.c b/src/stage.c index 69976ae..3927120 100644 --- a/src/stage.c +++ b/src/stage.c @@ -373,34 +373,3 @@ stage_t * stage_lookup_name(stage_t *stage, const char *name) return NULL; } - - -/* lookup a stage by an opaque key using the per-stage lookup_func when present, - * returns first hit, does not support multiple hits. - * Intended for rudimentary non-overlapping spatial searches like picking of - * basic 2D UI elements. - */ -stage_t * stage_lookup_key(stage_t *stage, void *key) -{ - assert(stage); - - if (stage->ops->lookup_func) { - stage_t *hit = (stage_t *)stage->ops->lookup_func(stage, stage->object, key); - - if (hit) - return hit; - } - - for (int i = 0; i < STAGE_LAYERS_MAX; i++) { - stage_t *s; - - DLL_FOR_EACH_ENTRY(&stage->layers[i], s, stage_t, layer) { - stage_t *hit = stage_lookup_key(s, key); - - if (hit) - return hit; - } - } - - return NULL; -} |