summaryrefslogtreecommitdiff
path: root/src/port/Engine.cpp
diff options
context:
space:
mode:
authorNicholas Estelami <NEstelami@users.noreply.github.com>2025-03-28 03:25:11 -0400
committerGitHub <noreply@github.com>2025-03-28 04:25:11 -0300
commit30ec4720c06dd3418641226a6d320067f2706700 (patch)
tree39a6a83b02325b4a027d260854a84f50b5abcfcc /src/port/Engine.cpp
parentea4254984225884476c66da8563166505bfd4aee (diff)
Floor Scrolling Interpolation (#176)
* Floor Scrolling Interpolation * Scrolling Improvements * Fix scroll stutter * bump LUS & Torch * missing prototype --------- Co-authored-by: Sonic Dreamcaster <alejandro.asenjo88@gmail.com>
Diffstat (limited to 'src/port/Engine.cpp')
-rw-r--r--src/port/Engine.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/port/Engine.cpp b/src/port/Engine.cpp
index 4da6fd77..e0307752 100644
--- a/src/port/Engine.cpp
+++ b/src/port/Engine.cpp
@@ -452,8 +452,11 @@ void GameEngine::RunCommands(Gfx* Commands, const std::vector<std::unordered_map
// Process window events for resize, mouse, keyboard events
wnd->HandleEvents();
+ gInterpolationIndex = 0;
+
for (const auto& m : mtx_replacements) {
wnd->DrawAndRunGraphicsCommands(Commands, m);
+ gInterpolationIndex++;
}
bool curAltAssets = CVarGetInteger("gEnhancements.Mods.AlternateAssets", 0);
@@ -538,6 +541,15 @@ uint32_t GameEngine::GetInterpolationFPS() {
CVarGetInteger("gInterpolationFPS", 60));
}
+uint32_t GameEngine::GetInterpolationFrameCount()
+{
+ return ceil((float)GetInterpolationFPS() / 30.0f);
+}
+
+extern "C" uint32_t GameEngine_GetInterpolationFrameCount() {
+ return GameEngine::GetInterpolationFrameCount();
+}
+
void GameEngine::ShowMessage(const char* title, const char* message, SDL_MessageBoxFlags type) {
#if defined(__SWITCH__)
SPDLOG_ERROR(message);