add interval from timer_elapse_seconds() result, add timers to twn_api.json
This commit is contained in:
parent
5228fa7e41
commit
f805bf3f92
@ -53,7 +53,7 @@ TWN_API bool rect_intersects(Rect a, Rect b);
|
||||
TWN_API float timer_tick_seconds(float seconds_left);
|
||||
|
||||
typedef struct TimerElapseSecondsResult {
|
||||
bool elapsed; float seconds_left;
|
||||
float seconds_left; float interval; bool elapsed;
|
||||
} TimerElapseSecondsResult;
|
||||
TWN_API TimerElapseSecondsResult timer_elapse_seconds(float seconds_left, float interval);
|
||||
|
||||
|
@ -264,6 +264,34 @@
|
||||
]
|
||||
},
|
||||
|
||||
"timer_tick_seconds": {
|
||||
"module": "util",
|
||||
"symbol": "tick_seconds",
|
||||
"header": "twn_util.h",
|
||||
"params": [
|
||||
{ "name": "seconds_left", "type": "float" }
|
||||
],
|
||||
"return": "float"
|
||||
},
|
||||
|
||||
"timer_elapse_seconds": {
|
||||
"module": "util",
|
||||
"symbol": "elapse_seconds",
|
||||
"header": "twn_util.h",
|
||||
"params": [
|
||||
{ "name": "seconds_left", "type": "float" },
|
||||
{ "name": "interval", "type": "float" }
|
||||
],
|
||||
"return": {
|
||||
"fields": [
|
||||
{ "name": "seconds_left", "type": "float" },
|
||||
{ "name": "interval", "type": "float" },
|
||||
{ "name": "elapsed", "type": "bool" }
|
||||
],
|
||||
"c_type": "TimerElapseSecondsResult"
|
||||
}
|
||||
},
|
||||
|
||||
"log_vec2": {
|
||||
"module": "util",
|
||||
"symbol": "log_vec2",
|
||||
|
Loading…
Reference in New Issue
Block a user