diff --git a/apps/openmw/mwrender/globalmap.cpp b/apps/openmw/mwrender/globalmap.cpp index eae63c514..5cf1ecd36 100644 --- a/apps/openmw/mwrender/globalmap.cpp +++ b/apps/openmw/mwrender/globalmap.cpp @@ -318,10 +318,15 @@ namespace MWRender if (mAlphaTexture) { osg::ref_ptr texcoords = new osg::Vec2Array; - texcoords->push_back(osg::Vec2f(0.f, 0.f)); - texcoords->push_back(osg::Vec2f(0.f, 1.f)); - texcoords->push_back(osg::Vec2f(1.f, 1.f)); - texcoords->push_back(osg::Vec2f(1.f, 0.f)); + + float x1 = x / static_cast(mWidth); + float x2 = (x + width) / static_cast(mWidth); + float y1 = y / static_cast(mHeight); + float y2 = (y + height) / static_cast(mHeight); + texcoords->push_back(osg::Vec2f(x1, y1)); + texcoords->push_back(osg::Vec2f(x1, y2)); + texcoords->push_back(osg::Vec2f(x2, y2)); + texcoords->push_back(osg::Vec2f(x2, y1)); geom->setTexCoordArray(1, texcoords, osg::Array::BIND_PER_VERTEX); stateset->setTextureAttributeAndModes(1, mAlphaTexture, osg::StateAttribute::ON);