This commit is contained in:
Akash Mozumdar 2018-09-22 03:17:52 -04:00
parent 38ea5dba36
commit 665c5b3eea
2 changed files with 10 additions and 3 deletions

View File

@ -28,8 +28,15 @@ void TextThread::Flush()
{ {
LOCK(ttMutex); LOCK(ttMutex);
if (buffer.size() < 400 && (GetTickCount() - timestamp < FlushDelay || buffer.size() == 0)) return; if (buffer.size() < 400 && (GetTickCount() - timestamp < FlushDelay || buffer.size() == 0)) return;
if (status & USING_UNICODE) sentence = std::wstring((wchar_t*)buffer.data(), buffer.size() / 2); if (status & USING_UNICODE)
else sentence = ToWString(buffer.data(), status & USING_UTF8 ? CP_UTF8 : SHIFT_JIS); {
sentence = std::wstring((wchar_t*)buffer.data(), buffer.size() / 2);
}
else
{
buffer.push_back(0); // Null terminate
sentence = ToWString(buffer.data(), status & USING_UTF8 ? CP_UTF8 : SHIFT_JIS);
}
buffer.clear(); buffer.clear();
} }
AddSentence(sentence); AddSentence(sentence);

View File

@ -13,7 +13,7 @@ struct InfoForExtension
}; };
// Traverses linked list to find info. // Traverses linked list to find info.
int GetProperty(const char* propertyName, const InfoForExtension* miscInfo) int54_t GetProperty(const char* propertyName, const InfoForExtension* miscInfo)
{ {
const InfoForExtension* miscInfoTraverser = miscInfo; const InfoForExtension* miscInfoTraverser = miscInfo;
while (miscInfoTraverser != nullptr) while (miscInfoTraverser != nullptr)