Commit c91856ec authored by Robert Menzel's avatar Robert Menzel

fixed parsing errors if a wrong locale is set

parent 1fab2513
......@@ -11,6 +11,7 @@
#include <fstream>
#include <string>
#include <clocale>
using namespace ACGL;
using namespace ACGL::OpenGL;
......@@ -145,6 +146,10 @@ namespace OpenGL{
SharedGeometryData loadGeometryDataFromOBJ(const std::string& _filename, bool _computeNormals)
{
char *currentLocale;
currentLocale = setlocale( LC_NUMERIC, NULL ); // store current locale
setlocale( LC_NUMERIC, "C" ); // make sure the decimal point is a '.'
SharedGeometryData data;
MemoryMappedFile mmf(_filename.c_str());
if(mmf.errorCode())
......@@ -416,6 +421,8 @@ SharedGeometryData loadGeometryDataFromOBJ(const std::string& _filename, bool _c
data->setSize(abDataElements * sizeof(GLfloat));
data->setData((GLubyte*)abData);
setlocale( LC_NUMERIC, currentLocale ); // restore old locale
return data;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment