mirror of https://github.com/stella-emu/stella.git
added if loading by ROM property name fails, try ROM file name (fixes #911)
This commit is contained in:
parent
87da2de653
commit
a6746103ec
|
@ -109,18 +109,22 @@ void RomInfoWidget::parseProperties(const FSNode& node)
|
||||||
myRomInfo.clear();
|
myRomInfo.clear();
|
||||||
|
|
||||||
#ifdef PNG_SUPPORT
|
#ifdef PNG_SUPPORT
|
||||||
// Get a valid filename representing a snapshot file for this rom
|
// Get a valid filename representing a snapshot file for this rom and load the snapshot
|
||||||
const string& filename = instance().snapshotLoadDir().getPath() +
|
const string& path = instance().snapshotLoadDir().getPath();
|
||||||
myProperties.get(PropType::Cart_Name) + ".png";
|
|
||||||
|
|
||||||
// Read the PNG file
|
// 1. Try to load snapshot by property name
|
||||||
mySurfaceIsValid = loadPng(filename);
|
mySurfaceIsValid = loadPng(path + myProperties.get(PropType::Cart_Name) + ".png");
|
||||||
|
|
||||||
// Try to load a default image if not ROM image exists
|
|
||||||
if(!mySurfaceIsValid)
|
if(!mySurfaceIsValid)
|
||||||
{
|
{
|
||||||
mySurfaceIsValid = loadPng(instance().snapshotLoadDir().getPath() +
|
// 2. If no snapshot with property name exists, try to load snapshot image by filename
|
||||||
"default_snapshot.png");
|
mySurfaceIsValid = loadPng(path + node.getNameWithExt("") + ".png");
|
||||||
|
|
||||||
|
if(!mySurfaceIsValid)
|
||||||
|
{
|
||||||
|
// 3. If no ROM snapshot exists, try to load a default snapshot
|
||||||
|
mySurfaceIsValid = loadPng(path + "default_snapshot.png");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
mySurfaceErrorMsg = "PNG image loading not supported";
|
mySurfaceErrorMsg = "PNG image loading not supported";
|
||||||
|
|
Loading…
Reference in New Issue