increase battlefield "hot area" size, opponent phase ring uses darker glyph vs human

This commit is contained in:
Anthony Calosa
2015-10-10 20:54:41 +08:00
parent 91053965be
commit 6376596e49
4 changed files with 13 additions and 7 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ private:
InOutQuadEasing zoomFactorEasing; InOutQuadEasing zoomFactorEasing;
DuelLayers* mpDuelLayers; DuelLayers* mpDuelLayers;
void DrawGlyph(JQuad *inQuad, int phaseId, float x, float y, float scale); void DrawGlyph(JQuad *inQuad, int phaseId, float x, float y, float scale, float z);
public: public:
GuiPhaseBar(DuelLayers* duelLayers); GuiPhaseBar(DuelLayers* duelLayers);
~GuiPhaseBar(); ~GuiPhaseBar();
+1 -1
View File
@@ -11,7 +11,7 @@ GuiFrame::GuiFrame(GameObserver* observer)
if (observer->getResourceManager()->GetTexture("wood.png")) if (observer->getResourceManager()->GetTexture("wood.png"))
{ {
wood = observer->getResourceManager()->RetrieveQuad("wood.png", 0, 0, 0, 0); wood = observer->getResourceManager()->RetrieveQuad("wood.png", 0, 0, 0, 0);
wood->mHeight =32.f; wood->mHeight = 32.f;
wood->mWidth = 480.f; wood->mWidth = 480.f;
} }
else else
+6 -3
View File
@@ -36,9 +36,9 @@ namespace
const unsigned kPhases = NB_MTG_PHASES - 2; //there are two phases we do not show const unsigned kPhases = NB_MTG_PHASES - 2; //there are two phases we do not show
} }
void GuiPhaseBar::DrawGlyph(JQuad *inQuad, int phaseId, float x, float y, float scale) void GuiPhaseBar::DrawGlyph(JQuad *inQuad, int phaseId, float x, float y, float scale, float z)
{ {
inQuad->SetTextureRect(phaseId * (kWidth + 1), 0, kWidth, kHeight); inQuad->SetTextureRect(phaseId * (kWidth + 1), z, kWidth, kHeight);
JRenderer::GetInstance()->RenderQuad(inQuad, x, y - scale * kWidth/2, 0.0f, scale, scale); JRenderer::GetInstance()->RenderQuad(inQuad, x, y - scale * kWidth/2, 0.0f, scale, scale);
} }
@@ -110,7 +110,10 @@ void GuiPhaseBar::Render()
//hint: sin(circPos + PI/2) = cos(circPos) //hint: sin(circPos + PI/2) = cos(circPos)
const float glyphScale = float(zoomFactor * cosf(circPos) * 0.5f); const float glyphScale = float(zoomFactor * cosf(circPos) * 0.5f);
DrawGlyph(quad.get(), (displayedPhaseId - 2 + i + kPhases) % kPhases, 0, glyphY, glyphScale); if (observer->currentPlayer && observer->currentPlayer->isAI() && !observer->currentPlayer->opponent()->isAI())
DrawGlyph(quad.get(), (displayedPhaseId - 2 + i + kPhases) % kPhases, 0, glyphY, glyphScale, 29);
else
DrawGlyph(quad.get(), (displayedPhaseId - 2 + i + kPhases) % kPhases, 0, glyphY, glyphScale, 0);
} }
//print phase name //print phase name
+5 -2
View File
@@ -106,7 +106,7 @@ GuiPlay::BattleField::BattleField() :
attackers(0), height(0.0), red(0), colorFlow(0) attackers(0), height(0.0), red(0), colorFlow(0)
{ {
} }
const float GuiPlay::BattleField::HEIGHT = 80.0f; const float GuiPlay::BattleField::HEIGHT = 146.0f;
void GuiPlay::BattleField::addAttacker(MTGCardInstance*) void GuiPlay::BattleField::addAttacker(MTGCardInstance*)
{ {
++attackers; ++attackers;
@@ -160,7 +160,10 @@ void GuiPlay::BattleField::Update(float dt)
void GuiPlay::BattleField::Render() void GuiPlay::BattleField::Render()
{ {
if (height > 3) if (height > 3)
JRenderer::GetInstance()->FillRect(44, SCREEN_HEIGHT / 2 + 10 - height / 2, 318, height, ARGB(127, red, 0, 0)); JRenderer::GetInstance()->FillRect(0, SCREEN_HEIGHT / 2 + 10 - height / 2, 480, height, ARGB(127, red, 0, 0));
//JQuadPtr fillblack = WResourceManager::Instance()->RetrieveTempQuad("fillblack.png", TEXTURE_SUB_5551);
//if (fillblack.get() && height > 3)//mask
//JRenderer::GetInstance()->RenderQuad(fillblack.get(), 0, 70.f, 0, 0.5f, 0.5f);
} }
GuiPlay::GuiPlay(DuelLayers* view) : GuiPlay::GuiPlay(DuelLayers* view) :