mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-11 21:21:57 -04:00
287ee6b2ee
* Deduplicate Speedrun Overrides Avoids issues where only one is updated + makes sense organizationally * Move restore_from_speedrun_mode I think it makes more sense to have this in the same place the overrides are set * Camelcase nit --------- Co-authored-by: Irastris <irastris15@gmail.com>
43 lines
880 B
C++
43 lines
880 B
C++
#pragma once
|
|
#include <aurora/aurora.h>
|
|
|
|
namespace dusk {
|
|
|
|
struct SpeedrunInfo {
|
|
void startRun() {
|
|
m_isRunStarted = true;
|
|
m_startTimestamp = OSGetTime();
|
|
}
|
|
|
|
void stopRun() {
|
|
m_isRunStarted = false;
|
|
m_endTimestamp = OSGetTime() - m_startTimestamp;
|
|
}
|
|
|
|
void reset() {
|
|
m_isRunStarted = false;
|
|
m_startTimestamp = 0;
|
|
m_endTimestamp = 0;
|
|
m_isPauseIGT = false;
|
|
m_loadStartTimestamp = 0;
|
|
m_totalLoadTime = 0;
|
|
m_igtTimer = 0;
|
|
}
|
|
|
|
bool m_isRunStarted = false;
|
|
OSTime m_startTimestamp = 0;
|
|
OSTime m_endTimestamp = 0;
|
|
|
|
bool m_isPauseIGT = false;
|
|
OSTime m_loadStartTimestamp = 0;
|
|
OSTime m_totalLoadTime = 0;
|
|
OSTime m_igtTimer = 0;
|
|
};
|
|
|
|
extern SpeedrunInfo m_speedrunInfo;
|
|
|
|
void resetForSpeedrunMode();
|
|
void restoreFromSpeedrunMode();
|
|
|
|
} // namespace dusk
|