mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 02:15:32 +00:00
Fix the global map overlay viewport (Bug #3018)
This commit is contained in:
parent
692a15a3df
commit
8b7bdcd127
2 changed files with 4 additions and 3 deletions
|
@ -251,6 +251,7 @@ namespace MWRender
|
|||
camera->setProjectionMatrix(osg::Matrix::identity());
|
||||
camera->setProjectionResizePolicy(osg::Camera::FIXED);
|
||||
camera->setRenderOrder(osg::Camera::PRE_RENDER);
|
||||
y = mHeight - y - height; // convert top-left origin to bottom-left
|
||||
camera->setViewport(x, y, width, height);
|
||||
|
||||
if (clear)
|
||||
|
@ -311,12 +312,12 @@ namespace MWRender
|
|||
return;
|
||||
|
||||
int originX = (cellX - mMinX) * mCellSize;
|
||||
int originY = (cellY - mMinY) * mCellSize;
|
||||
int originY = (cellY - mMinY + 1) * mCellSize; // +1 because we want the top left corner of the cell, not the bottom left
|
||||
|
||||
if (cellX > mMaxX || cellX < mMinX || cellY > mMaxY || cellY < mMinY)
|
||||
return;
|
||||
|
||||
requestOverlayTextureUpdate(originX, originY, mCellSize, mCellSize, localMapTexture, false, true);
|
||||
requestOverlayTextureUpdate(originX, mHeight - originY, mCellSize, mCellSize, localMapTexture, false, true);
|
||||
}
|
||||
|
||||
void GlobalMap::clear()
|
||||
|
|
|
@ -70,7 +70,7 @@ namespace MWRender
|
|||
private:
|
||||
/**
|
||||
* Request rendering a 2d quad onto mOverlayTexture.
|
||||
* x, y, width and height are the destination coordinates.
|
||||
* x, y, width and height are the destination coordinates (top-left coordinate origin)
|
||||
* @param cpuCopy copy the resulting render onto mOverlayImage as well?
|
||||
*/
|
||||
void requestOverlayTextureUpdate(int x, int y, int width, int height, osg::ref_ptr<osg::Texture2D> texture, bool clear, bool cpuCopy,
|
||||
|
|
Loading…
Reference in a new issue