summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author0scar <qgt268@alumni.ku.dk>2023-08-01 08:55:18 +0000
committer0scar <qgt268@alumni.ku.dk>2023-08-01 08:55:18 +0000
commite62f849f60533a4c32848fb5850df20bcd811cdb (patch)
tree3da51b48c0ec1733b490b88829127c8d5e22ee8f
parent755bf064df3031a095aff958ba3eba12af4f2a02 (diff)
Update kernelmap type
-rw-r--r--include/engine/utils.h4
-rw-r--r--src/utils.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/include/engine/utils.h b/include/engine/utils.h
index 65fa35c..b4b0e7d 100644
--- a/include/engine/utils.h
+++ b/include/engine/utils.h
@@ -24,9 +24,9 @@ i32 int_lerp(f32 dt, i32 a, i32 b);
/* Hashes */
u32 hash(char *str);
-/* Masks surrounding tiles of a kernel size of 3 */
+/* Masks surrounding tiles of a kernel size of 3x3 */
/* In reality we only need 9 bits for this, but I think I had a reason for using i32 */
-i32* kernmap(const void *map, i32 *dstmap, const v2_i32 mapsize, bool (*predicate)(const void*));
+i32* kernmap(const void *map, i32 *dstmap, const v2_i32 mapsize, predicate_t *predicate);
/* Returns an index from the given weights. */
i32 pick_from_sample(const i32 *weights, i32 len);
diff --git a/src/utils.c b/src/utils.c
index 748b82f..cd6d0b0 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -26,7 +26,7 @@ u32 hash(char *str) {
/* Populates dstmap
* on success: return pointer to dstmap
* on failure: return NULL */
-i32* kernmap(const void *map, i32 *dstmap, const v2_i32 mapsize, bool (*predicate)(const void*)) {
+i32* kernmap(const void *map, i32 *dstmap, const v2_i32 mapsize, predicate_t *predicate) {
const i32 w = mapsize.x;
const i32 h = mapsize.y;
i32 mask[w*h];