mirror of https://github.com/stella-emu/stella.git
added support for default image in ROM info viewer (resolves #601)
This commit is contained in:
parent
3eec0defce
commit
08dfe1fe86
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
|
@ -15,14 +15,17 @@
|
||||||
|
|
||||||
<body bgcolor="#FFFFFF">
|
<body bgcolor="#FFFFFF">
|
||||||
|
|
||||||
<center><b><font size="7">Stella</font></b></center>
|
<center>
|
||||||
|
<b><font size="7">Stella</font></b>
|
||||||
<br><br>
|
<br><br>
|
||||||
<center><h2><b>A multi-platform Atari 2600 VCS emulator</b></h2></center>
|
<img src="graphics/stella_icon.png">
|
||||||
|
<h2><b>A multi-platform Atari 2600 VCS emulator</b></h2>
|
||||||
|
|
||||||
<center><h4><b>Release 6.4</b></h4></center>
|
<h4><b>Release 6.4</b></h4>
|
||||||
<br><br>
|
<br>
|
||||||
|
|
||||||
<center><h2><b>User's Guide</b></h2></center>
|
<h2><b>User's Guide</b></h2>
|
||||||
|
</center>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<h2>Contents</h2>
|
<h2>Contents</h2>
|
||||||
|
@ -570,9 +573,10 @@
|
||||||
The path of the first ROM you play automatically defines the default ROM path. You
|
The path of the first ROM you play automatically defines the default ROM path. You
|
||||||
can change it later in the <b><a href="#ROMInfo">ROM Launcher</a></b> dialog.</p>
|
can change it later in the <b><a href="#ROMInfo">ROM Launcher</a></b> dialog.</p>
|
||||||
|
|
||||||
<p>At this point, you may want to set the locations for snapshots. This is described in more detail in <b>Advanced Configuration - <a href="#Snapshots">Snapshot Settings</a></b>.
|
<p>At this point, you may want to set the locations for snapshot images. This
|
||||||
These settings are optional, and can be left at the defaults if you won't be using
|
is described in more detail in <b><a href="#ROMInfo">ROM Launcher</a></b>.
|
||||||
snapshots in the ROM launcher.</p>
|
These settings are optional, and can be left at the defaults if you won't be
|
||||||
|
using snapshots in the ROM launcher. </p>
|
||||||
|
|
||||||
<p>You can start emulation by selecting a ROM and pressing 'Enter' or clicking 'Select',
|
<p>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
|
or double-clicking a ROM. Note that some games require you to 'Reset' the console
|
||||||
|
@ -3722,20 +3726,22 @@
|
||||||
|
|
||||||
<p>Several options are configurable in the ROM launcher. The size of the
|
<p>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
|
launcher and fonts, as well as the 'ROM Info Viewer' can be changed in
|
||||||
<b>UI Settings - Launcher</b> dialog, as shown below:</p>
|
the <b>UI Settings - Launcher</b> dialog, as shown below:</p>
|
||||||
<img src="graphics/options_ui.png">
|
<img src="graphics/options_ui.png">
|
||||||
<p>Most of the options are self-explanatory, except for the 'ROM info
|
<p>Most of the options are self-explanatory, except for the 'ROM info
|
||||||
width', which is described below.</p>
|
width' and 'Image path...', which are described below.</p>
|
||||||
|
|
||||||
<h3><b><a name="ROMInfoViewer">ROM Info Viewer</a></b></h3>
|
<h3><b><a name="ROMInfoViewer">ROM Info Viewer</a></b></h3>
|
||||||
|
|
||||||
<p>Stella supports viewing snapshots and ROM properties of the currently
|
<p>Stella supports viewing snapshots and ROM properties of the currently
|
||||||
selected ROM in the ROM launcher. Support is automatic, as long as your
|
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.
|
archive of updated snapshots will be available on the Stella webpage.
|
||||||
This archive may be updated periodically as new ROMs are found, and also
|
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
|
for each new release of Stella. In case no snapshot is found, you can
|
||||||
generated by Stella; they will be resized accordingly.</p>
|
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.</p>
|
||||||
|
|
||||||
The ROM Info Viewer's width can be defined between 0% (off) and 100%. The
|
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,
|
value is relative to the launcher width. For too small or too large values,
|
||||||
|
|
|
@ -108,20 +108,13 @@ void RomInfoWidget::parseProperties(const FilesystemNode& node)
|
||||||
myProperties.get(PropType::Cart_Name) + ".png";
|
myProperties.get(PropType::Cart_Name) + ".png";
|
||||||
|
|
||||||
// Read the PNG file
|
// Read the PNG file
|
||||||
try
|
mySurfaceIsValid = loadPng(filename);
|
||||||
{
|
|
||||||
instance().png().loadImage(filename, *mySurface);
|
|
||||||
|
|
||||||
// Scale surface to available image area
|
// Try to load a default image if not ROM image exists
|
||||||
const Common::Rect& src = mySurface->srcRect();
|
if(!mySurfaceIsValid)
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
mySurfaceErrorMsg = e.what();
|
mySurfaceIsValid = loadPng(instance().snapshotLoadDir().getPath() +
|
||||||
|
"default_snapshot.png");
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
mySurfaceErrorMsg = "PNG image loading not supported";
|
mySurfaceErrorMsg = "PNG image loading not supported";
|
||||||
|
@ -176,6 +169,30 @@ void RomInfoWidget::parseProperties(const FilesystemNode& node)
|
||||||
setDirty();
|
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)
|
void RomInfoWidget::drawWidget(bool hilite)
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,6 +44,9 @@ class RomInfoWidget : public Widget
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void parseProperties(const FilesystemNode& node);
|
void parseProperties(const FilesystemNode& node);
|
||||||
|
#ifdef PNG_SUPPORT
|
||||||
|
bool loadPng(const string& filename);
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Surface pointer holding the PNG image
|
// Surface pointer holding the PNG image
|
||||||
|
|
Loading…
Reference in New Issue