Commit c0230df1 authored by Chen Bill's avatar Chen Bill Committed by GitHub

DataManager: fix GetNumString (#2603)

* DataManager: fix FormatAttribute, FormatRace

* update FormatAttribute, FormatRace

* DataManager: fix FormatType

* update FormatType

* DataManager: fix FormatSetName

* DataManager: fix FormatLinkMarker

* merge

* DataManager: fix GetNumString

* rebuild class ustring16 from edopro version

* add stringw conversion

core::stringw in current version does not have data()

* add CGUITTFont::drawUstring

* use drawUstring

* update DrawShadowText

* fix Game::lpcstring

* fix DuelInfo::vic_string

* add PACK_MAX_SIZE
parent 8385b896
...@@ -269,7 +269,7 @@ bool CGUITTFont::load(const io::path& filename, const u32 size, const bool antia ...@@ -269,7 +269,7 @@ bool CGUITTFont::load(const io::path& filename, const u32 size, const bool antia
// Log. // Log.
if (logger) if (logger)
logger->log(L"CGUITTFont", core::stringw(core::stringw(L"Creating new font: ") + core::ustring(filename).toWCHAR_s() + L" " + core::stringc(size) + L"pt " + (antialias ? L"+antialias " : L"-antialias ") + (transparency ? L"+transparency" : L"-transparency")).c_str(), irr::ELL_INFORMATION); logger->log(L"CGUITTFont", core::stringw(core::stringw(L"Creating new font: ") + core::stringc(filename) + L" " + core::stringc(size) + L"pt " + (antialias ? L"+antialias " : L"-antialias ") + (transparency ? L"+transparency" : L"-transparency")).c_str(), irr::ELL_INFORMATION);
// Grab the face. // Grab the face.
SGUITTFace* face = 0; SGUITTFace* face = 0;
...@@ -304,8 +304,6 @@ bool CGUITTFont::load(const io::path& filename, const u32 size, const bool antia ...@@ -304,8 +304,6 @@ bool CGUITTFont::load(const io::path& filename, const u32 size, const bool antia
return false; return false;
} }
} else { } else {
core::ustring converter(filename);
if (FT_New_Face(c_library, reinterpret_cast<const char*>(converter.toUTF8_s().c_str()), 0, &face->face)) {
if (logger) logger->log(L"CGUITTFont", L"FT_New_Face failed.", irr::ELL_INFORMATION); if (logger) logger->log(L"CGUITTFont", L"FT_New_Face failed.", irr::ELL_INFORMATION);
c_faces.remove(filename); c_faces.remove(filename);
...@@ -313,7 +311,6 @@ bool CGUITTFont::load(const io::path& filename, const u32 size, const bool antia ...@@ -313,7 +311,6 @@ bool CGUITTFont::load(const io::path& filename, const u32 size, const bool antia
face = 0; face = 0;
return false; return false;
} }
}
} else { } else {
// Using another instance of this face. // Using another instance of this face.
face = node->getValue(); face = node->getValue();
...@@ -491,6 +488,12 @@ void CGUITTFont::setFontHinting(const bool enable, const bool enable_auto_hintin ...@@ -491,6 +488,12 @@ void CGUITTFont::setFontHinting(const bool enable, const bool enable_auto_hintin
} }
void CGUITTFont::draw(const core::stringw& text, const core::rect<s32>& position, video::SColor color, bool hcenter, bool vcenter, const core::rect<s32>* clip) { void CGUITTFont::draw(const core::stringw& text, const core::rect<s32>& position, video::SColor color, bool hcenter, bool vcenter, const core::rect<s32>* clip) {
if (!Driver)
return;
drawUstring(text, position, color, hcenter, vcenter, clip);
}
void CGUITTFont::drawUstring(const core::ustring& utext, const core::rect<s32>&position, video::SColor color, bool hcenter, bool vcenter, const core::rect<s32>*clip) {
if (!Driver) if (!Driver)
return; return;
...@@ -506,7 +509,7 @@ void CGUITTFont::draw(const core::stringw& text, const core::rect<s32>& position ...@@ -506,7 +509,7 @@ void CGUITTFont::draw(const core::stringw& text, const core::rect<s32>& position
// Determine offset positions. // Determine offset positions.
if (hcenter || vcenter) { if (hcenter || vcenter) {
textDimension = getDimension(text.c_str()); textDimension = getDimension(utext);
if (hcenter) if (hcenter)
offset.X = ((position.getWidth() - textDimension.Width) >> 1) + offset.X; offset.X = ((position.getWidth() - textDimension.Width) >> 1) + offset.X;
...@@ -515,9 +518,6 @@ void CGUITTFont::draw(const core::stringw& text, const core::rect<s32>& position ...@@ -515,9 +518,6 @@ void CGUITTFont::draw(const core::stringw& text, const core::rect<s32>& position
offset.Y = ((position.getHeight() - textDimension.Height) >> 1) + offset.Y; offset.Y = ((position.getHeight() - textDimension.Height) >> 1) + offset.Y;
} }
// Convert to a unicode string.
core::ustring utext(text);
// Set up our render map. // Set up our render map.
core::map<u32, CGUITTGlyphPage*> Render_Map; core::map<u32, CGUITTGlyphPage*> Render_Map;
......
...@@ -263,7 +263,10 @@ public: ...@@ -263,7 +263,10 @@ public:
virtual void setFontHinting(const bool enable, const bool enable_auto_hinting = true); virtual void setFontHinting(const bool enable, const bool enable_auto_hinting = true);
//! Draws some text and clips it to the specified rectangle if wanted. //! Draws some text and clips it to the specified rectangle if wanted.
virtual void draw(const core::stringw& text, const core::rect<s32>& position, void draw(const core::stringw& text, const core::rect<s32>& position,
video::SColor color, bool hcenter = false, bool vcenter = false,
const core::rect<s32>* clip = 0) override;
void drawUstring(const core::ustring& text, const core::rect<s32>& position,
video::SColor color, bool hcenter = false, bool vcenter = false, video::SColor color, bool hcenter = false, bool vcenter = false,
const core::rect<s32>* clip = 0); const core::rect<s32>* clip = 0);
......
...@@ -117,8 +117,6 @@ bool DataManager::LoadStrings(const char* file) { ...@@ -117,8 +117,6 @@ bool DataManager::LoadStrings(const char* file) {
ReadStringConfLine(linebuf); ReadStringConfLine(linebuf);
} }
fclose(fp); fclose(fp);
for(int i = 0; i < 301; ++i)
myswprintf(numStrings[i], L"%d", i);
return true; return true;
} }
bool DataManager::LoadStrings(IReadFile* reader) { bool DataManager::LoadStrings(IReadFile* reader) {
...@@ -272,14 +270,12 @@ std::vector<unsigned int> DataManager::GetSetCodes(std::wstring setname) const { ...@@ -272,14 +270,12 @@ std::vector<unsigned int> DataManager::GetSetCodes(std::wstring setname) const {
} }
return matchingCodes; return matchingCodes;
} }
const wchar_t* DataManager::GetNumString(int num, bool bracket) { std::wstring DataManager::GetNumString(int num, bool bracket) const {
if(!bracket) if(!bracket)
return numStrings[num]; return std::to_wstring(num);
wchar_t* p = numBuffer; std::wstring numBuffer{ L"(" };
*p++ = L'('; numBuffer.append(std::to_wstring(num));
BufferIO::CopyWStrRef(numStrings[num], p, 4); numBuffer.push_back(L')');
*p = L')';
*++p = 0;
return numBuffer; return numBuffer;
} }
const wchar_t* DataManager::FormatLocation(int location, int sequence) const { const wchar_t* DataManager::FormatLocation(int location, int sequence) const {
...@@ -304,95 +300,81 @@ const wchar_t* DataManager::FormatLocation(int location, int sequence) const { ...@@ -304,95 +300,81 @@ const wchar_t* DataManager::FormatLocation(int location, int sequence) const {
else else
return unknown_string; return unknown_string;
} }
const wchar_t* DataManager::FormatAttribute(int attribute) { std::wstring DataManager::FormatAttribute(unsigned int attribute) const {
wchar_t* p = attBuffer; std::wstring buffer;
unsigned filter = 1; for (int i = 0; i < ATTRIBUTES_COUNT; ++i) {
int i = 1010; if (attribute & (0x1U << i)) {
for(; filter != 0x80; filter <<= 1, ++i) { if (!buffer.empty())
if(attribute & filter) { buffer.push_back(L'|');
BufferIO::CopyWStrRef(GetSysString(i), p, 16); buffer.append(GetSysString(1010 + i));
*p = L'|';
*++p = 0;
} }
} }
if(p != attBuffer) if (buffer.empty())
*(p - 1) = 0; return std::wstring(unknown_string);
else return buffer;
return unknown_string;
return attBuffer;
} }
const wchar_t* DataManager::FormatRace(int race) { std::wstring DataManager::FormatRace(unsigned int race) const {
wchar_t* p = racBuffer; std::wstring buffer;
unsigned filter = 1; for(int i = 0; i < RACES_COUNT; ++i) {
int i = 1020; if(race & (0x1U << i)) {
for(; filter < (1 << RACES_COUNT); filter <<= 1, ++i) { if (!buffer.empty())
if(race & filter) { buffer.push_back(L'|');
BufferIO::CopyWStrRef(GetSysString(i), p, 16); buffer.append(GetSysString(1020 + i));
*p = L'|';
*++p = 0;
} }
} }
if(p != racBuffer) if (buffer.empty())
*(p - 1) = 0; return std::wstring(unknown_string);
else return buffer;
return unknown_string;
return racBuffer;
} }
const wchar_t* DataManager::FormatType(int type) { std::wstring DataManager::FormatType(unsigned int type) const {
wchar_t* p = tpBuffer; std::wstring buffer;
unsigned filter = 1;
int i = 1050; int i = 1050;
for(; filter != 0x8000000; filter <<= 1, ++i) { for (unsigned filter = TYPE_MONSTER; filter <= TYPE_LINK; filter <<= 1, ++i) {
if(type & filter) { if (type & filter) {
BufferIO::CopyWStrRef(GetSysString(i), p, 16); if (!buffer.empty())
*p = L'|'; buffer.push_back(L'|');
*++p = 0; buffer.append(GetSysString(i));
} }
} }
if(p != tpBuffer) if (buffer.empty())
*(p - 1) = 0; return std::wstring(unknown_string);
else return buffer;
return unknown_string;
return tpBuffer;
} }
const wchar_t* DataManager::FormatSetName(const uint16_t setcode[]) { std::wstring DataManager::FormatSetName(const uint16_t setcode[]) const {
wchar_t* p = scBuffer; std::wstring buffer;
for(int i = 0; i < 10; ++i) { for(int i = 0; i < 10; ++i) {
if (!setcode[i]) if (!setcode[i])
break; break;
const wchar_t* setname = GetSetName(setcode[i]); const wchar_t* setname = GetSetName(setcode[i]);
if(setname) { if(setname) {
BufferIO::CopyWStrRef(setname, p, 32); if (!buffer.empty())
*p = L'|'; buffer.push_back(L'|');
*++p = 0; buffer.append(setname);
} }
} }
if(p != scBuffer) if (buffer.empty())
*(p - 1) = 0; return std::wstring(unknown_string);
else return buffer;
return unknown_string;
return scBuffer;
} }
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))
......
...@@ -31,13 +31,13 @@ public: ...@@ -31,13 +31,13 @@ public:
const wchar_t* GetCounterName(int code) const; const wchar_t* GetCounterName(int code) const;
const wchar_t* GetSetName(int code) const; const wchar_t* GetSetName(int code) const;
std::vector<unsigned int> GetSetCodes(std::wstring setname) const; std::vector<unsigned int> GetSetCodes(std::wstring setname) const;
const wchar_t* GetNumString(int num, bool bracket = false); std::wstring GetNumString(int num, bool bracket = false) const;
const wchar_t* FormatLocation(int location, int sequence) const; const wchar_t* FormatLocation(int location, int sequence) const;
const wchar_t* FormatAttribute(int attribute); std::wstring FormatAttribute(unsigned int attribute) const;
const wchar_t* FormatRace(int race); std::wstring FormatRace(unsigned int race) const;
const wchar_t* FormatType(int type); std::wstring FormatType(unsigned int type) const;
const wchar_t* FormatSetName(const uint16_t setcode[]); 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;
...@@ -48,14 +48,6 @@ public: ...@@ -48,14 +48,6 @@ public:
string_pointer strings_begin; string_pointer strings_begin;
string_pointer strings_end; string_pointer strings_end;
wchar_t numStrings[301][4]{};
wchar_t numBuffer[6]{};
wchar_t attBuffer[128]{};
wchar_t racBuffer[128]{};
wchar_t tpBuffer[128]{};
wchar_t scBuffer[128]{};
wchar_t lmBuffer[32]{};
static byte scriptBuffer[0x20000]; static byte scriptBuffer[0x20000];
static const wchar_t* unknown_string; static const wchar_t* unknown_string;
static uint32 CardReader(uint32, card_data*); static uint32 CardReader(uint32, card_data*);
......
...@@ -186,7 +186,7 @@ int DeckManager::LoadDeck(Deck& deck, int* dbuf, int mainc, int sidec, bool is_p ...@@ -186,7 +186,7 @@ int DeckManager::LoadDeck(Deck& deck, int* dbuf, int mainc, int sidec, bool is_p
} }
int DeckManager::LoadDeck(Deck& deck, std::istringstream& deckStream, bool is_packlist) { int DeckManager::LoadDeck(Deck& deck, std::istringstream& deckStream, bool is_packlist) {
int ct = 0, mainc = 0, sidec = 0, code = 0; int ct = 0, mainc = 0, sidec = 0, code = 0;
int cardlist[300]{}; int cardlist[PACK_MAX_SIZE]{};
bool is_side = false; bool is_side = false;
std::string linebuf; std::string linebuf;
while (std::getline(deckStream, linebuf, '\n') && ct < (int)(sizeof cardlist / sizeof cardlist[0])) { while (std::getline(deckStream, linebuf, '\n') && ct < (int)(sizeof cardlist / sizeof cardlist[0])) {
......
...@@ -12,6 +12,7 @@ namespace ygo { ...@@ -12,6 +12,7 @@ namespace ygo {
constexpr int DECK_MIN_SIZE = 40; constexpr int DECK_MIN_SIZE = 40;
constexpr int EXTRA_MAX_SIZE = 15; constexpr int EXTRA_MAX_SIZE = 15;
constexpr int SIDE_MAX_SIZE = 15; constexpr int SIDE_MAX_SIZE = 15;
constexpr int PACK_MAX_SIZE = 1000;
struct LFList { struct LFList {
unsigned int hash{}; unsigned int hash{};
......
...@@ -411,12 +411,13 @@ void Game::DrawCard(ClientCard* pcard) { ...@@ -411,12 +411,13 @@ void Game::DrawCard(ClientCard* pcard) {
driver->drawVertexPrimitiveList(matManager.vSymbol, 4, matManager.iRectangle, 2); driver->drawVertexPrimitiveList(matManager.vSymbol, 4, matManager.iRectangle, 2);
} }
} }
void Game::DrawShadowText(CGUITTFont * font, const core::stringw & text, const core::rect<s32>& position, const core::rect<s32>& padding, template<typename T>
video::SColor color, video::SColor shadowcolor, bool hcenter, bool vcenter, const core::rect<s32>* clip) { inline void DrawShadowText(irr::gui::CGUITTFont* font, const T& text, const core::rect<s32>& position, const core::rect<s32>& padding,
video::SColor color = 0xffffffff, video::SColor shadowcolor = 0xff000000, bool hcenter = false, bool vcenter = false, const core::rect<s32>* clip = nullptr) {
core::rect<s32> shadowposition = recti(position.UpperLeftCorner.X - padding.UpperLeftCorner.X, position.UpperLeftCorner.Y - padding.UpperLeftCorner.Y, core::rect<s32> shadowposition = recti(position.UpperLeftCorner.X - padding.UpperLeftCorner.X, position.UpperLeftCorner.Y - padding.UpperLeftCorner.Y,
position.LowerRightCorner.X - padding.LowerRightCorner.X, position.LowerRightCorner.Y - padding.LowerRightCorner.Y); position.LowerRightCorner.X - padding.LowerRightCorner.X, position.LowerRightCorner.Y - padding.LowerRightCorner.Y);
font->draw(text, shadowposition, shadowcolor, hcenter, vcenter, clip); font->drawUstring(text, shadowposition, shadowcolor, hcenter, vcenter, clip);
font->draw(text, position, color, hcenter, vcenter, clip); font->drawUstring(text, position, color, hcenter, vcenter, clip);
} }
void Game::DrawMisc() { void Game::DrawMisc() {
static irr::core::vector3df act_rot(0, 0, 0); static irr::core::vector3df act_rot(0, 0, 0);
...@@ -563,7 +564,7 @@ void Game::DrawMisc() { ...@@ -563,7 +564,7 @@ void Game::DrawMisc() {
lpccolor -= 0x19000000; lpccolor -= 0x19000000;
lpframe--; lpframe--;
} }
if(lpcstring) { if(lpcstring.size()) {
if(lpplayer == 0) { if(lpplayer == 0) {
DrawShadowText(lpcFont, lpcstring, Resize(400, 472, 922, 520), Resize(0, 2, 2, 0), lpccolor, lpccolor | 0x00ffffff, true, false, 0); DrawShadowText(lpcFont, lpcstring, Resize(400, 472, 922, 520), Resize(0, 2, 2, 0), lpccolor, lpccolor | 0x00ffffff, true, false, 0);
} else { } else {
...@@ -583,17 +584,17 @@ void Game::DrawMisc() { ...@@ -583,17 +584,17 @@ void Game::DrawMisc() {
recti p1size = Resize(335, 31, 629, 50); recti p1size = Resize(335, 31, 629, 50);
recti p2size = Resize(986, 31, 986, 50); recti p2size = Resize(986, 31, 986, 50);
if(!dInfo.isTag || !dInfo.tag_player[0]) if(!dInfo.isTag || !dInfo.tag_player[0])
textFont->draw(dInfo.hostname, p1size, 0xffffffff, false, false, 0); textFont->drawUstring(dInfo.hostname, p1size, 0xffffffff, false, false, 0);
else else
textFont->draw(dInfo.hostname_tag, p1size, 0xffffffff, false, false, 0); textFont->drawUstring(dInfo.hostname_tag, p1size, 0xffffffff, false, false, 0);
if(!dInfo.isTag || !dInfo.tag_player[1]) { if(!dInfo.isTag || !dInfo.tag_player[1]) {
auto cld = textFont->getDimension(dInfo.clientname); auto cld = textFont->getDimension(dInfo.clientname);
p2size.UpperLeftCorner.X -= cld.Width; p2size.UpperLeftCorner.X -= cld.Width;
textFont->draw(dInfo.clientname, p2size, 0xffffffff, false, false, 0); textFont->drawUstring(dInfo.clientname, p2size, 0xffffffff, false, false, 0);
} else { } else {
auto cld = textFont->getDimension(dInfo.clientname_tag); auto cld = textFont->getDimension(dInfo.clientname_tag);
p2size.UpperLeftCorner.X -= cld.Width; p2size.UpperLeftCorner.X -= cld.Width;
textFont->draw(dInfo.clientname_tag, p2size, 0xffffffff, false, false, 0); textFont->drawUstring(dInfo.clientname_tag, p2size, 0xffffffff, false, false, 0);
} }
} }
driver->draw2DRectangle(Resize(632, 10, 688, 30), 0x00000000, 0x00000000, 0xffffffff, 0xffffffff); driver->draw2DRectangle(Resize(632, 10, 688, 30), 0x00000000, 0x00000000, 0xffffffff, 0xffffffff);
...@@ -956,7 +957,7 @@ void Game::DrawSpec() { ...@@ -956,7 +957,7 @@ void Game::DrawSpec() {
DrawShadowText(lpcFont, lstr, ResizePhaseHint(660 - (9 - showcardp) * 40, 290, 960, 370, pos.Width), Resize(-1, -1, 0, 0), alpha | 0xffffff, alpha); DrawShadowText(lpcFont, lstr, ResizePhaseHint(660 - (9 - showcardp) * 40, 290, 960, 370, pos.Width), Resize(-1, -1, 0, 0), alpha | 0xffffff, alpha);
} else if(showcardp < showcarddif) { } else if(showcardp < showcarddif) {
DrawShadowText(lpcFont, lstr, ResizePhaseHint(660, 290, 960, 370, pos.Width), Resize(-1, -1, 0, 0), 0xffffffff); DrawShadowText(lpcFont, lstr, ResizePhaseHint(660, 290, 960, 370, pos.Width), Resize(-1, -1, 0, 0), 0xffffffff);
if(dInfo.vic_string && (showcardcode == 1 || showcardcode == 2)) { if(dInfo.vic_string.size() && (showcardcode == 1 || showcardcode == 2)) {
int w = guiFont->getDimension(dInfo.vic_string).Width; int w = guiFont->getDimension(dInfo.vic_string).Width;
if(w < 200) if(w < 200)
w = 200; w = 200;
...@@ -1021,8 +1022,8 @@ void Game::DrawSpec() { ...@@ -1021,8 +1022,8 @@ void Game::DrawSpec() {
recti shadowloc = msgloc + position2di(1, 1); recti shadowloc = msgloc + position2di(1, 1);
driver->draw2DRectangle(rectloc, 0xa0000000, 0xa0000000, 0xa0000000, 0xa0000000); driver->draw2DRectangle(rectloc, 0xa0000000, 0xa0000000, 0xa0000000, 0xa0000000);
guiFont->draw(msg.c_str(), msgloc, 0xff000000, false, false); guiFont->drawUstring(msg, msgloc, 0xff000000, false, false);
guiFont->draw(msg.c_str(), shadowloc, chatColor[chatType[i]], false, false); guiFont->drawUstring(msg, shadowloc, chatColor[chatType[i]], false, false);
chatRectY += h; chatRectY += h;
} }
...@@ -1190,7 +1191,7 @@ void Game::DrawDeckBd() { ...@@ -1190,7 +1191,7 @@ void Game::DrawDeckBd() {
driver->draw2DRectangle(Resize(310, 137, 410, 157), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000); driver->draw2DRectangle(Resize(310, 137, 410, 157), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(309, 136, 410, 157)); driver->draw2DRectangleOutline(Resize(309, 136, 410, 157));
DrawShadowText(textFont, dataManager.GetSysString(deckBuilder.showing_pack ? 1477 : 1330), Resize(315, 137, 410, 157), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true); DrawShadowText(textFont, dataManager.GetSysString(deckBuilder.showing_pack ? 1477 : 1330), Resize(315, 137, 410, 157), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
DrawShadowText(numFont, dataManager.numStrings[mainsize], Resize(380, 138, 440, 158), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true); DrawShadowText(numFont, dataManager.GetNumString(mainsize), Resize(380, 138, 440, 158), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
driver->draw2DRectangle(Resize(310, 160, 797, deckBuilder.showing_pack ? 630 : 436), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000); driver->draw2DRectangle(Resize(310, 160, 797, deckBuilder.showing_pack ? 630 : 436), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(309, 159, 797, deckBuilder.showing_pack ? 630 : 436)); driver->draw2DRectangleOutline(Resize(309, 159, 797, deckBuilder.showing_pack ? 630 : 436));
int lx; int lx;
...@@ -1224,7 +1225,7 @@ void Game::DrawDeckBd() { ...@@ -1224,7 +1225,7 @@ void Game::DrawDeckBd() {
driver->draw2DRectangle(Resize(310, 440, 410, 460), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000); driver->draw2DRectangle(Resize(310, 440, 410, 460), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(309, 439, 410, 460)); driver->draw2DRectangleOutline(Resize(309, 439, 410, 460));
DrawShadowText(textFont, dataManager.GetSysString(1331), Resize(315, 440, 410, 460), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true); DrawShadowText(textFont, dataManager.GetSysString(1331), Resize(315, 440, 410, 460), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
DrawShadowText(numFont, dataManager.numStrings[deckManager.current_deck.extra.size()], Resize(380, 441, 440, 461), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true); DrawShadowText(numFont, dataManager.GetNumString(deckManager.current_deck.extra.size()), Resize(380, 441, 440, 461), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
driver->draw2DRectangle(Resize(310, 463, 797, 533), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000); driver->draw2DRectangle(Resize(310, 463, 797, 533), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(309, 462, 797, 533)); driver->draw2DRectangleOutline(Resize(309, 462, 797, 533));
if(deckManager.current_deck.extra.size() <= 10) if(deckManager.current_deck.extra.size() <= 10)
...@@ -1239,7 +1240,7 @@ void Game::DrawDeckBd() { ...@@ -1239,7 +1240,7 @@ void Game::DrawDeckBd() {
driver->draw2DRectangle(Resize(310, 537, 410, 557), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000); driver->draw2DRectangle(Resize(310, 537, 410, 557), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(309, 536, 410, 557)); driver->draw2DRectangleOutline(Resize(309, 536, 410, 557));
DrawShadowText(textFont, dataManager.GetSysString(1332), Resize(315, 537, 410, 557), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true); DrawShadowText(textFont, dataManager.GetSysString(1332), Resize(315, 537, 410, 557), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
DrawShadowText(numFont, dataManager.numStrings[deckManager.current_deck.side.size()], Resize(380, 538, 440, 558), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true); DrawShadowText(numFont, dataManager.GetNumString(deckManager.current_deck.side.size()), Resize(380, 538, 440, 558), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
driver->draw2DRectangle(Resize(310, 560, 797, 630), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000); driver->draw2DRectangle(Resize(310, 560, 797, 630), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(309, 559, 797, 630)); driver->draw2DRectangleOutline(Resize(309, 559, 797, 630));
if(deckManager.current_deck.side.size() <= 10) if(deckManager.current_deck.side.size() <= 10)
...@@ -1305,7 +1306,8 @@ void Game::DrawDeckBd() { ...@@ -1305,7 +1306,8 @@ void Game::DrawDeckBd() {
else else
myswprintf(adBuffer, L"%d/-", ptr->second.attack); myswprintf(adBuffer, L"%d/-", ptr->second.attack);
} }
myswprintf(textBuffer, L"%ls/%ls %ls%d", dataManager.FormatAttribute(ptr->second.attribute), dataManager.FormatRace(ptr->second.race), form, ptr->second.level); myswprintf(textBuffer, L"%ls/%ls %ls%d", dataManager.FormatAttribute(ptr->second.attribute).c_str(), dataManager.FormatRace(ptr->second.race).c_str(),
form, ptr->second.level);
DrawShadowText(textFont, textBuffer, Resize(860, 187 + i * 66, 955, 207 + i * 66), Resize(1, 1, 0, 0)); DrawShadowText(textFont, textBuffer, Resize(860, 187 + i * 66, 955, 207 + i * 66), Resize(1, 1, 0, 0));
if(ptr->second.type & TYPE_PENDULUM) { if(ptr->second.type & TYPE_PENDULUM) {
myswprintf(scaleBuffer, L" %d/%d", ptr->second.lscale, ptr->second.rscale); myswprintf(scaleBuffer, L" %d/%d", ptr->second.lscale, ptr->second.rscale);
...@@ -1315,8 +1317,8 @@ void Game::DrawDeckBd() { ...@@ -1315,8 +1317,8 @@ void Game::DrawDeckBd() {
} else { } else {
myswprintf(textBuffer, L"%ls", dataManager.GetName(ptr->first)); myswprintf(textBuffer, L"%ls", dataManager.GetName(ptr->first));
DrawShadowText(textFont, textBuffer, Resize(860, 165 + i * 66, 955, 185 + i * 66), Resize(1, 1, 0, 0)); DrawShadowText(textFont, textBuffer, Resize(860, 165 + i * 66, 955, 185 + i * 66), Resize(1, 1, 0, 0));
const wchar_t* ptype = dataManager.FormatType(ptr->second.type); myswprintf(textBuffer, L"%ls", dataManager.FormatType(ptr->second.type).c_str());
DrawShadowText(textFont, ptype, Resize(860, 187 + i * 66, 955, 207 + i * 66), Resize(1, 1, 0, 0)); DrawShadowText(textFont, textBuffer, Resize(860, 187 + i * 66, 955, 207 + i * 66), Resize(1, 1, 0, 0));
myswprintf(textBuffer, L"%ls", availBuffer); myswprintf(textBuffer, L"%ls", availBuffer);
DrawShadowText(textFont, textBuffer, Resize(860, 209 + i * 66, 955, 229 + i * 66), Resize(1, 1, 0, 0)); DrawShadowText(textFont, textBuffer, Resize(860, 209 + i * 66, 955, 229 + i * 66), Resize(1, 1, 0, 0));
} }
......
...@@ -1104,7 +1104,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) { ...@@ -1104,7 +1104,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
break; break;
} }
case HINT_RACE: { case HINT_RACE: {
myswprintf(textBuffer, dataManager.GetSysString(1511), dataManager.FormatRace(data)); myswprintf(textBuffer, dataManager.GetSysString(1511), dataManager.FormatRace(data).c_str());
mainGame->AddLog(textBuffer); mainGame->AddLog(textBuffer);
mainGame->gMutex.lock(); mainGame->gMutex.lock();
mainGame->SetStaticText(mainGame->stACMessage, 310, mainGame->guiFont, textBuffer); mainGame->SetStaticText(mainGame->stACMessage, 310, mainGame->guiFont, textBuffer);
...@@ -1114,7 +1114,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) { ...@@ -1114,7 +1114,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
break; break;
} }
case HINT_ATTRIB: { case HINT_ATTRIB: {
myswprintf(textBuffer, dataManager.GetSysString(1511), dataManager.FormatAttribute(data)); myswprintf(textBuffer, dataManager.GetSysString(1511), dataManager.FormatAttribute(data).c_str());
mainGame->AddLog(textBuffer); mainGame->AddLog(textBuffer);
mainGame->gMutex.lock(); mainGame->gMutex.lock();
mainGame->SetStaticText(mainGame->stACMessage, 310, mainGame->guiFont, textBuffer); mainGame->SetStaticText(mainGame->stACMessage, 310, mainGame->guiFont, textBuffer);
...@@ -1201,7 +1201,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) { ...@@ -1201,7 +1201,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
int type = BufferIO::ReadUInt8(pbuf); int type = BufferIO::ReadUInt8(pbuf);
mainGame->showcarddif = 110; mainGame->showcarddif = 110;
mainGame->showcardp = 0; mainGame->showcardp = 0;
mainGame->dInfo.vic_string = 0; mainGame->dInfo.vic_string = L"";
wchar_t vic_buf[256]; wchar_t vic_buf[256];
if(player == 2) if(player == 2)
mainGame->showcardcode = 3; mainGame->showcardcode = 3;
...@@ -1227,7 +1227,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) { ...@@ -1227,7 +1227,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
} }
mainGame->showcard = 101; mainGame->showcard = 101;
mainGame->WaitFrameSignal(120); mainGame->WaitFrameSignal(120);
mainGame->dInfo.vic_string = 0; mainGame->dInfo.vic_string = L"";
mainGame->showcard = 0; mainGame->showcard = 0;
break; break;
} }
...@@ -3184,7 +3184,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) { ...@@ -3184,7 +3184,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
mainGame->WaitFrameSignal(30); mainGame->WaitFrameSignal(30);
mainGame->lpframe = 10; mainGame->lpframe = 10;
mainGame->WaitFrameSignal(11); mainGame->WaitFrameSignal(11);
mainGame->lpcstring = 0; mainGame->lpcstring = L"";
mainGame->dInfo.lp[player] = final; mainGame->dInfo.lp[player] = final;
mainGame->gMutex.lock(); mainGame->gMutex.lock();
myswprintf(mainGame->dInfo.strLP[player], L"%d", mainGame->dInfo.lp[player]); myswprintf(mainGame->dInfo.strLP[player], L"%d", mainGame->dInfo.lp[player]);
...@@ -3213,7 +3213,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) { ...@@ -3213,7 +3213,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
mainGame->WaitFrameSignal(30); mainGame->WaitFrameSignal(30);
mainGame->lpframe = 10; mainGame->lpframe = 10;
mainGame->WaitFrameSignal(11); mainGame->WaitFrameSignal(11);
mainGame->lpcstring = 0; mainGame->lpcstring = L"";
mainGame->dInfo.lp[player] = final; mainGame->dInfo.lp[player] = final;
mainGame->gMutex.lock(); mainGame->gMutex.lock();
myswprintf(mainGame->dInfo.strLP[player], L"%d", mainGame->dInfo.lp[player]); myswprintf(mainGame->dInfo.strLP[player], L"%d", mainGame->dInfo.lp[player]);
...@@ -3365,7 +3365,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) { ...@@ -3365,7 +3365,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
mainGame->WaitFrameSignal(30); mainGame->WaitFrameSignal(30);
mainGame->lpframe = 10; mainGame->lpframe = 10;
mainGame->WaitFrameSignal(11); mainGame->WaitFrameSignal(11);
mainGame->lpcstring = 0; mainGame->lpcstring = L"";
mainGame->dInfo.lp[player] = final; mainGame->dInfo.lp[player] = final;
mainGame->gMutex.lock(); mainGame->gMutex.lock();
myswprintf(mainGame->dInfo.strLP[player], L"%d", mainGame->dInfo.lp[player]); myswprintf(mainGame->dInfo.strLP[player], L"%d", mainGame->dInfo.lp[player]);
......
...@@ -1600,7 +1600,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -1600,7 +1600,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
myswprintf(formatBuffer, L"\nLINK-%d", mcard->link); myswprintf(formatBuffer, L"\nLINK-%d", mcard->link);
str.append(formatBuffer); str.append(formatBuffer);
} }
myswprintf(formatBuffer, L" %ls/%ls", dataManager.FormatRace(mcard->race), dataManager.FormatAttribute(mcard->attribute)); myswprintf(formatBuffer, L" %ls/%ls", dataManager.FormatRace(mcard->race).c_str(), dataManager.FormatAttribute(mcard->attribute).c_str());
str.append(formatBuffer); str.append(formatBuffer);
if(mcard->location == LOCATION_HAND && (mcard->type & TYPE_PENDULUM)) { if(mcard->location == LOCATION_HAND && (mcard->type & TYPE_PENDULUM)) {
myswprintf(formatBuffer, L"\n%d/%d", mcard->lscale, mcard->rscale); myswprintf(formatBuffer, L"\n%d/%d", mcard->lscale, mcard->rscale);
...@@ -1626,9 +1626,9 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -1626,9 +1626,9 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
else if(mcard->cHint == CHINT_CARD) else if(mcard->cHint == CHINT_CARD)
myswprintf(formatBuffer, L"\n%ls%ls", dataManager.GetSysString(212), dataManager.GetName(mcard->chValue)); myswprintf(formatBuffer, L"\n%ls%ls", dataManager.GetSysString(212), dataManager.GetName(mcard->chValue));
else if(mcard->cHint == CHINT_RACE) else if(mcard->cHint == CHINT_RACE)
myswprintf(formatBuffer, L"\n%ls%ls", dataManager.GetSysString(213), dataManager.FormatRace(mcard->chValue)); myswprintf(formatBuffer, L"\n%ls%ls", dataManager.GetSysString(213), dataManager.FormatRace(mcard->chValue).c_str());
else if(mcard->cHint == CHINT_ATTRIBUTE) else if(mcard->cHint == CHINT_ATTRIBUTE)
myswprintf(formatBuffer, L"\n%ls%ls", dataManager.GetSysString(214), dataManager.FormatAttribute(mcard->chValue)); myswprintf(formatBuffer, L"\n%ls%ls", dataManager.GetSysString(214), dataManager.FormatAttribute(mcard->chValue).c_str());
else if(mcard->cHint == CHINT_NUMBER) else if(mcard->cHint == CHINT_NUMBER)
myswprintf(formatBuffer, L"\n%ls%d", dataManager.GetSysString(215), mcard->chValue); myswprintf(formatBuffer, L"\n%ls%d", dataManager.GetSysString(215), mcard->chValue);
str.append(formatBuffer); str.append(formatBuffer);
......
...@@ -43,7 +43,6 @@ void DuelInfo::Clear() { ...@@ -43,7 +43,6 @@ void DuelInfo::Clear() {
clientname_tag[0] = 0; clientname_tag[0] = 0;
strLP[0][0] = 0; strLP[0][0] = 0;
strLP[1][0] = 0; strLP[1][0] = 0;
vic_string = 0;
player_type = 0; player_type = 0;
time_player = 0; time_player = 0;
time_limit = 0; time_limit = 0;
...@@ -77,7 +76,6 @@ bool Game::Initialize() { ...@@ -77,7 +76,6 @@ bool Game::Initialize() {
showcard = 0; showcard = 0;
is_attacking = false; is_attacking = false;
lpframe = 0; lpframe = 0;
lpcstring = 0;
always_chain = false; always_chain = false;
ignore_chain = false; ignore_chain = false;
chain_when_avail = false; chain_when_avail = false;
...@@ -613,14 +611,14 @@ bool Game::Initialize() { ...@@ -613,14 +611,14 @@ bool Game::Initialize() {
wANAttribute->setVisible(false); wANAttribute->setVisible(false);
for(int filter = 0x1, i = 0; i < 7; filter <<= 1, ++i) for(int filter = 0x1, i = 0; i < 7; filter <<= 1, ++i)
chkAttribute[i] = env->addCheckBox(false, rect<s32>(10 + (i % 4) * 80, 25 + (i / 4) * 25, 90 + (i % 4) * 80, 50 + (i / 4) * 25), chkAttribute[i] = env->addCheckBox(false, rect<s32>(10 + (i % 4) * 80, 25 + (i / 4) * 25, 90 + (i % 4) * 80, 50 + (i / 4) * 25),
wANAttribute, CHECK_ATTRIBUTE, dataManager.FormatAttribute(filter)); wANAttribute, CHECK_ATTRIBUTE, dataManager.FormatAttribute(filter).c_str());
//announce race //announce race
wANRace = env->addWindow(rect<s32>(480, 200, 850, 410), false, dataManager.GetSysString(563)); wANRace = env->addWindow(rect<s32>(480, 200, 850, 410), false, dataManager.GetSysString(563));
wANRace->getCloseButton()->setVisible(false); wANRace->getCloseButton()->setVisible(false);
wANRace->setVisible(false); wANRace->setVisible(false);
for(int filter = 0x1, i = 0; i < RACES_COUNT; filter <<= 1, ++i) for(int filter = 0x1, i = 0; i < RACES_COUNT; filter <<= 1, ++i)
chkRace[i] = env->addCheckBox(false, rect<s32>(10 + (i % 4) * 90, 25 + (i / 4) * 25, 100 + (i % 4) * 90, 50 + (i / 4) * 25), chkRace[i] = env->addCheckBox(false, rect<s32>(10 + (i % 4) * 90, 25 + (i / 4) * 25, 100 + (i % 4) * 90, 50 + (i / 4) * 25),
wANRace, CHECK_RACE, dataManager.FormatRace(filter)); wANRace, CHECK_RACE, dataManager.FormatRace(filter).c_str());
//selection hint //selection hint
stHintMsg = env->addStaticText(L"", rect<s32>(500, 60, 820, 90), true, false, 0, -1, false); stHintMsg = env->addStaticText(L"", rect<s32>(500, 60, 820, 90), true, false, 0, -1, false);
stHintMsg->setBackgroundColor(0xc0ffffff); stHintMsg->setBackgroundColor(0xc0ffffff);
...@@ -750,13 +748,13 @@ bool Game::Initialize() { ...@@ -750,13 +748,13 @@ bool Game::Initialize() {
cbAttribute->setMaxSelectionRows(10); cbAttribute->setMaxSelectionRows(10);
cbAttribute->addItem(dataManager.GetSysString(1310), 0); cbAttribute->addItem(dataManager.GetSysString(1310), 0);
for(int filter = 0x1; filter != 0x80; filter <<= 1) for(int filter = 0x1; filter != 0x80; filter <<= 1)
cbAttribute->addItem(dataManager.FormatAttribute(filter), filter); cbAttribute->addItem(dataManager.FormatAttribute(filter).c_str(), filter);
stRace = env->addStaticText(dataManager.GetSysString(1321), rect<s32>(10, 42 + 75 / 6, 70, 62 + 75 / 6), false, false, wFilter); stRace = env->addStaticText(dataManager.GetSysString(1321), rect<s32>(10, 42 + 75 / 6, 70, 62 + 75 / 6), false, false, wFilter);
cbRace = env->addComboBox(rect<s32>(60, 40 + 75 / 6, 195, 60 + 75 / 6), wFilter, COMBOBOX_RACE); cbRace = env->addComboBox(rect<s32>(60, 40 + 75 / 6, 195, 60 + 75 / 6), wFilter, COMBOBOX_RACE);
cbRace->setMaxSelectionRows(10); cbRace->setMaxSelectionRows(10);
cbRace->addItem(dataManager.GetSysString(1310), 0); cbRace->addItem(dataManager.GetSysString(1310), 0);
for(int filter = 0x1; filter < (1 << RACES_COUNT); filter <<= 1) for(int filter = 0x1; filter < (1 << RACES_COUNT); filter <<= 1)
cbRace->addItem(dataManager.FormatRace(filter), filter); cbRace->addItem(dataManager.FormatRace(filter).c_str(), filter);
stAttack = env->addStaticText(dataManager.GetSysString(1322), rect<s32>(205, 22 + 50 / 6, 280, 42 + 50 / 6), false, false, wFilter); stAttack = env->addStaticText(dataManager.GetSysString(1322), rect<s32>(205, 22 + 50 / 6, 280, 42 + 50 / 6), false, false, wFilter);
ebAttack = env->addEditBox(L"", rect<s32>(260, 20 + 50 / 6, 340, 40 + 50 / 6), true, wFilter, EDITBOX_INPUTS); ebAttack = env->addEditBox(L"", rect<s32>(260, 20 + 50 / 6, 340, 40 + 50 / 6), true, wFilter, EDITBOX_INPUTS);
ebAttack->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER); ebAttack->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
...@@ -1552,7 +1550,7 @@ void Game::ShowCardInfo(int code, bool resize) { ...@@ -1552,7 +1550,7 @@ void Game::ShowCardInfo(int code, bool resize) {
} }
if (target->second.setcode[0]) { if (target->second.setcode[0]) {
offset = 23;// *yScale; offset = 23;// *yScale;
myswprintf(formatBuffer, L"%ls%ls", dataManager.GetSysString(1329), dataManager.FormatSetName(target->second.setcode)); myswprintf(formatBuffer, L"%ls%ls", dataManager.GetSysString(1329), dataManager.FormatSetName(target->second.setcode).c_str());
stSetName->setText(formatBuffer); stSetName->setText(formatBuffer);
} }
else else
...@@ -1563,7 +1561,7 @@ void Game::ShowCardInfo(int code, bool resize) { ...@@ -1563,7 +1561,7 @@ void Game::ShowCardInfo(int code, bool resize) {
} }
if(is_valid && cit->second.type & TYPE_MONSTER) { if(is_valid && cit->second.type & TYPE_MONSTER) {
auto& cd = cit->second; auto& cd = cit->second;
myswprintf(formatBuffer, L"[%ls] %ls/%ls", dataManager.FormatType(cd.type), dataManager.FormatRace(cd.race), dataManager.FormatAttribute(cd.attribute)); myswprintf(formatBuffer, L"[%ls] %ls/%ls", dataManager.FormatType(cd.type).c_str(), dataManager.FormatRace(cd.race).c_str(), dataManager.FormatAttribute(cd.attribute).c_str());
stInfo->setText(formatBuffer); stInfo->setText(formatBuffer);
int offset_info = 0; int offset_info = 0;
irr::core::dimension2d<unsigned int> dtxt = guiFont->getDimension(formatBuffer); irr::core::dimension2d<unsigned int> dtxt = guiFont->getDimension(formatBuffer);
...@@ -1586,9 +1584,9 @@ void Game::ShowCardInfo(int code, bool resize) { ...@@ -1586,9 +1584,9 @@ void Game::ShowCardInfo(int code, bool resize) {
} else { } else {
form = L"LINK-"; form = L"LINK-";
if(cd.attack < 0) if(cd.attack < 0)
myswprintf(adBuffer, L"?/- %ls", dataManager.FormatLinkMarker(cd.link_marker)); myswprintf(adBuffer, L"?/- %ls", dataManager.FormatLinkMarker(cd.link_marker).c_str());
else else
myswprintf(adBuffer, L"%d/- %ls", cd.attack, dataManager.FormatLinkMarker(cd.link_marker)); myswprintf(adBuffer, L"%d/- %ls", cd.attack, dataManager.FormatLinkMarker(cd.link_marker).c_str());
} }
if(cd.type & TYPE_PENDULUM) { if(cd.type & TYPE_PENDULUM) {
myswprintf(scaleBuffer, L" %d/%d", cd.lscale, cd.rscale); myswprintf(scaleBuffer, L" %d/%d", cd.lscale, cd.rscale);
...@@ -1607,9 +1605,9 @@ void Game::ShowCardInfo(int code, bool resize) { ...@@ -1607,9 +1605,9 @@ void Game::ShowCardInfo(int code, bool resize) {
} }
else { else {
if (is_valid) if (is_valid)
myswprintf(formatBuffer, L"[%ls]", dataManager.FormatType(cit->second.type)); myswprintf(formatBuffer, L"[%ls]", dataManager.FormatType(cit->second.type).c_str());
else else
myswprintf(formatBuffer, L"[%ls]", dataManager.FormatType(0)); myswprintf(formatBuffer, L"[%ls]", dataManager.unknown_string);
stInfo->setText(formatBuffer); stInfo->setText(formatBuffer);
stDataInfo->setText(L""); stDataInfo->setText(L"");
stSetName->setRelativePosition(rect<s32>(15, 60, 296 * xScale, 60 + offset)); stSetName->setRelativePosition(rect<s32>(15, 60, 296 * xScale, 60 + offset));
......
...@@ -104,7 +104,7 @@ struct DuelInfo { ...@@ -104,7 +104,7 @@ struct DuelInfo {
wchar_t hostname_tag[20]{}; wchar_t hostname_tag[20]{};
wchar_t clientname_tag[20]{}; wchar_t clientname_tag[20]{};
wchar_t strLP[2][16]{}; wchar_t strLP[2][16]{};
wchar_t* vic_string{ nullptr }; std::wstring vic_string;
unsigned char player_type{ 0 }; unsigned char player_type{ 0 };
unsigned char time_player{ 0 }; unsigned char time_player{ 0 };
unsigned short time_limit{ 0 }; unsigned short time_limit{ 0 };
...@@ -157,7 +157,6 @@ public: ...@@ -157,7 +157,6 @@ public:
void CheckMutual(ClientCard* pcard, int mark); void CheckMutual(ClientCard* pcard, int mark);
void DrawCards(); void DrawCards();
void DrawCard(ClientCard* pcard); void DrawCard(ClientCard* pcard);
void DrawShadowText(irr::gui::CGUITTFont* font, const core::stringw& text, const core::rect<s32>& position, const core::rect<s32>& padding, video::SColor color = 0xffffffff, video::SColor shadowcolor = 0xff000000, bool hcenter = false, bool vcenter = false, const core::rect<s32>* clip = 0);
void DrawMisc(); void DrawMisc();
void DrawStatus(ClientCard* pcard, int x1, int y1, int x2, int y2); void DrawStatus(ClientCard* pcard, int x1, int y1, int x2, int y2);
void DrawGUI(); void DrawGUI();
...@@ -258,7 +257,7 @@ public: ...@@ -258,7 +257,7 @@ public:
int lpd; int lpd;
int lpplayer; int lpplayer;
int lpccolor; int lpccolor;
wchar_t* lpcstring; std::wstring lpcstring;
bool always_chain; bool always_chain;
bool ignore_chain; bool ignore_chain;
bool chain_when_avail; bool chain_when_avail;
......
This diff is collapsed.
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