|
|
|
@ -40,7 +40,6 @@ MapView::MapView()
|
|
|
|
|
m_lockedFirstVisibleFloor = -1;
|
|
|
|
|
m_cachedFirstVisibleFloor = 0;
|
|
|
|
|
m_cachedLastVisibleFloor = 7;
|
|
|
|
|
m_customCameraPosition.z = 7;
|
|
|
|
|
|
|
|
|
|
Size frameBufferSize(std::min(g_graphics.getMaxTextureSize(), (int)DEFAULT_FRAMBUFFER_WIDTH),
|
|
|
|
|
std::min(g_graphics.getMaxTextureSize(), (int)DEFAULT_FRAMBUFFER_HEIGHT));
|
|
|
|
@ -472,6 +471,8 @@ int MapView::calcFirstVisibleFloor()
|
|
|
|
|
} else {
|
|
|
|
|
Position cameraPosition = getCameraPosition();
|
|
|
|
|
|
|
|
|
|
// this could happens if the player is not known yet
|
|
|
|
|
if(cameraPosition.isValid()) {
|
|
|
|
|
// avoid rendering multifloors in far views
|
|
|
|
|
if(m_viewRange >= FAR_VIEW) {
|
|
|
|
|
z = cameraPosition.z;
|
|
|
|
@ -511,11 +512,12 @@ int MapView::calcFirstVisibleFloor()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
z = firstFloor;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// just ensure the that the floor is in the valid range
|
|
|
|
|
z = std::min(std::max(z, 0), (int)Otc::MAX_Z);
|
|
|
|
|
return z;
|
|
|
|
|
}
|
|
|
|
@ -525,6 +527,8 @@ int MapView::calcLastVisibleFloor()
|
|
|
|
|
int z = 7;
|
|
|
|
|
|
|
|
|
|
Position cameraPosition = getCameraPosition();
|
|
|
|
|
// this could happens if the player is not known yet
|
|
|
|
|
if(cameraPosition.isValid()) {
|
|
|
|
|
// avoid rendering multifloors in far views
|
|
|
|
|
if(m_viewRange >= FAR_VIEW) {
|
|
|
|
|
z = cameraPosition.z;
|
|
|
|
@ -535,7 +539,9 @@ int MapView::calcLastVisibleFloor()
|
|
|
|
|
else
|
|
|
|
|
z = Otc::SEA_FLOOR;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// just ensure the that the floor is in the valid range
|
|
|
|
|
z = std::min(std::max(z, 0), (int)Otc::MAX_Z);
|
|
|
|
|
return z;
|
|
|
|
|
}
|
|
|
|
@ -553,6 +559,10 @@ TilePtr MapView::getTile(const Point& mousePos, const Rect& mapRect)
|
|
|
|
|
Size visibleSize = getVisibleSize();
|
|
|
|
|
Position cameraPosition = getCameraPosition();
|
|
|
|
|
|
|
|
|
|
// if we have no camera, its impossible to get the tile
|
|
|
|
|
if(!cameraPosition.isValid())
|
|
|
|
|
return nullptr;
|
|
|
|
|
|
|
|
|
|
float scaleFactor = m_tileSize / (float)Otc::TILE_PIXELS;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|