From cf2422002c1d16173c705fa6429f6293129d1393 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Sun, 9 Jun 2013 11:54:03 +0200 Subject: [PATCH] GameInfoCache: Get game and save sizes. --- UI/GameInfoCache.cpp | 20 ++++++++++---------- UI/GameInfoCache.h | 7 ++++++- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/UI/GameInfoCache.cpp b/UI/GameInfoCache.cpp index 2d7741c839..b1f26cb25a 100644 --- a/UI/GameInfoCache.cpp +++ b/UI/GameInfoCache.cpp @@ -196,18 +196,18 @@ public: info_->paramSFOLoaded = true; } - { - ReadFileToString(&umd, "/PSP_GAME/ICON0.PNG", &info_->iconTextureData, &info_->lock); - } - + ReadFileToString(&umd, "/PSP_GAME/ICON0.PNG", &info_->iconTextureData, &info_->lock); if (info_->wantBG) { - { - ReadFileToString(&umd, "/PSP_GAME/PIC0.PNG", &info_->pic0TextureData, &info_->lock); - } - { - ReadFileToString(&umd, "/PSP_GAME/PIC1.PNG", &info_->pic1TextureData, &info_->lock); - } + ReadFileToString(&umd, "/PSP_GAME/PIC0.PNG", &info_->pic0TextureData, &info_->lock); } + ReadFileToString(&umd, "/PSP_GAME/PIC1.PNG", &info_->pic1TextureData, &info_->lock); + + } + // probably only want these when we ask for the background image... + // should maybe flip the flag to "onlyIcon" + if (info_->wantBG) { + info_->gameSize = info_->GetGameSizeInBytes(); + info_->saveDataSize = info_->GetSaveDataSizeInBytes(); } } diff --git a/UI/GameInfoCache.h b/UI/GameInfoCache.h index bb054e3d76..cdaf3137ec 100644 --- a/UI/GameInfoCache.h +++ b/UI/GameInfoCache.h @@ -33,7 +33,9 @@ class GameInfo { public: - GameInfo() : fileType(FILETYPE_UNKNOWN), iconTexture(NULL), pic0Texture(NULL), pic1Texture(NULL), wantBG(false), paramSFOLoaded(false) {} + GameInfo() + : fileType(FILETYPE_UNKNOWN), iconTexture(NULL), pic0Texture(NULL), pic1Texture(NULL), + wantBG(false), paramSFOLoaded(false), gameSize(0), saveDataSize(0) {} bool DeleteGame(); // Better be sure what you're doing when calling this. bool DeleteAllSaveData(); @@ -75,6 +77,9 @@ public: double timeIconWasLoaded; double timePic0WasLoaded; double timePic1WasLoaded; + + u64 gameSize; + u64 saveDataSize; }; class GameInfoCache {