Skip to content

Commit

Permalink
Update src/external/ferox_utils.h
Browse files Browse the repository at this point in the history
  • Loading branch information
jdeokkim committed Nov 21, 2024
1 parent 9cbaf7e commit e7fbb3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/external/ferox_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@
/* Sets the capacity of `arr` to `newCapacity`. */
#define frSetDynArrayCapacity(arr, newCapacity) \
do { \
if ((arr).buffer == NULL) \
frInitDynArray((arr)); \
\
void *newBuffer = realloc( \
(arr).buffer, \
(newCapacity) * sizeof *((arr).buffer) \
Expand Down
1 change: 1 addition & 0 deletions src/world.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ frWorld *frCreateWorld(frVector2 gravity, float cellSize) {
result->hash = frCreateSpatialHash(cellSize);

frSetDynArrayCapacity(result->bodies, FR_WORLD_MAX_OBJECT_COUNT);

frInitRingBuffer(result->rbf, FR_WORLD_MAX_OBJECT_COUNT);

return result;
Expand Down

0 comments on commit e7fbb3b

Please sign in to comment.