From e62f849f60533a4c32848fb5850df20bcd811cdb Mon Sep 17 00:00:00 2001 From: 0scar Date: Tue, 1 Aug 2023 10:55:18 +0200 Subject: Update kernelmap type --- include/engine/utils.h | 4 ++-- src/utils.c | 2 +- 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]; -- cgit v1.3