Separated timer updates from rendering in adventure map and town screen

This commit is contained in:
Ivan Savenko committed 2023-05-14 22:22:37 +03:00
1 parent 3ecdff2a21
commit fa496628f2
8 files changed
+27 -13

No files matched your search

+8 -5
View File
@@ -55,6 +55,8 @@ BasicMapView::BasicMapView(const Point & offset, const Point & dimensions)
pos += offset;
pos.w = dimensions.x;
pos.h = dimensions.y;
addUsedEvents(TIME);
}
void BasicMapView::render(Canvas & target, bool fullUpdate)
@@ -64,21 +66,22 @@ void BasicMapView::render(Canvas & target, bool fullUpdate)
tilesCache->render(controller->getContext(), targetClipped, fullUpdate);
}
void BasicMapView::tick(uint32_t msPassed)
{
controller->tick(msPassed);
}
void BasicMapView::show(SDL_Surface * to)
{
controller->updateBefore(GH.getFrameDeltaMilliseconds());
Canvas target(to);
CSDL_Ext::CClipRectGuard guard(to, pos);
render(target, false);
controller->updateAfter(GH.getFrameDeltaMilliseconds());
controller->afterRender();
}
void BasicMapView::showAll(SDL_Surface * to)
{
controller->updateBefore(0);
Canvas target(to);
CSDL_Ext::CClipRectGuard guard(to, pos);
render(target, true);