File tree Expand file tree Collapse file tree 3 files changed +18
-8
lines changed Expand file tree Collapse file tree 3 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ extern "C" {
82
82
/* The major, minor, and the patch release version of this library. */
83
83
#define FR_API_VERSION_MAJOR 0
84
84
#define FR_API_VERSION_MINOR 9
85
- #define FR_API_VERSION_PATCH 6
85
+ #define FR_API_VERSION_PATCH 7
86
86
87
87
/* The full version string of this library. */
88
88
#define FR_API_VERSION \
Original file line number Diff line number Diff line change 77
77
/* Releases the memory allocated for `arr`. */
78
78
#define frReleaseDynArray (arr ) \
79
79
do { \
80
- free((arr).buffer); \
80
+ free((arr).buffer); \
81
+ \
82
+ ((arr).length) = 0; \
83
+ ((arr).capacity) = 0; \
81
84
} while (0)
82
85
83
86
/* Returns the capacity of `arr`. */
118
121
((arr).length = newLength)
119
122
120
123
/* Appends `newValue` at the end of `arr`. */
121
- #define frDynArrayPush (arr , newValue ) \
122
- do { \
123
- if ((arr).length >= (arr).capacity) \
124
- frSetDynArrayCapacity((arr), ((arr).capacity << 1)); \
125
- \
126
- (arr).buffer[(arr).length] = (newValue), ++(( arr).length) ; \
124
+ #define frDynArrayPush (arr , newValue ) \
125
+ do { \
126
+ if ((arr).length >= (arr).capacity) \
127
+ frSetDynArrayCapacity((arr), ((arr).capacity << 1)); \
128
+ \
129
+ (arr).buffer[(arr).length] = (newValue), ( arr).length++ ; \
127
130
} while (0)
128
131
129
132
/* Swaps the `i`-th value and the `j`-th value of `arr`. */
Original file line number Diff line number Diff line change @@ -269,6 +269,13 @@ void frUpdateWorld(frWorld *w, float dt) {
269
269
if (w == NULL || dt <= 0.0f ) return ;
270
270
271
271
float currentTime = frGetCurrentTime ();
272
+
273
+ if (w -> timestamp <= 0.0f ) {
274
+ w -> timestamp = currentTime ;
275
+
276
+ return ;
277
+ }
278
+
272
279
float elapsedTime = currentTime - w -> timestamp ;
273
280
274
281
w -> timestamp = currentTime , w -> accumulator += elapsedTime ;
You can’t perform that action at this time.
0 commit comments