Changed: Convert MSTR to UTF-8

--HG--
branch : develop
This commit is contained in:
kervala 2016-12-04 19:35:47 +01:00
parent 6d651b9c68
commit f5008cb00d
4 changed files with 11 additions and 11 deletions

View file

@ -185,7 +185,7 @@ void CExportNel::addSSSTrack(CSSSBuild &ssBuilder, INode& node)
if(note) if(note)
{ {
CSSSBuild::CKey ks; CSSSBuild::CKey ks;
ks.Value = std::string(note->note); ks.Value = note->note.ToUTF8();
ks.Time= CExportNel::convertTime (note->time); ks.Time= CExportNel::convertTime (note->time);
bs.Track.push_back(ks); bs.Track.push_back(ks);
} }
@ -224,7 +224,7 @@ NL3D::CTrackKeyFramerConstString* CExportNel::buildFromNoteTrack(INode& node)
{ {
firstDate = CExportNel::convertTime (note->time); firstDate = CExportNel::convertTime (note->time);
} }
ks.Value = std::string(note->note); ks.Value = note->note.ToUTF8();
lastDate = CExportNel::convertTime (note->time); lastDate = CExportNel::convertTime (note->time);
st->addKey(ks , lastDate ); st->addKey(ks , lastDate );

View file

@ -768,7 +768,7 @@ void CExportNel::buildAMaterial (NL3D::CMaterial& material, CMaxMaterialInfo& ma
// Set material name // Set material name
TSTR name=mtl.GetName(); TSTR name=mtl.GetName();
materialInfo.MaterialName = (const char*)name; materialInfo.MaterialName = name.ToUTF8();
} }
else else
{ {
@ -1120,7 +1120,7 @@ void CExportNel::buildAMaterial (NL3D::CMaterial& material, CMaxMaterialInfo& ma
// Set material name // Set material name
TSTR name=mtl.GetName(); TSTR name=mtl.GetName();
materialInfo.MaterialName = (const char*)name; materialInfo.MaterialName = name.ToUTF8();
} }
} }

View file

@ -579,7 +579,7 @@ static bool BuildMeshInterfaces(const char *cMaxFileName, std::vector<CMeshInter
{ {
// Rename the material // Rename the material
string newName = "NelAutoMergeRenamedTmp" + toString (i); string newName = "NelAutoMergeRenamedTmp" + toString (i);
string originalName = (*lib)[i]->GetName (); string originalName = (*lib)[i]->GetName ().ToUTF8();
renameMap.insert (map<string, string>::value_type (newName, originalName)); renameMap.insert (map<string, string>::value_type (newName, originalName));
(*lib)[i]->SetName (utf8ToTStr(newName)); (*lib)[i]->SetName (utf8ToTStr(newName));
} }
@ -604,7 +604,7 @@ static bool BuildMeshInterfaces(const char *cMaxFileName, std::vector<CMeshInter
for (i=0; i<size; i++) for (i=0; i<size; i++)
{ {
// Find the name in the map ? // Find the name in the map ?
string key = (*lib)[i]->GetName (); string key = (*lib)[i]->GetName ().ToUTF8();
map<string, string>::iterator ite = renameMap.find (key); map<string, string>::iterator ite = renameMap.find (key);
// Not found ? This is a merged material // Not found ? This is a merged material
@ -612,7 +612,7 @@ static bool BuildMeshInterfaces(const char *cMaxFileName, std::vector<CMeshInter
{ {
// Rename the material // Rename the material
string newName = "NelAutoMergeRenamed" + toString (i); string newName = "NelAutoMergeRenamed" + toString (i);
string originalName = (*lib)[i]->GetName (); string originalName = (*lib)[i]->GetName ().ToUTF8();
renameMap.insert (map<string, string>::value_type (newName, originalName)); renameMap.insert (map<string, string>::value_type (newName, originalName));
(*lib)[i]->SetName (utf8ToTStr(newName)); (*lib)[i]->SetName (utf8ToTStr(newName));
} }
@ -622,7 +622,7 @@ static bool BuildMeshInterfaces(const char *cMaxFileName, std::vector<CMeshInter
for (i=0; i<size; i++) for (i=0; i<size; i++)
{ {
// Find the name // Find the name
string key = (*lib)[i]->GetName (); string key = (*lib)[i]->GetName ().ToUTF8();
map<string, string>::iterator ite = renameMap.find (key); map<string, string>::iterator ite = renameMap.find (key);
if (ite != renameMap.end ()) if (ite != renameMap.end ())
{ {

View file

@ -223,7 +223,7 @@ Animatable* CExportNel::getSubAnimByName (Animatable& node, const char* sName)
TSTR sSubName=node.SubAnimName(nSub); TSTR sSubName=node.SubAnimName(nSub);
// Good name? // Good name?
if (strcmp (sSubName, sName)==0) if (strcmp (sSubName.ToUTF8(), sName)==0)
{ {
// ok, return this subanim // ok, return this subanim
return node.SubAnim(nSub); return node.SubAnim(nSub);
@ -288,7 +288,7 @@ Control* CExportNel::getControlerByName (Animatable& node, const char* sName)
{ {
// Sub anim name // Sub anim name
TSTR name=node.SubAnimName (s); TSTR name=node.SubAnimName (s);
if (strcmp (name, sName)==0) if (strcmp (name.ToUTF8(), sName)==0)
{ {
// Get the controller pointer of this sub anim // Get the controller pointer of this sub anim
Control* c=GetControlInterface (node.SubAnim(s)); Control* c=GetControlInterface (node.SubAnim(s));
@ -502,7 +502,7 @@ std::string CExportNel::getName (MtlBase& mtl)
// Return its name // Return its name
TSTR name; TSTR name;
name=mtl.GetName(); name=mtl.GetName();
return std::string (name); return std::string((const char*)name.ToUTF8());
} }
// -------------------------------------------------- // --------------------------------------------------