diff --git a/WFObj.cc b/WFObj.cc index 3777c09..c2a5ff5 100644 --- a/WFObj.cc +++ b/WFObj.cc @@ -14,7 +14,7 @@ using namespace std; #define WHITESPACE " \n\r\t\v" -#define DEBUGGL +//#define DEBUGGL /****** static functions ******/ @@ -376,24 +376,6 @@ bool WFMtl::load(const string & filename, WFObj::loadTextureFunc_t loadTexture) processInputLine(input); } - /* DEBUG */ - map > >::iterator it = m_data.begin(); - while (it != m_data.end()) - { - cout << "Material '" << it->first << "':" << endl; - for (int i = 0; i < it->second.size(); i++) - { - cout << " "; - for (int j = 0; j < it->second[i].size(); j++) - { - cout << '\'' << it->second[i][j] << "' "; - } - cout << endl; - } - it++; - } - /* END DEBUG */ - ifs.close(); m_loadTexture = loadTexture; m_fileName = filename; @@ -490,6 +472,21 @@ void WFMtl::renderBegin(const string & mtlname) didSomething = true; } } + else if (type == "Ns") /* set shininess */ + { + if (stmts[i].size() == 2) + { + pushAttributes(); + GLfloat shininess = 0.0f; + sscanf(stmts[i][1].c_str(), "%f", &shininess); +#ifdef DEBUGGL + cout << " glMaterialf(GL_FRONT, GL_SHININESS, " + << shininess << ")" << endl; +#endif + glMaterialf(GL_FRONT, GL_SHININESS, shininess); + didSomething = true; + } + } else if (type == "map_Kd") /* load a diffuse texture */ { /* TODO: figure out how i want to load the texture */