Minor fixes in the code, mostly spacing

This commit is contained in:
Pol 2015-09-17 13:55:08 -07:00
parent 2fc7bd1660
commit 67e86104f6

View File

@ -256,16 +256,14 @@ int main(int argc, char ** argv) {
// Parsing command line parameters to see if the user wants to use a
// specific method to calculate normals.
for (int i = 1; i < argc; ++i) {
if (strstr(argv[i], "-limit")) {
normalMethod = Limit;
}
else if (!strcmp(argv[i], "-crossquad")) {
} else if (!strcmp(argv[i], "-crossquad")) {
normalMethod = CrossQuad;
}
else if (!strcmp(argv[i], "-crosstriangle")) {
} else if (!strcmp(argv[i], "-crosstriangle")) {
normalMethod = CrossTriangle;
}
else {
} else {
printf("Parameters : \n");
printf(" -crosstriangle : use the cross product of vectors\n");
printf(" generated from 3 verts (default).\n");
@ -290,8 +288,8 @@ int main(int argc, char ** argv) {
desc.vertIndicesPerFace = g_vertIndices;
// Create a face-varying channel descriptor
const int numChannels = 2;
const int channelUV = 0;
const int numChannels = 2;
const int channelUV = 0;
const int channelColor = 1;
Descriptor::FVarChannel channels[numChannels];
channels[channelUV].numValues = g_nuvs;
@ -344,9 +342,8 @@ int main(int argc, char ** argv) {
// Interpolate both vertex and face-varying primvar data
Far::PrimvarRefiner primvarRefiner(*refiner);
Vertex * srcVert = verts;
FVarVertexUV * srcFVarUV = fvVertsUV;
Vertex * srcVert = verts;
FVarVertexUV * srcFVarUV = fvVertsUV;
FVarVertexColor * srcFVarColor = fvVertsColor;
for (int level = 1; level <= maxlevel; ++level) {
@ -374,8 +371,7 @@ int main(int argc, char ** argv) {
std::vector<Vertex> normals(nverts);
if(normalMethod == Limit) {
if (normalMethod == Limit) {
// Limit position, derivatives and normals
std::vector<Vertex> fineLimitPos(nverts);
std::vector<Vertex> fineDu(nverts);
@ -393,7 +389,6 @@ int main(int argc, char ** argv) {
}
} else if (normalMethod == CrossQuad) {
// Accumulate normals calculated using the cross product of the two
// vectors generated by the 4 verts that form a quad.
for (int f = 0; f < nfaces; f++) {
@ -424,7 +419,6 @@ int main(int argc, char ** argv) {
}
} else if (normalMethod == CrossTriangle) {
// Accumulate normals calculated using the cross product of the
// two vectors generated by 3 verts.
for (int f = 0; f < nfaces; f++) {
@ -456,12 +450,11 @@ int main(int argc, char ** argv) {
// Finally we just need to normalize the accumulated normals
for (int vert = 0; vert < nverts; ++vert) {
normalize(&normals[vert].position[0]);
}
{ // Output OBJ of the highest level refined -----------
// Print vertex positions
for (int vert = 0; vert < nverts; ++vert) {
float const * pos = verts[firstOfLastVerts + vert].GetPosition();