some small fixes

This commit is contained in:
thrust26 2023-08-19 19:25:50 +02:00
parent 53b3d0901c
commit d3b46c742d
1 changed files with 14 additions and 10 deletions

View File

@ -1301,7 +1301,15 @@ FBInitStatus FrameBuffer::applyVideoMode()
// Inform TIA surface about new mode, and update TIA settings
if(inTIAMode)
{
myTIASurface->initialize(myOSystem.console(), myActiveVidMode);
#ifdef IMAGE_SUPPORT
if(myBezelSurface)
deallocateSurface(myBezelSurface);
myBezelSurface = nullptr;
if(showBezel)
loadBezel();
#endif
myTIASurface->initialize(myOSystem.console(), myActiveVidMode);
if(fullScreen())
myOSystem.settings().setValue("tia.fs_stretch",
myActiveVidMode.stretch == VideoModeHandler::Mode::Stretch::Fill);
@ -1309,13 +1317,6 @@ FBInitStatus FrameBuffer::applyVideoMode()
myOSystem.settings().setValue("tia.zoom", myActiveVidMode.zoom);
}
#ifdef IMAGE_SUPPORT
if(myBezelSurface)
deallocateSurface(myBezelSurface);
if(showBezel)
loadBezel();
#endif
resetSurfaces();
setCursorState();
myPendingRender = true;
@ -1376,8 +1377,11 @@ bool FrameBuffer::loadBezel()
// Scale bezel to fullscreen (preserve or stretch) or window size
const uInt32 bezelH = std::min(myActiveVidMode.screenS.h,
myActiveVidMode.imageR.h());
myBezelSurface->setDstSize(myActiveVidMode.screenS.w, bezelH);
myBezelSurface->setDstPos(0, (myActiveVidMode.screenS.h - bezelH) / 2); // center vertically
const uInt32 bezelW = std::min(myActiveVidMode.screenS.w,
static_cast<uInt32>(bezelH * (16.F / 9.F)));
myBezelSurface->setDstSize(bezelW, bezelH);
myBezelSurface->setDstPos((myActiveVidMode.screenS.w - bezelW) / 2,
(myActiveVidMode.screenS.h - bezelH) / 2); // center
myBezelSurface->setScalingInterpolation(ScalingInterpolation::sharp);
}
if(myBezelSurface)