Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ProgressiveMeshGenerator::addIndexData(IndexData* indexData, bool useSharedVertexLookup, unsigned short submeshID)
- {
- const HardwareIndexBufferSharedPtr& ibuf = indexData->indexBuffer;
- size_t isize = ibuf->getIndexSize();
- mIndexBufferInfoList[submeshID].indexSize = isize;
- mIndexBufferInfoList[submeshID].indexCount = indexData->indexCount;
- if (indexData->indexCount == 0) {
- // Locking a zero length buffer on linux with nvidia cards fails.
- return;
- }
- VertexLookupList& lookup = useSharedVertexLookup ? mSharedVertexLookup : mVertexLookup;
- // Lock the buffer for reading.
- char* iStart = static_cast<char*>(ibuf->lock(HardwareBuffer::HBL_READ_ONLY));
- char* iEnd = iStart + ibuf->getSizeInBytes();
- if (isize == sizeof(unsigned short)) {
- addIndexDataImpl<unsigned short>((unsigned short*) iStart, (unsigned short*) iEnd, lookup, submeshID);
- } else {
- // Unsupported index size.
- OgreAssert(isize == sizeof(unsigned int), "");
- addIndexDataImpl<unsigned int>((unsigned int*) iStart, (unsigned int*) iEnd, lookup, submeshID);
- }
- ibuf->unlock();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement