mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-14 18:19:36 +01:00
Use the new frame timing to implement the menu throttle directly
This commit is contained in:
1 parent
cc75979f5b
commit
864528303a
8 files changed
+29
-34
No files matched your search
+12
-2
@@ -48,6 +48,7 @@ void FrameTiming::Reset(Draw::DrawContext *draw) {
|
||||
presentMode = GetBestImmediateMode(draw->GetDeviceCaps().presentModesSupported);
|
||||
presentInterval = 0;
|
||||
}
|
||||
setTimestepCalled_ = false;
|
||||
}
|
||||
|
||||
Draw::PresentMode ComputePresentMode(Draw::DrawContext *draw, int *interval) {
|
||||
@@ -99,18 +100,27 @@ void FrameTiming::BeforeCPUSlice() {
|
||||
cpuSliceStartTime = time_now_d();
|
||||
}
|
||||
|
||||
void FrameTiming::EndOfCPUSlice(float scaledTimeStep) {
|
||||
void FrameTiming::SetTimeStep(float scaledTimeStep) {
|
||||
_dbg_assert_(usePresentTiming);
|
||||
|
||||
double now = time_now_d();
|
||||
|
||||
cpuTime = now - cpuSliceStartTime;
|
||||
this->timeStep = scaledTimeStep;
|
||||
this->timeStep = scaledTimeStep + nudge_;
|
||||
|
||||
// Sync up lastPresentTime with the current time if it's way off.
|
||||
if (lastPresentTime < now - 0.5f) {
|
||||
lastPresentTime = now;
|
||||
}
|
||||
setTimestepCalled_ = true;
|
||||
}
|
||||
|
||||
void FrameTiming::AfterCPUSlice() {
|
||||
if (!setTimestepCalled_) {
|
||||
// We're in the menu or something.
|
||||
usePresentTiming = true;
|
||||
SetTimeStep(1.0f / 60.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void FrameTiming::BeforePresent() {
|
||||
|
||||
Reference in new issue
Block a user