Commit f7e6b52c authored by Chen Bill's avatar Chen Bill

DataManager: fix FormatLinkMarker

parent ba831be8
......@@ -360,26 +360,25 @@ std::wstring DataManager::FormatSetName(const uint16_t setcode[]) const {
buffer.pop_back();
return buffer;
}
const wchar_t* DataManager::FormatLinkMarker(int link_marker) {
wchar_t* p = lmBuffer;
*p = 0;
if(link_marker & LINK_MARKER_TOP_LEFT)
BufferIO::CopyWStrRef(L"[\u2196]", p, 4);
if(link_marker & LINK_MARKER_TOP)
BufferIO::CopyWStrRef(L"[\u2191]", p, 4);
if(link_marker & LINK_MARKER_TOP_RIGHT)
BufferIO::CopyWStrRef(L"[\u2197]", p, 4);
if(link_marker & LINK_MARKER_LEFT)
BufferIO::CopyWStrRef(L"[\u2190]", p, 4);
if(link_marker & LINK_MARKER_RIGHT)
BufferIO::CopyWStrRef(L"[\u2192]", p, 4);
if(link_marker & LINK_MARKER_BOTTOM_LEFT)
BufferIO::CopyWStrRef(L"[\u2199]", p, 4);
if(link_marker & LINK_MARKER_BOTTOM)
BufferIO::CopyWStrRef(L"[\u2193]", p, 4);
if(link_marker & LINK_MARKER_BOTTOM_RIGHT)
BufferIO::CopyWStrRef(L"[\u2198]", p, 4);
return lmBuffer;
std::wstring DataManager::FormatLinkMarker(unsigned int link_marker) const {
std::wstring buffer;
if (link_marker & LINK_MARKER_TOP_LEFT)
buffer.append(L"[\u2196]");
if (link_marker & LINK_MARKER_TOP)
buffer.append(L"[\u2191]");
if (link_marker & LINK_MARKER_TOP_RIGHT)
buffer.append(L"[\u2197]");
if (link_marker & LINK_MARKER_LEFT)
buffer.append(L"[\u2190]");
if (link_marker & LINK_MARKER_RIGHT)
buffer.append(L"[\u2192]");
if (link_marker & LINK_MARKER_BOTTOM_LEFT)
buffer.append(L"[\u2199]");
if (link_marker & LINK_MARKER_BOTTOM)
buffer.append(L"[\u2193]");
if (link_marker & LINK_MARKER_BOTTOM_RIGHT)
buffer.append(L"[\u2198]");
return buffer;
}
uint32 DataManager::CardReader(uint32 code, card_data* pData) {
if (!dataManager.GetData(code, pData))
......
......@@ -37,7 +37,7 @@ public:
std::wstring FormatRace(unsigned int race) const;
std::wstring FormatType(unsigned int type) const;
std::wstring FormatSetName(const uint16_t setcode[]) const;
const wchar_t* FormatLinkMarker(int link_marker);
std::wstring FormatLinkMarker(unsigned int link_marker) const;
std::unordered_map<unsigned int, std::wstring> _counterStrings;
std::unordered_map<unsigned int, std::wstring> _victoryStrings;
......@@ -50,7 +50,6 @@ public:
wchar_t numStrings[301][4]{};
wchar_t numBuffer[6]{};
wchar_t lmBuffer[32]{};
static byte scriptBuffer[0x20000];
static const wchar_t* unknown_string;
......
......@@ -1602,7 +1602,7 @@ void Game::ShowCardInfo(int code, bool resize) {
else
myswprintf(adBuffer, L"%d/- ", cd.attack);
wcscat(formatBuffer, adBuffer);
wcscat(formatBuffer, dataManager.FormatLinkMarker(cd.link_marker));
wcscat(formatBuffer, dataManager.FormatLinkMarker(cd.link_marker).c_str());
}
if(cd.type & TYPE_PENDULUM) {
wchar_t scaleBuffer[16];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment