Skip to content

Commit

Permalink
some small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
thrust26 committed Aug 19, 2023
1 parent 53b3d09 commit d3b46c7
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/emucore/FrameBuffer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1301,21 +1301,22 @@ FBInitStatus FrameBuffer::applyVideoMode()
// Inform TIA surface about new mode, and update TIA settings
if(inTIAMode)
{
myTIASurface->initialize(myOSystem.console(), myActiveVidMode);
if(fullScreen())
myOSystem.settings().setValue("tia.fs_stretch",
myActiveVidMode.stretch == VideoModeHandler::Mode::Stretch::Fill);
else
myOSystem.settings().setValue("tia.zoom", myActiveVidMode.zoom);
}

#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);
else
myOSystem.settings().setValue("tia.zoom", myActiveVidMode.zoom);
}

resetSurfaces();
setCursorState();
myPendingRender = true;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit d3b46c7

Please sign in to comment.