Commit 4db0b84f authored by mercury233's avatar mercury233 Committed by GitHub

Merge pull request #1949 from edo9300/patch

Added DrawLinkedZones()
parents 6344b48c 723bdccd
......@@ -163,8 +163,13 @@ void Game::DrawBackGround() {
S3DVertex *vertex = 0;
if (dField.hovered_location == LOCATION_DECK)
vertex = matManager.vFieldDeck[dField.hovered_controler];
else if (dField.hovered_location == LOCATION_MZONE)
else if (dField.hovered_location == LOCATION_MZONE) {
vertex = matManager.vFieldMzone[dField.hovered_controler][dField.hovered_sequence];
ClientCard* pcard = mainGame->dField.mzone[dField.hovered_controler][dField.hovered_sequence];
if(pcard && pcard->type & TYPE_LINK) {
DrawLinkedZones(pcard);
}
}
else if (dField.hovered_location == LOCATION_SZONE)
vertex = matManager.vFieldSzone[dField.hovered_controler][dField.hovered_sequence];
else if (dField.hovered_location == LOCATION_GRAVE)
......@@ -188,6 +193,36 @@ void Game::DrawBackGround() {
driver->drawVertexPrimitiveList(vertex, 4, matManager.iRectangle, 2);
}
}
void Game::DrawLinkedZones(ClientCard* pcard) {
int mark = pcard->link_marker;
matManager.mSelField.AmbientColor = 0xff0261a2;
driver->setMaterial(matManager.mSelField);
if (dField.hovered_sequence<5) {
if (mark & LINK_MARKER_LEFT && dField.hovered_sequence>0)
driver->drawVertexPrimitiveList(&matManager.vFieldMzone[dField.hovered_controler][dField.hovered_sequence - 1], 4, matManager.iRectangle, 2);
if (mark & LINK_MARKER_RIGHT && dField.hovered_sequence<4)
driver->drawVertexPrimitiveList(&matManager.vFieldMzone[dField.hovered_controler][dField.hovered_sequence + 1], 4, matManager.iRectangle, 2);
if ((mark & LINK_MARKER_TOP_LEFT && dField.hovered_sequence == 2) || (mark & LINK_MARKER_TOP && dField.hovered_sequence == 1) || (mark & LINK_MARKER_TOP_RIGHT && dField.hovered_sequence == 0))
driver->drawVertexPrimitiveList(&matManager.vFieldMzone[dField.hovered_controler][5], 4, matManager.iRectangle, 2);
if ((mark & LINK_MARKER_TOP_LEFT && dField.hovered_sequence == 4) || (mark & LINK_MARKER_TOP && dField.hovered_sequence == 3) || (mark & LINK_MARKER_TOP_RIGHT && dField.hovered_sequence == 2))
driver->drawVertexPrimitiveList(&matManager.vFieldMzone[dField.hovered_controler][6], 4, matManager.iRectangle, 2);
}
else {
int swap = (dField.hovered_sequence == 5) ? 0 : 2;
if (mark & LINK_MARKER_BOTTOM_LEFT)
driver->drawVertexPrimitiveList(&matManager.vFieldMzone[dField.hovered_controler][0 + swap], 4, matManager.iRectangle, 2);
if (mark & LINK_MARKER_BOTTOM)
driver->drawVertexPrimitiveList(&matManager.vFieldMzone[dField.hovered_controler][1 + swap], 4, matManager.iRectangle, 2);
if (mark & LINK_MARKER_BOTTOM_RIGHT)
driver->drawVertexPrimitiveList(&matManager.vFieldMzone[dField.hovered_controler][2 + swap], 4, matManager.iRectangle, 2);
if (mark & LINK_MARKER_TOP_LEFT)
driver->drawVertexPrimitiveList(&matManager.vFieldMzone[1 - dField.hovered_controler][4 - swap], 4, matManager.iRectangle, 2);
if (mark & LINK_MARKER_TOP)
driver->drawVertexPrimitiveList(&matManager.vFieldMzone[1 - dField.hovered_controler][3 - swap], 4, matManager.iRectangle, 2);
if (mark & LINK_MARKER_TOP_RIGHT)
driver->drawVertexPrimitiveList(&matManager.vFieldMzone[1 - dField.hovered_controler][2 - swap], 4, matManager.iRectangle, 2);
}
}
void Game::DrawCards() {
for(int p = 0; p < 2; ++p) {
for(auto it = dField.mzone[p].begin(); it != dField.mzone[p].end(); ++it)
......
......@@ -88,6 +88,7 @@ public:
void RefreshSingleplay();
void DrawSelectionLine(irr::video::S3DVertex* vec, bool strip, int width, float* cv);
void DrawBackGround();
void DrawLinkedZones(ClientCard* pcard);
void DrawCards();
void DrawCard(ClientCard* pcard);
void DrawMisc();
......
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