diff --git a/docs/graphics/Stella_icon.png b/docs/graphics/Stella_icon.png new file mode 100644 index 000000000..89a0938d4 Binary files /dev/null and b/docs/graphics/Stella_icon.png differ diff --git a/docs/graphics/resources/default_snapshot.png b/docs/graphics/resources/default_snapshot.png new file mode 100644 index 000000000..34e9cc901 Binary files /dev/null and b/docs/graphics/resources/default_snapshot.png differ diff --git a/docs/index.html b/docs/index.html index 05ab607e0..6d2d31351 100644 --- a/docs/index.html +++ b/docs/index.html @@ -15,14 +15,17 @@
-At this point, you may want to set the locations for snapshots. This is described in more detail in Advanced Configuration - Snapshot Settings. - These settings are optional, and can be left at the defaults if you won't be using - snapshots in the ROM launcher.
+At this point, you may want to set the locations for snapshot images. This + is described in more detail in ROM Launcher. + These settings are optional, and can be left at the defaults if you won't be + using snapshots in the ROM launcher.
You can start emulation by selecting a ROM and pressing 'Enter' or clicking 'Select', or double-clicking a ROM. Note that some games require you to 'Reset' the console @@ -3722,20 +3726,22 @@
Several options are configurable in the ROM launcher. The size of the launcher and fonts, as well as the 'ROM Info Viewer' can be changed in - UI Settings - Launcher dialog, as shown below:
+ the UI Settings - Launcher dialog, as shown below:Most of the options are self-explanatory, except for the 'ROM info - width', which is described below.
+ width' and 'Image path...', which are described below.Stella supports viewing snapshots and ROM properties of the currently selected ROM in the ROM launcher. Support is automatic, as long as your - snapshot directory contains snapshots in the appropriate format. An + image directory contains snapshots in the appropriate format. An archive of updated snapshots will be available on the Stella webpage. This archive may be updated periodically as new ROMs are found, and also - for each new release of Stella. Note that the snapshots can be any size - generated by Stella; they will be resized accordingly.
+ for each new release of Stella. In case no snapshot is found, you can + provide a default image named 'default_snapshot.png'. + Note that the snapshots can be any size (e.g. generated by Stella); they + will be resized accordingly. The ROM Info Viewer's width can be defined between 0% (off) and 100%. The value is relative to the launcher width. For too small or too large values, diff --git a/src/gui/RomInfoWidget.cxx b/src/gui/RomInfoWidget.cxx index 325cadfda..4cf7f4d33 100644 --- a/src/gui/RomInfoWidget.cxx +++ b/src/gui/RomInfoWidget.cxx @@ -108,20 +108,13 @@ void RomInfoWidget::parseProperties(const FilesystemNode& node) myProperties.get(PropType::Cart_Name) + ".png"; // Read the PNG file - try - { - instance().png().loadImage(filename, *mySurface); + mySurfaceIsValid = loadPng(filename); - // Scale surface to available image area - const Common::Rect& src = mySurface->srcRect(); - float scale = std::min(float(myAvail.w) / src.w(), float(myAvail.h) / src.h()) * - instance().frameBuffer().hidpiScaleFactor(); - mySurface->setDstSize(uInt32(src.w() * scale), uInt32(src.h() * scale)); - mySurfaceIsValid = true; - } - catch(const runtime_error& e) + // Try to load a default image if not ROM image exists + if(!mySurfaceIsValid) { - mySurfaceErrorMsg = e.what(); + mySurfaceIsValid = loadPng(instance().snapshotLoadDir().getPath() + + "default_snapshot.png"); } #else mySurfaceErrorMsg = "PNG image loading not supported"; @@ -176,6 +169,30 @@ void RomInfoWidget::parseProperties(const FilesystemNode& node) setDirty(); } +#ifdef PNG_SUPPORT +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +bool RomInfoWidget::loadPng(const string& filename) +{ + try + { + instance().png().loadImage(filename, *mySurface); + + // Scale surface to available image area + const Common::Rect& src = mySurface->srcRect(); + float scale = std::min(float(myAvail.w) / src.w(), float(myAvail.h) / src.h()) * + instance().frameBuffer().hidpiScaleFactor(); + mySurface->setDstSize(uInt32(src.w() * scale), uInt32(src.h() * scale)); + + return true; + } + catch(const runtime_error& e) + { + mySurfaceErrorMsg = e.what(); + } + return false; +} +#endif + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void RomInfoWidget::drawWidget(bool hilite) { diff --git a/src/gui/RomInfoWidget.hxx b/src/gui/RomInfoWidget.hxx index dbf3beee1..3a3c14f91 100644 --- a/src/gui/RomInfoWidget.hxx +++ b/src/gui/RomInfoWidget.hxx @@ -44,6 +44,9 @@ class RomInfoWidget : public Widget private: void parseProperties(const FilesystemNode& node); + #ifdef PNG_SUPPORT + bool loadPng(const string& filename); + #endif private: // Surface pointer holding the PNG image