summaryrefslogtreecommitdiff
path: root/src/puzzles/collection.c
diff options
context:
space:
mode:
authorPhysick <96335032+DegustatorPonos@users.noreply.github.com>2026-09-03 19:11:39 +0500
committerPhysick <96335032+DegustatorPonos@users.noreply.github.com>2026-09-03 19:11:39 +0500
commitc88bb49416aaeb13c3969727a305bc7ed3263963 (patch)
tree997c136ee0cfc0a5ba6c153c78ab268d0195ac4a /src/puzzles/collection.c
parentaaefc10681cc2bcb30268c67de1a4784e0ca891f (diff)
more transitions
Diffstat (limited to 'src/puzzles/collection.c')
-rw-r--r--src/puzzles/collection.c7
1 files changed, 4 insertions, 3 deletions
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);