mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-10 01:37:13 +00:00
fix: const-correctness, remove manual UTF16 conversion
This commit is contained in:
parent
996c731d77
commit
49721095f6
|
|
@ -516,14 +516,9 @@ IggyLibrary UIController::loadSkin(const std::wstring &skinPath, const std::wstr
|
|||
{
|
||||
byteArray baFile = app.getArchiveFile(skinPath);
|
||||
|
||||
// Copy 32-bit wchar_t to 16-bit IggyUTF16
|
||||
std::vector<IggyUTF16> utf16Name(skinName.length() + 1);
|
||||
for(size_t i = 0; i < skinName.length(); ++i) {
|
||||
utf16Name[i] = static_cast<IggyUTF16>(skinName[i]);
|
||||
}
|
||||
utf16Name[skinName.length()] = 0; // null terminator
|
||||
const std::u16string convSkinName = convWstringToU16string(skinName);
|
||||
|
||||
lib = IggyLibraryCreateFromMemoryUTF16( utf16Name.data() , (void *)baFile.data, baFile.length, NULL );
|
||||
lib = IggyLibraryCreateFromMemoryUTF16( convSkinName.data() , (void *)baFile.data, baFile.length, NULL );
|
||||
|
||||
delete[] baFile.data;
|
||||
#ifdef _DEBUG
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ typedef enum IggyDatatype
|
|||
#include <stddef.h>
|
||||
IDOCN typedef wchar_t IggyUTF16;
|
||||
#else
|
||||
typedef char16_t IggyUTF16;
|
||||
typedef const char16_t IggyUTF16;
|
||||
#endif
|
||||
|
||||
typedef struct IggyStringUTF16
|
||||
|
|
|
|||
Loading…
Reference in a new issue