Fixed parsing of mesh lod levels from mesh names

--HG--
branch : nfb
This commit is contained in:
2014-04-09 22:15:01 -07:00
parent ecf2ea2be4
commit 56a43bb4f4

View File

@@ -71,7 +71,7 @@ void KRMesh::setName(const std::string name) {
if(last_underscore_pos != std::string::npos) { if(last_underscore_pos != std::string::npos) {
// Found an underscore // Found an underscore
std::string suffix = name.substr(last_underscore_pos + 1); std::string suffix = name.substr(last_underscore_pos + 1);
if(suffix.find_first_of("lod") == 0) { if(suffix.find("lod") == 0) {
std::string lod_level_string = suffix.substr(3); std::string lod_level_string = suffix.substr(3);
char *end = NULL; char *end = NULL;
int c = (int)strtol(lod_level_string.c_str(), &end, 10); int c = (int)strtol(lod_level_string.c_str(), &end, 10);
@@ -91,7 +91,7 @@ int KRMesh::GetLODCoverage(const std::string &name)
if(last_underscore_pos != std::string::npos) { if(last_underscore_pos != std::string::npos) {
// Found an underscore // Found an underscore
std::string suffix = name.substr(last_underscore_pos + 1); std::string suffix = name.substr(last_underscore_pos + 1);
if(suffix.find_first_of("lod") == 0) { if(suffix.find("lod") == 0) {
std::string lod_level_string = suffix.substr(3); std::string lod_level_string = suffix.substr(3);
char *end = NULL; char *end = NULL;
int c = (int)strtol(lod_level_string.c_str(), &end, 10); int c = (int)strtol(lod_level_string.c_str(), &end, 10);