Use better approach to show either pic0 or pic1

This commit is contained in:
raven02 2013-09-24 19:07:27 +08:00
parent eeb50b354f
commit c7021b0a2e

View File

@ -682,16 +682,20 @@ void GamePauseScreen::DrawBackground(UIContext &dc) {
dc.Flush();
if (ginfo) {
bool hasPic = false;
if (ginfo->pic1Texture) {
ginfo->pic1Texture->Bind(0);
hasPic = true;
} else if (ginfo->pic0Texture) {
// Draw pic0 if pic1 is not available
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();
}
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();
}
}