From 6d1250aa6af2d643bdcaedeba23925089bfa0c75 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Thu, 8 Sep 2016 23:54:05 -0700 Subject: [PATCH] More cleanup for the demo code --- demo/main.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/demo/main.cpp b/demo/main.cpp index feb039e7..b6a7c934 100644 --- a/demo/main.cpp +++ b/demo/main.cpp @@ -131,7 +131,7 @@ void optimize(const Mesh& mesh, const char* name, void (*optf)(Mesh& mesh)) PostTLCacheStatistics stats = analyzePostTL(©.indices[0], copy.indices.size(), copy.vertices.size(), kCacheSize); - printf("%s: ACMR %f in %f msec (%d triangles)\n", name, stats.acmr, double(end - start) / CLOCKS_PER_SEC * 1000, int(mesh.indices.size() / 3)); + printf("%s: ACMR %f in %f msec\n", name, stats.acmr, double(end - start) / CLOCKS_PER_SEC * 1000); } int main(int argc, char** argv) @@ -141,20 +141,25 @@ int main(int argc, char** argv) if (argc > 1) { mesh = readOBJ(argv[1]); + if (mesh.vertices.empty()) { printf("Mesh %s appears to be empty\n", argv[1]); return 0; } + + printf("Using %s (%d vertices, %d triangles)\n", argv[1], int(mesh.vertices.size()), int(mesh.indices.size() / 3)); } else { printf("Usage: %s [.obj file]\n", argv[0]); - printf("Defaulting to a tesselated plane\n"); + mesh = generatePlane(1000); + + printf("Using a tesselated plane (%d vertices, %d triangles)\n", int(mesh.vertices.size()), int(mesh.indices.size() / 3)); } - optimize(mesh, "none", optimizeNone); + optimize(mesh, "Original", optimizeNone); optimize(mesh, "TomF", optimizeTomF); optimize(mesh, "Tipsify", optimizeTipsify); optimize(mesh, "Tipsify + overdraw", optimizeTipsifyOverdraw);