add valid flag, expand clear()

This commit is contained in:
Josh Holtrop 2011-04-20 12:22:59 -04:00
parent d33b4826e2
commit cf4e09814f
2 changed files with 7 additions and 0 deletions

View File

@ -97,6 +97,8 @@ WFObj::WFObj(loadfile_t lf, loadtexture_t lt)
{ {
m_loadfile = loadfile; m_loadfile = loadfile;
} }
m_valid = false;
clear();
} }
WFObj::~WFObj() WFObj::~WFObj()
@ -107,6 +109,10 @@ void WFObj::clear()
{ {
for (int i = 0; i < sizeof(m_vertices)/sizeof(m_vertices[0]); i++) for (int i = 0; i < sizeof(m_vertices)/sizeof(m_vertices[0]); i++)
m_vertices[i].clear(); m_vertices[i].clear();
m_faces.clear();
m_valid = false;
m_path = "";
m_current_material_name = "";
} }
bool WFObj::load(const char *fname) bool WFObj::load(const char *fname)

View File

@ -79,6 +79,7 @@ protected:
loadfile_t m_loadfile; loadfile_t m_loadfile;
loadtexture_t m_loadtexture; loadtexture_t m_loadtexture;
std::string m_current_material_name; std::string m_current_material_name;
bool m_valid;
}; };
#endif #endif