|
@@ -133,22 +133,22 @@ void loadOBJFile(const char *filepath)
|
|
|
|
|
|
if (objFileLoaderParser(fileBuff))
|
|
if (objFileLoaderParser(fileBuff))
|
|
{
|
|
{
|
|
- log(TLOG_ERROR, "OBJLoader", "Errors occurred while opening the file '%s'.", filepath);
|
|
|
|
|
|
+ Log(TLOG_ERROR, "OBJLoader", "Errors occurred while opening the file '%s'.", filepath);
|
|
}
|
|
}
|
|
|
|
|
|
- log(TLOG_VERBOSE, "OBJLoader", "OBJ File '%s' loaded. Some stats:", filepath);
|
|
|
|
- log(TLOG_VERBOSE, "OBJLoader", "Total ignored lines : %lu", objFileLoaderIgnoredLines);
|
|
|
|
- log(TLOG_VERBOSE, "OBJLoader", "Number of vertices : %lu", objFileLoaderLoadedVertices);
|
|
|
|
- log(TLOG_VERBOSE, "OBJLoader", "Number of normal vertices : %lu", objFileLoaderLoadedVerticesNormal);
|
|
|
|
- log(TLOG_VERBOSE, "OBJLoader", "Number of texture vertices : %lu", objFileLoaderLoadedVerticesTexture);
|
|
|
|
- log(TLOG_VERBOSE, "OBJLoader", "Number of faces in file : %lu", objFileLoaderLoadedFaces);
|
|
|
|
- log(TLOG_VERBOSE, "OBJLoader", "Number of created triangles : %lu", objFileLoaderTotalTri);
|
|
|
|
|
|
+ Log(TLOG_VERBOSE, "OBJLoader", "OBJ File '%s' loaded. Some stats:", filepath);
|
|
|
|
+ Log(TLOG_VERBOSE, "OBJLoader", "Total ignored lines : %lu", objFileLoaderIgnoredLines);
|
|
|
|
+ Log(TLOG_VERBOSE, "OBJLoader", "Number of vertices : %lu", objFileLoaderLoadedVertices);
|
|
|
|
+ Log(TLOG_VERBOSE, "OBJLoader", "Number of normal vertices : %lu", objFileLoaderLoadedVerticesNormal);
|
|
|
|
+ Log(TLOG_VERBOSE, "OBJLoader", "Number of texture vertices : %lu", objFileLoaderLoadedVerticesTexture);
|
|
|
|
+ Log(TLOG_VERBOSE, "OBJLoader", "Number of faces in file : %lu", objFileLoaderLoadedFaces);
|
|
|
|
+ Log(TLOG_VERBOSE, "OBJLoader", "Number of created triangles : %lu", objFileLoaderTotalTri);
|
|
|
|
|
|
free(fileBuff);
|
|
free(fileBuff);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- log(TLOG_ERROR, "OBJLoader", "Can't open/find the file '%s'.", filepath);
|
|
|
|
|
|
+ Log(TLOG_ERROR, "OBJLoader", "Can't open/find the file '%s'.", filepath);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -178,7 +178,7 @@ static int objFileLoaderParser(const char *content)
|
|
}
|
|
}
|
|
if (lineLength >= MAX_LINE_LENGTH)
|
|
if (lineLength >= MAX_LINE_LENGTH)
|
|
{
|
|
{
|
|
- log(TLOG_ERROR, "OBJLoader", "Line %d is too long! (%d)", currentLineNum, lineLength);
|
|
|
|
|
|
+ Log(TLOG_ERROR, "OBJLoader", "Line %d is too long! (%d)", currentLineNum, lineLength);
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
memset(lineBuff, 0, MAX_LINE_LENGTH);
|
|
memset(lineBuff, 0, MAX_LINE_LENGTH);
|
|
@@ -268,7 +268,7 @@ static int objFileLoaderParseFaceVertex(char *buf, uint32_t *v, uint32_t *vt, u
|
|
case 1: *vt = atol(buf); break;
|
|
case 1: *vt = atol(buf); break;
|
|
case 2: *vn = atol(buf); break;
|
|
case 2: *vn = atol(buf); break;
|
|
default:
|
|
default:
|
|
- log(TLOG_ERROR, "OBJLoader", "Too many entry for a face vertex!");
|
|
|
|
|
|
+ Log(TLOG_ERROR, "OBJLoader", "Too many entry for a face vertex!");
|
|
ret = 1;
|
|
ret = 1;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -289,7 +289,7 @@ int objFileLoaderExecuteLine(int argc, char *argv[], uint32_t currentLine)
|
|
/* Vertice entry */
|
|
/* Vertice entry */
|
|
if (argc != 4)
|
|
if (argc != 4)
|
|
{
|
|
{
|
|
- log(TLOG_ERROR, "OBJLoader", "Malformed file at line %d: Vertices expect 3 parameters!", currentLine);
|
|
|
|
|
|
+ Log(TLOG_ERROR, "OBJLoader", "Malformed file at line %d: Vertices expect 3 parameters!", currentLine);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -304,7 +304,7 @@ int objFileLoaderExecuteLine(int argc, char *argv[], uint32_t currentLine)
|
|
/* Vertice Normal entry */
|
|
/* Vertice Normal entry */
|
|
if (argc != 4)
|
|
if (argc != 4)
|
|
{
|
|
{
|
|
- log(TLOG_ERROR, "OBJLoader", "Malformed file at line %d: Vertices normal expect 3 parameters!", currentLine);
|
|
|
|
|
|
+ Log(TLOG_ERROR, "OBJLoader", "Malformed file at line %d: Vertices normal expect 3 parameters!", currentLine);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -319,7 +319,7 @@ int objFileLoaderExecuteLine(int argc, char *argv[], uint32_t currentLine)
|
|
/* Vertice Normal entry */
|
|
/* Vertice Normal entry */
|
|
if ((argc < 3) || (argc > 4))
|
|
if ((argc < 3) || (argc > 4))
|
|
{
|
|
{
|
|
- log(TLOG_ERROR, "OBJLoader", "Malformed file at line %d: Vertices texture expect 2 or 3 parameters!", currentLine);
|
|
|
|
|
|
+ Log(TLOG_ERROR, "OBJLoader", "Malformed file at line %d: Vertices texture expect 2 or 3 parameters!", currentLine);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -363,7 +363,7 @@ int objFileLoaderExecuteLine(int argc, char *argv[], uint32_t currentLine)
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- log(TLOG_ERROR, "OBJLoader", "Malformed file at line %d: Too few/many parameters!", currentLine);
|
|
|
|
|
|
+ Log(TLOG_ERROR, "OBJLoader", "Malformed file at line %d: Too few/many parameters!", currentLine);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/* We ignore groups for now, may use it later. */
|
|
/* We ignore groups for now, may use it later. */
|
|
@@ -376,7 +376,7 @@ int objFileLoaderExecuteLine(int argc, char *argv[], uint32_t currentLine)
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- log(TLOG_ERROR, "OBJLoader", "Malformed file at line %d: Too few/many parameters!", currentLine);
|
|
|
|
|
|
+ Log(TLOG_ERROR, "OBJLoader", "Malformed file at line %d: Too few/many parameters!", currentLine);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|