Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 559472
Collapse All | Expand All

(-)a/OgreMain/include/OgreProgressiveMeshGenerator.h (-1 / +34 lines)
Lines 215-221 Link Here
215
	void tuneContainerSize();
215
	void tuneContainerSize();
216
	void addVertexData(VertexData* vertexData, bool useSharedVertexLookup);
216
	void addVertexData(VertexData* vertexData, bool useSharedVertexLookup);
217
	template<typename IndexType>
217
	template<typename IndexType>
218
	void addIndexDataImpl(IndexType* iPos, const IndexType* iEnd, VertexLookupList& lookup, unsigned short submeshID);
218
	void addIndexDataImpl(IndexType* iPos, const IndexType* iEnd, VertexLookupList& lookup, unsigned short submeshID)
219
	{
220
221
		// Loop through all triangles and connect them to the vertices.
222
		for (; iPos < iEnd; iPos += 3) {
223
			// It should never reallocate or every pointer will be invalid.
224
			OgreAssert(mTriangleList.capacity() > mTriangleList.size(), "");
225
			mTriangleList.push_back(PMTriangle());
226
			PMTriangle* tri = &mTriangleList.back();
227
			tri->isRemoved = false;
228
			tri->submeshID = submeshID;
229
			for (int i = 0; i < 3; i++) {
230
				// Invalid index: Index is bigger then vertex buffer size.
231
				OgreAssert(iPos[i] < lookup.size(), "");
232
				tri->vertexID[i] = iPos[i];
233
				tri->vertex[i] = lookup[iPos[i]];
234
			}
235
			if (tri->isMalformed()) {
236
#if OGRE_DEBUG_MODE
237
				stringstream str;
238
				str << "In " << mMeshName << " malformed triangle found with ID: " << getTriangleID(tri) << ". " <<
239
				std::endl;
240
				printTriangle(tri, str);
241
				str << "It will be excluded from LOD level calculations.";
242
				LogManager::getSingleton().stream() << str.str();
243
#endif
244
				tri->isRemoved = true;
245
				mIndexBufferInfoList[tri->submeshID].indexCount -= 3;
246
				continue;
247
			}
248
			tri->computeNormal();
249
			addTriangleToEdges(tri);
250
		}
251
	}
219
	void addIndexData(IndexData* indexData, bool useSharedVertexLookup, unsigned short submeshID);
252
	void addIndexData(IndexData* indexData, bool useSharedVertexLookup, unsigned short submeshID);
220
253
221
	void computeCosts();
254
	void computeCosts();
(-)a/OgreMain/src/OgreProgressiveMeshGenerator.cpp (+3 lines)
Lines 219-224 Link Here
219
	}
219
	}
220
	vbuf->unlock();
220
	vbuf->unlock();
221
}
221
}
222
/// Called from OgreQueuedProgressiveMeshGenerator.cpp, so it can not be defined in here.
223
#if 0
222
template<typename IndexType>
224
template<typename IndexType>
223
void ProgressiveMeshGenerator::addIndexDataImpl(IndexType* iPos, const IndexType* iEnd,
225
void ProgressiveMeshGenerator::addIndexDataImpl(IndexType* iPos, const IndexType* iEnd,
224
                                                VertexLookupList& lookup,
226
                                                VertexLookupList& lookup,
Lines 256-261 Link Here
256
		addTriangleToEdges(tri);
258
		addTriangleToEdges(tri);
257
	}
259
	}
258
}
260
}
261
#endif // 0
259
262
260
void ProgressiveMeshGenerator::addIndexData(IndexData* indexData, bool useSharedVertexLookup, unsigned short submeshID)
263
void ProgressiveMeshGenerator::addIndexData(IndexData* indexData, bool useSharedVertexLookup, unsigned short submeshID)
261
{
264
{

Return to bug 559472