unsuccessful experimentation

This commit is contained in:
Asuro
2025-02-18 00:03:09 +01:00
parent fb5851020f
commit 2c32a261c1
12 changed files with 111 additions and 34 deletions

View File

@@ -1,4 +1,5 @@
#include "Global.h"
#include "Input.h"
#include "Instance.h"
#include "Log.h"
#include "Setup.h"
@@ -53,11 +54,21 @@ namespace Game
void Update()
{
++GetInstance().Time.FrameCounter;
double newNow = (bx::getHPCounter() - GetInstance().Time.StartTime) / (double)(bx::getHPFrequency());
GetInstance().Time.Delta = newNow - GetInstance().Time.Now;
GetInstance().Time.Now = newNow;
auto& inst = GetInstance();
int64_t newNowHP = bx::getHPCounter() - GetInstance().Time.StartTime;
inst.Time.DeltaHP = newNowHP - inst.Time.NowHP;
inst.Time.NowHP = newNowHP;
inst.Time.Now = (double)inst.Time.NowHP / bx::getHPFrequency();
inst.Time.Delta = (double)inst.Time.DeltaHP / bx::getHPFrequency();
GetShared().Window.PerfCounters[(int32_t)PerfCounterType::GameDelta].Write(inst.Time.DeltaHP,
GetShared().Window.FrameCounter);
if (GetKeyPressedNow(ScanCode::R))
{
GetInstance().Size = 0;
Shutdown();
Setup(GetShared());
}
SetupInstance.Rendering.Update();
auto& win = GetShared().Window;