From: <ma...@us...> - 2006-09-22 20:57:31
|
Update of /cvsroot/exult/./exult/shapes In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv29541/shapes Modified Files: miscinf.cc Log Message: * Fixed problem in Windows builds with USE_EXULTSTUDIO option which caused excessive processor usage, as well as being indirectly responsible for the rapid build-up of the avatar's 'rest_time'. * The files 'paperdoll_info.txt', 'bodies.txt' and 'shape_info.txt' (and similar files in the future -- and with the exception of the files bundled the Exult_XX.flx files) no longer require declaration of all sections to be properly parsed. Index: miscinf.cc =================================================================== RCS file: /cvsroot/exult/./exult/shapes/miscinf.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- miscinf.cc 17 Sep 2006 04:29:54 -0000 1.4 +++ miscinf.cc 22 Sep 2006 20:57:28 -0000 1.5 @@ -201,8 +201,16 @@ snprintf(buf, 50, "<STATIC>/%s.txt", fname); ifstream in; U7open(in, buf, true); + in.seekg(0, std::ios::end); + int size = in.tellg(); // Get file size. + in.seekg(0); for (int i=0; i<numsections; i++) - Read_text_msg_file(in, static_strings[i], sections[i]); + { + std::size_t loc = in.tellg(); + if (loc < size && + Read_text_msg_file(in, static_strings[i], sections[i]) == -1) + in.seekg(loc); + } in.close(); } catch (std::exception &e) @@ -217,8 +225,16 @@ { ifstream in; U7open(in, buf, true); + in.seekg(0, std::ios::end); + int size = in.tellg(); // Get file size. + in.seekg(0); for (int i=0; i<numsections; i++) - Read_text_msg_file(in, patch_strings[i], sections[i]); + { + std::size_t loc = in.tellg(); + if (loc < size && + Read_text_msg_file(in, patch_strings[i], sections[i]) == -1) + in.seekg(loc); + } in.close(); } |