From: <mg...@us...> - 2010-08-14 19:35:32
|
Revision: 34829 http://crystal.svn.sourceforge.net/crystal/?rev=34829&view=rev Author: mgist Date: 2010-08-14 19:35:25 +0000 (Sat, 14 Aug 2010) Log Message: ----------- - Tweaked the lod help output a little. - Got rid of some MSVC compile warnings. Modified Paths: -------------- CS/branches/soc2010/lod/apps/tools/lod/LodGen.cpp CS/branches/soc2010/lod/apps/tools/lod/LodGen.h CS/branches/soc2010/lod/apps/tools/lod/lod.cpp Modified: CS/branches/soc2010/lod/apps/tools/lod/LodGen.cpp =================================================================== --- CS/branches/soc2010/lod/apps/tools/lod/LodGen.cpp 2010-08-14 19:00:20 UTC (rev 34828) +++ CS/branches/soc2010/lod/apps/tools/lod/LodGen.cpp 2010-08-14 19:35:25 UTC (rev 34829) @@ -550,7 +550,8 @@ int samples_per_triangle = 10; int count = 0; - srand(test_tris.GetSize()+test_tris0.GetSize()); + unsigned int seed = (unsigned int)(test_tris.GetSize()+test_tris0.GetSize()); + srand(seed); // For each triangle in test_tris0, test its distance to all triangles // in test_tris @@ -865,8 +866,8 @@ k.GetTriangle(i)[1] == k.GetTriangle(i-curr_num_triangles)[1] && k.GetTriangle(i)[2] == k.GetTriangle(i-curr_num_triangles)[2]); k.tri_indices.DeleteRange(sw.start_index, sw.end_index-1); - sw.start_index -= curr_num_triangles; - sw.end_index -= curr_num_triangles; + sw.start_index -= (int)curr_num_triangles; + sw.end_index -= (int)curr_num_triangles; k.SetLastWindow(sw); break; } @@ -919,8 +920,8 @@ // Replicate index buffer if (min_d == FLT_MAX) could_not_collapse = true; - sw.start_index += curr_num_triangles; - sw.end_index += curr_num_triangles; + sw.start_index += (int)curr_num_triangles; + sw.end_index += (int)curr_num_triangles; k.SetLastWindow(sw); top_limit = sw.end_index; for (int i = sw.start_index; i < sw.end_index; i++) Modified: CS/branches/soc2010/lod/apps/tools/lod/LodGen.h =================================================================== --- CS/branches/soc2010/lod/apps/tools/lod/LodGen.h 2010-08-14 19:00:20 UTC (rev 34828) +++ CS/branches/soc2010/lod/apps/tools/lod/LodGen.h 2010-08-14 19:35:25 UTC (rev 34829) @@ -104,13 +104,13 @@ size_t GetTriangleCount() const { return ordered_tris.GetSize(); } /// Get a triangle from the processed mesh - const csTriangle& GetTriangle(int i) const { return ordered_tris[i]; } + const csTriangle& GetTriangle(size_t i) const { return ordered_tris[i]; } /// Get the number of sliding windows in the processed mesh size_t GetSlidingWindowCount() const { return k.sliding_windows.GetSize(); } /// Get a sliding window from the processed mesh - const SlidingWindow& GetSlidingWindow(int i) const { return k.sliding_windows[i]; } + const SlidingWindow& GetSlidingWindow(size_t i) const { return k.sliding_windows[i]; } protected: /** Modified: CS/branches/soc2010/lod/apps/tools/lod/lod.cpp =================================================================== --- CS/branches/soc2010/lod/apps/tools/lod/lod.cpp 2010-08-14 19:00:20 UTC (rev 34828) +++ CS/branches/soc2010/lod/apps/tools/lod/lod.cpp 2010-08-14 19:35:25 UTC (rev 34829) @@ -41,16 +41,16 @@ { // ---------+---------+---------+---------+---------+---------+---------+-------80+ csPrintf("Usage:\n\n"); - csPrintf("lod -i=<input_file> -o=<output_file> -mindist=d -maxdist=d [-em=<fast|precise>]\n"); - csPrintf(" [-v]\n\n"); - csPrintf("-em Error metric (fast or precise).\n"); - csPrintf("-v Verbose.\n"); + csPrintf("lod -i=<input_file> [-o=<output_file>] -mindist=d -maxdist=d [-v] [-force]\n"); + csPrintf(" [-em=<fast|precise>]\n\n"); csPrintf("-mindist Minimum LOD distance.\n"); csPrintf("-maxdist Maximum LOD distance.\n"); csPrintf(" For medium-sized objects, try -mindist=5 -maxdist=50.\n"); csPrintf(" Existing values in input file take precedence, unless -force is used.\n"); csPrintf("-force Force use of cmdline-specified mindist and maxdist.\n"); csPrintf(" Mindist and maxdist *need* to be either in cmdline or input file.\n"); + csPrintf("-em Error metric (fast or precise).\n"); + csPrintf("-v Verbose.\n"); } bool Lod::ParseParams(int argc, char* argv[]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |