mirror of https://github.com/stella-emu/stella.git
minor code cleanup
This commit is contained in:
parent
33756b2481
commit
1569ee1c6b
|
@ -385,9 +385,8 @@ void FrameBuffer::drawFrameStats()
|
||||||
int xPos = XPOS;
|
int xPos = XPOS;
|
||||||
|
|
||||||
myStatsMsg.surface->invalidate();
|
myStatsMsg.surface->invalidate();
|
||||||
string bsinfo = info.BankSwitch +
|
|
||||||
(myOSystem.settings().getBool("dev.settings") ? "| Developer" : "");
|
// draw scanlines
|
||||||
// draw shadowed text
|
|
||||||
color = myOSystem.console().tia().scanlinesLastFrame() != myLastScanlines ?
|
color = myOSystem.console().tia().scanlinesLastFrame() != myLastScanlines ?
|
||||||
uInt32(kDbgColorRed) : myStatsMsg.color;
|
uInt32(kDbgColorRed) : myStatsMsg.color;
|
||||||
std::snprintf(msg, 30, "%3u", myOSystem.console().tia().scanlinesLastFrame());
|
std::snprintf(msg, 30, "%3u", myOSystem.console().tia().scanlinesLastFrame());
|
||||||
|
@ -395,24 +394,14 @@ void FrameBuffer::drawFrameStats()
|
||||||
myStatsMsg.w, color, TextAlign::Left, 0, true, kBGColor);
|
myStatsMsg.w, color, TextAlign::Left, 0, true, kBGColor);
|
||||||
xPos += font().getStringWidth(msg);
|
xPos += font().getStringWidth(msg);
|
||||||
|
|
||||||
|
// draw frequency
|
||||||
std::snprintf(msg, 30, " => %s", info.DisplayFormat.c_str());
|
std::snprintf(msg, 30, " => %s", info.DisplayFormat.c_str());
|
||||||
myStatsMsg.surface->drawString(font(), msg, xPos, YPOS,
|
myStatsMsg.surface->drawString(font(), msg, xPos, YPOS,
|
||||||
myStatsMsg.w, myStatsMsg.color, TextAlign::Left, 0, true, kBGColor);
|
myStatsMsg.w, myStatsMsg.color, TextAlign::Left, 0, true, kBGColor);
|
||||||
xPos += font().getStringWidth(msg);
|
xPos += font().getStringWidth(msg);
|
||||||
|
|
||||||
// draw framerate
|
// draw the effective framerate
|
||||||
float frameRate;
|
float frameRate;
|
||||||
/*if(myOSystem.settings().getInt("framerate") == 0)
|
|
||||||
{
|
|
||||||
frameRate = 1000000.0 * (ti.totalFrames - myTotalFrames) / (ti.totalTime - myTotalTime);
|
|
||||||
if(frameRate > myOSystem.console().getFramerate() + 1)
|
|
||||||
frameRate = 1; // check soon again
|
|
||||||
myTotalFrames = ti.totalFrames;
|
|
||||||
myTotalTime = ti.totalTime;
|
|
||||||
}
|
|
||||||
else*/
|
|
||||||
{
|
|
||||||
// if 'Auto' is not selected, draw the effective framerate
|
|
||||||
const TimingInfo& ti = myOSystem.timingInfo();
|
const TimingInfo& ti = myOSystem.timingInfo();
|
||||||
if(ti.totalFrames - myTotalFrames >= myLastFrameRate)
|
if(ti.totalFrames - myTotalFrames >= myLastFrameRate)
|
||||||
{
|
{
|
||||||
|
@ -424,13 +413,14 @@ void FrameBuffer::drawFrameStats()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
frameRate = myLastFrameRate;
|
frameRate = myLastFrameRate;
|
||||||
}
|
|
||||||
myLastFrameRate = frameRate;
|
|
||||||
std::snprintf(msg, 30, " @ %5.2ffps", frameRate);
|
std::snprintf(msg, 30, " @ %5.2ffps", frameRate);
|
||||||
myStatsMsg.surface->drawString(font(), msg, xPos, YPOS,
|
myStatsMsg.surface->drawString(font(), msg, xPos, YPOS,
|
||||||
myStatsMsg.w, myStatsMsg.color, TextAlign::Left, 0, true, kBGColor);
|
myStatsMsg.w, myStatsMsg.color, TextAlign::Left, 0, true, kBGColor);
|
||||||
|
myLastFrameRate = frameRate;
|
||||||
|
|
||||||
// draw bankswitching type
|
// draw bankswitching type
|
||||||
|
string bsinfo = info.BankSwitch +
|
||||||
|
(myOSystem.settings().getBool("dev.settings") ? "| Developer" : "");
|
||||||
myStatsMsg.surface->drawString(font(), bsinfo, XPOS, YPOS + font().getFontHeight(),
|
myStatsMsg.surface->drawString(font(), bsinfo, XPOS, YPOS + font().getFontHeight(),
|
||||||
myStatsMsg.w, myStatsMsg.color, TextAlign::Left, 0, true, kBGColor);
|
myStatsMsg.w, myStatsMsg.color, TextAlign::Left, 0, true, kBGColor);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue