diff --git a/src/common/FrameBufferSDL2.cxx b/src/common/FrameBufferSDL2.cxx index 76d6ece46..d9338eeb9 100644 --- a/src/common/FrameBufferSDL2.cxx +++ b/src/common/FrameBufferSDL2.cxx @@ -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 { diff --git a/src/common/FrameBufferSDL2.hxx b/src/common/FrameBufferSDL2.hxx index cf134e96e..3944849ce 100644 --- a/src/common/FrameBufferSDL2.hxx +++ b/src/common/FrameBufferSDL2.hxx @@ -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. diff --git a/src/emucore/Console.cxx b/src/emucore/Console.cxx index 16f122693..d9e6ab65b 100644 --- a/src/emucore/Console.cxx +++ b/src/emucore/Console.cxx @@ -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")); diff --git a/src/emucore/FrameBuffer.cxx b/src/emucore/FrameBuffer.cxx index 4ffa1b2f4..456175997 100644 --- a/src/emucore/FrameBuffer.cxx +++ b/src/emucore/FrameBuffer.cxx @@ -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); diff --git a/src/emucore/FrameBuffer.hxx b/src/emucore/FrameBuffer.hxx index da1f984e4..975ecbf4e 100644 --- a/src/emucore/FrameBuffer.hxx +++ b/src/emucore/FrameBuffer.hxx @@ -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;