diff --git a/projects/mtg/include/GuiPhaseBar.h b/projects/mtg/include/GuiPhaseBar.h index 78cec2677..4b78f7d7c 100644 --- a/projects/mtg/include/GuiPhaseBar.h +++ b/projects/mtg/include/GuiPhaseBar.h @@ -22,7 +22,7 @@ private: InOutQuadEasing zoomFactorEasing; 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: GuiPhaseBar(DuelLayers* duelLayers); ~GuiPhaseBar(); diff --git a/projects/mtg/src/GuiFrame.cpp b/projects/mtg/src/GuiFrame.cpp index 276fefffa..39d1ac33a 100644 --- a/projects/mtg/src/GuiFrame.cpp +++ b/projects/mtg/src/GuiFrame.cpp @@ -11,7 +11,7 @@ GuiFrame::GuiFrame(GameObserver* observer) if (observer->getResourceManager()->GetTexture("wood.png")) { wood = observer->getResourceManager()->RetrieveQuad("wood.png", 0, 0, 0, 0); - wood->mHeight =32.f; + wood->mHeight = 32.f; wood->mWidth = 480.f; } else diff --git a/projects/mtg/src/GuiPhaseBar.cpp b/projects/mtg/src/GuiPhaseBar.cpp index f782c6518..ffb541c3f 100644 --- a/projects/mtg/src/GuiPhaseBar.cpp +++ b/projects/mtg/src/GuiPhaseBar.cpp @@ -36,9 +36,9 @@ namespace 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); } @@ -110,7 +110,10 @@ void GuiPhaseBar::Render() //hint: sin(circPos + PI/2) = cos(circPos) 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 diff --git a/projects/mtg/src/GuiPlay.cpp b/projects/mtg/src/GuiPlay.cpp index 43403d5ab..d9ebce42f 100644 --- a/projects/mtg/src/GuiPlay.cpp +++ b/projects/mtg/src/GuiPlay.cpp @@ -106,7 +106,7 @@ GuiPlay::BattleField::BattleField() : 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*) { ++attackers; @@ -160,7 +160,10 @@ void GuiPlay::BattleField::Update(float dt) void GuiPlay::BattleField::Render() { 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) :