1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-27 21:49:10 +02:00

use fps in calculation

This commit is contained in:
Michael 2023-08-28 00:49:32 +02:00 committed by GitHub
parent 3ce9d022d5
commit 9f51f42128
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -103,6 +103,9 @@ MapView::MapView(const Point & offset, const Point & dimensions)
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
actions = std::make_shared<MapViewActions>(*this, model);
actions->setContext(controller->getContext());
// catch min 10 frames
postSwipeCatchIntervalMs = static_cast<int>(10.0 * 1000.0 * (1.0 / settings["video"]["targetfps"].Float()));
}
void MapView::onMapLevelSwitched()

View File

@ -52,8 +52,8 @@ class MapView : public BasicMapView
std::vector<std::pair<uint32_t, Point>> swipeHistory;
double postSwipeAngle = 0.0;
double postSwipeSpeed = 0.0;
const int postSwipeCatchIntervalMs = 150;
int postSwipeCatchIntervalMs;
const double postSwipeSlowdownSpeed = 0.006;
const double postSwipeMinimalSpeed = 0.1;