Centralize game background drawing code.

No need to duplicate it everywhere.
This commit is contained in:
Unknown W. Brackets committed 2014-02-09 17:39:15 -08:00
1 parent 80704d013e
commit 274160bc22
10 files changed
+63 -107

No files matched your search

-28
View File
@@ -958,34 +958,6 @@ void GamePauseScreen::update(InputState &input) {
UIScreen::update(input);
}
void DrawBackground(float alpha);
void GamePauseScreen::DrawBackground(UIContext &dc) {
GameInfo *ginfo = g_gameInfoCache.GetInfo(gamePath_, true);
dc.Flush();
if (ginfo) {
bool hasPic = false;
if (ginfo->pic1Texture) {
ginfo->pic1Texture->Bind(0);
hasPic = true;
} else if (ginfo->pic0Texture) {
ginfo->pic0Texture->Bind(0);
hasPic = true;
}
if (hasPic) {
uint32_t color = whiteAlpha(ease((time_now_d() - ginfo->timePic1WasLoaded) * 3)) & 0xFFc0c0c0;
dc.Draw()->DrawTexRect(0,0,dp_xres, dp_yres, 0,0,1,1, color);
dc.Flush();
dc.RebindTexture();
} else {
::DrawBackground(1.0f);
dc.RebindTexture();
dc.Flush();
}
}
}
GamePauseScreen::~GamePauseScreen() {
if (saveSlots_ != NULL) {
g_Config.iCurrentStateSlot = saveSlots_->GetSelection();