developer/player settings added to frame stats overlay

This commit is contained in:
thrust26 2018-01-15 20:25:28 +01:00
parent 8583883795
commit b22c292f3c
5 changed files with 32 additions and 11 deletions

View File

@ -235,6 +235,14 @@ bool FrameBufferSDL2::setVideoMode(const string& title, const VideoMode& mode)
return true;
}
void FrameBufferSDL2::setTitle(const string& title)
{
myScreenTitle = title;
if(myWindow)
SDL_SetWindowTitle(myWindow, title.c_str());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string FrameBufferSDL2::about() const
{

View File

@ -46,11 +46,13 @@ class FrameBufferSDL2 : public FrameBuffer
//////////////////////////////////////////////////////////////////////
// The following are derived from public methods in FrameBuffer.hxx
//////////////////////////////////////////////////////////////////////
/**
Toggles the use of grabmouse (only has effect in emulation mode).
The method changes the 'grabmouse' setting and saves it.
Updates window title
@param title The title of the application / window
*/
void toggleGrabMouse();
void setTitle(const string& title);
/**
Shows or hides the cursor based on the given boolean value.

View File

@ -531,6 +531,7 @@ FBInitStatus Console::initializeVideo(bool full)
if(full)
{
bool devSettings = myOSystem.settings().getBool("dev.settings");
const string& title = string("Stella ") + STELLA_VERSION +
": \"" + myProperties.get(Cartridge_Name) + "\"";
fbstatus = myOSystem.frameBuffer().createDisplay(title,
@ -539,7 +540,7 @@ FBInitStatus Console::initializeVideo(bool full)
return fbstatus;
myOSystem.frameBuffer().showFrameStats(
myOSystem.settings().getBool(myOSystem.settings().getBool("dev.settings") ? "dev.stats" : "plr.stats"));
myOSystem.settings().getBool(devSettings ? "dev.stats" : "plr.stats"));
generateColorLossPalette();
}
setPalette(myOSystem.settings().getString("palette"));

View File

@ -292,6 +292,8 @@ void FrameBuffer::update()
myOSystem.console().tia().scanlinesLastFrame(),
myOSystem.console().getFramerate(), info.DisplayFormat.c_str());
myStatsMsg.surface->invalidate();
string bsinfo = info.BankSwitch +
(myOSystem.settings().getBool("dev.settings") ? "| Developer" : "| Player");
// draw shadowed text
myStatsMsg.surface->drawString(infoFont(), msg, 1 + 1, 1 + 0,
myStatsMsg.w, kBGColor);
@ -301,13 +303,13 @@ void FrameBuffer::update()
myStatsMsg.w, kBGColor);
myStatsMsg.surface->drawString(infoFont(), msg, 1, 1,
myStatsMsg.w, myStatsMsg.color);
myStatsMsg.surface->drawString(infoFont(), info.BankSwitch, 1 + 1, 15 + 0,
myStatsMsg.surface->drawString(infoFont(), bsinfo, 1 + 1, 15 + 0,
myStatsMsg.w, kBGColor);
myStatsMsg.surface->drawString(infoFont(), info.BankSwitch, 1 + 0, 15 + 1,
myStatsMsg.surface->drawString(infoFont(), bsinfo, 1 + 0, 15 + 1,
myStatsMsg.w, kBGColor);
myStatsMsg.surface->drawString(infoFont(), info.BankSwitch, 1 + 1, 15 + 1,
myStatsMsg.surface->drawString(infoFont(), bsinfo, 1 + 1, 15 + 1,
myStatsMsg.w, kBGColor);
myStatsMsg.surface->drawString(infoFont(), info.BankSwitch, 1, 15,
myStatsMsg.surface->drawString(infoFont(), bsinfo, 1, 15,
myStatsMsg.w, myStatsMsg.color);
myStatsMsg.surface->setDirty();
myStatsMsg.surface->setDstPos(myImageRect.x() + 1, myImageRect.y() + 1);

View File

@ -268,6 +268,13 @@ class FrameBuffer
// implemented in derived classes.
//////////////////////////////////////////////////////////////////////
public:
/**
Updates window title
@param title The title of the application / window
*/
virtual void setTitle(const string& title) = 0;
/**
Shows or hides the cursor based on the given boolean value.
*/
@ -446,6 +453,10 @@ class FrameBuffer
int myIdx;
};
protected:
// Title of the main window/screen
string myScreenTitle;
private:
// Indicates the number of times the framebuffer was initialized
uInt32 myInitializedCount;
@ -460,9 +471,6 @@ class FrameBuffer
// Dimensions of the main window (not always the same as the image)
GUI::Size myScreenSize;
// Title of the main window/screen
string myScreenTitle;
// Maximum dimensions of the desktop area
GUI::Size myDesktopSize;