2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-13 05:26:10 +00:00

Add MP1_VARIABLE_DELTA_TIME option (for high refresh rates; buggy)

This commit is contained in:
2020-02-24 21:42:55 -05:00
parent 051a547c42
commit ae591d4817
2 changed files with 33 additions and 11 deletions

View File

@@ -1,6 +1,11 @@
#pragma once
#ifndef MP1_USE_BOO
#define MP1_USE_BOO 0
#endif
#ifndef MP1_VARIABLE_DELTA_TIME
#define MP1_VARIABLE_DELTA_TIME 0
#endif
#include "IMain.hpp"
#include "CTweaks.hpp"
@@ -108,7 +113,6 @@ public:
CScriptMazeNode::LoadMazeSeeds();
}
void ResetGameState() {
x134_gameState = std::make_unique<CGameState>();
g_GameState = x134_gameState.get();
@@ -174,8 +178,8 @@ public:
void PreloadAudio();
bool LoadAudio();
void UnloadAudio();
void UpdateTicks();
void Update();
void UpdateTicks(float dt);
void Update(float dt);
void Draw();
bool isRectDirty() const { return m_rectIsDirty; }
@@ -251,6 +255,12 @@ private:
bool m_loadedPersistentResources = false;
bool m_doQuit = false;
#if MP1_VARIABLE_DELTA_TIME
bool m_firstFrame = true;
using delta_clock = std::chrono::high_resolution_clock;
std::chrono::time_point<delta_clock> m_prevFrameTime;
#endif
void InitializeSubsystems();
static void InitializeDiscord();
static void ShutdownDiscord();