forked from teamnwah/openmw-tes3coop
Merge remote-tracking branch 'upstream/openmw-37' into HEAD
This commit is contained in:
commit
e9e12d396d
3 changed files with 6 additions and 5 deletions
|
@ -746,7 +746,7 @@ namespace MWGui
|
||||||
|
|
||||||
mGlobalMapTexture.reset(new osgMyGUI::OSGTexture(mGlobalMapRender->getBaseTexture()));
|
mGlobalMapTexture.reset(new osgMyGUI::OSGTexture(mGlobalMapRender->getBaseTexture()));
|
||||||
mGlobalMapImage->setRenderItemTexture(mGlobalMapTexture.get());
|
mGlobalMapImage->setRenderItemTexture(mGlobalMapTexture.get());
|
||||||
mGlobalMapImage->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f, 1.f, 1.f));
|
mGlobalMapImage->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 1.f, 1.f, 0.f));
|
||||||
|
|
||||||
mGlobalMapOverlayTexture.reset(new osgMyGUI::OSGTexture(mGlobalMapRender->getOverlayTexture()));
|
mGlobalMapOverlayTexture.reset(new osgMyGUI::OSGTexture(mGlobalMapRender->getOverlayTexture()));
|
||||||
mGlobalMapOverlay->setRenderItemTexture(mGlobalMapOverlayTexture.get());
|
mGlobalMapOverlay->setRenderItemTexture(mGlobalMapOverlayTexture.get());
|
||||||
|
|
|
@ -165,7 +165,7 @@ namespace MWRender
|
||||||
int vertexY = static_cast<int>(float(cellY) / float(mCellSize) * 9);
|
int vertexY = static_cast<int>(float(cellY) / float(mCellSize) * 9);
|
||||||
|
|
||||||
int texelX = (x-mMinX) * mCellSize + cellX;
|
int texelX = (x-mMinX) * mCellSize + cellX;
|
||||||
int texelY = (mHeight-1) - ((y-mMinY) * mCellSize + cellY);
|
int texelY = (y-mMinY) * mCellSize + cellY;
|
||||||
|
|
||||||
unsigned char r,g,b;
|
unsigned char r,g,b;
|
||||||
|
|
||||||
|
@ -251,6 +251,7 @@ namespace MWRender
|
||||||
camera->setProjectionMatrix(osg::Matrix::identity());
|
camera->setProjectionMatrix(osg::Matrix::identity());
|
||||||
camera->setProjectionResizePolicy(osg::Camera::FIXED);
|
camera->setProjectionResizePolicy(osg::Camera::FIXED);
|
||||||
camera->setRenderOrder(osg::Camera::PRE_RENDER);
|
camera->setRenderOrder(osg::Camera::PRE_RENDER);
|
||||||
|
y = mHeight - y - height; // convert top-left origin to bottom-left
|
||||||
camera->setViewport(x, y, width, height);
|
camera->setViewport(x, y, width, height);
|
||||||
|
|
||||||
if (clear)
|
if (clear)
|
||||||
|
@ -311,12 +312,12 @@ namespace MWRender
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int originX = (cellX - mMinX) * mCellSize;
|
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)
|
if (cellX > mMaxX || cellX < mMinX || cellY > mMaxY || cellY < mMinY)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
requestOverlayTextureUpdate(originX, originY, mCellSize, mCellSize, localMapTexture, false, true);
|
requestOverlayTextureUpdate(originX, mHeight - originY, mCellSize, mCellSize, localMapTexture, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GlobalMap::clear()
|
void GlobalMap::clear()
|
||||||
|
|
|
@ -70,7 +70,7 @@ namespace MWRender
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
* Request rendering a 2d quad onto mOverlayTexture.
|
* 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?
|
* @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,
|
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