mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-20 09:57:10 +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);
|
byteArray baFile = app.getArchiveFile(skinPath);
|
||||||
|
|
||||||
// Copy 32-bit wchar_t to 16-bit IggyUTF16
|
const std::u16string convSkinName = convWstringToU16string(skinName);
|
||||||
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
|
|
||||||
|
|
||||||
lib = IggyLibraryCreateFromMemoryUTF16( utf16Name.data() , (void *)baFile.data, baFile.length, NULL );
|
lib = IggyLibraryCreateFromMemoryUTF16( convSkinName.data() , (void *)baFile.data, baFile.length, NULL );
|
||||||
|
|
||||||
delete[] baFile.data;
|
delete[] baFile.data;
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ typedef enum IggyDatatype
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
IDOCN typedef wchar_t IggyUTF16;
|
IDOCN typedef wchar_t IggyUTF16;
|
||||||
#else
|
#else
|
||||||
typedef char16_t IggyUTF16;
|
typedef const char16_t IggyUTF16;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct IggyStringUTF16
|
typedef struct IggyStringUTF16
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue