From f435946f66d1edd2df53e4e77e30c572ddffdbf0 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Sun, 17 Jul 2016 14:11:49 +0800 Subject: [PATCH] seperated backdrop and phase info graphic --- projects/mtg/src/GameApp.cpp | 6 +++--- projects/mtg/src/GuiBackground.cpp | 4 +--- projects/mtg/src/GuiPhaseBar.cpp | 8 ++++++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/projects/mtg/src/GameApp.cpp b/projects/mtg/src/GameApp.cpp index 60fcfd31a..e9d2196c1 100644 --- a/projects/mtg/src/GameApp.cpp +++ b/projects/mtg/src/GameApp.cpp @@ -228,9 +228,9 @@ void GameApp::Create() LOG("--Loading various textures"); // Load in this function only textures that are used frequently throughout the game. These textures will constantly stay in Ram, so be frugal WResourceManager::Instance()->RetrieveTexture("phasebar.png", RETRIEVE_MANAGE); - WResourceManager::Instance()->RetrieveTexture("wood.png", RETRIEVE_MANAGE); - WResourceManager::Instance()->RetrieveTexture("gold.png", RETRIEVE_MANAGE); - WResourceManager::Instance()->RetrieveTexture("goldglow.png", RETRIEVE_MANAGE); + //WResourceManager::Instance()->RetrieveTexture("wood.png", RETRIEVE_MANAGE); + //WResourceManager::Instance()->RetrieveTexture("gold.png", RETRIEVE_MANAGE); + //WResourceManager::Instance()->RetrieveTexture("goldglow.png", RETRIEVE_MANAGE); WResourceManager::Instance()->RetrieveTexture("backdrop.jpg", RETRIEVE_MANAGE); WResourceManager::Instance()->RetrieveTexture("handback.png", RETRIEVE_MANAGE); WResourceManager::Instance()->RetrieveTexture("shadows.png", RETRIEVE_MANAGE); diff --git a/projects/mtg/src/GuiBackground.cpp b/projects/mtg/src/GuiBackground.cpp index fba1877d6..70b2ced0f 100644 --- a/projects/mtg/src/GuiBackground.cpp +++ b/projects/mtg/src/GuiBackground.cpp @@ -30,8 +30,6 @@ void GuiBackground::Render() } if (quad.get()) { - quad->mWidth = 480.f; - quad->mHeight = 272.f; - renderer->RenderQuad(quad.get(), 0, 0); + renderer->RenderQuad(quad.get(), 0, 0, 0, SCREEN_WIDTH_F / quad->mWidth, SCREEN_HEIGHT_F / quad->mHeight); } } diff --git a/projects/mtg/src/GuiPhaseBar.cpp b/projects/mtg/src/GuiPhaseBar.cpp index 7d774f44a..0de7a7de2 100644 --- a/projects/mtg/src/GuiPhaseBar.cpp +++ b/projects/mtg/src/GuiPhaseBar.cpp @@ -95,6 +95,7 @@ bool GuiPhaseBar::Leaving(JButton) void GuiPhaseBar::Render() { JQuadPtr quad = WResourceManager::Instance()->GetQuad("phasebar"); + JQuadPtr phaseinfo = WResourceManager::Instance()->RetrieveTempQuad("phaseinfo.png"); //new phaseinfo graphics //uncomment to draw a hideous line across hires screens. // JRenderer::GetInstance()->DrawLine(0, CENTER, SCREEN_WIDTH, CENTER, ARGB(255, 255, 255, 255)); @@ -148,6 +149,13 @@ void GuiPhaseBar::Render() string phaseNameToTranslate = observer->phaseRing->phaseName(displayedPhaseId%kPhases + 1); phaseNameToTranslate = _(phaseNameToTranslate); sprintf(buf, _("(%s%s) %s").c_str(), currentP.c_str(), interrupt.c_str(),phaseNameToTranslate.c_str()); + if(phaseinfo.get()) + { + phaseinfo->SetHotSpot(phaseinfo->mWidth - 1.f,0); + phaseinfo->mWidth = font->GetStringWidth(buf)+12.f; + phaseinfo->mHeight = font->GetHeight()+5.f; + JRenderer::GetInstance()->RenderQuad(phaseinfo.get(),SCREEN_WIDTH_F,0,0); + } font->DrawString(buf, SCREEN_WIDTH - 5, 2, JGETEXT_RIGHT); }