Commit 2d97c252 authored by Robert Menzel's avatar Robert Menzel

merged conflict

parents 18c850a5 a5ec6617
......@@ -194,7 +194,7 @@ SharedGeometryData loadGeometryDataFromOBJ(const std::string& _filename, bool _c
std::vector<IndexTuple> pointIndices = parseIndices(parameters);
// points are just added in order
for(unsigned int i = 0; i < pointIndices.size(); ++i)
for(size_t i = 0; i < pointIndices.size(); ++i)
{
indices.push_back(pointIndices[i]);
}
......@@ -211,7 +211,7 @@ SharedGeometryData loadGeometryDataFromOBJ(const std::string& _filename, bool _c
std::vector<IndexTuple> lineIndices = parseIndices(parameters);
// add line segments for the line strip defined by the vertices
for(unsigned int i = 0; i < lineIndices.size() - 1; ++i)
for(size_t i = 0; i < lineIndices.size() - 1; ++i)
{
indices.push_back(lineIndices[i]);
indices.push_back(lineIndices[i+1]);
......@@ -229,13 +229,35 @@ SharedGeometryData loadGeometryDataFromOBJ(const std::string& _filename, bool _c
std::vector<IndexTuple> faceIndices = parseIndices(parameters);
// triangulate the polygon defined by the indices
for(unsigned int i = 1; i < faceIndices.size() - 1; ++i)
for(size_t i = 1; i < faceIndices.size() - 1; ++i)
{
indices.push_back(faceIndices[0]);
indices.push_back(faceIndices[i]);
indices.push_back(faceIndices[i+1]);
}
}
else if(keyword == "bevel" || keyword == "bmat"
|| keyword == "bsp" || keyword == "bzp"
|| keyword == "c_interp" || keyword == "cdc"
|| keyword == "cdp" || keyword == "con"
|| keyword == "cstype" || keyword == "ctech"
|| keyword == "curv" || keyword == "curv2"
|| keyword == "d_interp" || keyword == "deg"
|| keyword == "end" || keyword == "g"
|| keyword == "hole" || keyword == "lod"
|| keyword == "maplib" || keyword == "mg"
|| keyword == "mtllib" || keyword == "o"
|| keyword == "parm" || keyword == "res"
|| keyword == "s" || keyword == "scrv"
|| keyword == "shadow_obj" || keyword == "sp"
|| keyword == "stech" || keyword == "step"
|| keyword == "surf" || keyword == "trace_obj"
|| keyword == "trim" || keyword == "usemap"
|| keyword == "usemtl" || keyword == "vp")
{
// part of the OBJ specification (i.e. non-polygonal geometry, object groups, etc.)
// is not supported and is silently ignored
}
else
{
warning() << "unknown OBJ keyword ignored: " << keyword << std::endl;
......@@ -249,7 +271,7 @@ SharedGeometryData loadGeometryDataFromOBJ(const std::string& _filename, bool _c
GLfloat* abData = new GLfloat[abDataElements];
size_t pos = 0;
for(unsigned int i = 0; i < indices.size(); ++i)
for(size_t i = 0; i < indices.size(); ++i)
{
const glm::vec4& position = positionData[indices[i].position];
abData[pos++] = position.x;
......@@ -276,7 +298,7 @@ SharedGeometryData loadGeometryDataFromOBJ(const std::string& _filename, bool _c
}
size_t strideSize = 0;
ArrayBuffer::Attribute attrPosition = { "aPosition", GL_FLOAT, positionDimension, 0, GL_FALSE, 0, GL_FALSE };
ArrayBuffer::Attribute attrPosition = { "aPosition", GL_FLOAT, positionDimension, (GLuint)0, GL_FALSE, 0, GL_FALSE };
strideSize += positionDimension * sizeof(GLfloat);
data->mAttributes.push_back(attrPosition);
......
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