diff --git a/src/common/Bezel.cxx b/src/common/Bezel.cxx index 66ba13715..7a12e54d8 100644 --- a/src/common/Bezel.cxx +++ b/src/common/Bezel.cxx @@ -227,24 +227,11 @@ void Bezel::apply() mySurface->applyAttributes(); mySurface->setVisible(true); } - else - if(mySurface) - mySurface->setVisible(false); - - // If the bezel window is not rounded, it has to be rendered only once for each buffer - if(mySurface && !myInfo.isRounded()) - myRenderCount = 2; // double buffering } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Bezel::render(bool force) { - if(myRenderCount) - { - force = true; - myRenderCount--; - } - // Only bezels with rounded windows have to be rendered each frame if(mySurface && (myInfo.isRounded() || force)) mySurface->render(); diff --git a/src/common/Bezel.hxx b/src/common/Bezel.hxx index cda575a31..28b00ee5e 100644 --- a/src/common/Bezel.hxx +++ b/src/common/Bezel.hxx @@ -135,8 +135,6 @@ class Bezel // The bezel surface which blends over the TIA surface shared_ptr mySurface; - uInt32 myRenderCount{0}; - // Bezel info structure Info myInfo; diff --git a/src/emucore/FrameBuffer.cxx b/src/emucore/FrameBuffer.cxx index 6cb38e580..e5f27b2bd 100644 --- a/src/emucore/FrameBuffer.cxx +++ b/src/emucore/FrameBuffer.cxx @@ -588,7 +588,7 @@ void FrameBuffer::updateInEmulationMode(float framesPerSecond) // We don't worry about selective rendering here; the rendering // always happens at the full framerate - renderTIA(false); + renderTIA(false); // do not clear screen in emulation mode // Show frame statistics if(myStatsMsg.enabled) @@ -1269,23 +1269,34 @@ void FrameBuffer::toggleBezel(bool toggle) { bool enabled = myOSystem.settings().getBool("bezel.show"); - if(toggle) + if(toggle && myBufferType == BufferType::Emulator) { - if(myBufferType == BufferType::Emulator && - (fullScreen() || myOSystem.settings().getBool("bezel.windowed"))) + if(!fullScreen() && !myOSystem.settings().getBool("bezel.windowed")) + { + myOSystem.frameBuffer().showTextMessage("Bezels in windowed mode are not enabled"); + return; + } + else { enabled = !enabled; myOSystem.settings().setValue("bezel.show", enabled); - myBezel->load(); + if(!myBezel->load() && enabled) + { + myOSystem.settings().setValue("bezel.show", !enabled); + myOSystem.frameBuffer().showTextMessage("No bezel image found"); + return; + } + else + { + // Determine possible TIA windowed zoom levels + const double currentTIAZoom = + static_cast(myOSystem.settings().getFloat("tia.zoom")); + myOSystem.settings().setValue("tia.zoom", + BSPF::clamp(currentTIAZoom, supportedTIAMinZoom(), supportedTIAMaxZoom())); - // Determine possible TIA windowed zoom levels - const double currentTIAZoom = - static_cast(myOSystem.settings().getFloat("tia.zoom")); - myOSystem.settings().setValue("tia.zoom", - BSPF::clamp(currentTIAZoom, supportedTIAMinZoom(), supportedTIAMaxZoom())); - - saveCurrentWindowPosition(); - applyVideoMode(); + saveCurrentWindowPosition(); + applyVideoMode(); + } } } myOSystem.frameBuffer().showTextMessage(enabled ? "Bezel enabled" : "Bezel disabled"); @@ -1298,6 +1309,11 @@ FBInitStatus FrameBuffer::applyVideoMode() const Settings& s = myOSystem.settings(); const int display = displayId(); + // Get rid of the previous output + myBackend->clear(); + myBackend->renderToScreen(); + myBackend->clear(); + if(s.getBool("fullscreen")) myVidModeHandler.setDisplaySize(myFullscreenDisplays[display], display); else @@ -1333,6 +1349,13 @@ FBInitStatus FrameBuffer::applyVideoMode() { #ifdef IMAGE_SUPPORT myBezel->apply(); + if(!myBezel->info().isRounded()) + { + // If the bezel window is not rounded, it has to be rendered only once for each buffer + myBezel->render(true); + myBackend->renderToScreen(); + myBezel->render(true); + } #endif myTIASurface->initialize(myOSystem.console(), myActiveVidMode);