mirror of https://github.com/stella-emu/stella.git
improved the code for rendering non-rounded bezels only on load (this should work)
This commit is contained in:
parent
e76b91720d
commit
647f3d48a5
|
@ -227,24 +227,11 @@ void Bezel::apply()
|
||||||
mySurface->applyAttributes();
|
mySurface->applyAttributes();
|
||||||
mySurface->setVisible(true);
|
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)
|
void Bezel::render(bool force)
|
||||||
{
|
{
|
||||||
if(myRenderCount)
|
|
||||||
{
|
|
||||||
force = true;
|
|
||||||
myRenderCount--;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only bezels with rounded windows have to be rendered each frame
|
// Only bezels with rounded windows have to be rendered each frame
|
||||||
if(mySurface && (myInfo.isRounded() || force))
|
if(mySurface && (myInfo.isRounded() || force))
|
||||||
mySurface->render();
|
mySurface->render();
|
||||||
|
|
|
@ -135,8 +135,6 @@ class Bezel
|
||||||
// The bezel surface which blends over the TIA surface
|
// The bezel surface which blends over the TIA surface
|
||||||
shared_ptr<FBSurface> mySurface;
|
shared_ptr<FBSurface> mySurface;
|
||||||
|
|
||||||
uInt32 myRenderCount{0};
|
|
||||||
|
|
||||||
// Bezel info structure
|
// Bezel info structure
|
||||||
Info myInfo;
|
Info myInfo;
|
||||||
|
|
||||||
|
|
|
@ -588,7 +588,7 @@ void FrameBuffer::updateInEmulationMode(float framesPerSecond)
|
||||||
// We don't worry about selective rendering here; the rendering
|
// We don't worry about selective rendering here; the rendering
|
||||||
// always happens at the full framerate
|
// always happens at the full framerate
|
||||||
|
|
||||||
renderTIA(false);
|
renderTIA(false); // do not clear screen in emulation mode
|
||||||
|
|
||||||
// Show frame statistics
|
// Show frame statistics
|
||||||
if(myStatsMsg.enabled)
|
if(myStatsMsg.enabled)
|
||||||
|
@ -1269,23 +1269,34 @@ void FrameBuffer::toggleBezel(bool toggle)
|
||||||
{
|
{
|
||||||
bool enabled = myOSystem.settings().getBool("bezel.show");
|
bool enabled = myOSystem.settings().getBool("bezel.show");
|
||||||
|
|
||||||
if(toggle)
|
if(toggle && myBufferType == BufferType::Emulator)
|
||||||
{
|
{
|
||||||
if(myBufferType == BufferType::Emulator &&
|
if(!fullScreen() && !myOSystem.settings().getBool("bezel.windowed"))
|
||||||
(fullScreen() || myOSystem.settings().getBool("bezel.windowed")))
|
{
|
||||||
|
myOSystem.frameBuffer().showTextMessage("Bezels in windowed mode are not enabled");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
enabled = !enabled;
|
enabled = !enabled;
|
||||||
myOSystem.settings().setValue("bezel.show", 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<double>(myOSystem.settings().getFloat("tia.zoom"));
|
||||||
|
myOSystem.settings().setValue("tia.zoom",
|
||||||
|
BSPF::clamp(currentTIAZoom, supportedTIAMinZoom(), supportedTIAMaxZoom()));
|
||||||
|
|
||||||
// Determine possible TIA windowed zoom levels
|
saveCurrentWindowPosition();
|
||||||
const double currentTIAZoom =
|
applyVideoMode();
|
||||||
static_cast<double>(myOSystem.settings().getFloat("tia.zoom"));
|
}
|
||||||
myOSystem.settings().setValue("tia.zoom",
|
|
||||||
BSPF::clamp(currentTIAZoom, supportedTIAMinZoom(), supportedTIAMaxZoom()));
|
|
||||||
|
|
||||||
saveCurrentWindowPosition();
|
|
||||||
applyVideoMode();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
myOSystem.frameBuffer().showTextMessage(enabled ? "Bezel enabled" : "Bezel disabled");
|
myOSystem.frameBuffer().showTextMessage(enabled ? "Bezel enabled" : "Bezel disabled");
|
||||||
|
@ -1298,6 +1309,11 @@ FBInitStatus FrameBuffer::applyVideoMode()
|
||||||
const Settings& s = myOSystem.settings();
|
const Settings& s = myOSystem.settings();
|
||||||
const int display = displayId();
|
const int display = displayId();
|
||||||
|
|
||||||
|
// Get rid of the previous output
|
||||||
|
myBackend->clear();
|
||||||
|
myBackend->renderToScreen();
|
||||||
|
myBackend->clear();
|
||||||
|
|
||||||
if(s.getBool("fullscreen"))
|
if(s.getBool("fullscreen"))
|
||||||
myVidModeHandler.setDisplaySize(myFullscreenDisplays[display], display);
|
myVidModeHandler.setDisplaySize(myFullscreenDisplays[display], display);
|
||||||
else
|
else
|
||||||
|
@ -1333,6 +1349,13 @@ FBInitStatus FrameBuffer::applyVideoMode()
|
||||||
{
|
{
|
||||||
#ifdef IMAGE_SUPPORT
|
#ifdef IMAGE_SUPPORT
|
||||||
myBezel->apply();
|
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
|
#endif
|
||||||
|
|
||||||
myTIASurface->initialize(myOSystem.console(), myActiveVidMode);
|
myTIASurface->initialize(myOSystem.console(), myActiveVidMode);
|
||||||
|
|
Loading…
Reference in New Issue