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

@ -23,6 +23,7 @@
#include "Common/FileUtil.h"
#include "Common/Hash.h"
#include "Common/IniFile.h"
#include "Common/NandPaths.h"
#include "Common/StringUtil.h"
#include "Core/Boot/Boot.h"
@ -371,9 +372,7 @@ const std::string GameListItem::GetWiiFSPath() const
u64 title_id = 0;
iso->GetTitleID(&title_id);
const std::string path =
StringFromFormat("%s/title/%08x/%08x/data/", File::GetUserPath(D_WIIROOT_IDX).c_str(),
(u32)(title_id >> 32), (u32)title_id);
const std::string path = Common::GetTitleDataPath(title_id, Common::FROM_CONFIGURED_ROOT);
if (!File::Exists(path))
File::CreateFullPath(path);