diff --git a/projects/mtg/include/CarouselDeckView.h b/projects/mtg/include/CarouselDeckView.h index 7514ed62d..f5dce5fc5 100644 --- a/projects/mtg/include/CarouselDeckView.h +++ b/projects/mtg/include/CarouselDeckView.h @@ -23,7 +23,7 @@ public: void renderCard(int index) { int alpha = (int) (255 * (mCards[index].scale + 1.0 - max_scale)); - DeckView::renderCard(index, alpha); + DeckView::renderCard(index, alpha, false, true); } void Render(); diff --git a/projects/mtg/include/DeckView.h b/projects/mtg/include/DeckView.h index 7feec1226..10ff6161b 100644 --- a/projects/mtg/include/DeckView.h +++ b/projects/mtg/include/DeckView.h @@ -207,7 +207,7 @@ protected: * * \see mCards */ - void renderCard(int index, int alpha, bool asThumbnail = false); + void renderCard(int index, int alpha, bool asThumbnail = false, bool addWHborder = false); /*! \brief Returns the index in mCards of the card that is nearest to the given point * diff --git a/projects/mtg/src/CardGui.cpp b/projects/mtg/src/CardGui.cpp index 56a79293f..06f3a30df 100644 --- a/projects/mtg/src/CardGui.cpp +++ b/projects/mtg/src/CardGui.cpp @@ -1145,20 +1145,16 @@ void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder { if(cardsetname == "2ED"||cardsetname == "RV"||cardsetname == "4ED"||cardsetname == "5ED"||cardsetname == "6ED"||cardsetname == "7ED"||cardsetname == "8ED"||cardsetname == "9ED"||cardsetname == "CHR"||cardsetname == "DM") { - //like white border - renderer->FillRoundRect(x-92,pos.actY-130, (scale * quad->mWidth)-10, (scale * quad->mHeight)-11, 9.0f,ARGB(255,248,248,255)); - //black thin line to simulate card edge - renderer->DrawRoundRect(x-92,pos.actY-130, (scale * quad->mWidth)-10, (scale * quad->mHeight)-11, 9.0f,ARGB(150,20,20,20)); + JRenderer::GetInstance()->FillRoundRect((pos.actX - (pos.actZ * 84.f))-10.f,(pos.actY - (pos.actZ * 119.7f))-12.5f,pos.actZ * 168.f + 6.5f,pos.actZ * 239.4f + 12.f,6.5f,ARGB(255,248,248,255)); + JRenderer::GetInstance()->DrawRoundRect((pos.actX - (pos.actZ * 84.f))-10.f,(pos.actY - (pos.actZ * 119.7f))-12.5f,pos.actZ * 168.f + 6.5f,pos.actZ * 239.4f + 12.f,6.5f,ARGB(150,20,20,20)); } else { - //like black border - renderer->FillRoundRect(x-92,pos.actY-130, (scale * quad->mWidth)-10, (scale * quad->mHeight)-11, 9.0f,ARGB(255,10,10,10)); - //white thin line to simulate card edge - renderer->DrawRoundRect(x-92,pos.actY-130, (scale * quad->mWidth)-10, (scale * quad->mHeight)-11, 9.0f,ARGB(50,240,240,240)); + JRenderer::GetInstance()->FillRoundRect((pos.actX - (pos.actZ * 84.f))-10.f,(pos.actY - (pos.actZ * 119.7f))-12.5f,pos.actZ * 168.f + 6.5f,pos.actZ * 239.4f + 12.f,6.5f,ARGB(255,5,5,5)); + JRenderer::GetInstance()->DrawRoundRect((pos.actX - (pos.actZ * 84.f))-10.f,(pos.actY - (pos.actZ * 119.7f))-12.5f,pos.actZ * 168.f + 6.5f,pos.actZ * 239.4f + 12.f,6.5f,ARGB(50,240,240,240)); } //render card image - renderer->RenderQuad(quad.get(), x, pos.actY-2, pos.actT, scale-0.02f, scale-0.02f); + renderer->RenderQuad(quad.get(), x, pos.actY, pos.actT, scale, scale); } else renderer->RenderQuad(quad.get(), x, pos.actY, pos.actT, scale, scale); diff --git a/projects/mtg/src/DeckView.cpp b/projects/mtg/src/DeckView.cpp index 43a06dd30..a18424a9a 100644 --- a/projects/mtg/src/DeckView.cpp +++ b/projects/mtg/src/DeckView.cpp @@ -93,7 +93,7 @@ void DeckView::reloadIndexes() } } -void DeckView::renderCard(int index, int alpha, bool asThumbnail) +void DeckView::renderCard(int index, int alpha, bool asThumbnail, bool addWHborder) { WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT); @@ -146,17 +146,18 @@ void DeckView::renderCard(int index, int alpha, bool asThumbnail) else {//NORMAL VIEW WITH IMAGES int mode = !options[Options::DISABLECARDS].number ? DrawMode::kNormal : DrawMode::kText; + float modx = addWHborder ? 2.0f:0.0f; //border for editor && others??? string cardsetname = setlist[cardPosition.card->setId].c_str(); if(cardsetname == "2ED"||cardsetname == "RV"||cardsetname == "4ED"||cardsetname == "5ED"||cardsetname == "6ED"||cardsetname == "7ED"||cardsetname == "8ED"||cardsetname == "9ED"||cardsetname == "CHR"||cardsetname == "DM") { - JRenderer::GetInstance()->FillRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-5.f,(cardPosition.y - cardPosition.scale * 142.5f)-5.f,cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f,ARGB(255,248,248,255)); - JRenderer::GetInstance()->DrawRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-5.f,(cardPosition.y - cardPosition.scale * 142.5f)-5.f,cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f,ARGB(150,20,20,20)); + JRenderer::GetInstance()->FillRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-(5.f+modx),(cardPosition.y - cardPosition.scale * 142.5f)-(5.f+modx),cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f+modx,ARGB(255,248,248,255)); + JRenderer::GetInstance()->DrawRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-(5.f+modx),(cardPosition.y - cardPosition.scale * 142.5f)-(5.f+modx),cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f+modx,ARGB(150,20,20,20)); } else { - JRenderer::GetInstance()->FillRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-5.f,(cardPosition.y - cardPosition.scale * 142.5f)-5.f,cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f,ARGB(255,10,10,10)); - JRenderer::GetInstance()->DrawRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-5.f,(cardPosition.y - cardPosition.scale * 142.5f)-5.f,cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f,ARGB(50,240,240,240)); + JRenderer::GetInstance()->FillRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-(5.f+modx),(cardPosition.y - cardPosition.scale * 142.5f)-(5.f+modx),cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f+modx,ARGB(255,10,10,10)); + JRenderer::GetInstance()->DrawRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-(5.f+modx),(cardPosition.y - cardPosition.scale * 142.5f)-(5.f+modx),cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f+modx,ARGB(50,240,240,240)); } Pos pos = Pos(cardPosition.x, cardPosition.y, cardPosition.scale * 285 / 250, 0.0, 255); CardGui::DrawCard(cardPosition.card, pos, mode, asThumbnail, true);