mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:53:51 +00:00
Minor cleanup to loading texture UV coords
This commit is contained in:
parent
01a1a0b846
commit
e7c0f2a211
1 changed files with 6 additions and 13 deletions
|
@ -1400,21 +1400,14 @@ class NIFObjectLoader : Ogre::ManualResourceLoader
|
||||||
|
|
||||||
// Texture UV coordinates
|
// Texture UV coordinates
|
||||||
size_t numUVs = data->uvlist.size();
|
size_t numUVs = data->uvlist.size();
|
||||||
if(numUVs)
|
for(size_t i = 0;i < numUVs;i++)
|
||||||
{
|
{
|
||||||
for(size_t i = 0;i < numUVs;i++)
|
vbuf = hwBufMgr->createVertexBuffer(Ogre::VertexElement::getTypeSize(Ogre::VET_FLOAT2),
|
||||||
{
|
srcVerts.size(), Ogre::HardwareBuffer::HBU_STATIC);
|
||||||
size_t elemSize = Ogre::VertexElement::getTypeSize(Ogre::VET_FLOAT2);
|
vbuf->writeData(0, vbuf->getSizeInBytes(), &data->uvlist[i][0], true);
|
||||||
vbuf = hwBufMgr->createVertexBuffer(elemSize, srcVerts.size(),
|
|
||||||
Ogre::HardwareBuffer::HBU_STATIC);
|
|
||||||
|
|
||||||
const std::vector<Ogre::Vector2> &uvlist = data->uvlist[i];
|
decl->addElement(nextBuf, 0, Ogre::VET_FLOAT2, Ogre::VES_TEXTURE_COORDINATES, i);
|
||||||
|
bind->setBinding(nextBuf++, vbuf);
|
||||||
vbuf->writeData(0, elemSize*srcVerts.size(), &uvlist[0], true);
|
|
||||||
decl->addElement(nextBuf, 0, Ogre::VET_FLOAT2,
|
|
||||||
Ogre::VES_TEXTURE_COORDINATES, i);
|
|
||||||
bind->setBinding(nextBuf++, vbuf);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Triangle faces
|
// Triangle faces
|
||||||
|
|
Loading…
Reference in a new issue