active selection

This commit is contained in:
2025-09-29 22:52:32 +02:00
parent 2138da7d4d
commit 8136896f59
6 changed files with 74 additions and 55 deletions
+13
View File
@@ -10,4 +10,17 @@ unsigned int arr_uint_index_of(UintArray array, unsigned int value) {
}
return ARRAY_NOT_FOUND;
}
unsigned int arr_uint_remap_index(UintArray offsets, unsigned int *index) {
unsigned int i;
for (i = offsets.length - 1; i > 0; i--) {
if (*index >= offsets.values[i]) {
*index -= offsets.values[i];
return i;
}
}
return 0;
}