Integrating new directory structure .

This commit is contained in:
emb 2015-02-25 22:49:24 -06:00
parent 49d2fd7c6a
commit c010852bab
4 changed files with 31 additions and 17 deletions

View File

@ -41,14 +41,13 @@ exitOnFirstPageBack = yes
# enter 0 attract mode, otherwise enter the number of seconds to wait before enabling attract mode # enter 0 attract mode, otherwise enter the number of seconds to wait before enabling attract mode
attractModeTime = 45 attractModeTime = 45
#######################################
# Debugging
#######################################
# do not set to "yes" unless you want your hard drive to quickly fill up
debug.logfps = no
####################################### #######################################
# Base folders of media and ROM files # Base folders of media and ROM files
####################################### #######################################
baseMediaPath=../Media # Override if you choose to have your media stored outside of RetroFE.
baseItemPath=../ROMs # If this is commented out your artwork will be searched in collections/<collectionname>/<imagetype>
# baseMediaPath=d:/media
# Override if you choose to have your ROMs stored outside of RetroFE.
# If this is commented out your roms will be searched in collections/<collectionname>/roms
# baseItemPath=d:/roms

View File

@ -198,8 +198,8 @@ bool Configuration::GetProperty(std::string key, std::string &value)
{ {
bool retVal = GetRawProperty(key, value); bool retVal = GetRawProperty(key, value);
std::string baseMediaPath; std::string baseMediaPath = GetAbsolutePath();
std::string baseItemPath; std::string baseItemPath = GetAbsolutePath();
std::string collectionName; std::string collectionName;
GetRawProperty("baseMediaPath", baseMediaPath); GetRawProperty("baseMediaPath", baseMediaPath);
@ -349,24 +349,31 @@ void Configuration::GetMediaPropertyAbsolutePath(std::string collectionName, std
{ {
std::string key = "media." + collectionName + "." + mediaType; std::string key = "media." + collectionName + "." + mediaType;
// use user-overridden setting if it exists
if(GetPropertyAbsolutePath(key, value)) if(GetPropertyAbsolutePath(key, value))
{ {
return; return;
} }
// use user-overridden base media path if it was specified
std::string baseMediaPath; std::string baseMediaPath;
if(!GetPropertyAbsolutePath("baseMediaPath", baseMediaPath)) if(!GetPropertyAbsolutePath("baseMediaPath", baseMediaPath))
{ {
baseMediaPath = "collections"; // base media path was not specified, assume media files are in the collection
baseMediaPath = GetAbsolutePath() + "/collections";
} }
if(mediaType == "manufacturer") if(mediaType == "manufacturer")
{ {
value = baseMediaPath + "/_manufacturer"; value = baseMediaPath + "/_manufacturer";
} }
else if(system)
{
value = baseMediaPath + "/" + collectionName + "/system_artwork";
}
else else
{ {
value = baseMediaPath + "/" + collectionName + "/" + mediaType + "/system"); value = baseMediaPath + "/" + collectionName + "/medium_artwork/" + mediaType;
} }
} }
@ -380,12 +387,14 @@ void Configuration::GetCollectionAbsolutePath(std::string collectionName, std::s
} }
std::string baseItemPath; std::string baseItemPath;
if(!GetPropertyAbsolutePath("baseItemPath", baseItemPath)) if(GetPropertyAbsolutePath("baseItemPath", baseItemPath))
{ {
baseItemPath = "Assets"; value = baseItemPath + "/" + collectionName;
return;
} }
value = baseItemPath + "/" + collectionName; value = GetAbsolutePath() + "/collections/" + collectionName + "/roms";
} }

View File

@ -208,7 +208,7 @@ void ReloadableMedia::ReloadTexture()
if(!LoadedComponent) if(!LoadedComponent)
{ {
Config.GetMediaPropertyAbsolutePath(imageBasename, Type, true, imagePath); Config.GetMediaPropertyAbsolutePath(imageBasename, Type, true, imagePath);
LoadedComponent = imageBuild.CreateImage(imagePath, imageBasename, ScaleX, ScaleY); LoadedComponent = imageBuild.CreateImage(imagePath, Type, ScaleX, ScaleY);
} }
if (LoadedComponent != NULL) if (LoadedComponent != NULL)

View File

@ -688,9 +688,15 @@ bool ScrollingList::AllocateTexture(ComponentItemBinding *s)
Component *t = NULL; Component *t = NULL;
ImageBuilder imageBuild; ImageBuilder imageBuild;
Config.GetMediaPropertyAbsolutePath(GetCollectionName(), ImageType, imagePath); Config.GetMediaPropertyAbsolutePath(GetCollectionName(), ImageType, false, imagePath);
t = imageBuild.CreateImage(imagePath, item->GetName(), ScaleX, ScaleY); t = imageBuild.CreateImage(imagePath, item->GetName(), ScaleX, ScaleY);
if(!t)
{
Config.GetMediaPropertyAbsolutePath(item->GetName(), ImageType, true, imagePath);
t = imageBuild.CreateImage(imagePath, ImageType, ScaleX, ScaleY);
}
if(!t && item->GetTitle() != item->GetFullTitle()) if(!t && item->GetTitle() != item->GetFullTitle())
{ {
t = imageBuild.CreateImage(imagePath, item->GetFullTitle(), ScaleX, ScaleY); t = imageBuild.CreateImage(imagePath, item->GetFullTitle(), ScaleX, ScaleY);