mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Separated timer updates from rendering in adventure map and town screen
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user