Don't duplicate code for getting paths based on title IDs

I've seen the expression (u32)(title_id >> 32), (u32)title_id
a few more times in my life than I would've liked to...
This commit is contained in:
JosJuice
2017-05-06 17:45:08 +02:00
parent 2261224980
commit 36b9e3dd35
10 changed files with 31 additions and 29 deletions

View File

@ -13,6 +13,7 @@
#include "Common/ColorUtil.h"
#include "Common/CommonTypes.h"
#include "Common/FileUtil.h"
#include "Common/NandPaths.h"
#include "Common/StringUtil.h"
#include "Common/Swap.h"
@ -30,9 +31,8 @@ std::vector<u32> IVolume::GetWiiBanner(int* width, int* height, u64 title_id)
*width = 0;
*height = 0;
std::string file_name = StringFromFormat("%s/title/%08x/%08x/data/banner.bin",
File::GetUserPath(D_WIIROOT_IDX).c_str(),
(u32)(title_id >> 32), (u32)title_id);
const std::string file_name =
Common::GetTitleDataPath(title_id, Common::FROM_CONFIGURED_ROOT) + "banner.bin";
if (!File::Exists(file_name))
return std::vector<u32>();