mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-17 16:30:30 +02:00
Centralize game background drawing code.
No need to duplicate it everywhere.
This commit is contained in:
1 parent
80704d013e
commit
274160bc22
10 files changed
+63
-107
No files matched your search
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user