replaced some overlay

This commit is contained in:
Anthony Calosa
2017-03-04 04:24:40 +08:00
parent 9512e5c3db
commit 9c10574e49
+49 -4
View File
@@ -196,9 +196,12 @@ void GuiGameZone::Render()
{ {
//Texture //Texture
JQuadPtr quad = WResourceManager::Instance()->GetQuad(kGenericCardThumbnailID); JQuadPtr quad = WResourceManager::Instance()->GetQuad(kGenericCardThumbnailID);
JQuadPtr overlay;
float scale = defaultHeight / quad->mHeight; float scale = defaultHeight / quad->mHeight;
float scale2 = scale;
float modx = 0; float modx = 0;
float mody = 0; float mody = 0;
bool replaced = false; bool replaced = false;
bool showtop = (zone && zone->owner->game->battlefield->nb_cards && zone->owner->game->battlefield->hasAbility(Constants::SHOWFROMTOPLIBRARY))?true:false; bool showtop = (zone && zone->owner->game->battlefield->nb_cards && zone->owner->game->battlefield->hasAbility(Constants::SHOWFROMTOPLIBRARY))?true:false;
bool showopponenttop = (zone && zone->owner->opponent()->game->battlefield->nb_cards && zone->owner->opponent()->game->battlefield->hasAbility(Constants::SHOWOPPONENTTOPLIBRARY))?true:false; bool showopponenttop = (zone && zone->owner->opponent()->game->battlefield->nb_cards && zone->owner->opponent()->game->battlefield->hasAbility(Constants::SHOWOPPONENTTOPLIBRARY))?true:false;
@@ -209,6 +212,46 @@ void GuiGameZone::Render()
quad->SetColor(ARGB((int)(actA),255,240,255)); quad->SetColor(ARGB((int)(actA),255,240,255));
} }
//overlay
JQuadPtr iconcard = WResourceManager::Instance()->RetrieveTempQuad("iconcard.png");
JQuadPtr iconhand = WResourceManager::Instance()->RetrieveTempQuad("iconhand.png");
JQuadPtr iconlibrary = WResourceManager::Instance()->RetrieveTempQuad("iconlibrary.png");
JQuadPtr iconexile = WResourceManager::Instance()->RetrieveTempQuad("iconexile.png");
if(iconlibrary && type == GUI_LIBRARY)
{
scale2 = defaultHeight / iconlibrary->mHeight;
modx = -0.f;
mody = -2.f;
iconlibrary->SetColor(ARGB((int)(actA),255,255,255));
quad = iconlibrary;
}
if(iconhand && type == GUI_OPPONENTHAND)
{
scale2 = defaultHeight / iconhand->mHeight;
modx = -0.f;
mody = -2.f;
iconhand->SetColor(ARGB((int)(actA),255,255,255));
quad = iconhand;
}
if(iconcard && type == GUI_GRAVEYARD)
{
scale2 = defaultHeight / iconcard->mHeight;
modx = -0.f;
mody = -2.f;
iconcard->SetColor(ARGB((int)(actA),255,255,255));
quad = iconcard;
}
if(iconexile && type == GUI_EXILE)
{
scale2 = defaultHeight / iconexile->mHeight;
modx = -0.f;
mody = -2.f;
iconexile->SetColor(ARGB((int)(actA),255,255,255));
quad = iconexile;
}
//
if(type == GUI_LIBRARY && zone->nb_cards && !showCards) if(type == GUI_LIBRARY && zone->nb_cards && !showCards)
{ {
int top = zone->nb_cards - 1; int top = zone->nb_cards - 1;
@@ -227,7 +270,7 @@ void GuiGameZone::Render()
if(kquad) if(kquad)
{ {
kquad->SetColor(ARGB((int)(actA),255,255,255)); kquad->SetColor(ARGB((int)(actA),255,255,255));
scale = defaultHeight / kquad->mHeight; scale2 = defaultHeight / kquad->mHeight;
modx = (35/4)+1; modx = (35/4)+1;
mody = (50/4)+1; mody = (50/4)+1;
quad = kquad; quad = kquad;
@@ -238,7 +281,7 @@ void GuiGameZone::Render()
if(quad) if(quad)
{ {
quad->SetColor(ARGB((int)(actA),255,255,255)); quad->SetColor(ARGB((int)(actA),255,255,255));
scale = defaultHeight / quad->mHeight; scale2 = defaultHeight / quad->mHeight;
modx = (35/4)+1; modx = (35/4)+1;
mody = (50/4)+1; mody = (50/4)+1;
} }
@@ -250,7 +293,9 @@ void GuiGameZone::Render()
//render small card quad //render small card quad
if(quad) if(quad)
JRenderer::GetInstance()->RenderQuad(quad.get(), actX+modx, actY+mody, 0.0, scale * actZ, scale * actZ); JRenderer::GetInstance()->RenderQuad(quad.get(), actX+modx, actY+mody, 0.0, scale2 * actZ, scale2 * actZ);
/*if(overlay)
JRenderer::GetInstance()->RenderQuad(overlay.get(), actX, actY, 0.0, scale2 * actZ, scale2 * actZ);*/
float x0 = actX; float x0 = actX;
if (x0 < SCREEN_WIDTH / 2) if (x0 < SCREEN_WIDTH / 2)
@@ -261,7 +306,7 @@ void GuiGameZone::Render()
if (mHasFocus) if (mHasFocus)
{ {
if(!replaced) if(!replaced)
JRenderer::GetInstance()->FillRect(actX, actY, quad->mWidth * scale * actZ, quad->mHeight * scale * actZ, JRenderer::GetInstance()->FillRect(actX, actY, quad->mWidth * scale2 * actZ, quad->mHeight * scale2 * actZ,
ARGB(abs(128 - wave),255,255,255)); ARGB(abs(128 - wave),255,255,255));
} }