Commit 194608f8 authored by Chen Bill's avatar Chen Bill

replace irr::core::recti

parent 2c4d3263
......@@ -652,7 +652,7 @@ void ClientField::ShowSelectOption(int select_hint) {
mainGame->btnOptionOK->setVisible(false);
for(int i = 0; i < 5; i++)
mainGame->btnOption[i]->setVisible(i < count);
recti pos = mainGame->wOptions->getRelativePosition();
irr::core::recti pos = mainGame->wOptions->getRelativePosition();
int newheight = 30 + 40 * (scrollbar ? 5 : count);
int oldheight = pos.LowerRightCorner.Y - pos.UpperLeftCorner.Y;
pos.UpperLeftCorner.Y = pos.UpperLeftCorner.Y + (oldheight - newheight) / 2;
......@@ -667,7 +667,7 @@ void ClientField::ShowSelectOption(int select_hint) {
mainGame->btnOptionOK->setVisible(true);
for(int i = 0; i < 5; i++)
mainGame->btnOption[i]->setVisible(false);
recti pos = mainGame->wOptions->getRelativePosition();
irr::core::recti pos = mainGame->wOptions->getRelativePosition();
pos.LowerRightCorner.Y = pos.UpperLeftCorner.Y + 140;
mainGame->wOptions->setRelativePosition(pos);
}
......
......@@ -1685,8 +1685,8 @@ void DeckBuilder::ShowBigCard(int code, float zoom) {
auto size = img->getSize();
s32 left = mainGame->window_size.Width / 2 - size.Width / 2;
s32 top = mainGame->window_size.Height / 2 - size.Height / 2;
mainGame->imgBigCard->setRelativePosition(recti(0, 0, size.Width, size.Height));
mainGame->wBigCard->setRelativePosition(recti(left, top, left + size.Width, top + size.Height));
mainGame->imgBigCard->setRelativePosition(irr::core::recti(0, 0, size.Width, size.Height));
mainGame->wBigCard->setRelativePosition(irr::core::recti(left, top, left + size.Width, top + size.Height));
mainGame->gMutex.lock();
mainGame->btnBigCardOriginalSize->setVisible(true);
mainGame->btnBigCardZoomIn->setVisible(true);
......@@ -1713,8 +1713,8 @@ void DeckBuilder::ZoomBigCard(s32 centerx, s32 centery) {
float posy = (float)(centery - pos.UpperLeftCorner.Y) / pos.getHeight();
s32 left = centerx - size.Width * posx;
s32 top = centery - size.Height * posy;
mainGame->imgBigCard->setRelativePosition(recti(0, 0, size.Width, size.Height));
mainGame->wBigCard->setRelativePosition(recti(left, top, left + size.Width, top + size.Height));
mainGame->imgBigCard->setRelativePosition(irr::core::recti(0, 0, size.Width, size.Height));
mainGame->wBigCard->setRelativePosition(irr::core::recti(left, top, left + size.Width, top + size.Height));
}
void DeckBuilder::CloseBigCard() {
mainGame->HideElement(mainGame->wBigCard);
......
......@@ -50,7 +50,7 @@ void Game::DrawSelectionLine(irr::video::S3DVertex* vec, bool strip, int width,
}
}
void Game::DrawSelectionLine(irr::gui::IGUIElement* element, int width, irr::video::SColor color) {
recti pos = element->getAbsolutePosition();
irr::core::recti pos = element->getAbsolutePosition();
float x1 = pos.UpperLeftCorner.X;
float x2 = pos.LowerRightCorner.X;
float y1 = pos.UpperLeftCorner.Y;
......@@ -58,15 +58,15 @@ void Game::DrawSelectionLine(irr::gui::IGUIElement* element, int width, irr::vid
float w = pos.getWidth();
float h = pos.getHeight();
if(linePatternD3D < 15) {
driver->draw2DRectangle(color, recti(x1 - 1 - width, y1 - 1 - width, x1 + (w * (linePatternD3D + 1) / 15.0) + 1 + width, y1 - 1));
driver->draw2DRectangle(color, recti(x2 - (w * (linePatternD3D + 1) / 15.0) - 1 - width, y2 + 1, x2 + 1 + width, y2 + 1 + width));
driver->draw2DRectangle(color, recti(x1 - 1 - width, y1 - 1 - width, x1 - 1, y2 - (h * (linePatternD3D + 1) / 15.0) + 1 + width));
driver->draw2DRectangle(color, recti(x2 + 1, y1 + (h * (linePatternD3D + 1) / 15.0) - 1 - width, x2 + 1 + width, y2 + 1 + width));
driver->draw2DRectangle(color, irr::core::recti(x1 - 1 - width, y1 - 1 - width, x1 + (w * (linePatternD3D + 1) / 15.0) + 1 + width, y1 - 1));
driver->draw2DRectangle(color, irr::core::recti(x2 - (w * (linePatternD3D + 1) / 15.0) - 1 - width, y2 + 1, x2 + 1 + width, y2 + 1 + width));
driver->draw2DRectangle(color, irr::core::recti(x1 - 1 - width, y1 - 1 - width, x1 - 1, y2 - (h * (linePatternD3D + 1) / 15.0) + 1 + width));
driver->draw2DRectangle(color, irr::core::recti(x2 + 1, y1 + (h * (linePatternD3D + 1) / 15.0) - 1 - width, x2 + 1 + width, y2 + 1 + width));
} else {
driver->draw2DRectangle(color, recti(x1 - 1 - width + (w * (linePatternD3D - 14) / 15.0), y1 - 1 - width, x2 + 1 + width, y1 - 1));
driver->draw2DRectangle(color, recti(x1 - 1 - width, y2 + 1, x2 - (w * (linePatternD3D - 14) / 15.0) + 1 + width, y2 + 1 + width));
driver->draw2DRectangle(color, recti(x1 - 1 - width, y2 - (h * (linePatternD3D - 14) / 15.0) - 1 - width, x1 - 1, y2 + 1 + width));
driver->draw2DRectangle(color, recti(x2 + 1, y1 - 1 - width, x2 + 1 + width, y1 + (h * (linePatternD3D - 14) / 15.0) + 1 + width));
driver->draw2DRectangle(color, irr::core::recti(x1 - 1 - width + (w * (linePatternD3D - 14) / 15.0), y1 - 1 - width, x2 + 1 + width, y1 - 1));
driver->draw2DRectangle(color, irr::core::recti(x1 - 1 - width, y2 + 1, x2 - (w * (linePatternD3D - 14) / 15.0) + 1 + width, y2 + 1 + width));
driver->draw2DRectangle(color, irr::core::recti(x1 - 1 - width, y2 - (h * (linePatternD3D - 14) / 15.0) - 1 - width, x1 - 1, y2 + 1 + width));
driver->draw2DRectangle(color, irr::core::recti(x2 + 1, y1 - 1 - width, x2 + 1 + width, y1 + (h * (linePatternD3D - 14) / 15.0) + 1 + width));
}
}
void Game::DrawBackGround() {
......@@ -415,7 +415,7 @@ void Game::DrawCard(ClientCard* pcard) {
template<typename T>
void Game::DrawShadowText(irr::gui::CGUITTFont* font, const T& text, const core::rect<s32>& position, const core::rect<s32>& padding,
video::SColor color, video::SColor shadowcolor, bool hcenter, bool vcenter, const core::rect<s32>* clip) {
core::rect<s32> shadowposition = recti(position.UpperLeftCorner.X - padding.UpperLeftCorner.X, position.UpperLeftCorner.Y - padding.UpperLeftCorner.Y,
core::rect<s32> shadowposition = irr::core::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);
font->drawUstring(text, shadowposition, shadowcolor, hcenter, vcenter, clip);
font->drawUstring(text, position, color, hcenter, vcenter, clip);
......@@ -532,8 +532,8 @@ void Game::DrawMisc() {
driver->draw2DRectangle(0xa0000000, Resize(689, 8, 991, 51));
driver->draw2DRectangleOutline(Resize(689, 8, 991, 51), 0xffff8080);
}
driver->draw2DImage(imageManager.tLPFrame, Resize(330, 10, 629, 30), recti(0, 0, 200, 20), 0, 0, true);
driver->draw2DImage(imageManager.tLPFrame, Resize(691, 10, 990, 30), recti(0, 0, 200, 20), 0, 0, true);
driver->draw2DImage(imageManager.tLPFrame, Resize(330, 10, 629, 30), irr::core::recti(0, 0, 200, 20), 0, 0, true);
driver->draw2DImage(imageManager.tLPFrame, Resize(691, 10, 990, 30), irr::core::recti(0, 0, 200, 20), 0, 0, true);
if(dInfo.start_lp) {
auto maxLP = dInfo.isTag ? dInfo.start_lp / 2 : dInfo.start_lp;
if(dInfo.lp[0] >= maxLP) {
......@@ -541,23 +541,23 @@ void Game::DrawMisc() {
auto partialLP = dInfo.lp[0] % maxLP;
auto bgColorPos = (layerCount - 1) % 5;
auto fgColorPos = layerCount % 5;
driver->draw2DImage(imageManager.tLPBar, Resize(335 + 290 * partialLP / maxLP, 12, 625, 28), recti(0, bgColorPos * 16, 16, (bgColorPos + 1) * 16), 0, 0, true);
driver->draw2DImage(imageManager.tLPBar, Resize(335 + 290 * partialLP / maxLP, 12, 625, 28), irr::core::recti(0, bgColorPos * 16, 16, (bgColorPos + 1) * 16), 0, 0, true);
if(partialLP > 0) {
driver->draw2DImage(imageManager.tLPBar, Resize(335, 12, 335 + 290 * partialLP / maxLP, 28), recti(0, fgColorPos * 16, 16, (fgColorPos + 1) * 16), 0, 0, true);
driver->draw2DImage(imageManager.tLPBar, Resize(335, 12, 335 + 290 * partialLP / maxLP, 28), irr::core::recti(0, fgColorPos * 16, 16, (fgColorPos + 1) * 16), 0, 0, true);
}
}
else driver->draw2DImage(imageManager.tLPBar, Resize(335, 12, 335 + 290 * dInfo.lp[0] / maxLP, 28), recti(0, 0, 16, 16), 0, 0, true);
else driver->draw2DImage(imageManager.tLPBar, Resize(335, 12, 335 + 290 * dInfo.lp[0] / maxLP, 28), irr::core::recti(0, 0, 16, 16), 0, 0, true);
if(dInfo.lp[1] >= maxLP) {
auto layerCount = dInfo.lp[1] / maxLP;
auto partialLP = dInfo.lp[1] % maxLP;
auto bgColorPos = (layerCount - 1) % 5;
auto fgColorPos = layerCount % 5;
driver->draw2DImage(imageManager.tLPBar, Resize(696, 12, 986 - 290 * partialLP / maxLP, 28), recti(0, bgColorPos * 16, 16, (bgColorPos + 1) * 16), 0, 0, true);
driver->draw2DImage(imageManager.tLPBar, Resize(696, 12, 986 - 290 * partialLP / maxLP, 28), irr::core::recti(0, bgColorPos * 16, 16, (bgColorPos + 1) * 16), 0, 0, true);
if(partialLP > 0) {
driver->draw2DImage(imageManager.tLPBar, Resize(986 - 290 * partialLP / maxLP, 12, 986, 28), recti(0, fgColorPos * 16, 16, (fgColorPos + 1) * 16), 0, 0, true);
driver->draw2DImage(imageManager.tLPBar, Resize(986 - 290 * partialLP / maxLP, 12, 986, 28), irr::core::recti(0, fgColorPos * 16, 16, (fgColorPos + 1) * 16), 0, 0, true);
}
}
else driver->draw2DImage(imageManager.tLPBar, Resize(986 - 290 * dInfo.lp[1] / maxLP, 12, 986, 28), recti(0, 0, 16, 16), 0, 0, true);
else driver->draw2DImage(imageManager.tLPBar, Resize(986 - 290 * dInfo.lp[1] / maxLP, 12, 986, 28), irr::core::recti(0, 0, 16, 16), 0, 0, true);
}
if(lpframe) {
dInfo.lp[lpplayer] -= lpd;
......@@ -582,8 +582,8 @@ void Game::DrawMisc() {
DrawShadowText(numFont, dInfo.strLP[1], Resize(691, 12, 992, 30), Resize(0, 1, 2, 0), 0xffffff00, 0xff000000, true, false, 0);
if(!gameConf.hide_player_name) {
recti p1size = Resize(335, 31, 629, 50);
recti p2size = Resize(986, 31, 986, 50);
irr::core::recti p1size = Resize(335, 31, 629, 50);
irr::core::recti p2size = Resize(986, 31, 986, 50);
if(!dInfo.isTag || !dInfo.tag_player[0])
textFont->drawUstring(dInfo.hostname, p1size, 0xffffffff, false, false, 0);
else
......@@ -815,7 +815,7 @@ void Game::DrawSpec() {
case 1: {
driver->draw2DImage(imageManager.GetTexture(showcardcode, true), ResizeCardHint(574, 150));
driver->draw2DImage(imageManager.tMask, ResizeCardMid(574, 150, 574 + (showcarddif > CARD_IMG_WIDTH ? CARD_IMG_WIDTH : showcarddif), 150 + CARD_IMG_HEIGHT, midx, midy),
recti(CARD_IMG_HEIGHT - showcarddif, 0, CARD_IMG_HEIGHT - (showcarddif > CARD_IMG_WIDTH ? showcarddif - CARD_IMG_WIDTH : 0), CARD_IMG_HEIGHT), 0, 0, true);
irr::core::recti(CARD_IMG_HEIGHT - showcarddif, 0, CARD_IMG_HEIGHT - (showcarddif > CARD_IMG_WIDTH ? showcarddif - CARD_IMG_WIDTH : 0), CARD_IMG_HEIGHT), 0, 0, true);
showcarddif += 15;
if(showcarddif >= CARD_IMG_HEIGHT) {
showcard = 2;
......@@ -826,7 +826,7 @@ void Game::DrawSpec() {
case 2: {
driver->draw2DImage(imageManager.GetTexture(showcardcode, true), ResizeCardHint(574, 150));
driver->draw2DImage(imageManager.tMask, ResizeCardMid(574 + showcarddif, 150, 574 + CARD_IMG_WIDTH, 150 + CARD_IMG_HEIGHT, midx, midy),
recti(0, 0, CARD_IMG_WIDTH - showcarddif, CARD_IMG_HEIGHT), 0, 0, true);
irr::core::recti(0, 0, CARD_IMG_WIDTH - showcarddif, CARD_IMG_HEIGHT), 0, 0, true);
showcarddif += 15;
if(showcarddif >= CARD_IMG_WIDTH) {
showcard = 0;
......@@ -835,7 +835,7 @@ void Game::DrawSpec() {
}
case 3: {
driver->draw2DImage(imageManager.GetTexture(showcardcode, true), ResizeCardHint(574, 150));
driver->draw2DImage(imageManager.tNegated, ResizeCardMid(536 + showcarddif, 141 + showcarddif, 792 - showcarddif, 397 - showcarddif, midx, midy), recti(0, 0, 128, 128), 0, 0, true);
driver->draw2DImage(imageManager.tNegated, ResizeCardMid(536 + showcarddif, 141 + showcarddif, 792 - showcarddif, 397 - showcarddif, midx, midy), irr::core::recti(0, 0, 128, 128), 0, 0, true);
if(showcarddif < 64)
showcarddif += 4;
break;
......@@ -865,7 +865,7 @@ void Game::DrawSpec() {
case 6: {
driver->draw2DImage(imageManager.GetTexture(showcardcode, true), ResizeCardHint(574, 150));
driver->draw2DImage(imageManager.tNumber, ResizeCardMid(536 + showcarddif, 141 + showcarddif, 792 - showcarddif, 397 - showcarddif, midx, midy),
recti((showcardp % 5) * 64, (showcardp / 5) * 64, (showcardp % 5 + 1) * 64, (showcardp / 5 + 1) * 64), 0, 0, true);
irr::core::recti((showcardp % 5) * 64, (showcardp / 5) * 64, (showcardp % 5 + 1) * 64, (showcardp / 5 + 1) * 64), 0, 0, true);
if(showcarddif < 64)
showcarddif += 4;
break;
......@@ -1018,9 +1018,9 @@ void Game::DrawSpec() {
int w = guiFont->getDimension(msg).Width;
int h = guiFont->getDimension(msg).Height + 2;
recti rectloc(x, y - chatRectY - h, x + 2 + w, y - chatRectY);
recti msgloc(x, y - chatRectY - h, x - 4, y - chatRectY);
recti shadowloc = msgloc + irr::core::vector2di(1, 1);
irr::core::recti rectloc(x, y - chatRectY - h, x + 2 + w, y - chatRectY);
irr::core::recti msgloc(x, y - chatRectY - h, x - 4, y - chatRectY);
irr::core::recti shadowloc = msgloc + irr::core::vector2di(1, 1);
driver->draw2DRectangle(rectloc, 0xa0000000, 0xa0000000, 0xa0000000, 0xa0000000);
guiFont->drawUstring(msg, msgloc, 0xff000000, false, false);
......@@ -1033,7 +1033,7 @@ void Game::DrawSpec() {
void Game::DrawBackImage(irr::video::ITexture* texture) {
if(!texture)
return;
driver->draw2DImage(texture, Resize(0, 0, 1024, 640), recti(0, 0, texture->getOriginalSize().Width, texture->getOriginalSize().Height));
driver->draw2DImage(texture, Resize(0, 0, 1024, 640), irr::core::recti(0, 0, texture->getOriginalSize().Width, texture->getOriginalSize().Height));
}
void Game::ShowElement(irr::gui::IGUIElement * win, int autoframe) {
FadingUnit fu;
......@@ -1135,26 +1135,26 @@ void Game::DrawThumb(code_pointer cp, irr::core::vector2di pos, const LFList* lf
if(img == nullptr)
return; //nullptr->getSize() will cause a crash
dimension2d<u32> size = img->getOriginalSize();
recti dragloc = mainGame->Resize(pos.X, pos.Y, pos.X + CARD_THUMB_WIDTH, pos.Y + CARD_THUMB_HEIGHT);
recti limitloc = mainGame->Resize(pos.X, pos.Y, pos.X + 20, pos.Y + 20);
recti otloc = Resize(pos.X + 7, pos.Y + 50, pos.X + 37, pos.Y + 65);
irr::core::recti dragloc = mainGame->Resize(pos.X, pos.Y, pos.X + CARD_THUMB_WIDTH, pos.Y + CARD_THUMB_HEIGHT);
irr::core::recti limitloc = mainGame->Resize(pos.X, pos.Y, pos.X + 20, pos.Y + 20);
irr::core::recti otloc = Resize(pos.X + 7, pos.Y + 50, pos.X + 37, pos.Y + 65);
if(drag) {
dragloc = recti(pos.X, pos.Y, pos.X + CARD_THUMB_WIDTH * mainGame->xScale, pos.Y + CARD_THUMB_HEIGHT * mainGame->yScale);
limitloc = recti(pos.X, pos.Y, pos.X + 20 * mainGame->xScale, pos.Y + 20 * mainGame->yScale);
otloc = recti(pos.X + 7, pos.Y + 50 * mainGame->yScale, pos.X + 37 * mainGame->xScale, pos.Y + 65 * mainGame->yScale);
dragloc = irr::core::recti(pos.X, pos.Y, pos.X + CARD_THUMB_WIDTH * mainGame->xScale, pos.Y + CARD_THUMB_HEIGHT * mainGame->yScale);
limitloc = irr::core::recti(pos.X, pos.Y, pos.X + 20 * mainGame->xScale, pos.Y + 20 * mainGame->yScale);
otloc = irr::core::recti(pos.X + 7, pos.Y + 50 * mainGame->yScale, pos.X + 37 * mainGame->xScale, pos.Y + 65 * mainGame->yScale);
}
driver->draw2DImage(img, dragloc, rect<s32>(0, 0, size.Width, size.Height));
auto lfit = lflist->content.find(lcode);
if (lfit != lflist->content.end()) {
switch(lfit->second) {
case 0:
driver->draw2DImage(imageManager.tLim, limitloc, recti(0, 0, 64, 64), 0, 0, true);
driver->draw2DImage(imageManager.tLim, limitloc, irr::core::recti(0, 0, 64, 64), 0, 0, true);
break;
case 1:
driver->draw2DImage(imageManager.tLim, limitloc, recti(64, 0, 128, 64), 0, 0, true);
driver->draw2DImage(imageManager.tLim, limitloc, irr::core::recti(64, 0, 128, 64), 0, 0, true);
break;
case 2:
driver->draw2DImage(imageManager.tLim, limitloc, recti(0, 64, 64, 128), 0, 0, true);
driver->draw2DImage(imageManager.tLim, limitloc, irr::core::recti(0, 64, 64, 128), 0, 0, true);
break;
}
}
......@@ -1174,16 +1174,16 @@ void Game::DrawThumb(code_pointer cp, irr::core::vector2di pos, const LFList* lf
}
if(showAvail) {
if((cp->second.ot & AVAIL_OCG) && !(cp->second.ot & AVAIL_TCG))
driver->draw2DImage(imageManager.tOT, otloc, recti(0, 128, 128, 192), 0, 0, true);
driver->draw2DImage(imageManager.tOT, otloc, irr::core::recti(0, 128, 128, 192), 0, 0, true);
else if((cp->second.ot & AVAIL_TCG) && !(cp->second.ot & AVAIL_OCG))
driver->draw2DImage(imageManager.tOT, otloc, recti(0, 192, 128, 256), 0, 0, true);
driver->draw2DImage(imageManager.tOT, otloc, irr::core::recti(0, 192, 128, 256), 0, 0, true);
} else if(showNotAvail) {
if(cp->second.ot & AVAIL_OCG)
driver->draw2DImage(imageManager.tOT, otloc, recti(0, 0, 128, 64), 0, 0, true);
driver->draw2DImage(imageManager.tOT, otloc, irr::core::recti(0, 0, 128, 64), 0, 0, true);
else if(cp->second.ot & AVAIL_TCG)
driver->draw2DImage(imageManager.tOT, otloc, recti(0, 64, 128, 128), 0, 0, true);
driver->draw2DImage(imageManager.tOT, otloc, irr::core::recti(0, 64, 128, 128), 0, 0, true);
else if(!avail)
driver->draw2DImage(imageManager.tLim, otloc, recti(0, 0, 64, 64), 0, 0, true);
driver->draw2DImage(imageManager.tLim, otloc, irr::core::recti(0, 0, 64, 64), 0, 0, true);
}
}
void Game::DrawDeckBd() {
......
......@@ -3674,7 +3674,7 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
mainGame->cbANNumber->setVisible(false);
mainGame->btnANNumberOK->setRelativePosition(rect<s32>(20, 195, 210, 230));
mainGame->btnANNumberOK->setEnabled(false);
recti pos = mainGame->wANNumber->getRelativePosition();
irr::core::recti pos = mainGame->wANNumber->getRelativePosition();
pos.LowerRightCorner.Y = pos.UpperLeftCorner.Y + 250;
mainGame->wANNumber->setRelativePosition(pos);
} else {
......@@ -3683,7 +3683,7 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
}
mainGame->cbANNumber->setVisible(true);
mainGame->btnANNumberOK->setRelativePosition(rect<s32>(80, 60, 150, 85));
recti pos = mainGame->wANNumber->getRelativePosition();
irr::core::recti pos = mainGame->wANNumber->getRelativePosition();
pos.LowerRightCorner.Y = pos.UpperLeftCorner.Y + 95;
mainGame->wANNumber->setRelativePosition(pos);
}
......
......@@ -1638,7 +1638,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
should_show_tip = true;
irr::core::dimension2d<unsigned int> dtip = mainGame->guiFont->getDimension(str.c_str()) + irr::core::dimension2d<unsigned int>(10, 10);
mainGame->stTip->setRelativePosition(recti(mousepos.X - 10 - dtip.Width, mousepos.Y - 10 - dtip.Height, mousepos.X - 10, mousepos.Y - 10));
mainGame->stTip->setRelativePosition(irr::core::recti(mousepos.X - 10 - dtip.Width, mousepos.Y - 10 - dtip.Height, mousepos.X - 10, mousepos.Y - 10));
mainGame->stTip->setText(str.c_str());
}
} else {
......@@ -1677,7 +1677,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
should_show_tip = true;
irr::core::dimension2d<unsigned int> dtip = mainGame->guiFont->getDimension(str.c_str()) + irr::core::dimension2d<unsigned int>(10, 10);
mainGame->stTip->setRelativePosition(recti(mousepos.X - 10 - dtip.Width, mousepos.Y + 10, mousepos.X - 10, mousepos.Y + 10 + dtip.Height));
mainGame->stTip->setRelativePosition(irr::core::recti(mousepos.X - 10 - dtip.Width, mousepos.Y + 10, mousepos.X - 10, mousepos.Y + 10 + dtip.Height));
mainGame->stTip->setText(str.c_str());
}
hovered_player = mplayer;
......@@ -2006,13 +2006,13 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
}
case SCROLL_TAB_HELPER: {
rect<s32> pos = mainGame->tabHelper->getRelativePosition();
mainGame->tabHelper->setRelativePosition(recti(0, mainGame->scrTabHelper->getPos() * -1, pos.LowerRightCorner.X, pos.LowerRightCorner.Y));
mainGame->tabHelper->setRelativePosition(irr::core::recti(0, mainGame->scrTabHelper->getPos() * -1, pos.LowerRightCorner.X, pos.LowerRightCorner.Y));
return true;
break;
}
case SCROLL_TAB_SYSTEM: {
rect<s32> pos = mainGame->tabSystem->getRelativePosition();
mainGame->tabSystem->setRelativePosition(recti(0, mainGame->scrTabSystem->getPos() * -1, pos.LowerRightCorner.X, pos.LowerRightCorner.Y));
mainGame->tabSystem->setRelativePosition(irr::core::recti(0, mainGame->scrTabSystem->getPos() * -1, pos.LowerRightCorner.X, pos.LowerRightCorner.Y));
return true;
break;
}
......@@ -2476,7 +2476,7 @@ void ClientField::ShowCardInfoInList(ClientCard* pcard, irr::gui::IGUIElement* e
x = w + 10;
if(x + w > 670)
x = 670 - w;
mainGame->stCardListTip->setRelativePosition(recti(x - w, y - 10, x + w, y - 10 + dTip.Height));
mainGame->stCardListTip->setRelativePosition(irr::core::recti(x - w, y - 10, x + w, y - 10 + dTip.Height));
mainGame->stCardListTip->setVisible(true);
}
}
......
......@@ -385,8 +385,8 @@ bool Game::Initialize() {
btnClearLog = env->addButton(rect<s32>(160, 300, 260, 325), tabLog, BUTTON_CLEAR_LOG, dataManager.GetSysString(1272));
//helper
irr::gui::IGUITab* _tabHelper = wInfos->addTab(dataManager.GetSysString(1298));
_tabHelper->setRelativePosition(recti(16, 49, 299, 362));
tabHelper = env->addWindow(recti(0, 0, 250, 300), false, L"", _tabHelper);
_tabHelper->setRelativePosition(irr::core::recti(16, 49, 299, 362));
tabHelper = env->addWindow(irr::core::recti(0, 0, 250, 300), false, L"", _tabHelper);
tabHelper->setDrawTitlebar(false);
tabHelper->getCloseButton()->setVisible(false);
tabHelper->setDrawBackground(false);
......@@ -426,8 +426,8 @@ bool Game::Initialize() {
elmTabHelperLast = chkAutoSaveReplay;
//system
irr::gui::IGUITab* _tabSystem = wInfos->addTab(dataManager.GetSysString(1273));
_tabSystem->setRelativePosition(recti(16, 49, 299, 362));
tabSystem = env->addWindow(recti(0, 0, 250, 300), false, L"", _tabSystem);
_tabSystem->setRelativePosition(irr::core::recti(16, 49, 299, 362));
tabSystem = env->addWindow(irr::core::recti(0, 0, 250, 300), false, L"", _tabSystem);
tabSystem->setDrawTitlebar(false);
tabSystem->getCloseButton()->setVisible(false);
tabSystem->setDrawBackground(false);
......@@ -694,7 +694,7 @@ bool Game::Initialize() {
cbDMCategory->setMaxSelectionRows(10);
btnDMOK = env->addButton(rect<s32>(70, 80, 140, 105), wDMQuery, BUTTON_DM_OK, dataManager.GetSysString(1211));
btnDMCancel = env->addButton(rect<s32>(170, 80, 240, 105), wDMQuery, BUTTON_DM_CANCEL, dataManager.GetSysString(1212));
scrPackCards = env->addScrollBar(false, recti(775, 161, 795, 629), 0, SCROLL_FILTER);
scrPackCards = env->addScrollBar(false, irr::core::recti(775, 161, 795, 629), 0, SCROLL_FILTER);
scrPackCards->setLargeStep(1);
scrPackCards->setSmallStep(1);
scrPackCards->setVisible(false);
......@@ -722,7 +722,7 @@ bool Game::Initialize() {
btnSideReload = env->addButton(rect<s32>(440, 100, 500, 130), 0, BUTTON_SIDE_RELOAD, dataManager.GetSysString(1309));
btnSideReload->setVisible(false);
//
scrFilter = env->addScrollBar(false, recti(999, 161, 1019, 629), 0, SCROLL_FILTER);
scrFilter = env->addScrollBar(false, irr::core::recti(999, 161, 1019, 629), 0, SCROLL_FILTER);
scrFilter->setLargeStep(10);
scrFilter->setSmallStep(1);
scrFilter->setVisible(false);
......@@ -803,25 +803,25 @@ bool Game::Initialize() {
catewidth = dtxt.Width + 40;
}
for(int i = 0; i < 32; ++i)
chkCategory[i] = env->addCheckBox(false, recti(10 + (i % 4) * catewidth, 5 + (i / 4) * 25, 10 + (i % 4 + 1) * catewidth, 5 + (i / 4 + 1) * 25), wCategories, -1, dataManager.GetSysString(1100 + i));
chkCategory[i] = env->addCheckBox(false, irr::core::recti(10 + (i % 4) * catewidth, 5 + (i / 4) * 25, 10 + (i % 4 + 1) * catewidth, 5 + (i / 4 + 1) * 25), wCategories, -1, dataManager.GetSysString(1100 + i));
int wcatewidth = catewidth * 4 + 16;
wCategories->setRelativePosition(rect<s32>(1000 - wcatewidth, 60, 1000, 305));
btnCategoryOK->setRelativePosition(recti(wcatewidth / 2 - 50, 210, wcatewidth / 2 + 50, 235));
btnCategoryOK->setRelativePosition(irr::core::recti(wcatewidth / 2 - 50, 210, wcatewidth / 2 + 50, 235));
btnMarksFilter = env->addButton(rect<s32>(60, 80 + 125 / 6, 195, 100 + 125 / 6), wFilter, BUTTON_MARKS_FILTER, dataManager.GetSysString(1374));
wLinkMarks = env->addWindow(rect<s32>(700, 30, 820, 150), false, L"");
wLinkMarks->getCloseButton()->setVisible(false);
wLinkMarks->setDrawTitlebar(false);
wLinkMarks->setDraggable(false);
wLinkMarks->setVisible(false);
btnMarksOK = env->addButton(recti(45, 45, 75, 75), wLinkMarks, BUTTON_MARKERS_OK, dataManager.GetSysString(1211));
btnMark[0] = env->addButton(recti(10, 10, 40, 40), wLinkMarks, -1, L"\u2196");
btnMark[1] = env->addButton(recti(45, 10, 75, 40), wLinkMarks, -1, L"\u2191");
btnMark[2] = env->addButton(recti(80, 10, 110, 40), wLinkMarks, -1, L"\u2197");
btnMark[3] = env->addButton(recti(10, 45, 40, 75), wLinkMarks, -1, L"\u2190");
btnMark[4] = env->addButton(recti(80, 45, 110, 75), wLinkMarks, -1, L"\u2192");
btnMark[5] = env->addButton(recti(10, 80, 40, 110), wLinkMarks, -1, L"\u2199");
btnMark[6] = env->addButton(recti(45, 80, 75, 110), wLinkMarks, -1, L"\u2193");
btnMark[7] = env->addButton(recti(80, 80, 110, 110), wLinkMarks, -1, L"\u2198");
btnMarksOK = env->addButton(irr::core::recti(45, 45, 75, 75), wLinkMarks, BUTTON_MARKERS_OK, dataManager.GetSysString(1211));
btnMark[0] = env->addButton(irr::core::recti(10, 10, 40, 40), wLinkMarks, -1, L"\u2196");
btnMark[1] = env->addButton(irr::core::recti(45, 10, 75, 40), wLinkMarks, -1, L"\u2191");
btnMark[2] = env->addButton(irr::core::recti(80, 10, 110, 40), wLinkMarks, -1, L"\u2197");
btnMark[3] = env->addButton(irr::core::recti(10, 45, 40, 75), wLinkMarks, -1, L"\u2190");
btnMark[4] = env->addButton(irr::core::recti(80, 45, 110, 75), wLinkMarks, -1, L"\u2192");
btnMark[5] = env->addButton(irr::core::recti(10, 80, 40, 110), wLinkMarks, -1, L"\u2199");
btnMark[6] = env->addButton(irr::core::recti(45, 80, 75, 110), wLinkMarks, -1, L"\u2193");
btnMark[7] = env->addButton(irr::core::recti(80, 80, 110, 110), wLinkMarks, -1, L"\u2198");
for(int i=0;i<8;i++)
btnMark[i]->setIsPushButton(true);
//replay window
......@@ -1903,8 +1903,8 @@ void Game::OnResize() {
btnClearFilter->setRelativePosition(Resize(205, 80 + 125 / 6, 255, 100 + 125 / 6));
btnMarksFilter->setRelativePosition(Resize(60, 80 + 125 / 6, 195, 100 + 125 / 6));
recti btncatepos = btnEffectFilter->getAbsolutePosition();
wCategories->setRelativePosition(recti(
irr::core::recti btncatepos = btnEffectFilter->getAbsolutePosition();
wCategories->setRelativePosition(irr::core::recti(
btncatepos.LowerRightCorner.X - wCategories->getRelativePosition().getWidth(),
btncatepos.LowerRightCorner.Y - btncatepos.getHeight() / 2,
btncatepos.LowerRightCorner.X,
......@@ -1953,12 +1953,12 @@ void Game::OnResize() {
stHintMsg->setRelativePosition(ResizeWin(660 - 160 * xScale, 60, 660 + 160 * xScale, 90));
//sound / music volume bar
scrSoundVolume->setRelativePosition(recti(scrSoundVolume->getRelativePosition().UpperLeftCorner.X, scrSoundVolume->getRelativePosition().UpperLeftCorner.Y, 20 + (300 * xScale) - 70, scrSoundVolume->getRelativePosition().LowerRightCorner.Y));
scrMusicVolume->setRelativePosition(recti(scrMusicVolume->getRelativePosition().UpperLeftCorner.X, scrMusicVolume->getRelativePosition().UpperLeftCorner.Y, 20 + (300 * xScale) - 70, scrMusicVolume->getRelativePosition().LowerRightCorner.Y));
scrSoundVolume->setRelativePosition(irr::core::recti(scrSoundVolume->getRelativePosition().UpperLeftCorner.X, scrSoundVolume->getRelativePosition().UpperLeftCorner.Y, 20 + (300 * xScale) - 70, scrSoundVolume->getRelativePosition().LowerRightCorner.Y));
scrMusicVolume->setRelativePosition(irr::core::recti(scrMusicVolume->getRelativePosition().UpperLeftCorner.X, scrMusicVolume->getRelativePosition().UpperLeftCorner.Y, 20 + (300 * xScale) - 70, scrMusicVolume->getRelativePosition().LowerRightCorner.Y));
recti tabHelperPos = recti(0, 0, 300 * xScale - 50, 365 * yScale - 65);
irr::core::recti tabHelperPos = irr::core::recti(0, 0, 300 * xScale - 50, 365 * yScale - 65);
tabHelper->setRelativePosition(tabHelperPos);
scrTabHelper->setRelativePosition(recti(tabHelperPos.LowerRightCorner.X + 2, 0, tabHelperPos.LowerRightCorner.X + 22, tabHelperPos.LowerRightCorner.Y));
scrTabHelper->setRelativePosition(irr::core::recti(tabHelperPos.LowerRightCorner.X + 2, 0, tabHelperPos.LowerRightCorner.X + 22, tabHelperPos.LowerRightCorner.Y));
s32 tabHelperLastY = elmTabHelperLast->getRelativePosition().LowerRightCorner.Y;
if(tabHelperLastY > tabHelperPos.LowerRightCorner.Y) {
scrTabHelper->setMax(tabHelperLastY - tabHelperPos.LowerRightCorner.Y + 5);
......@@ -1968,9 +1968,9 @@ void Game::OnResize() {
else
scrTabHelper->setVisible(false);
recti tabSystemPos = recti(0, 0, 300 * xScale - 50, 365 * yScale - 65);
irr::core::recti tabSystemPos = irr::core::recti(0, 0, 300 * xScale - 50, 365 * yScale - 65);
tabSystem->setRelativePosition(tabSystemPos);
scrTabSystem->setRelativePosition(recti(tabSystemPos.LowerRightCorner.X + 2, 0, tabSystemPos.LowerRightCorner.X + 22, tabSystemPos.LowerRightCorner.Y));
scrTabSystem->setRelativePosition(irr::core::recti(tabSystemPos.LowerRightCorner.X + 2, 0, tabSystemPos.LowerRightCorner.X + 22, tabSystemPos.LowerRightCorner.Y));
s32 tabSystemLastY = elmTabSystemLast->getRelativePosition().LowerRightCorner.Y;
if(tabSystemLastY > tabSystemPos.LowerRightCorner.Y) {
scrTabSystem->setMax(tabSystemLastY - tabSystemPos.LowerRightCorner.Y + 5);
......@@ -1982,24 +1982,24 @@ void Game::OnResize() {
if(gameConf.resize_popup_menu) {
int width = 100 * xScale;
int height = (yScale >= 0.666) ? 21 * yScale : 14;
wCmdMenu->setRelativePosition(recti(1, 1, width + 1, 1));
btnActivate->setRelativePosition(recti(1, 1, width, height));
btnSummon->setRelativePosition(recti(1, 1, width, height));
btnSPSummon->setRelativePosition(recti(1, 1, width, height));
btnMSet->setRelativePosition(recti(1, 1, width, height));
btnSSet->setRelativePosition(recti(1, 1, width, height));
btnRepos->setRelativePosition(recti(1, 1, width, height));
btnAttack->setRelativePosition(recti(1, 1, width, height));
btnActivate->setRelativePosition(recti(1, 1, width, height));
btnShowList->setRelativePosition(recti(1, 1, width, height));
btnOperation->setRelativePosition(recti(1, 1, width, height));
btnReset->setRelativePosition(recti(1, 1, width, height));
wCmdMenu->setRelativePosition(irr::core::recti(1, 1, width + 1, 1));
btnActivate->setRelativePosition(irr::core::recti(1, 1, width, height));
btnSummon->setRelativePosition(irr::core::recti(1, 1, width, height));
btnSPSummon->setRelativePosition(irr::core::recti(1, 1, width, height));
btnMSet->setRelativePosition(irr::core::recti(1, 1, width, height));
btnSSet->setRelativePosition(irr::core::recti(1, 1, width, height));
btnRepos->setRelativePosition(irr::core::recti(1, 1, width, height));
btnAttack->setRelativePosition(irr::core::recti(1, 1, width, height));
btnActivate->setRelativePosition(irr::core::recti(1, 1, width, height));
btnShowList->setRelativePosition(irr::core::recti(1, 1, width, height));
btnOperation->setRelativePosition(irr::core::recti(1, 1, width, height));
btnReset->setRelativePosition(irr::core::recti(1, 1, width, height));
}
wCardImg->setRelativePosition(ResizeCardImgWin(1, 1, 20, 18));
imgCard->setRelativePosition(ResizeCardImgWin(10, 9, 0, 0));
wInfos->setRelativePosition(Resize(1, 275, 301, 639));
stName->setRelativePosition(recti(10, 10, 300 * xScale - 13, 10 + 22));
stName->setRelativePosition(irr::core::recti(10, 10, 300 * xScale - 13, 10 + 22));
lstLog->setRelativePosition(Resize(10, 10, 290, 290));
if(showingcode)
ShowCardInfo(showingcode, true);
......@@ -2039,22 +2039,22 @@ void Game::OnResize() {
void Game::ResizeChatInputWindow() {
s32 x = wInfos->getRelativePosition().LowerRightCorner.X + 6;
if(is_building) x = 802 * xScale;
wChat->setRelativePosition(recti(x, window_size.Height - 25, window_size.Width, window_size.Height));
ebChatInput->setRelativePosition(recti(3, 2, window_size.Width - wChat->getRelativePosition().UpperLeftCorner.X - 6, 22));
wChat->setRelativePosition(irr::core::recti(x, window_size.Height - 25, window_size.Width, window_size.Height));
ebChatInput->setRelativePosition(irr::core::recti(3, 2, window_size.Width - wChat->getRelativePosition().UpperLeftCorner.X - 6, 22));
}
recti Game::Resize(s32 x, s32 y, s32 x2, s32 y2) {
irr::core::recti Game::Resize(s32 x, s32 y, s32 x2, s32 y2) {
x = x * xScale;
y = y * yScale;
x2 = x2 * xScale;
y2 = y2 * yScale;
return recti(x, y, x2, y2);
return irr::core::recti(x, y, x2, y2);
}
recti Game::Resize(s32 x, s32 y, s32 x2, s32 y2, s32 dx, s32 dy, s32 dx2, s32 dy2) {
irr::core::recti Game::Resize(s32 x, s32 y, s32 x2, s32 y2, s32 dx, s32 dy, s32 dx2, s32 dy2) {
x = x * xScale + dx;
y = y * yScale + dy;
x2 = x2 * xScale + dx2;
y2 = y2 * yScale + dy2;
return recti(x, y, x2, y2);
return irr::core::recti(x, y, x2, y2);
}
irr::core::vector2di Game::Resize(s32 x, s32 y) {
x = x * xScale;
......@@ -2066,23 +2066,23 @@ irr::core::vector2di Game::ResizeReverse(s32 x, s32 y) {
y = y / yScale;
return irr::core::vector2di(x, y);
}
recti Game::ResizeWin(s32 x, s32 y, s32 x2, s32 y2) {
irr::core::recti Game::ResizeWin(s32 x, s32 y, s32 x2, s32 y2) {
s32 w = x2 - x;
s32 h = y2 - y;
x = (x + w / 2) * xScale - w / 2;
y = (y + h / 2) * yScale - h / 2;
x2 = w + x;
y2 = h + y;
return recti(x, y, x2, y2);
return irr::core::recti(x, y, x2, y2);
}
recti Game::ResizePhaseHint(s32 x, s32 y, s32 x2, s32 y2, s32 width) {
irr::core::recti Game::ResizePhaseHint(s32 x, s32 y, s32 x2, s32 y2, s32 width) {
x = x * xScale - width / 2;
y = y * yScale;
x2 = x2 * xScale;
y2 = y2 * yScale;
return recti(x, y, x2, y2);
return irr::core::recti(x, y, x2, y2);
}
recti Game::ResizeCardImgWin(s32 x, s32 y, s32 mx, s32 my) {
irr::core::recti Game::ResizeCardImgWin(s32 x, s32 y, s32 mx, s32 my) {
float mul = xScale;
if(xScale > yScale)
mul = yScale;
......@@ -2090,15 +2090,15 @@ recti Game::ResizeCardImgWin(s32 x, s32 y, s32 mx, s32 my) {
s32 h = CARD_IMG_HEIGHT * mul + my * yScale;
x = x * xScale;
y = y * yScale;
return recti(x, y, x + w, y + h);
return irr::core::recti(x, y, x + w, y + h);
}
recti Game::ResizeCardHint(s32 x, s32 y, s32 x2, s32 y2) {
irr::core::recti Game::ResizeCardHint(s32 x, s32 y, s32 x2, s32 y2) {
return ResizeCardMid(x, y, x2, y2, (x + x2) * 0.5, (y + y2) * 0.5);
}
irr::core::vector2di Game::ResizeCardHint(s32 x, s32 y) {
return ResizeCardMid(x, y, x + CARD_IMG_WIDTH * 0.5, y + CARD_IMG_HEIGHT * 0.5);
}
recti Game::ResizeCardMid(s32 x, s32 y, s32 x2, s32 y2, s32 midx, s32 midy) {
irr::core::recti Game::ResizeCardMid(s32 x, s32 y, s32 x2, s32 y2, s32 midx, s32 midy) {
float mul = xScale;
if(xScale > yScale)
mul = yScale;
......@@ -2108,7 +2108,7 @@ recti Game::ResizeCardMid(s32 x, s32 y, s32 x2, s32 y2, s32 midx, s32 midy) {
y = cy + (y - midy) * mul;
x2 = cx + (x2 - midx) * mul;
y2 = cy + (y2 - midy) * mul;
return recti(x, y, x2, y2);
return irr::core::recti(x, y, x2, y2);
}
irr::core::vector2di Game::ResizeCardMid(s32 x, s32 y, s32 midx, s32 midy) {
float mul = xScale;
......@@ -2120,7 +2120,7 @@ irr::core::vector2di Game::ResizeCardMid(s32 x, s32 y, s32 midx, s32 midy) {
y = cy + (y - midy) * mul;
return irr::core::vector2di(x, y);
}
recti Game::ResizeFit(s32 x, s32 y, s32 x2, s32 y2) {
irr::core::recti Game::ResizeFit(s32 x, s32 y, s32 x2, s32 y2) {
float mul = xScale;
if(xScale > yScale)
mul = yScale;
......@@ -2128,7 +2128,7 @@ recti Game::ResizeFit(s32 x, s32 y, s32 x2, s32 y2) {
y = y * mul;
x2 = x2 * mul;
y2 = y2 * mul;
return recti(x, y, x2, y2);
return irr::core::recti(x, y, x2, y2);
}
void Game::SetWindowsIcon() {
#ifdef _WIN32
......
......@@ -204,18 +204,18 @@ public:
void OnResize();
void ResizeChatInputWindow();
recti Resize(s32 x, s32 y, s32 x2, s32 y2);
recti Resize(s32 x, s32 y, s32 x2, s32 y2, s32 dx, s32 dy, s32 dx2, s32 dy2);
irr::core::recti Resize(s32 x, s32 y, s32 x2, s32 y2);
irr::core::recti Resize(s32 x, s32 y, s32 x2, s32 y2, s32 dx, s32 dy, s32 dx2, s32 dy2);
irr::core::vector2di Resize(s32 x, s32 y);
irr::core::vector2di ResizeReverse(s32 x, s32 y);
recti ResizePhaseHint(s32 x, s32 y, s32 x2, s32 y2, s32 width);
recti ResizeWin(s32 x, s32 y, s32 x2, s32 y2);
recti ResizeCardImgWin(s32 x, s32 y, s32 mx, s32 my);
recti ResizeCardHint(s32 x, s32 y, s32 x2, s32 y2);
irr::core::recti ResizePhaseHint(s32 x, s32 y, s32 x2, s32 y2, s32 width);
irr::core::recti ResizeWin(s32 x, s32 y, s32 x2, s32 y2);
irr::core::recti ResizeCardImgWin(s32 x, s32 y, s32 mx, s32 my);
irr::core::recti ResizeCardHint(s32 x, s32 y, s32 x2, s32 y2);
irr::core::vector2di ResizeCardHint(s32 x, s32 y);
recti ResizeCardMid(s32 x, s32 y, s32 x2, s32 y2, s32 midx, s32 midy);
irr::core::recti ResizeCardMid(s32 x, s32 y, s32 x2, s32 y2, s32 midx, s32 midy);
irr::core::vector2di ResizeCardMid(s32 x, s32 y, s32 midx, s32 midy);
recti ResizeFit(s32 x, s32 y, s32 x2, s32 y2);
irr::core::recti ResizeFit(s32 x, s32 y, s32 x2, s32 y2);
void SetWindowsIcon();
void SetWindowsScale(float scale);
......
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