getting ready to call materials
git-svn-id: svn://anubis/misc/wfobj@21 bd8a9e45-a331-0410-811e-c64571078777
This commit is contained in:
parent
5b34c54c96
commit
2fe1763b74
18
WFObj.cc
18
WFObj.cc
@ -110,6 +110,9 @@ GLuint WFObj::render()
|
||||
vector<Vertex> vertices[VERTEX_TYPES];
|
||||
int numVertsLast = 0;
|
||||
bool inFace = false;
|
||||
bool inMaterial = false;
|
||||
string currentMaterialName;
|
||||
WFMtl material;
|
||||
for (int i = 0; i < len; i++)
|
||||
{
|
||||
string type = m_data[i][0];
|
||||
@ -227,9 +230,24 @@ GLuint WFObj::render()
|
||||
glEnd();
|
||||
inFace = false;
|
||||
}
|
||||
if (inMaterial)
|
||||
{
|
||||
material.renderEnd(currentMaterialName);
|
||||
inMaterial = false;
|
||||
}
|
||||
if (m_data[i].size() >= 2)
|
||||
{
|
||||
currentMaterialName = m_data[i][1];
|
||||
material.renderBegin(currentMaterialName);
|
||||
inMaterial = true;
|
||||
}
|
||||
}
|
||||
else if (type == "mtllib")
|
||||
{
|
||||
if (m_data[i].size() >= 2)
|
||||
{
|
||||
material.load(m_data[i][1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (inFace)
|
||||
|
Loading…
x
Reference in New Issue
Block a user