Remove #ifdefs for USE_VFS

This commit is contained in:
Asdow
2023-10-08 16:45:06 +03:00
parent eca4086d30
commit 4b1de56b01
34 changed files with 9 additions and 1916 deletions
+1 -21
View File
@@ -141,15 +141,6 @@ typedef VECTOR4 COLOR; // rgba color array
inline void convert_string(std::wstring const& str_in, std::string &str_out)
{
#if !defined(USE_VFS)
const wchar_t* src = str_in.c_str();
size_t len = wcstombs(NULL, src, str_in.length());
if(len > 0)
{
str_out.resize(len);
wcstombs(&str_out[0], src, len);
}
#else
if(vfs::Settings::getUseUnicode())
{
str_out = vfs::String::as_utf8(str_in);
@@ -158,20 +149,10 @@ inline void convert_string(std::wstring const& str_in, std::string &str_out)
{
vfs::String::narrow(str_in, str_out);
}
#endif
}
inline void convert_string(std::string const& str_in, std::wstring &str_out)
{
#if !defined(USE_VFS)
const char* src = str_in.c_str();
size_t len = mbstowcs(NULL, src, str_in.length());
if(len > 0)
{
str_out.resize(len);
mbstowcs(&str_out[0], src, len);
}
#else
if(vfs::Settings::getUseUnicode())
{
vfs::String::as_utf16(str_in, str_out);
@@ -180,8 +161,7 @@ inline void convert_string(std::string const& str_in, std::wstring &str_out)
{
vfs::String::widen(str_in, str_out);
}
#endif
}
#endif
#endif