Changed: Use VSCode auto-formatter.
This commit is contained in:
@@ -88,7 +88,6 @@ void ObjLoader::load(MeshFrame *o_result, char *t_filename, float t_scale, u8 t_
|
||||
&vertexIndex[0], &coordIndex[0], &normalIndex[0],
|
||||
&vertexIndex[1], &coordIndex[1], &normalIndex[1],
|
||||
&vertexIndex[2], &coordIndex[2], &normalIndex[2]);
|
||||
|
||||
}
|
||||
break;
|
||||
/* Loaded only two digits (V, VT) succesfuly. Not setting VN. */
|
||||
@@ -98,7 +97,6 @@ void ObjLoader::load(MeshFrame *o_result, char *t_filename, float t_scale, u8 t_
|
||||
&vertexIndex[0], &coordIndex[0],
|
||||
&vertexIndex[1], &coordIndex[1],
|
||||
&vertexIndex[2], &coordIndex[2]);
|
||||
|
||||
}
|
||||
break;
|
||||
/* Only V set. Checking for existance of VT or VN. */
|
||||
@@ -107,23 +105,26 @@ void ObjLoader::load(MeshFrame *o_result, char *t_filename, float t_scale, u8 t_
|
||||
/* Check for existance of V/// configuration.. */
|
||||
newerMatches = fscanf(file, "%d/// %d/// %d///\n", x, x, x);
|
||||
fsetpos(file, &start);
|
||||
if(newerMatches==3){
|
||||
if (newerMatches == 3)
|
||||
{
|
||||
/* Configuration confirmed. */
|
||||
fscanf(file, "%d/// %d/// %d///\n", &vertexIndex[0], &vertexIndex[1], &vertexIndex[2]);
|
||||
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Failed, checking configuration V//VN */
|
||||
newerMatches = fscanf(file, "%d//%d %d//%d %d//%d", x, x, x, x, x, x);
|
||||
fsetpos(file, &start);
|
||||
if(newerMatches==6){
|
||||
if (newerMatches == 6)
|
||||
{
|
||||
/* Configuration confirmed. */
|
||||
newerMatches = fscanf(file, "%d//%d %d//%d %d//%d",
|
||||
&vertexIndex[0], &normalIndex[0],
|
||||
&vertexIndex[1], &normalIndex[1],
|
||||
&vertexIndex[2], &normalIndex[2]);
|
||||
}
|
||||
else{
|
||||
else
|
||||
{
|
||||
/*Unknown configuration.*/
|
||||
PRINT_ERR("Unknown .obj face for .obj file!");
|
||||
printf("Obj file mentioned: \"%s\"\n", path);
|
||||
@@ -134,7 +135,6 @@ void ObjLoader::load(MeshFrame *o_result, char *t_filename, float t_scale, u8 t_
|
||||
PRINT_ERR("Unknown faces format in .obj file!");
|
||||
printf(" \"%s\"\n", path);
|
||||
break;
|
||||
|
||||
}
|
||||
/* if(ferror(file))
|
||||
PRINT_ERR("Failed to load .obj file \"%s\".");
|
||||
@@ -194,17 +194,14 @@ void ObjLoader::load(MeshFrame *o_result, char *t_filename, float t_scale, u8 t_
|
||||
o_result->getMaterial(materialsI).setNormalFace(faceI, normalIndex[0] - 1);
|
||||
o_result->getMaterial(materialsI).setNormalFace(faceI + 1, normalIndex[1] - 1);
|
||||
o_result->getMaterial(materialsI).setNormalFace(faceI + 2, normalIndex[2] - 1);
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
||||
}
|
||||
o_result->calculateBoundingBoxes();
|
||||
fclose(file);
|
||||
|
||||
Reference in New Issue
Block a user