From 92a7352e30300bf218ed2994c5f688f45103651b Mon Sep 17 00:00:00 2001 From: stephena Date: Thu, 23 Jun 2005 14:33:12 +0000 Subject: [PATCH] Reworked the FrameBuffer update system so that TIA updates and overlay updates are actually two separate things (and often done independently). Previously, the only overlay was the menu, and since this was always drawn over the TIA, updating one or the other was the same thing. Now, the debugger area can be updated without affecting the TIA, since technically it isn't really an overlay (it doesn't sit on top of the TIA). There are still some TODO's wrt using dirty rectangles instead of full updates, but at least the full updates are now restricted to just the overlay area. Fixed multiple frame step in the PromptWidget by changing FrameBuffer::advance() to advance a given number of frames. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@550 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- stella/src/common/FrameBufferGL.cxx | 11 ++-- stella/src/common/FrameBufferSoft.cxx | 11 ++-- stella/src/debugger/Debugger.cxx | 7 ++- stella/src/debugger/Debugger.hxx | 6 +-- stella/src/debugger/DebuggerParser.cxx | 6 +-- stella/src/emucore/EventHandler.cxx | 15 +++--- stella/src/emucore/FrameBuffer.cxx | 74 +++++++++++++++++--------- stella/src/emucore/FrameBuffer.hxx | 45 ++++++++-------- stella/src/emucore/OSystem.cxx | 4 +- stella/src/gui/AboutDialog.cxx | 4 +- stella/src/gui/AddrValueWidget.cxx | 9 ++-- stella/src/gui/AudioDialog.cxx | 4 +- stella/src/gui/CpuWidget.cxx | 5 +- stella/src/gui/DataGridWidget.cxx | 10 ++-- stella/src/gui/DebuggerDialog.cxx | 4 +- stella/src/gui/DialogContainer.cxx | 6 +-- stella/src/gui/EditNumWidget.cxx | 5 +- stella/src/gui/EditTextWidget.cxx | 5 +- stella/src/gui/EditableWidget.cxx | 8 +-- stella/src/gui/GameInfoDialog.cxx | 4 +- stella/src/gui/HelpDialog.cxx | 4 +- stella/src/gui/ListWidget.cxx | 13 +++-- stella/src/gui/PopUpWidget.cxx | 5 +- stella/src/gui/ProgressDialog.cxx | 8 +-- stella/src/gui/PromptWidget.cxx | 62 +++++++++++---------- stella/src/gui/RamWidget.cxx | 5 +- stella/src/gui/ScrollBarWidget.cxx | 8 +-- stella/src/gui/TabWidget.cxx | 12 +++-- stella/src/gui/VideoDialog.cxx | 4 +- stella/src/gui/Widget.cxx | 14 ++--- stella/src/gui/Widget.hxx | 10 ++-- 31 files changed, 221 insertions(+), 167 deletions(-) diff --git a/stella/src/common/FrameBufferGL.cxx b/stella/src/common/FrameBufferGL.cxx index c14e7bfd5..dd75c9839 100644 --- a/stella/src/common/FrameBufferGL.cxx +++ b/stella/src/common/FrameBufferGL.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: FrameBufferGL.cxx,v 1.31 2005-06-21 23:01:23 stephena Exp $ +// $Id: FrameBufferGL.cxx,v 1.32 2005-06-23 14:33:09 stephena Exp $ //============================================================================ #include @@ -200,7 +200,8 @@ bool FrameBufferGL::createScreen() SDL_GL_SwapBuffers(); glClear(GL_COLOR_BUFFER_BIT); - refresh(); + refreshTIA(); + refreshOverlay(); return true; } @@ -227,7 +228,7 @@ void FrameBufferGL::drawMediaSource() { const uInt32 bufofs = bufofsY + x; uInt8 v = currentFrame[bufofs]; - if(v == previousFrame[bufofs] && !theRedrawEntireFrameIndicator) + if(v == previousFrame[bufofs] && !theRedrawTIAIndicator) continue; // x << 1 is times 2 ( doubling width ) @@ -237,7 +238,7 @@ void FrameBufferGL::drawMediaSource() } // The frame doesn't need to be completely redrawn anymore - theRedrawEntireFrameIndicator = false; + theRedrawTIAIndicator = false; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -300,7 +301,7 @@ void FrameBufferGL::toggleFilter() glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, myFilterParam); // The filtering has changed, so redraw the entire screen - theRedrawEntireFrameIndicator = true; + theRedrawTIAIndicator = true; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/common/FrameBufferSoft.cxx b/stella/src/common/FrameBufferSoft.cxx index 7097b5a08..64478b8bb 100644 --- a/stella/src/common/FrameBufferSoft.cxx +++ b/stella/src/common/FrameBufferSoft.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: FrameBufferSoft.cxx,v 1.27 2005-06-21 18:46:33 stephena Exp $ +// $Id: FrameBufferSoft.cxx,v 1.28 2005-06-23 14:33:10 stephena Exp $ //============================================================================ #include @@ -96,7 +96,8 @@ bool FrameBufferSoft::createScreen() return false; } - refresh(); + refreshTIA(); + refreshOverlay(); return true; } @@ -143,7 +144,7 @@ void FrameBufferSoft::drawMediaSource() for(uInt16 x = 0; x < width; x += 4, ++current, ++previous) { // Has something changed in this set of four pixels? - if((*current != *previous) || theRedrawEntireFrameIndicator) + if((*current != *previous) || theRedrawTIAIndicator) { uInt8* c = (uInt8*)current; uInt8* p = (uInt8*)previous; @@ -152,7 +153,7 @@ void FrameBufferSoft::drawMediaSource() for(uInt16 i = 0; i < 4; ++i, ++c, ++p) { // See if this pixel has changed - if((*c != *p) || theRedrawEntireFrameIndicator) + if((*c != *p) || theRedrawTIAIndicator) { // Can we extend a rectangle or do we have to create a new one? if((currentCount != 0) && @@ -252,7 +253,7 @@ void FrameBufferSoft::drawMediaSource() } // The frame doesn't need to be completely redrawn anymore - theRedrawEntireFrameIndicator = false; + theRedrawTIAIndicator = false; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/debugger/Debugger.cxx b/stella/src/debugger/Debugger.cxx index a35de5fc1..a5555ed02 100644 --- a/stella/src/debugger/Debugger.cxx +++ b/stella/src/debugger/Debugger.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Debugger.cxx,v 1.30 2005-06-23 02:56:45 urchlay Exp $ +// $Id: Debugger.cxx,v 1.31 2005-06-23 14:33:10 stephena Exp $ //============================================================================ #include "bspf.hxx" @@ -568,9 +568,8 @@ string Debugger::disassemble(int start, int lines) { } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void Debugger::nextFrame() { - myOSystem->frameBuffer().advance(); - myOSystem->frameBuffer().refresh(true); // Stephen, does this break anything? --Brian +void Debugger::nextFrame(int frames) { + myOSystem->frameBuffer().advance(frames); myBaseDialog->loadConfig(); } diff --git a/stella/src/debugger/Debugger.hxx b/stella/src/debugger/Debugger.hxx index 3d73856dd..372408557 100644 --- a/stella/src/debugger/Debugger.hxx +++ b/stella/src/debugger/Debugger.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Debugger.hxx,v 1.27 2005-06-23 02:56:45 urchlay Exp $ +// $Id: Debugger.hxx,v 1.28 2005-06-23 14:33:10 stephena Exp $ //============================================================================ #ifndef DEBUGGER_HXX @@ -51,7 +51,7 @@ enum { for all debugging operations in Stella (parser, 6502 debugger, etc). @author Stephen Anthony - @version $Id: Debugger.hxx,v 1.27 2005-06-23 02:56:45 urchlay Exp $ + @version $Id: Debugger.hxx,v 1.28 2005-06-23 14:33:10 stephena Exp $ */ class Debugger : public DialogContainer { @@ -196,7 +196,7 @@ class Debugger : public DialogContainer void toggleD(); void reset(); void autoLoadSymbols(string file); - void nextFrame(); + void nextFrame(int frames); void clearAllBreakPoints(); void formatFlags(int f, char *out); diff --git a/stella/src/debugger/DebuggerParser.cxx b/stella/src/debugger/DebuggerParser.cxx index 55d5de6ce..7e511693b 100644 --- a/stella/src/debugger/DebuggerParser.cxx +++ b/stella/src/debugger/DebuggerParser.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: DebuggerParser.cxx,v 1.30 2005-06-23 02:56:45 urchlay Exp $ +// $Id: DebuggerParser.cxx,v 1.31 2005-06-23 14:33:10 stephena Exp $ //============================================================================ #include "bspf.hxx" @@ -560,11 +560,9 @@ string DebuggerParser::run(const string& command) { } else if(subStringMatch(verb, "disasm")) { return disasm(); } else if(subStringMatch(verb, "frame")) { - // FIXME: make multiple frames work! int count = 1; if(argCount != 0) count = args[0]; - for(int i=0; inextFrame(); + debugger->nextFrame(count); return "advanced frame"; } else if(subStringMatch(verb, "clearbreaks")) { debugger->clearAllBreakPoints(); diff --git a/stella/src/emucore/EventHandler.cxx b/stella/src/emucore/EventHandler.cxx index 71558174f..9fa5050c3 100644 --- a/stella/src/emucore/EventHandler.cxx +++ b/stella/src/emucore/EventHandler.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: EventHandler.cxx,v 1.75 2005-06-16 16:36:49 urchlay Exp $ +// $Id: EventHandler.cxx,v 1.76 2005-06-23 14:33:11 stephena Exp $ //============================================================================ #include @@ -465,7 +465,8 @@ void EventHandler::poll(uInt32 time) break; // SDL_QUIT case SDL_VIDEOEXPOSE: - myOSystem->frameBuffer().refresh(); + myOSystem->frameBuffer().refreshTIA(); + myOSystem->frameBuffer().refreshOverlay(); break; // SDL_VIDEOEXPOSE } @@ -1269,7 +1270,7 @@ void EventHandler::takeSnapshot() filename = sspath + ".png"; // Now create a Snapshot object and save the PNG - myOSystem->frameBuffer().refresh(true); + myOSystem->frameBuffer().refreshTIA(true); Snapshot snapshot(myOSystem->frameBuffer()); string result = snapshot.savePNG(filename); myOSystem->frameBuffer().showMessage(result); @@ -1298,7 +1299,7 @@ void EventHandler::enterMenuMode() { myState = S_MENU; myOSystem->menu().reStack(); - myOSystem->frameBuffer().refresh(); + myOSystem->frameBuffer().refreshOverlay(); myOSystem->frameBuffer().setCursorState(); myOSystem->sound().mute(true); myEvent->clear(); @@ -1308,7 +1309,7 @@ void EventHandler::enterMenuMode() void EventHandler::leaveMenuMode() { myState = S_EMULATE; - myOSystem->frameBuffer().refresh(); + myOSystem->frameBuffer().refreshTIA(); myOSystem->frameBuffer().setCursorState(); myOSystem->sound().mute(false); myEvent->clear(); @@ -1324,7 +1325,7 @@ void EventHandler::enterDebugMode() myState = S_DEBUGGER; myOSystem->createFrameBuffer(); myOSystem->debugger().reStack(); - myOSystem->frameBuffer().refresh(); + myOSystem->frameBuffer().refreshOverlay(); myOSystem->frameBuffer().setCursorState(); myEvent->clear(); @@ -1337,7 +1338,7 @@ void EventHandler::leaveDebugMode() { myState = S_EMULATE; myOSystem->createFrameBuffer(); - myOSystem->frameBuffer().refresh(); + myOSystem->frameBuffer().refreshTIA(); myOSystem->frameBuffer().setCursorState(); myEvent->clear(); diff --git a/stella/src/emucore/FrameBuffer.cxx b/stella/src/emucore/FrameBuffer.cxx index db401cf12..d12301ba7 100644 --- a/stella/src/emucore/FrameBuffer.cxx +++ b/stella/src/emucore/FrameBuffer.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: FrameBuffer.cxx,v 1.46 2005-06-17 17:34:01 stephena Exp $ +// $Id: FrameBuffer.cxx,v 1.47 2005-06-23 14:33:11 stephena Exp $ //============================================================================ #include @@ -37,17 +37,17 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FrameBuffer::FrameBuffer(OSystem* osystem) : myOSystem(osystem), - theRedrawEntireFrameIndicator(true), - theFrameAdvanceIndicator(false), + theRedrawTIAIndicator(true), theZoomLevel(2), theMaxZoomLevel(2), theAspectRatio(1.0), myFrameRate(0), myPauseStatus(false), - theOverlayChangedIndicator(false), + theRedrawOverlayIndicator(false), + myOverlayRedraws(2), + theFrameAdvanceIndicator(0), myMessageTime(0), myMessageText(""), - myOverlayRedraws(2), myNumRedraws(0) { // Fill the GUI colors array @@ -150,7 +150,7 @@ void FrameBuffer::initialize(const string& title, uInt32 width, uInt32 height, // Erase any messages from a previous run myMessageTime = 0; - theRedrawEntireFrameIndicator = true; + theRedrawTIAIndicator = true; //FIX } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -191,7 +191,7 @@ void FrameBuffer::update() // Erase this message on next update if(myMessageTime == 0) - theRedrawEntireFrameIndicator = true; + theRedrawTIAIndicator = true; // FIX } } break; // S_EMULATE @@ -200,11 +200,11 @@ void FrameBuffer::update() case EventHandler::S_MENU: { // Only update the screen if it's been invalidated - if(theRedrawEntireFrameIndicator) + if(theRedrawTIAIndicator) drawMediaSource(); // Only update the overlay if it's changed - if(theOverlayChangedIndicator) + if(theRedrawOverlayIndicator) { // Then overlay any menu items myOSystem->menu().draw(); @@ -215,7 +215,7 @@ void FrameBuffer::update() // menus at least twice (so they'll be in both buffers) // Otherwise, we get horrible flickering myOverlayRedraws--; - theOverlayChangedIndicator = (myOverlayRedraws != 0); + theRedrawOverlayIndicator = (myOverlayRedraws != 0); } break; } @@ -223,41 +223,40 @@ void FrameBuffer::update() case EventHandler::S_LAUNCHER: { // Only update the screen if it's been invalidated or the overlay have changed - if(theRedrawEntireFrameIndicator || theOverlayChangedIndicator) + if(theRedrawOverlayIndicator) { // Overlay the ROM launcher myOSystem->launcher().draw(); - // Now the screen is up to date - theRedrawEntireFrameIndicator = false; - // This is a performance hack to only draw the overlay when necessary // Software mode is single-buffered, so we don't have to worry // However, OpenGL mode is double-buffered, so we need to draw the // menus at least twice (so they'll be in both buffers) // Otherwise, we get horrible flickering myOverlayRedraws--; - theOverlayChangedIndicator = (myOverlayRedraws != 0); + theRedrawOverlayIndicator = (myOverlayRedraws != 0); } break; } case EventHandler::S_DEBUGGER: + { // Get one frames' worth of data - if(theFrameAdvanceIndicator) + bool advance = false; + if(theFrameAdvanceIndicator > 0) { myOSystem->console().mediaSource().update(); - theRedrawEntireFrameIndicator = true; // do the next section of code - theOverlayChangedIndicator = true; // do this just to be sure - theFrameAdvanceIndicator = false; + advance = true; + --theFrameAdvanceIndicator; } - // Only update the screen if it's been invalidated - if(theRedrawEntireFrameIndicator) + // Only update the screen if it's been invalidated or we're in + // frame advance mode + if(advance || theRedrawTIAIndicator) drawMediaSource(); // Only update the overlay if it's changed - if(theOverlayChangedIndicator) + if(theRedrawOverlayIndicator) { // Overlay the ROM launcher myOSystem->debugger().draw(); @@ -268,9 +267,10 @@ void FrameBuffer::update() // menus at least twice (so they'll be in both buffers) // Otherwise, we get horrible flickering myOverlayRedraws--; - theOverlayChangedIndicator = (myOverlayRedraws != 0); + theRedrawOverlayIndicator = (myOverlayRedraws != 0); } break; // S_DEBUGGER + } case EventHandler::S_NONE: return; @@ -281,12 +281,36 @@ void FrameBuffer::update() postFrameUpdate(); } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void FrameBuffer::refreshTIA(bool now) +{ +// cerr << "refreshTIA() " << myNumRedraws++ << endl; + theRedrawTIAIndicator = true; + if(now) + { + myMessageTime = 0; + update(); + } +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void FrameBuffer::refreshOverlay(bool now) +{ +// cerr << "refreshOverlay()\n"; + if(myOSystem->eventHandler().state() == EventHandler::S_MENU) + refreshTIA(now); + + theRedrawOverlayIndicator = true; + myOverlayRedraws = 2; + if(now) update(); +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void FrameBuffer::showMessage(const string& message) { myMessageText = message; myMessageTime = myFrameRate << 1; // Show message for 2 seconds - theRedrawEntireFrameIndicator = true; + theRedrawTIAIndicator = true; // FIXME } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -309,7 +333,7 @@ void FrameBuffer::setPalette(const uInt32* palette) myPalette[i] = mapRGB(r, g, b); } - theRedrawEntireFrameIndicator = true; + theRedrawTIAIndicator = true; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/emucore/FrameBuffer.hxx b/stella/src/emucore/FrameBuffer.hxx index dd00f5c86..dfafe5776 100644 --- a/stella/src/emucore/FrameBuffer.hxx +++ b/stella/src/emucore/FrameBuffer.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: FrameBuffer.hxx,v 1.41 2005-06-17 17:34:01 stephena Exp $ +// $Id: FrameBuffer.hxx,v 1.42 2005-06-23 14:33:11 stephena Exp $ //============================================================================ #ifndef FRAMEBUFFER_HXX @@ -28,8 +28,8 @@ #include "Font.hxx" #include "GuiUtils.hxx" -class Console; class OSystem; +class Console; // Text alignment modes for drawString() enum TextAlignment { @@ -46,7 +46,7 @@ enum TextAlignment { All GUI elements (ala ScummVM) are drawn here as well. @author Stephen Anthony - @version $Id: FrameBuffer.hxx,v 1.41 2005-06-17 17:34:01 stephena Exp $ + @version $Id: FrameBuffer.hxx,v 1.42 2005-06-23 14:33:11 stephena Exp $ */ class FrameBuffer { @@ -125,25 +125,24 @@ class FrameBuffer void pause(bool status); /** - Indicates that the window contents are dirty, and certain areas need + Indicates that the TIA area is dirty, and certain areas need to be redrawn. @param now Determine if the refresh should be done right away or in the next frame */ - void refresh(bool now = false) - { -// cerr << "refresh() " << myNumRedraws++ << endl; - theRedrawEntireFrameIndicator = true; - theOverlayChangedIndicator = true; - myOverlayRedraws = 2; - if(now) { myMessageTime = 0; update(); } - } + void refreshTIA(bool now = false); + + /** + Indicates that the overlay area is dirty, and certain areas need + to be redrawn. + */ + void refreshOverlay(bool now = false); /** Indicates that the emulation should advance one frame. */ - void advance() { theFrameAdvanceIndicator = true; } + void advance(int frames) { theFrameAdvanceIndicator = frames; } /** Toggles between fullscreen and window mode. @@ -411,11 +410,8 @@ class FrameBuffer // Dimensions of the desktop area SDL_Rect myDesktopDim; - // Indicates if the entire frame should be redrawn - bool theRedrawEntireFrameIndicator; - - // Indicates if the emulation should advance by one frame - bool theFrameAdvanceIndicator; + // Indicates if the TIA area should be redrawn + bool theRedrawTIAIndicator; // The SDL video buffer SDL_Surface* myScreen; @@ -451,8 +447,14 @@ class FrameBuffer // Indicates the current pause status bool myPauseStatus; - // Indicates if the menus should be redrawn - bool theOverlayChangedIndicator; + // Indicates if the overlay area should be redrawn + bool theRedrawOverlayIndicator; + + // Number of times menu have been drawn + int myOverlayRedraws; + + // Indicates how many frames the emulation should advance + int theFrameAdvanceIndicator; // Message timer Int32 myMessageTime; @@ -460,9 +462,6 @@ class FrameBuffer // Message text string myMessageText; - // Number of times menu have been drawn - uInt32 myOverlayRedraws; - // Indicates how many times the framebuffer has been redrawn // Used only for debugging purposes uInt32 myNumRedraws; diff --git a/stella/src/emucore/OSystem.cxx b/stella/src/emucore/OSystem.cxx index 05a487844..932927187 100644 --- a/stella/src/emucore/OSystem.cxx +++ b/stella/src/emucore/OSystem.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: OSystem.cxx,v 1.26 2005-06-20 18:32:11 stephena Exp $ +// $Id: OSystem.cxx,v 1.27 2005-06-23 14:33:11 stephena Exp $ //============================================================================ #include @@ -339,7 +339,7 @@ void OSystem::createLauncher() // And start the base dialog myLauncher->initialize(); myLauncher->reStack(); - myFrameBuffer->refresh(); + myFrameBuffer->refreshOverlay(); myFrameBuffer->setCursorState(); mySound->mute(true); } diff --git a/stella/src/gui/AboutDialog.cxx b/stella/src/gui/AboutDialog.cxx index 5dfd8bb33..7dffe0578 100644 --- a/stella/src/gui/AboutDialog.cxx +++ b/stella/src/gui/AboutDialog.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: AboutDialog.cxx,v 1.2 2005-06-16 00:55:59 stephena Exp $ +// $Id: AboutDialog.cxx,v 1.3 2005-06-23 14:33:11 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -226,7 +226,7 @@ void AboutDialog::displayInfo() delete[] dscStr; - instance()->frameBuffer().refresh(); + instance()->frameBuffer().refreshOverlay(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/gui/AddrValueWidget.cxx b/stella/src/gui/AddrValueWidget.cxx index e0f0a17ad..76426c8ed 100644 --- a/stella/src/gui/AddrValueWidget.cxx +++ b/stella/src/gui/AddrValueWidget.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: AddrValueWidget.cxx,v 1.6 2005-06-22 18:30:43 stephena Exp $ +// $Id: AddrValueWidget.cxx,v 1.7 2005-06-23 14:33:11 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -143,7 +143,9 @@ void AddrValueWidget::handleMouseDown(int x, int y, int button, int clickCount) abortEditMode(); _selectedItem = newSelectedItem; sendCommand(kAVSelectionChangedCmd, _selectedItem); - instance()->frameBuffer().refresh(); + + // TODO - dirty rectangle + instance()->frameBuffer().refreshOverlay(); } // TODO: Determine where inside the string the user clicked and place the @@ -261,7 +263,8 @@ bool AddrValueWidget::handleKeyDown(int ascii, int keycode, int modifiers) // also draw scrollbar _scrollBar->draw(); - instance()->frameBuffer().refresh(); + // TODO - dirty rectangle + instance()->frameBuffer().refreshOverlay(); } _currentKeyDown = keycode; diff --git a/stella/src/gui/AudioDialog.cxx b/stella/src/gui/AudioDialog.cxx index 9f2b8ec68..10c4d9bf0 100644 --- a/stella/src/gui/AudioDialog.cxx +++ b/stella/src/gui/AudioDialog.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: AudioDialog.cxx,v 1.8 2005-06-16 00:55:59 stephena Exp $ +// $Id: AudioDialog.cxx,v 1.9 2005-06-23 14:33:11 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -181,7 +181,7 @@ void AudioDialog::setDefaults() // Make sure that mutually-exclusive items are not enabled at the same time handleSoundEnableChange(true); - instance()->frameBuffer().refresh(); + instance()->frameBuffer().refreshOverlay(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/gui/CpuWidget.cxx b/stella/src/gui/CpuWidget.cxx index 313f9a2ee..f8c108298 100644 --- a/stella/src/gui/CpuWidget.cxx +++ b/stella/src/gui/CpuWidget.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: CpuWidget.cxx,v 1.3 2005-06-22 18:30:43 stephena Exp $ +// $Id: CpuWidget.cxx,v 1.4 2005-06-23 14:33:11 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -221,7 +221,8 @@ void CpuWidget::handleCommand(CommandSender* sender, int cmd, int data) */ } - instance()->frameBuffer().refresh(); + // TODO - dirty rect, or is it necessary here? + instance()->frameBuffer().refreshOverlay(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/gui/DataGridWidget.cxx b/stella/src/gui/DataGridWidget.cxx index 020cca710..fe4e0a91b 100644 --- a/stella/src/gui/DataGridWidget.cxx +++ b/stella/src/gui/DataGridWidget.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: DataGridWidget.cxx,v 1.3 2005-06-22 18:30:43 stephena Exp $ +// $Id: DataGridWidget.cxx,v 1.4 2005-06-23 14:33:11 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -129,7 +129,9 @@ void DataGridWidget::handleMouseDown(int x, int y, int button, int clickCount) _currentCol = _selectedItem - (_currentRow * _cols); sendCommand(kDGSelectionChangedCmd, _selectedItem); - instance()->frameBuffer().refresh(); + + // TODO - dirty rectangle + instance()->frameBuffer().refreshOverlay(); } // TODO: Determine where inside the string the user clicked and place the @@ -269,7 +271,9 @@ bool DataGridWidget::handleKeyDown(int ascii, int keycode, int modifiers) _selectedItem = _currentRow*_cols + _currentCol; draw(); sendCommand(kDGSelectionChangedCmd, _selectedItem); - instance()->frameBuffer().refresh(); + + // TODO - dirty rectangle + instance()->frameBuffer().refreshOverlay(); } _currentKeyDown = keycode; diff --git a/stella/src/gui/DebuggerDialog.cxx b/stella/src/gui/DebuggerDialog.cxx index c9a90b62c..2c6d4f9d2 100644 --- a/stella/src/gui/DebuggerDialog.cxx +++ b/stella/src/gui/DebuggerDialog.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: DebuggerDialog.cxx,v 1.16 2005-06-20 18:32:12 stephena Exp $ +// $Id: DebuggerDialog.cxx,v 1.17 2005-06-23 14:33:11 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -127,7 +127,7 @@ void DebuggerDialog::handleCommand(CommandSender* sender, int cmd, int data) break; case kDDAdvCmd: - instance()->debugger().nextFrame(); + instance()->debugger().nextFrame(1); myTab->loadConfig(); break; diff --git a/stella/src/gui/DialogContainer.cxx b/stella/src/gui/DialogContainer.cxx index 9d5a8e0e1..0d1f22aaf 100644 --- a/stella/src/gui/DialogContainer.cxx +++ b/stella/src/gui/DialogContainer.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: DialogContainer.cxx,v 1.10 2005-06-16 00:55:59 stephena Exp $ +// $Id: DialogContainer.cxx,v 1.11 2005-06-23 14:33:11 stephena Exp $ //============================================================================ #include "OSystem.hxx" @@ -86,7 +86,7 @@ void DialogContainer::draw() void DialogContainer::addDialog(Dialog* d) { myDialogStack.push(d); - myOSystem->frameBuffer().refresh(); + myOSystem->frameBuffer().refreshOverlay(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -95,7 +95,7 @@ void DialogContainer::removeDialog() if(!myDialogStack.empty()) { myDialogStack.pop(); - myOSystem->frameBuffer().refresh(); + myOSystem->frameBuffer().refreshOverlay(); } } diff --git a/stella/src/gui/EditNumWidget.cxx b/stella/src/gui/EditNumWidget.cxx index c1cd05ea2..3ab1cf92f 100644 --- a/stella/src/gui/EditNumWidget.cxx +++ b/stella/src/gui/EditNumWidget.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: EditNumWidget.cxx,v 1.4 2005-06-20 21:01:37 stephena Exp $ +// $Id: EditNumWidget.cxx,v 1.5 2005-06-23 14:33:11 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -75,7 +75,8 @@ void EditNumWidget::handleMouseDown(int x, int y, int button, int clickCount) if (setCaretPos(i)) { draw(); - _boss->instance()->frameBuffer().refresh(); + // TODO - dirty rectangle + _boss->instance()->frameBuffer().refreshOverlay(); } } diff --git a/stella/src/gui/EditTextWidget.cxx b/stella/src/gui/EditTextWidget.cxx index 969bfc042..fb68eee04 100644 --- a/stella/src/gui/EditTextWidget.cxx +++ b/stella/src/gui/EditTextWidget.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: EditTextWidget.cxx,v 1.4 2005-06-22 18:30:43 stephena Exp $ +// $Id: EditTextWidget.cxx,v 1.5 2005-06-23 14:33:11 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -65,7 +65,8 @@ void EditTextWidget::handleMouseDown(int x, int y, int button, int clickCount) if (setCaretPos(i)) { draw(); - _boss->instance()->frameBuffer().refresh(); + // TODO - dirty rectangle + _boss->instance()->frameBuffer().refreshOverlay(); } } diff --git a/stella/src/gui/EditableWidget.cxx b/stella/src/gui/EditableWidget.cxx index a1a456c35..e7a002b56 100644 --- a/stella/src/gui/EditableWidget.cxx +++ b/stella/src/gui/EditableWidget.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: EditableWidget.cxx,v 1.6 2005-06-22 18:30:43 stephena Exp $ +// $Id: EditableWidget.cxx,v 1.7 2005-06-23 14:33:11 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -54,7 +54,8 @@ void EditableWidget::setEditString(const string& str) _editScrollOffset = 0; // Make sure the new string is seen onscreen - _boss->instance()->frameBuffer().refresh(); + // TODO - dirty rectangle + _boss->instance()->frameBuffer().refreshOverlay(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -141,7 +142,8 @@ bool EditableWidget::handleKeyDown(int ascii, int keycode, int modifiers) if (dirty) { draw(); - _boss->instance()->frameBuffer().refresh(); + // TODO - dirty rectangle + _boss->instance()->frameBuffer().refreshOverlay(); } return handled; diff --git a/stella/src/gui/GameInfoDialog.cxx b/stella/src/gui/GameInfoDialog.cxx index 9d584fa44..a8d122e51 100644 --- a/stella/src/gui/GameInfoDialog.cxx +++ b/stella/src/gui/GameInfoDialog.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: GameInfoDialog.cxx,v 1.6 2005-06-16 00:55:59 stephena Exp $ +// $Id: GameInfoDialog.cxx,v 1.7 2005-06-23 14:33:11 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -118,7 +118,7 @@ void GameInfoDialog::displayInfo() delete[] keyStr; delete[] dscStr; - instance()->frameBuffer().refresh(); + instance()->frameBuffer().refreshOverlay(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/gui/HelpDialog.cxx b/stella/src/gui/HelpDialog.cxx index f4e343508..98be9154a 100644 --- a/stella/src/gui/HelpDialog.cxx +++ b/stella/src/gui/HelpDialog.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: HelpDialog.cxx,v 1.8 2005-06-16 00:55:59 stephena Exp $ +// $Id: HelpDialog.cxx,v 1.9 2005-06-23 14:33:11 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -173,7 +173,7 @@ void HelpDialog::displayInfo() delete[] keyStr; delete[] dscStr; - instance()->frameBuffer().refresh(); + instance()->frameBuffer().refreshOverlay(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/gui/ListWidget.cxx b/stella/src/gui/ListWidget.cxx index f4774ebb5..efb0240f4 100644 --- a/stella/src/gui/ListWidget.cxx +++ b/stella/src/gui/ListWidget.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: ListWidget.cxx,v 1.21 2005-06-22 18:30:43 stephena Exp $ +// $Id: ListWidget.cxx,v 1.22 2005-06-23 14:33:11 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -77,7 +77,9 @@ void ListWidget::setSelected(int item) _currentPos = _selectedItem - _entriesPerPage / 2; scrollToCurrent(); draw(); - instance()->frameBuffer().refresh(); + + // TODO - dirty rectangle + instance()->frameBuffer().refreshOverlay(); } } @@ -142,7 +144,9 @@ void ListWidget::handleMouseDown(int x, int y, int button, int clickCount) abortEditMode(); _selectedItem = newSelectedItem; sendCommand(kListSelectionChangedCmd, _selectedItem); - instance()->frameBuffer().refresh(); + + // TODO - dirty rectangle + instance()->frameBuffer().refreshOverlay(); } // TODO: Determine where inside the string the user clicked and place the @@ -302,7 +306,8 @@ bool ListWidget::handleKeyDown(int ascii, int keycode, int modifiers) // also draw scrollbar _scrollBar->draw(); - instance()->frameBuffer().refresh(); + // TODO - dirty rectangle + instance()->frameBuffer().refreshOverlay(); } _currentKeyDown = keycode; diff --git a/stella/src/gui/PopUpWidget.cxx b/stella/src/gui/PopUpWidget.cxx index 39fa0cfe8..3c2d2d346 100644 --- a/stella/src/gui/PopUpWidget.cxx +++ b/stella/src/gui/PopUpWidget.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: PopUpWidget.cxx,v 1.12 2005-06-16 00:56:00 stephena Exp $ +// $Id: PopUpWidget.cxx,v 1.13 2005-06-23 14:33:11 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -177,7 +177,8 @@ void PopUpDialog::setSelection(int item) if(item >= 0) drawMenuEntry(item, true); - _popUpBoss->instance()->frameBuffer().refresh(); + // TODO - dirty rectangle + _popUpBoss->instance()->frameBuffer().refreshOverlay(); } } diff --git a/stella/src/gui/ProgressDialog.cxx b/stella/src/gui/ProgressDialog.cxx index e9d7e5150..86a59e1c8 100644 --- a/stella/src/gui/ProgressDialog.cxx +++ b/stella/src/gui/ProgressDialog.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: ProgressDialog.cxx,v 1.2 2005-06-16 00:56:00 stephena Exp $ +// $Id: ProgressDialog.cxx,v 1.3 2005-06-23 14:33:11 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -47,7 +47,7 @@ ProgressDialog::ProgressDialog(OSystem* osystem, DialogContainer* parent, // across the entire screen for a split-second parent->addDialog(this); - instance()->frameBuffer().refresh(true); + instance()->frameBuffer().refreshOverlay(true); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -59,7 +59,7 @@ ProgressDialog::~ProgressDialog() void ProgressDialog::done() { parent()->removeDialog(); - instance()->frameBuffer().refresh(true); + instance()->frameBuffer().refreshOverlay(true); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -87,6 +87,6 @@ void ProgressDialog::setProgress(int progress) { myCurrentStep += myStep; mySlider->setValue(p); - instance()->frameBuffer().refresh(true); + instance()->frameBuffer().refreshOverlay(true); } } diff --git a/stella/src/gui/PromptWidget.cxx b/stella/src/gui/PromptWidget.cxx index 8b917d2fe..eb3e5bfeb 100644 --- a/stella/src/gui/PromptWidget.cxx +++ b/stella/src/gui/PromptWidget.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: PromptWidget.cxx,v 1.12 2005-06-23 01:10:26 urchlay Exp $ +// $Id: PromptWidget.cxx,v 1.13 2005-06-23 14:33:11 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -152,6 +152,7 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers) { int i; bool handled = true; + bool dirty = false; switch (keycode) { @@ -186,8 +187,7 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers) printPrompt(); - draw(); - instance()->frameBuffer().refresh(); + dirty = true; break; } @@ -196,14 +196,12 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers) killChar(-1); scrollToCurrent(); - draw(); // FIXME - not nice to redraw the full console just for one char! - instance()->frameBuffer().refresh(); + dirty = true; break; case 127: killChar(+1); - draw(); - instance()->frameBuffer().refresh(); + dirty = true; break; case 256 + 24: // pageup @@ -217,8 +215,8 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers) if (_scrollLine < _firstLineInBuffer + _linesPerPage - 1) _scrollLine = _firstLineInBuffer + _linesPerPage - 1; updateScrollBuffer(); - draw(); - instance()->frameBuffer().refresh(); + + dirty = true; } break; @@ -233,8 +231,8 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers) if (_scrollLine > _promptEndPos / _lineWidth) _scrollLine = _promptEndPos / _lineWidth; updateScrollBuffer(); - draw(); - instance()->frameBuffer().refresh(); + + dirty = true; } break; @@ -247,8 +245,7 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers) else _currentPos = _promptStartPos; - draw(); - instance()->frameBuffer().refresh(); + dirty = true; break; case 256 + 23: // end @@ -262,8 +259,7 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers) else _currentPos = _promptEndPos; - draw(); - instance()->frameBuffer().refresh(); + dirty = true; break; case 273: // cursor up @@ -274,8 +270,8 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers) _scrollLine -= 1; updateScrollBuffer(); - draw(); - instance()->frameBuffer().refresh(); + + dirty = true; } else historyScroll(+1); @@ -290,8 +286,8 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers) _scrollLine += 1; updateScrollBuffer(); - draw(); - instance()->frameBuffer().refresh(); + + dirty = true; } else historyScroll(-1); @@ -300,15 +296,15 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers) case 275: // cursor right if (_currentPos < _promptEndPos) _currentPos++; - draw(); - instance()->frameBuffer().refresh(); + + dirty = true; break; case 276: // cursor left if (_currentPos > _promptStartPos) _currentPos--; - draw(); - instance()->frameBuffer().refresh(); + + dirty = true; break; default: @@ -332,6 +328,13 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers) break; } + if(dirty) + { + draw(); + // TODO - dirty rectangle + instance()->frameBuffer().refreshOverlay(); + } + return handled; } @@ -361,7 +364,7 @@ void PromptWidget::handleCommand(CommandSender* sender, int cmd, int data) { _scrollLine = newPos; draw(); - instance()->frameBuffer().refresh(); + instance()->frameBuffer().refreshOverlay(); } break; } @@ -408,7 +411,7 @@ void PromptWidget::specialKeys(int keycode) if(handled) { draw(); - instance()->frameBuffer().refresh(); + instance()->frameBuffer().refreshOverlay(); } } @@ -544,7 +547,8 @@ void PromptWidget::historyScroll(int direction) scrollToCurrent(); draw(); - instance()->frameBuffer().refresh(); + // TODO - dirty rectangle + instance()->frameBuffer().refreshOverlay(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -615,7 +619,8 @@ void PromptWidget::putchar(int c) putcharIntern(c); draw(); // FIXME - not nice to redraw the full console just for one char! - instance()->frameBuffer().refresh(); + // TODO - dirty rectangle + instance()->frameBuffer().refreshOverlay(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -648,7 +653,8 @@ void PromptWidget::print(const char *str) putcharIntern(*str++); draw(); - instance()->frameBuffer().refresh(); + // TODO - dirty rectangle + instance()->frameBuffer().refreshOverlay(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/gui/RamWidget.cxx b/stella/src/gui/RamWidget.cxx index 742333164..ced2c9b1c 100644 --- a/stella/src/gui/RamWidget.cxx +++ b/stella/src/gui/RamWidget.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: RamWidget.cxx,v 1.8 2005-06-22 18:30:44 stephena Exp $ +// $Id: RamWidget.cxx,v 1.9 2005-06-23 14:33:11 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -216,7 +216,8 @@ void RamWidget::handleCommand(CommandSender* sender, int cmd, int data) break; } - instance()->frameBuffer().refresh(); + // TODO - dirty rect, or is it necessary here? + instance()->frameBuffer().refreshOverlay(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/gui/ScrollBarWidget.cxx b/stella/src/gui/ScrollBarWidget.cxx index 13ae52c51..80ae2662f 100644 --- a/stella/src/gui/ScrollBarWidget.cxx +++ b/stella/src/gui/ScrollBarWidget.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: ScrollBarWidget.cxx,v 1.7 2005-06-16 00:56:00 stephena Exp $ +// $Id: ScrollBarWidget.cxx,v 1.8 2005-06-23 14:33:11 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -187,7 +187,8 @@ void ScrollBarWidget::handleMouseMoved(int x, int y, int button) draw(); // Refresh the FB, since the selected part has changed - _boss->instance()->frameBuffer().refresh(); + // TODO - dirty rectangle + _boss->instance()->frameBuffer().refreshOverlay(); } } } @@ -228,7 +229,8 @@ void ScrollBarWidget::recalc() _sliderPos = UP_DOWN_BOX_HEIGHT; } - _boss->instance()->frameBuffer().refresh(); + // TODO - dirty rectangle + _boss->instance()->frameBuffer().refreshOverlay(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/gui/TabWidget.cxx b/stella/src/gui/TabWidget.cxx index 0b5d72c80..4c44fc6f9 100644 --- a/stella/src/gui/TabWidget.cxx +++ b/stella/src/gui/TabWidget.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: TabWidget.cxx,v 1.9 2005-06-17 14:42:49 stephena Exp $ +// $Id: TabWidget.cxx,v 1.10 2005-06-23 14:33:11 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -125,7 +125,9 @@ void TabWidget::setActiveTab(int tabID) _activeWidget->receivedFocus(); _boss->draw(); - _boss->instance()->frameBuffer().refresh(); + + // TODO - dirty rectangle + _boss->instance()->frameBuffer().refreshOverlay(); } } @@ -241,7 +243,8 @@ void TabWidget::handleCommand(CommandSender* sender, int cmd, int data) Widget::setFocusForChain(_firstWidget, _activeWidget); // Make sure the changes are shown onscreen - _boss->instance()->frameBuffer().refresh(); + // TODO - dirty rectangle + _boss->instance()->frameBuffer().refreshOverlay(); } break; @@ -263,7 +266,8 @@ void TabWidget::loadConfig() } // Make sure changes are seen onscreen - instance()->frameBuffer().refresh(); + // TODO - dirty rectangle + instance()->frameBuffer().refreshOverlay(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/gui/VideoDialog.cxx b/stella/src/gui/VideoDialog.cxx index 9e3d7bb20..75a29d1d0 100644 --- a/stella/src/gui/VideoDialog.cxx +++ b/stella/src/gui/VideoDialog.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: VideoDialog.cxx,v 1.16 2005-06-16 00:56:00 stephena Exp $ +// $Id: VideoDialog.cxx,v 1.17 2005-06-23 14:33:11 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -336,7 +336,7 @@ void VideoDialog::setDefaults() // Make sure that mutually-exclusive items are not enabled at the same time handleRendererChange(0); // 0 indicates software mode - instance()->frameBuffer().refresh(); + instance()->frameBuffer().refreshOverlay(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/gui/Widget.cxx b/stella/src/gui/Widget.cxx index f76c470a4..d8b02da4a 100644 --- a/stella/src/gui/Widget.cxx +++ b/stella/src/gui/Widget.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Widget.cxx,v 1.18 2005-06-16 22:18:02 stephena Exp $ +// $Id: Widget.cxx,v 1.19 2005-06-23 14:33:12 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -339,8 +339,8 @@ void StaticTextWidget::setValue(int value) _label = buf; // Refresh the screen when the text has changed - // TODO - eventually, this should be a dirty rectangle - _boss->instance()->frameBuffer().refresh(); + // TODO - create dirty rectangle + _boss->instance()->frameBuffer().refreshOverlay(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -421,8 +421,8 @@ void CheckboxWidget::setState(bool state) sendCommand(_cmd, _state); // Refresh the screen after the checkbox is drawn - // TODO - eventually, this should be a dirty rectangle - _boss->instance()->frameBuffer().refresh(); + // TODO - create dirty rectangle + _boss->instance()->frameBuffer().refreshOverlay(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -480,8 +480,8 @@ void SliderWidget::handleMouseMoved(int x, int y, int button) sendCommand(_cmd, _value); } // Refresh the screen while the slider is being redrawn - // TODO - eventually, this should be a dirty rectangle - _boss->instance()->frameBuffer().refresh(); + // TODO - create dirty rectangle + _boss->instance()->frameBuffer().refreshOverlay(); } } diff --git a/stella/src/gui/Widget.hxx b/stella/src/gui/Widget.hxx index be1919aca..c12760017 100644 --- a/stella/src/gui/Widget.hxx +++ b/stella/src/gui/Widget.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Widget.hxx,v 1.20 2005-06-20 18:32:12 stephena Exp $ +// $Id: Widget.hxx,v 1.21 2005-06-23 14:33:12 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -67,7 +67,7 @@ enum { This is the base class for all widgets. @author Stephen Anthony - @version $Id: Widget.hxx,v 1.20 2005-06-20 18:32:12 stephena Exp $ + @version $Id: Widget.hxx,v 1.21 2005-06-23 14:33:12 stephena Exp $ */ class Widget : public GuiObject { @@ -98,10 +98,10 @@ class Widget : public GuiObject virtual bool wantsFocus() { return false; }; void setFlags(int flags) { _flags |= flags; - _boss->instance()->frameBuffer().refresh(); + _boss->instance()->frameBuffer().refreshOverlay(); } void clearFlags(int flags) { _flags &= ~flags; - _boss->instance()->frameBuffer().refresh(); + _boss->instance()->frameBuffer().refreshOverlay(); } int getFlags() const { return _flags; } @@ -168,7 +168,7 @@ class StaticTextWidget : public Widget void setValue(int value); void setAlign(TextAlignment align) { _align = align; } void setLabel(const string& label) { _label = label; - _boss->instance()->frameBuffer().refresh(); + _boss->instance()->frameBuffer().refreshOverlay(); } const string& getLabel() const { return _label; }