Fix plugin build for 3ds Max 9

feature/code-to-root
kaetemi 5 years ago
parent b713dccdc9
commit 50be041116

@ -21,6 +21,7 @@
#define NLMAX_STRING_COMMON_H #define NLMAX_STRING_COMMON_H
#include <nel/misc/ucstring.h> #include <nel/misc/ucstring.h>
#include <nel/misc/string_common.h>
#if (MAX_VERSION_MAJOR < 15) #if (MAX_VERSION_MAJOR < 15)
#define GET_OBJECT_NAME_CONST #define GET_OBJECT_NAME_CONST
@ -37,9 +38,7 @@ static TSTR MaxTStrFromUtf8(const std::string &src)
{ {
TSTR dst; TSTR dst;
#if (MAX_VERSION_MAJOR < 15) #if (MAX_VERSION_MAJOR < 15)
ucstring uc; dst = nlUtf8ToTStr(src);
uc.fromUtf8(src);
dst = (const mwchar_t *)uc.c_str();
#else #else
dst.FromUTF8(src.c_str()); dst.FromUTF8(src.c_str());
#endif #endif
@ -49,14 +48,7 @@ static TSTR MaxTStrFromUtf8(const std::string &src)
static std::string MaxTStrToUtf8(const TSTR& src) static std::string MaxTStrToUtf8(const TSTR& src)
{ {
#if (MAX_VERSION_MAJOR < 15) #if (MAX_VERSION_MAJOR < 15)
#ifdef _UNICODE return NLMISC::tStrToUtf8(src.data());
ucstring uc(src.data());
return uc.toUtf8();
#else
WStr ws = src;
ucstring uc((const ucchar *)ws.data());
return uc.toUtf8();
#endif
#else #else
return src.ToUTF8().data(); return src.ToUTF8().data();
#endif #endif
@ -64,13 +56,7 @@ static std::string MaxTStrToUtf8(const TSTR& src)
static std::string MCharStrToUtf8(const MCHAR *src) static std::string MCharStrToUtf8(const MCHAR *src)
{ {
#ifdef _UNICODE return NLMISC::tStrToUtf8(src);
ucstring uc((const ucchar *)src);
return uc.toUtf8();
#else
ucstring uc((const ucchar *)WStr(src).data());
return uc.toUtf8();
#endif
} }
#endif /* #ifndef NLMAX_STRING_COMMON_H */ #endif /* #ifndef NLMAX_STRING_COMMON_H */

@ -1271,7 +1271,7 @@ Value* get_patch_vertex_cf (Value** arg_list, int count)
// Check to see if the arguments match up to what we expect // Check to see if the arguments match up to what we expect
// We want to use 'TurnAllTexturesOn <object to use>' // We want to use 'TurnAllTexturesOn <object to use>'
const MCHAR *message= _M("NeLGetPatchVertex [NeLPatchMesh] [PatchId] [VertexId]"); MCHAR *message= _M("NeLGetPatchVertex [NeLPatchMesh] [PatchId] [VertexId]");
type_check(arg_list[0], MAXNode, message); type_check(arg_list[0], MAXNode, message);
type_check(arg_list[1], Integer, message); type_check(arg_list[1], Integer, message);
type_check(arg_list[2], Integer, message); type_check(arg_list[2], Integer, message);

Loading…
Cancel
Save