twn_util.h: make return structs comply to type naming
This commit is contained in:
parent
d11143ac86
commit
eff9fe6918
@ -79,12 +79,14 @@ TWN_API int32_t timer_tick_frames(int32_t frames_left);
|
|||||||
/* note that it should be decremented only on the next tick after its creation */
|
/* note that it should be decremented only on the next tick after its creation */
|
||||||
TWN_API float timer_tick_seconds(float seconds_left);
|
TWN_API float timer_tick_seconds(float seconds_left);
|
||||||
|
|
||||||
TWN_API struct timer_elapse_frames_result {
|
typedef struct TimerElapseFramesResult {
|
||||||
bool elapsed; int32_t frames_left;
|
bool elapsed; int32_t frames_left;
|
||||||
} timer_elapse_frames(int32_t frames_left, int32_t interval);
|
} TimerElapseFramesResult;
|
||||||
|
TWN_API TimerElapseFramesResult timer_elapse_frames(int32_t frames_left, int32_t interval);
|
||||||
|
|
||||||
TWN_API struct timer_elapse_seconds_result {
|
typedef struct TimerElapseSecondsResult {
|
||||||
bool elapsed; float seconds_left;
|
bool elapsed; float seconds_left;
|
||||||
} timer_elapse_seconds(float seconds_left, float interval);
|
} TimerElapseSecondsResult;
|
||||||
|
TWN_API TimerElapseSecondsResult timer_elapse_seconds(float seconds_left, float interval);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -285,7 +285,7 @@ float timer_tick_seconds(float seconds_left) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct timer_elapse_frames_result timer_elapse_frames(int32_t frames_left, int32_t interval) {
|
TimerElapseFramesResult timer_elapse_frames(int32_t frames_left, int32_t interval) {
|
||||||
SDL_assert(frames_left >= 0);
|
SDL_assert(frames_left >= 0);
|
||||||
SDL_assert(interval > 0);
|
SDL_assert(interval > 0);
|
||||||
|
|
||||||
@ -295,14 +295,14 @@ struct timer_elapse_frames_result timer_elapse_frames(int32_t frames_left, int32
|
|||||||
elapsed = true;
|
elapsed = true;
|
||||||
frames_left += interval;
|
frames_left += interval;
|
||||||
}
|
}
|
||||||
return (struct timer_elapse_frames_result) {
|
return (TimerElapseFramesResult) {
|
||||||
.elapsed = elapsed,
|
.elapsed = elapsed,
|
||||||
.frames_left = frames_left
|
.frames_left = frames_left
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct timer_elapse_seconds_result timer_elapse_seconds(float seconds_left, float interval) {
|
TimerElapseSecondsResult timer_elapse_seconds(float seconds_left, float interval) {
|
||||||
SDL_assert(seconds_left >= 0);
|
SDL_assert(seconds_left >= 0);
|
||||||
SDL_assert(interval > 0);
|
SDL_assert(interval > 0);
|
||||||
|
|
||||||
@ -312,7 +312,7 @@ struct timer_elapse_seconds_result timer_elapse_seconds(float seconds_left, floa
|
|||||||
elapsed = true;
|
elapsed = true;
|
||||||
seconds_left += interval;
|
seconds_left += interval;
|
||||||
}
|
}
|
||||||
return (struct timer_elapse_seconds_result) {
|
return (TimerElapseSecondsResult) {
|
||||||
.elapsed = elapsed,
|
.elapsed = elapsed,
|
||||||
.seconds_left = seconds_left
|
.seconds_left = seconds_left
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user