diff --git a/projects/mtg/include/CardGui.h b/projects/mtg/include/CardGui.h index 4ef10700b..cea1cf5e5 100644 --- a/projects/mtg/include/CardGui.h +++ b/projects/mtg/include/CardGui.h @@ -33,7 +33,7 @@ protected: /* ** Tries to render the Big version of a card picture, backups to text version in case of failure */ - static void RenderBig(MTGCard * card, const Pos& pos, bool thumb = false, bool noborder = false); + static void RenderBig(MTGCard * card, const Pos& pos, bool thumb = false, bool noborder = false, bool gdv = false); static void RenderCountersBig(MTGCard * card, const Pos& pos, int drawMode = DrawMode::kNormal); static void AlternateRender(MTGCard * card, const Pos& pos); @@ -55,8 +55,8 @@ public: virtual void Render(); virtual void Update(float dt); - void DrawCard(const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false, bool noborder = false); - static void DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false, bool noborder = false); + void DrawCard(const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false, bool noborder = false, bool gdv = false); + static void DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false, bool noborder = false, bool gdv = false); static JQuadPtr AlternateThumbQuad(MTGCard * card); virtual ostream& toString(ostream&) const; diff --git a/projects/mtg/include/DeckView.h b/projects/mtg/include/DeckView.h index 7feec1226..6cf0b9bf9 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 griddeckview = 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 c5e815d99..1348d4afb 100644 --- a/projects/mtg/src/CardGui.cpp +++ b/projects/mtg/src/CardGui.cpp @@ -111,17 +111,17 @@ void CardGui::Update(float dt) PlayGuiObject::Update(dt); } -void CardGui::DrawCard(const Pos& inPosition, int inMode, bool thumb, bool noborder) +void CardGui::DrawCard(const Pos& inPosition, int inMode, bool thumb, bool noborder, bool gdv) { DrawCard(card, inPosition, inMode, thumb, noborder); } -void CardGui::DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode, bool thumb, bool noborder) +void CardGui::DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode, bool thumb, bool noborder, bool gdv) { switch (inMode) { case DrawMode::kNormal: - RenderBig(inCard, inPosition, thumb, noborder); + RenderBig(inCard, inPosition, thumb, noborder, gdv); break; case DrawMode::kText: AlternateRender(inCard, inPosition); @@ -596,19 +596,19 @@ void CardGui::AlternateRender(MTGCard * card, const Pos& pos) items.clear(); if (q.get() && q->mTex) { - //test - //draw black border ingame only if(thiscard && thiscard->getObserver()) { zpos = thiscard->zpos; - renderer->FillRoundRect((pos.actX - (pos.actZ * 84.f))-11.5f,(pos.actY - (pos.actZ * 119.7f))-14.f,pos.actZ * 168.f + 6.5f,pos.actZ * 239.4f + 12.f,8.f,ARGB(255,5,5,5)); - renderer->DrawRoundRect((pos.actX - (pos.actZ * 84.f))-11.5f,(pos.actY - (pos.actZ * 119.7f))-14.f,pos.actZ * 168.f + 6.5f,pos.actZ * 239.4f + 12.f,8.f,ARGB(50,240,240,240)); } q->SetHotSpot(static_cast (q->mTex->mWidth / 2), static_cast (q->mTex->mHeight / 2)); float scale = pos.actZ * 250 / q->mHeight; q->SetColor(ARGB((int)pos.actA,255,255,255)); + //new border + renderer->FillRoundRect(pos.actX - (scale * q->mWidth / 2)-5.8f,pos.actY - (scale * q->mHeight / 2)-5.8f, (scale * q->mWidth)-0.02f, (scale * q->mHeight)-0.02f, 5.8f,ARGB(255,5,5,5)); + renderer->DrawRoundRect(pos.actX - (scale * q->mWidth / 2)-5.8f,pos.actY - (scale * q->mHeight / 2)-5.8f, (scale * q->mWidth)-0.02f, (scale * q->mHeight)-0.02f, 5.8f,ARGB(50,240,240,240)); + //end renderer->RenderQuad(q.get(), x, pos.actY, pos.actT, scale, scale); } @@ -1170,7 +1170,7 @@ void CardGui::TinyCropRender(MTGCard * card, const Pos& pos, JQuad * quad) } //Renders a big card on screen. Defaults to the "alternate" rendering if no image is found -void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder) +void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder, bool gdv) { JRenderer * renderer = JRenderer::GetInstance(); //GameObserver * game = GameObserver::GetInstance(); @@ -1217,7 +1217,7 @@ void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder float scale = pos.actZ * 250.f / quad->mHeight; //init setname string cardsetname = setlist[card->setId].c_str(); - if(!noborder) + /*if(!noborder) { if(cardsetname == "2ED"||cardsetname == "RV"||cardsetname == "4ED"||cardsetname == "5ED"||cardsetname == "6ED"||cardsetname == "7ED"||cardsetname == "8ED"||cardsetname == "9ED"||cardsetname == "CHR"||cardsetname == "DM") {//Draw white border @@ -1238,7 +1238,19 @@ void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder renderer->DrawRoundRect((pos.actX - (pos.actZ * 84.f))-11.5f,(pos.actY - (pos.actZ * 119.7f))-14.f,pos.actZ * 168.f + 6.5f,pos.actZ * 239.4f + 12.f,8.f,ARGB(50,240,240,240)); } } + }*///disabled this for universal border across game, deck editor, etc... + //universal border + if(cardsetname == "2ED"||cardsetname == "RV"||cardsetname == "4ED"||cardsetname == "5ED"||cardsetname == "6ED"||cardsetname == "7ED"||cardsetname == "8ED"||cardsetname == "9ED"||cardsetname == "CHR"||cardsetname == "DM") + {//white border + renderer->FillRoundRect(pos.actX - (scale * quad->mWidth / 2)-6.f,pos.actY - (scale * quad->mHeight / 2)-5.8f, (scale * quad->mWidth)-0.02f, (scale * quad->mHeight)-0.02f, 5.8f,ARGB(255,248,248,255)); + renderer->DrawRoundRect(pos.actX - (scale * quad->mWidth / 2)-6.f,pos.actY - (scale * quad->mHeight / 2)-5.8f, (scale * quad->mWidth)-0.02f, (scale * quad->mHeight)-0.02f, 5.8f,ARGB(150,20,20,20)); } + else + {//black border + renderer->FillRoundRect(pos.actX - (scale * quad->mWidth / 2)-6.f,pos.actY - (scale * quad->mHeight / 2)-5.8f, (scale * quad->mWidth)-0.02f, (scale * quad->mHeight)-0.02f, 5.8f,ARGB(255,5,5,5)); + renderer->DrawRoundRect(pos.actX - (scale * quad->mWidth / 2)-6.f,pos.actY - (scale * quad->mHeight / 2)-5.8f, (scale * quad->mWidth)-0.02f, (scale * quad->mHeight)-0.02f, 5.8f,ARGB(50,240,240,240)); + } + //end new border //draw inner border if(cardsetname == "LEA"||cardsetname == "LEB") { @@ -1250,9 +1262,10 @@ void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder renderer->RenderQuad(alphabeta.get(), x, pos.actY+0.2f, pos.actT, myscale, myscale); } } - float modxscale = (cardsetname =="UNH")?0.02f:0.0f; - float modyscale = (cardsetname =="UNH")?0.015f:0.0f; - renderer->RenderQuad(quad.get(), x, pos.actY, pos.actT, scale+modxscale, scale+modyscale); + float modxscale = (cardsetname =="UNH")?0.015f:0.0f; + float modyscale = (cardsetname =="UNH")?0.010f:0.0f; + float gdvadd = gdv?0.008f:0.0f;//scale add grid deck view + renderer->RenderQuad(quad.get(), x, pos.actY, pos.actT, (scale-0.005f)+modxscale+gdvadd, (scale-0.005f)+modyscale+gdvadd); RenderCountersBig(card, pos); return; diff --git a/projects/mtg/src/DeckView.cpp b/projects/mtg/src/DeckView.cpp index 43a06dd30..a184d1d93 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 griddeckview) { WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT); @@ -146,7 +146,7 @@ void DeckView::renderCard(int index, int alpha, bool asThumbnail) else {//NORMAL VIEW WITH IMAGES int mode = !options[Options::DISABLECARDS].number ? DrawMode::kNormal : DrawMode::kText; - //border for editor && others??? + /*//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") { @@ -157,9 +157,9 @@ void DeckView::renderCard(int index, int alpha, bool asThumbnail) { 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)); - } + }*///disabled this for universal border Pos pos = Pos(cardPosition.x, cardPosition.y, cardPosition.scale * 285 / 250, 0.0, 255); - CardGui::DrawCard(cardPosition.card, pos, mode, asThumbnail, true); + CardGui::DrawCard(cardPosition.card, pos, mode, asThumbnail, true, griddeckview); } int quadAlpha = alpha; if (!deck()->count(cardPosition.card)) quadAlpha /= 2; diff --git a/projects/mtg/src/GridDeckView.cpp b/projects/mtg/src/GridDeckView.cpp index 032230ac9..d93035e15 100644 --- a/projects/mtg/src/GridDeckView.cpp +++ b/projects/mtg/src/GridDeckView.cpp @@ -132,9 +132,9 @@ void GridDeckView::Render() #endif } #if !defined (PSP) - renderCard(i, 255, false);//for psp, use lowres images if you can. + renderCard(i, 255, false, true);//for psp, use lowres images if you can. #else - renderCard(i, 255, true); + renderCard(i, 255, true, true); #endif } else