Commit e2f8a703 authored by lukeph's avatar lukeph

-B3D loader: support for different TRIS Chunks sharing the same vertex in static meshes.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@925 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 2da809bc
...@@ -524,6 +524,9 @@ bool CB3DMeshFileLoader::readChunkVRTS(CSkinnedMesh::SJoint *InJoint, scene::SSk ...@@ -524,6 +524,9 @@ bool CB3DMeshFileLoader::readChunkVRTS(CSkinnedMesh::SJoint *InJoint, scene::SSk
bool CB3DMeshFileLoader::readChunkTRIS(CSkinnedMesh::SJoint *InJoint, scene::SSkinMeshBuffer *MeshBuffer, u32 MeshBufferID, s32 Vertices_Start) bool CB3DMeshFileLoader::readChunkTRIS(CSkinnedMesh::SJoint *InJoint, scene::SSkinMeshBuffer *MeshBuffer, u32 MeshBufferID, s32 Vertices_Start)
{ {
bool showVertexWarning=false;
s32 triangle_brush_id; // Note: Irrlicht can't have different brushes for each triangle (I'm using a workaround) s32 triangle_brush_id; // Note: Irrlicht can't have different brushes for each triangle (I'm using a workaround)
file->read(&triangle_brush_id, sizeof(triangle_brush_id)); file->read(&triangle_brush_id, sizeof(triangle_brush_id));
...@@ -566,6 +569,15 @@ bool CB3DMeshFileLoader::readChunkTRIS(CSkinnedMesh::SJoint *InJoint, scene::SSk ...@@ -566,6 +569,15 @@ bool CB3DMeshFileLoader::readChunkTRIS(CSkinnedMesh::SJoint *InJoint, scene::SSk
for(s32 i=0; i<3; ++i) for(s32 i=0; i<3; ++i)
{ {
if (AnimatedVertices_VertexID[ vertex_id[i] ] != -1)
{
if ( AnimatedVertices_BufferID[ vertex_id[i] ] != (s32)MeshBufferID ) //If this vertex is linked in a different meshbuffer
{
AnimatedVertices_VertexID[ vertex_id[i] ] = -1;
AnimatedVertices_BufferID[ vertex_id[i] ] = -1;
showVertexWarning=true;
}
}
if (AnimatedVertices_VertexID[ vertex_id[i] ] == -1) //If this vertex is not in the meshbuffer if (AnimatedVertices_VertexID[ vertex_id[i] ] == -1) //If this vertex is not in the meshbuffer
{ {
...@@ -617,6 +629,11 @@ bool CB3DMeshFileLoader::readChunkTRIS(CSkinnedMesh::SJoint *InJoint, scene::SSk ...@@ -617,6 +629,11 @@ bool CB3DMeshFileLoader::readChunkTRIS(CSkinnedMesh::SJoint *InJoint, scene::SSk
B3dStack.erase(B3dStack.size()-1); B3dStack.erase(B3dStack.size()-1);
if (showVertexWarning)
os::Printer::log("B3dMeshLoader: Warning, different meshbuffers linking to the same vertex, this will cause problems with animated meshes");
return true; return true;
} }
......
...@@ -960,7 +960,7 @@ s32 CGUIEditBox::getCursorPos(s32 x, s32 y) ...@@ -960,7 +960,7 @@ s32 CGUIEditBox::getCursorPos(s32 x, s32 y)
if (WordWrap || MultiLine) if (WordWrap || MultiLine)
lineCount = BrokenText.size(); lineCount = BrokenText.size();
core::stringw *txtLine; core::stringw *txtLine=0;
s32 startPos=0; s32 startPos=0;
x+=3; x+=3;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment