From c88bb49416aaeb13c3969727a305bc7ed3263963 Mon Sep 17 00:00:00 2001 From: Physick <96335032+DegustatorPonos@users.noreply.github.com> Date: Thu, 3 Sep 2026 19:11:39 +0500 Subject: more transitions --- src/puzzles/collection.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/puzzles/collection.c') diff --git a/src/puzzles/collection.c b/src/puzzles/collection.c index 5a46239..ea1a3b1 100644 --- a/src/puzzles/collection.c +++ b/src/puzzles/collection.c @@ -99,7 +99,7 @@ size_t getElementCount(DIR *dir, CollectionElement *el) { return outp; } -void initCollectionFromDir(CollectionElement *el, void (*callback)(CollectionElement *)) { +void initCollectionFromDir(CollectionElement *el, void (*callback)(CollectionElement *), void *callbackData) { if (el == NULL) return; TraceLog(LOG_INFO, "Initializing a collection element from %s/", el->path); @@ -145,6 +145,7 @@ void initCollectionFromDir(CollectionElement *el, void (*callback)(CollectionEle read_el->path = strdup(full_path_buf); read_el->name = getName(entry->d_name); read_el->callback = callback; + read_el->callbackData = callbackData; idx += 1; } @@ -155,7 +156,7 @@ void initCollectionFromDir(CollectionElement *el, void (*callback)(CollectionEle closedir(dir); } -void InitializeCollection(CollectionElement *el, void (*callback)(CollectionElement *)) { +void InitializeCollection(CollectionElement *el, void (*callback)(CollectionElement *), void *callbackData) { if (el == NULL) { TraceLog(LOG_ERROR, "Failed to initialize collection element: the element is NULL"); return; @@ -163,7 +164,7 @@ void InitializeCollection(CollectionElement *el, void (*callback)(CollectionElem switch (el->type) { case COLLECTION_ELEMENT_PUZZLE: break; case COLLECTION_ELEMENT_COLLECTION: - initCollectionFromDir(el, callback); + initCollectionFromDir(el, callback, callbackData); break; default: TraceLog(LOG_WARNING, "Invalid CollectionElement type for %s", el->path); -- cgit v1.3