mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
preparation
This commit is contained in:
@ -25,6 +25,7 @@
|
||||
#include "../render/Canvas.h"
|
||||
#include "../render/IImage.h"
|
||||
#include "../renderSDL/SDL_Extensions.h"
|
||||
#include "../eventsSDL/InputHandler.h"
|
||||
|
||||
#include "../../CCallback.h"
|
||||
|
||||
@ -82,6 +83,13 @@ void BasicMapView::showAll(Canvas & to)
|
||||
render(to, true);
|
||||
}
|
||||
|
||||
void MapView::tick(uint32_t msPassed)
|
||||
{
|
||||
postSwipe(msPassed);
|
||||
|
||||
controller->tick(msPassed);
|
||||
}
|
||||
|
||||
void MapView::show(Canvas & to)
|
||||
{
|
||||
actions->setContext(controller->getContext());
|
||||
@ -115,9 +123,16 @@ void MapView::onMapScrolled(const Point & distance)
|
||||
|
||||
void MapView::onMapSwiped(const Point & viewPosition)
|
||||
{
|
||||
swipeHistory[GH.input().getTicks()] = viewPosition;
|
||||
|
||||
controller->setViewCenter(model->getMapViewCenter() + viewPosition, model->getLevel());
|
||||
}
|
||||
|
||||
void MapView::postSwipe(uint32_t msPassed) {
|
||||
if(!actions->dragActive)
|
||||
swipeHistory.clear();
|
||||
}
|
||||
|
||||
void MapView::onCenteredTile(const int3 & tile)
|
||||
{
|
||||
controller->setViewCenter(tile);
|
||||
|
Reference in New Issue
Block a user