mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2025-12-12 17:58:53 +01:00
Integrating media paths to search for system directory in collections.
This commit is contained in:
parent
55d014fb71
commit
49d2fd7c6a
@ -340,6 +340,12 @@ bool Configuration::GetPropertyAbsolutePath(std::string key, std::string &value)
|
||||
}
|
||||
|
||||
void Configuration::GetMediaPropertyAbsolutePath(std::string collectionName, std::string mediaType, std::string &value)
|
||||
{
|
||||
return GetMediaPropertyAbsolutePath(collectionName, mediaType, false, value);
|
||||
}
|
||||
|
||||
|
||||
void Configuration::GetMediaPropertyAbsolutePath(std::string collectionName, std::string mediaType, bool system, std::string &value)
|
||||
{
|
||||
std::string key = "media." + collectionName + "." + mediaType;
|
||||
|
||||
@ -347,6 +353,7 @@ void Configuration::GetMediaPropertyAbsolutePath(std::string collectionName, std
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
std::string baseMediaPath;
|
||||
if(!GetPropertyAbsolutePath("baseMediaPath", baseMediaPath))
|
||||
{
|
||||
@ -355,11 +362,11 @@ void Configuration::GetMediaPropertyAbsolutePath(std::string collectionName, std
|
||||
|
||||
if(mediaType == "manufacturer")
|
||||
{
|
||||
value = baseMediaPath + "/_Manufacturer";
|
||||
value = baseMediaPath + "/_manufacturer";
|
||||
}
|
||||
else
|
||||
{
|
||||
value = baseMediaPath + "/" + collectionName + "/" + mediaType);
|
||||
value = baseMediaPath + "/" + collectionName + "/" + mediaType + "/system");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -43,6 +43,7 @@ public:
|
||||
bool PropertyPrefixExists(std::string key);
|
||||
bool GetPropertyAbsolutePath(std::string key, std::string &value);
|
||||
void GetMediaPropertyAbsolutePath(std::string collectionName, std::string mediaType, std::string &value);
|
||||
void GetMediaPropertyAbsolutePath(std::string collectionName, std::string mediaType, bool system, std::string &value);
|
||||
void GetCollectionAbsolutePath(std::string collectionName, std::string &value);
|
||||
bool IsVerbose() const;
|
||||
void SetVerbose(bool verbose);
|
||||
|
||||
@ -199,18 +199,25 @@ void ReloadableMedia::ReloadTexture()
|
||||
if(!LoadedComponent)
|
||||
{
|
||||
std::string imagePath;
|
||||
Config.GetMediaPropertyAbsolutePath(GetCollectionName(), Type, imagePath);
|
||||
Config.GetMediaPropertyAbsolutePath(GetCollectionName(), Type, false, imagePath);
|
||||
|
||||
ImageBuilder imageBuild;
|
||||
|
||||
LoadedComponent = imageBuild.CreateImage(imagePath, imageBasename, ScaleX, ScaleY);
|
||||
|
||||
if(!LoadedComponent)
|
||||
{
|
||||
Config.GetMediaPropertyAbsolutePath(imageBasename, Type, true, imagePath);
|
||||
LoadedComponent = imageBuild.CreateImage(imagePath, imageBasename, ScaleX, ScaleY);
|
||||
}
|
||||
|
||||
if (LoadedComponent != NULL)
|
||||
{
|
||||
LoadedComponent->AllocateGraphicsMemory();
|
||||
GetBaseViewInfo()->SetImageWidth(LoadedComponent->GetBaseViewInfo()->GetImageWidth());
|
||||
GetBaseViewInfo()->SetImageHeight(LoadedComponent->GetBaseViewInfo()->GetImageHeight());
|
||||
LoadedComponent->AllocateGraphicsMemory();
|
||||
GetBaseViewInfo()->SetImageWidth(LoadedComponent->GetBaseViewInfo()->GetImageWidth());
|
||||
GetBaseViewInfo()->SetImageHeight(LoadedComponent->GetBaseViewInfo()->GetImageHeight());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(!LoadedComponent && TextFallback)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user