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 { ...@@ -360,26 +360,25 @@ std::wstring DataManager::FormatSetName(const uint16_t setcode[]) const {
buffer.pop_back(); buffer.pop_back();
return buffer; return buffer;
} }
const wchar_t* DataManager::FormatLinkMarker(int link_marker) { std::wstring DataManager::FormatLinkMarker(unsigned int link_marker) const {
wchar_t* p = lmBuffer; std::wstring buffer;
*p = 0; if (link_marker & LINK_MARKER_TOP_LEFT)
if(link_marker & LINK_MARKER_TOP_LEFT) buffer.append(L"[\u2196]");
BufferIO::CopyWStrRef(L"[\u2196]", p, 4); if (link_marker & LINK_MARKER_TOP)
if(link_marker & LINK_MARKER_TOP) buffer.append(L"[\u2191]");
BufferIO::CopyWStrRef(L"[\u2191]", p, 4); if (link_marker & LINK_MARKER_TOP_RIGHT)
if(link_marker & LINK_MARKER_TOP_RIGHT) buffer.append(L"[\u2197]");
BufferIO::CopyWStrRef(L"[\u2197]", p, 4); if (link_marker & LINK_MARKER_LEFT)
if(link_marker & LINK_MARKER_LEFT) buffer.append(L"[\u2190]");
BufferIO::CopyWStrRef(L"[\u2190]", p, 4); if (link_marker & LINK_MARKER_RIGHT)
if(link_marker & LINK_MARKER_RIGHT) buffer.append(L"[\u2192]");
BufferIO::CopyWStrRef(L"[\u2192]", p, 4); if (link_marker & LINK_MARKER_BOTTOM_LEFT)
if(link_marker & LINK_MARKER_BOTTOM_LEFT) buffer.append(L"[\u2199]");
BufferIO::CopyWStrRef(L"[\u2199]", p, 4); if (link_marker & LINK_MARKER_BOTTOM)
if(link_marker & LINK_MARKER_BOTTOM) buffer.append(L"[\u2193]");
BufferIO::CopyWStrRef(L"[\u2193]", p, 4); if (link_marker & LINK_MARKER_BOTTOM_RIGHT)
if(link_marker & LINK_MARKER_BOTTOM_RIGHT) buffer.append(L"[\u2198]");
BufferIO::CopyWStrRef(L"[\u2198]", p, 4); return buffer;
return lmBuffer;
} }
uint32 DataManager::CardReader(uint32 code, card_data* pData) { uint32 DataManager::CardReader(uint32 code, card_data* pData) {
if (!dataManager.GetData(code, pData)) if (!dataManager.GetData(code, pData))
......
...@@ -37,7 +37,7 @@ public: ...@@ -37,7 +37,7 @@ public:
std::wstring FormatRace(unsigned int race) const; std::wstring FormatRace(unsigned int race) const;
std::wstring FormatType(unsigned int type) const; std::wstring FormatType(unsigned int type) const;
std::wstring FormatSetName(const uint16_t setcode[]) 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> _counterStrings;
std::unordered_map<unsigned int, std::wstring> _victoryStrings; std::unordered_map<unsigned int, std::wstring> _victoryStrings;
...@@ -50,7 +50,6 @@ public: ...@@ -50,7 +50,6 @@ public:
wchar_t numStrings[301][4]{}; wchar_t numStrings[301][4]{};
wchar_t numBuffer[6]{}; wchar_t numBuffer[6]{};
wchar_t lmBuffer[32]{};
static byte scriptBuffer[0x20000]; static byte scriptBuffer[0x20000];
static const wchar_t* unknown_string; static const wchar_t* unknown_string;
......
...@@ -1602,7 +1602,7 @@ void Game::ShowCardInfo(int code, bool resize) { ...@@ -1602,7 +1602,7 @@ void Game::ShowCardInfo(int code, bool resize) {
else else
myswprintf(adBuffer, L"%d/- ", cd.attack); myswprintf(adBuffer, L"%d/- ", cd.attack);
wcscat(formatBuffer, adBuffer); wcscat(formatBuffer, adBuffer);
wcscat(formatBuffer, dataManager.FormatLinkMarker(cd.link_marker)); wcscat(formatBuffer, dataManager.FormatLinkMarker(cd.link_marker).c_str());
} }
if(cd.type & TYPE_PENDULUM) { if(cd.type & TYPE_PENDULUM) {
wchar_t scaleBuffer[16]; 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