fixed compile errors
This commit is contained in:
parent
a95136f7b9
commit
772717f91c
|
@ -14,6 +14,7 @@ class Material
|
|||
{
|
||||
public:
|
||||
std::string name;
|
||||
std::string textureFile;
|
||||
Color ambient;
|
||||
Color diffuse;
|
||||
Color specular;
|
||||
|
@ -22,4 +23,4 @@ public:
|
|||
float opacity;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#include "md2.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "../chunks/chunks.h"
|
||||
|
||||
Md2::Md2()
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#include "ms3d.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "../util/files.h"
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "obj.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
||||
|
@ -386,7 +387,7 @@ bool Obj::LoadMaterialLibrary(const std::string &file, const std::string &textur
|
|||
{
|
||||
//ASSERT(currentMaterial >= 0);
|
||||
sscanf(line.c_str(), "Ka %f %f %f", &r, &g, &b);
|
||||
m_materials[currentMaterial].material->SetAmbient(RGB_24_f(r, g, b));
|
||||
m_materials[currentMaterial].material->ambient = Color::FromInt(RGB_24_f(r, g, b));
|
||||
}
|
||||
|
||||
// Diffuse color
|
||||
|
@ -394,7 +395,7 @@ bool Obj::LoadMaterialLibrary(const std::string &file, const std::string &textur
|
|||
{
|
||||
//ASSERT(currentMaterial >= 0);
|
||||
sscanf(line.c_str(), "Kd %f %f %f", &r, &g, &b);
|
||||
m_materials[currentMaterial].material->SetDiffuse(RGB_24_f(r, g, b));
|
||||
m_materials[currentMaterial].material->diffuse = Color::FromInt(RGB_24_f(r, g, b));
|
||||
}
|
||||
|
||||
// Specular color
|
||||
|
@ -402,7 +403,7 @@ bool Obj::LoadMaterialLibrary(const std::string &file, const std::string &textur
|
|||
{
|
||||
//ASSERT(currentMaterial >= 0);
|
||||
sscanf(line.c_str(), "Ks %f %f %f", &r, &g, &b);
|
||||
m_materials[currentMaterial].material->SetSpecular(RGB_24_f(r, g, b));
|
||||
m_materials[currentMaterial].material->specular = Color::FromInt(RGB_24_f(r, g, b));
|
||||
}
|
||||
|
||||
// Alpha value
|
||||
|
@ -427,7 +428,7 @@ bool Obj::LoadMaterialLibrary(const std::string &file, const std::string &textur
|
|||
else if (op == "map_Ka" || op == "map_Kd")
|
||||
{
|
||||
//ASSERT(currentMaterial >= 0);
|
||||
m_materials[currentMaterial].material->SetTexture(texturePath + line.substr(op.length() + 1));
|
||||
m_materials[currentMaterial].material->textureFile = texturePath + line.substr(op.length() + 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Reference in a new issue