prizm_racing/src/time-gint.cpp

24 lines
363 B
C++
Raw Normal View History

2022-11-27 09:29:26 +01:00
#ifdef GINT
#include "time.h"
#include <gint/rtc.h>
#include <libprof.h>
2022-11-27 09:29:26 +01:00
namespace Time {
prof_t prof;
void init(){
prof_init();
prof = prof_make();
}
2022-11-27 09:29:26 +01:00
void update(){
prof_leave(prof);
2022-11-27 09:29:26 +01:00
const float lastTime = time;
time = rtc_ticks();
delta = prof_time(prof) / 1000.0f / (1000.0f / 128.0f);
prof = prof_make();
prof_enter(prof);
2022-11-27 09:29:26 +01:00
}
};
#endif