fixed zoom when switching bezel paths

This commit is contained in:
thrust26 2023-08-28 11:16:27 +02:00
parent c2460b7c17
commit deea1e37ea
2 changed files with 8 additions and 11 deletions

View File

@ -77,7 +77,7 @@ uInt32 Bezel::borderSize(uInt32 x, uInt32 y, uInt32 size, Int32 step) const
uInt8 r, g, b, a;
myFB.getRGBA(*pixels, &r, &g, &b, &a);
if(a < 255)
if(a < 255) // transparent pixel?
return i;
}
return size - 1;
@ -86,13 +86,14 @@ uInt32 Bezel::borderSize(uInt32 x, uInt32 y, uInt32 size, Int32 step) const
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool Bezel::load()
{
const Settings& settings = myOSystem.settings();
bool isValid = false;
#ifdef IMAGE_SUPPORT
const bool show = myOSystem.eventHandler().inTIAMode() &&
myOSystem.settings().getBool("bezel.show") &&
(myOSystem.settings().getBool("fullscreen") ||
myOSystem.settings().getBool("bezel.windowed"));
settings.getBool("bezel.show") &&
(settings.getBool("fullscreen") ||
settings.getBool("bezel.windowed"));
if(show)
{
@ -122,15 +123,11 @@ bool Bezel::load()
}
} while(index != -1);
}
catch(const runtime_error&)
{
isValid = false;
}
catch(const runtime_error&) { }
}
#endif
if(isValid)
{
const Settings& settings = myOSystem.settings();
const Int32 w = mySurface->width();
const Int32 h = mySurface->height();
uInt32 top, bottom, left, right;

View File

@ -281,7 +281,7 @@ FBInitStatus FrameBuffer::createDisplay(string_view title, BufferType type,
if(myBufferType == BufferType::Emulator)
{
// myBezel->load();
myBezel->load(); // make sure we have the correct bezel size
// Determine possible TIA windowed zoom levels
const double currentTIAZoom =
@ -1239,7 +1239,7 @@ void FrameBuffer::switchVideoMode(int direction)
else if(direction == -1) zoom -= ZOOM_STEPS;
// Make sure the level is within the allowable desktop size
zoom = BSPF::clamp(zoom, supportedTIAMinZoom(), supportedTIAMaxZoom());
zoom = BSPF::clampw(zoom, supportedTIAMinZoom(), supportedTIAMaxZoom());
myOSystem.settings().setValue("tia.zoom", zoom);
}
else