reduced TimeMachineDialog transparency

frame stats now always displays the real frameRate
This commit is contained in:
thrust26 2018-01-30 09:06:03 +01:00
parent 9a3516b610
commit eb96e1ca49
2 changed files with 19 additions and 23 deletions

View File

@ -385,40 +385,36 @@ void FrameBuffer::drawFrameStats()
const int XPOS = 2, YPOS = 0;
myStatsMsg.surface->invalidate();
string bsinfo = info.BankSwitch +
(myOSystem.settings().getBool("dev.settings") ? "| Developer" : "| Player");
// draw shadowed text
string bsinfo = info.BankSwitch +
(myOSystem.settings().getBool("dev.settings") ? "| Developer" : "");
color = myOSystem.console().tia().scanlinesLastFrame() != myLastScanlines ? kDbgColorRed : myStatsMsg.color;
std::snprintf(msg, 30, "%3u", myOSystem.console().tia().scanlinesLastFrame());
myStatsMsg.surface->drawString(font(), msg, XPOS, YPOS,
myStatsMsg.w, color, TextAlign::Left, 0, true, kBGColor);
// draw framerate
// draw the effective framerate
float frameRate;
if(myOSystem.settings().getInt("framerate") == 0)
{
// if 'Auto' is selected, draw the calculated framerate
frameRate = myOSystem.console().getFramerate();
}
else
{
// if 'Auto' is not selected, draw the effective framerate
const TimingInfo& ti = myOSystem.timingInfo();
// update every ~1 second
if(ti.totalFrames - myTotalFrames >= myLastFrameRate)
{
frameRate = 1000000.0 * (ti.totalFrames - myTotalFrames) / (ti.totalTime - myTotalTime);
if(frameRate > myOSystem.console().getFramerate() + 1)
frameRate = 1;
frameRate = 1; // check soon again
myTotalFrames = ti.totalFrames;
myTotalTime = ti.totalTime;
}
else
frameRate = myLastFrameRate;
}
color = frameRate != myLastFrameRate ? kDbgColorRed : myStatsMsg.color;
myLastFrameRate = frameRate;
std::snprintf(msg, 30, "@%6.2ffps", frameRate);
myStatsMsg.surface->drawString(font(), msg, XPOS + font().getStringWidth("262 "), YPOS,
myStatsMsg.w, color, TextAlign::Left, 0, true, kBGColor);
myStatsMsg.w, myStatsMsg.color, TextAlign::Left, 0, true, kBGColor);
// draw bankswitching type
std::snprintf(msg, 30, "=> %s", info.DisplayFormat.c_str());
myStatsMsg.surface->drawString(font(), msg, XPOS + font().getStringWidth("262 @ 60.00fps "), YPOS,
myStatsMsg.w, myStatsMsg.color, TextAlign::Left, 0, true, kBGColor);

View File

@ -261,7 +261,7 @@ void TimeMachineDialog::loadConfig()
if(!surface().attributes().blending)
{
surface().attributes().blending = true;
surface().attributes().blendalpha = 80;
surface().attributes().blendalpha = 92;
surface().applyAttributes();
}