OSDN Git Service

refactoring.
[meshio/meshio.git] / src / vmd.cpp
index b93b72b..322344d 100755 (executable)
@@ -20,7 +20,8 @@ template<class READER>
        void
        readBoneMap(READER &reader, IO &io)
        {
-               std::string name=reader.getString(15, true);
+               std::wstring name=
+                       text::trim(text::to_WideChar(CP_OEMCP, reader.getString(15, true)));
                unsigned int frame=reader.getUint();
                IO::BoneMap::iterator found=io.boneMap.find(name);
                if(found==io.boneMap.end()){
@@ -44,7 +45,8 @@ template<class READER>
        void
        readMorphMap(READER &reader, IO &io)
        {
-               std::string name=reader.getString(15, true);
+               std::wstring name=
+                       text::trim(text::to_WideChar(CP_OEMCP, reader.getString(15, true)));
                unsigned int frame=reader.getUint();
                IO::MorphMap::iterator found=io.morphMap.find(name);
                if(found==io.morphMap.end()){
@@ -196,12 +198,12 @@ bool IO::write(std::ostream &os)
        return false;
 }
 
-BoneKeyFrameList* IO::getBoneKeyFrameList(const std::string &name)
+BoneKeyFrameList* IO::getBoneKeyFrameList(const std::wstring &name)
 {
        return boneMap[name];
 }
 
-MorphKeyFrameList* IO::getMorphKeyFrameList(const std::string &name)
+MorphKeyFrameList* IO::getMorphKeyFrameList(const std::wstring &name)
 {
        return morphMap[name];
 }