seperated backdrop and phase info graphic

This commit is contained in:
Anthony Calosa
2016-07-17 14:11:49 +08:00
parent 64d91ccaab
commit f435946f66
3 changed files with 12 additions and 6 deletions

View File

@@ -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);

View File

@@ -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);
}
}

View File

@@ -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);
}