Increase maximum move offset to be 64 instead of 32

This commit is contained in:
Ahmed Samy 2013-12-12 03:23:13 +02:00
parent bd8c883e13
commit 57c432d3ea
1 changed files with 20 additions and 4 deletions

View File

@ -567,22 +567,38 @@ Position MapView::getPosition(const Point& point, const Size& mapSize)
void MapView::move(int x, int y) void MapView::move(int x, int y)
{ {
if(m_moveOffset.x + x > 32) { if(m_moveOffset.x + x > 32) {
if(m_moveOffset.x + x > 64)
m_customCameraPosition.x += 2;
else
m_customCameraPosition.x += 1; m_customCameraPosition.x += 1;
m_moveOffset.x = x; m_moveOffset.x = x;
requestVisibleTilesCacheUpdate(); requestVisibleTilesCacheUpdate();
} else if(m_moveOffset.x - x < -32) { } else if(m_moveOffset.x - x < -32) {
if(m_moveOffset.x - x < -64)
m_customCameraPosition.x -= 2;
else
m_customCameraPosition.x -= 1; m_customCameraPosition.x -= 1;
m_moveOffset.x = x; m_moveOffset.x = x;
requestVisibleTilesCacheUpdate(); requestVisibleTilesCacheUpdate();
} else } else
m_moveOffset.x += x; m_moveOffset.x += x;
if(m_moveOffset.y + y > 32) { if(m_moveOffset.y + y > 32) {
if(m_moveOffset.y + y > 64)
m_customCameraPosition.y += 2;
else
m_customCameraPosition.y += 1; m_customCameraPosition.y += 1;
m_moveOffset.y = y; m_moveOffset.y = y;
requestVisibleTilesCacheUpdate(); requestVisibleTilesCacheUpdate();
} else if(m_moveOffset.y - y < -32) { } else if(m_moveOffset.y - y < -32) {
if(m_moveOffset.y - y < -64)
m_customCameraPosition.y -= 2;
else
m_customCameraPosition.y -= 1; m_customCameraPosition.y -= 1;
m_moveOffset.y = y; m_moveOffset.y = y;
requestVisibleTilesCacheUpdate(); requestVisibleTilesCacheUpdate();
} else } else