mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-26 23:10:38 +00:00
Show bg and icon on pause screen.
This commit is contained in:
parent
3301fd5119
commit
0eda1a8fe5
@ -77,6 +77,11 @@ GameInfo *GameInfoCache::GetInfo(const std::string &gamePath, bool wantBG) {
|
||||
auto iter = info_.find(gamePath);
|
||||
if (iter != info_.end()) {
|
||||
GameInfo *info = iter->second;
|
||||
if (!info->wantBG && wantBG) {
|
||||
// Need to start over.
|
||||
delete info;
|
||||
goto again;
|
||||
}
|
||||
if (info->iconTextureData.size()) {
|
||||
info->iconTexture = new Texture();
|
||||
// TODO: We could actually do the PNG decoding as well on the async thread.
|
||||
@ -97,6 +102,8 @@ GameInfo *GameInfoCache::GetInfo(const std::string &gamePath, bool wantBG) {
|
||||
return iter->second;
|
||||
}
|
||||
|
||||
again:
|
||||
|
||||
// return info;
|
||||
|
||||
// TODO: Everything below here should be asynchronous and run on a thread,
|
||||
@ -116,7 +123,7 @@ GameInfo *GameInfoCache::GetInfo(const std::string &gamePath, bool wantBG) {
|
||||
ISOFileSystem umd(&handles, bd);
|
||||
|
||||
GameInfo *info = new GameInfo();
|
||||
|
||||
info->wantBG = wantBG;
|
||||
|
||||
// Alright, let's fetch the PARAM.SFO.
|
||||
std::string paramSFOcontents;
|
||||
|
@ -41,6 +41,8 @@ struct GameInfo {
|
||||
std::string bgTextureData;
|
||||
Texture *bgTexture;
|
||||
|
||||
bool wantBG;
|
||||
|
||||
double lastAccessedTime;
|
||||
|
||||
// The time at which the Icon and the BG were loaded.
|
||||
|
@ -47,6 +47,7 @@ namespace MainWindow {
|
||||
|
||||
#include "Common/StringUtil.h"
|
||||
#include "Core/System.h"
|
||||
#include "Core/CoreParameter.h"
|
||||
#include "GPU/ge_constants.h"
|
||||
#include "GPU/GPUState.h"
|
||||
#include "GPU/GPUInterface.h"
|
||||
@ -303,6 +304,26 @@ void PauseScreen::render() {
|
||||
title = game_title.c_str();
|
||||
}
|
||||
|
||||
|
||||
UIContext *ctx = screenManager()->getUIContext();
|
||||
// This might create a texture so we must flush first.
|
||||
UIFlush();
|
||||
GameInfo *ginfo = g_gameInfoCache.GetInfo(PSP_CoreParameter().fileToStart, true);
|
||||
|
||||
if (ginfo && ginfo->bgTexture) {
|
||||
ginfo->bgTexture->Bind(0);
|
||||
ui_draw2d.DrawTexRect(0,0,dp_xres, dp_yres, 0,0,1,1,0xFFc0c0c0);
|
||||
ui_draw2d.Flush();
|
||||
ctx->RebindTexture();
|
||||
}
|
||||
|
||||
if (ginfo && ginfo->iconTexture) {
|
||||
ginfo->iconTexture->Bind(0);
|
||||
ui_draw2d.DrawTexRect(10,10,10+144, 10+80, 0,0,1,1,0xFFFFFFFF);
|
||||
ui_draw2d.Flush();
|
||||
ctx->RebindTexture();
|
||||
}
|
||||
|
||||
ui_draw2d.DrawText(UBUNTU48, title, dp_xres / 2, 30, 0xFFFFFFFF, ALIGN_HCENTER);
|
||||
|
||||
int x = 30;
|
||||
|
@ -4,7 +4,6 @@
|
||||
#include <memory>
|
||||
|
||||
#include "../Common/CommonTypes.h"
|
||||
#include "../Core/HLE/sceCtrl.h"
|
||||
|
||||
struct InputState;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user