Show bg and icon on pause screen.

This commit is contained in:
Henrik Rydgard 2013-03-31 01:04:46 +01:00
parent 3301fd5119
commit 0eda1a8fe5
4 changed files with 31 additions and 2 deletions

View File

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

View File

@ -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.

View File

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

View File

@ -4,7 +4,6 @@
#include <memory>
#include "../Common/CommonTypes.h"
#include "../Core/HLE/sceCtrl.h"
struct InputState;