persona-3-dual
A DS demake of Persona 3
Loading...
Searching...
No Matches
timer.hpp
Go to the documentation of this file.
1
6
7#pragma once
8#include <aegis/types.hpp>
9#include <cstdint>
10
11extern volatile int32_t frame;
12
13constexpr uint32_t TARGET_FPS = 60;
14
15class Timer
16{
17 public:
23 void start(ae::q20_12_t durationSeconds);
24
30 bool isFinished();
31
37 ae::q20_12_t getDuration();
38
44 ae::q20_12_t getElapsed();
45
51 ae::q20_12_t getProgress();
52
53 private:
54 uint32_t startFrame = 0;
55 uint32_t durationFrames = 0;
56 bool running = false;
57};
uint32_t startFrame
Definition timer.hpp:54
bool isFinished()
Checks if the timer expired.
Definition timer.cpp:17
ae::q20_12_t getDuration()
Gets duration of the timer.
Definition timer.cpp:26
bool running
Definition timer.hpp:56
ae::q20_12_t getProgress()
Gets progress of how much of the time has passed.
Definition timer.cpp:39
uint32_t durationFrames
Definition timer.hpp:55
void start(ae::q20_12_t durationSeconds)
Starts a timer.
Definition timer.cpp:5
ae::q20_12_t getElapsed()
Gets elapsed time since the timer was started.
Definition timer.cpp:32
volatile int32_t frame
Definition main.cpp:35
constexpr uint32_t TARGET_FPS
Definition timer.hpp:13