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
This commit is contained in:
stephena 2005-06-23 14:33:12 +00:00
parent cbd3258604
commit 92a7352e30
31 changed files with 221 additions and 167 deletions

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 <SDL.h> #include <SDL.h>
@ -200,7 +200,8 @@ bool FrameBufferGL::createScreen()
SDL_GL_SwapBuffers(); SDL_GL_SwapBuffers();
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
refresh(); refreshTIA();
refreshOverlay();
return true; return true;
} }
@ -227,7 +228,7 @@ void FrameBufferGL::drawMediaSource()
{ {
const uInt32 bufofs = bufofsY + x; const uInt32 bufofs = bufofsY + x;
uInt8 v = currentFrame[bufofs]; uInt8 v = currentFrame[bufofs];
if(v == previousFrame[bufofs] && !theRedrawEntireFrameIndicator) if(v == previousFrame[bufofs] && !theRedrawTIAIndicator)
continue; continue;
// x << 1 is times 2 ( doubling width ) // x << 1 is times 2 ( doubling width )
@ -237,7 +238,7 @@ void FrameBufferGL::drawMediaSource()
} }
// The frame doesn't need to be completely redrawn anymore // 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); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, myFilterParam);
// The filtering has changed, so redraw the entire screen // The filtering has changed, so redraw the entire screen
theRedrawEntireFrameIndicator = true; theRedrawTIAIndicator = true;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 <SDL.h> #include <SDL.h>
@ -96,7 +96,8 @@ bool FrameBufferSoft::createScreen()
return false; return false;
} }
refresh(); refreshTIA();
refreshOverlay();
return true; return true;
} }
@ -143,7 +144,7 @@ void FrameBufferSoft::drawMediaSource()
for(uInt16 x = 0; x < width; x += 4, ++current, ++previous) for(uInt16 x = 0; x < width; x += 4, ++current, ++previous)
{ {
// Has something changed in this set of four pixels? // Has something changed in this set of four pixels?
if((*current != *previous) || theRedrawEntireFrameIndicator) if((*current != *previous) || theRedrawTIAIndicator)
{ {
uInt8* c = (uInt8*)current; uInt8* c = (uInt8*)current;
uInt8* p = (uInt8*)previous; uInt8* p = (uInt8*)previous;
@ -152,7 +153,7 @@ void FrameBufferSoft::drawMediaSource()
for(uInt16 i = 0; i < 4; ++i, ++c, ++p) for(uInt16 i = 0; i < 4; ++i, ++c, ++p)
{ {
// See if this pixel has changed // 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? // Can we extend a rectangle or do we have to create a new one?
if((currentCount != 0) && if((currentCount != 0) &&
@ -252,7 +253,7 @@ void FrameBufferSoft::drawMediaSource()
} }
// The frame doesn't need to be completely redrawn anymore // The frame doesn't need to be completely redrawn anymore
theRedrawEntireFrameIndicator = false; theRedrawTIAIndicator = false;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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" #include "bspf.hxx"
@ -568,9 +568,8 @@ string Debugger::disassemble(int start, int lines) {
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Debugger::nextFrame() { void Debugger::nextFrame(int frames) {
myOSystem->frameBuffer().advance(); myOSystem->frameBuffer().advance(frames);
myOSystem->frameBuffer().refresh(true); // Stephen, does this break anything? --Brian
myBaseDialog->loadConfig(); myBaseDialog->loadConfig();
} }

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 #ifndef DEBUGGER_HXX
@ -51,7 +51,7 @@ enum {
for all debugging operations in Stella (parser, 6502 debugger, etc). for all debugging operations in Stella (parser, 6502 debugger, etc).
@author Stephen Anthony @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 class Debugger : public DialogContainer
{ {
@ -196,7 +196,7 @@ class Debugger : public DialogContainer
void toggleD(); void toggleD();
void reset(); void reset();
void autoLoadSymbols(string file); void autoLoadSymbols(string file);
void nextFrame(); void nextFrame(int frames);
void clearAllBreakPoints(); void clearAllBreakPoints();
void formatFlags(int f, char *out); void formatFlags(int f, char *out);

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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" #include "bspf.hxx"
@ -560,11 +560,9 @@ string DebuggerParser::run(const string& command) {
} else if(subStringMatch(verb, "disasm")) { } else if(subStringMatch(verb, "disasm")) {
return disasm(); return disasm();
} else if(subStringMatch(verb, "frame")) { } else if(subStringMatch(verb, "frame")) {
// FIXME: make multiple frames work!
int count = 1; int count = 1;
if(argCount != 0) count = args[0]; if(argCount != 0) count = args[0];
for(int i=0; i<count; i++) debugger->nextFrame(count);
debugger->nextFrame();
return "advanced frame"; return "advanced frame";
} else if(subStringMatch(verb, "clearbreaks")) { } else if(subStringMatch(verb, "clearbreaks")) {
debugger->clearAllBreakPoints(); debugger->clearAllBreakPoints();

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 <algorithm> #include <algorithm>
@ -465,7 +465,8 @@ void EventHandler::poll(uInt32 time)
break; // SDL_QUIT break; // SDL_QUIT
case SDL_VIDEOEXPOSE: case SDL_VIDEOEXPOSE:
myOSystem->frameBuffer().refresh(); myOSystem->frameBuffer().refreshTIA();
myOSystem->frameBuffer().refreshOverlay();
break; // SDL_VIDEOEXPOSE break; // SDL_VIDEOEXPOSE
} }
@ -1269,7 +1270,7 @@ void EventHandler::takeSnapshot()
filename = sspath + ".png"; filename = sspath + ".png";
// Now create a Snapshot object and save the PNG // Now create a Snapshot object and save the PNG
myOSystem->frameBuffer().refresh(true); myOSystem->frameBuffer().refreshTIA(true);
Snapshot snapshot(myOSystem->frameBuffer()); Snapshot snapshot(myOSystem->frameBuffer());
string result = snapshot.savePNG(filename); string result = snapshot.savePNG(filename);
myOSystem->frameBuffer().showMessage(result); myOSystem->frameBuffer().showMessage(result);
@ -1298,7 +1299,7 @@ void EventHandler::enterMenuMode()
{ {
myState = S_MENU; myState = S_MENU;
myOSystem->menu().reStack(); myOSystem->menu().reStack();
myOSystem->frameBuffer().refresh(); myOSystem->frameBuffer().refreshOverlay();
myOSystem->frameBuffer().setCursorState(); myOSystem->frameBuffer().setCursorState();
myOSystem->sound().mute(true); myOSystem->sound().mute(true);
myEvent->clear(); myEvent->clear();
@ -1308,7 +1309,7 @@ void EventHandler::enterMenuMode()
void EventHandler::leaveMenuMode() void EventHandler::leaveMenuMode()
{ {
myState = S_EMULATE; myState = S_EMULATE;
myOSystem->frameBuffer().refresh(); myOSystem->frameBuffer().refreshTIA();
myOSystem->frameBuffer().setCursorState(); myOSystem->frameBuffer().setCursorState();
myOSystem->sound().mute(false); myOSystem->sound().mute(false);
myEvent->clear(); myEvent->clear();
@ -1324,7 +1325,7 @@ void EventHandler::enterDebugMode()
myState = S_DEBUGGER; myState = S_DEBUGGER;
myOSystem->createFrameBuffer(); myOSystem->createFrameBuffer();
myOSystem->debugger().reStack(); myOSystem->debugger().reStack();
myOSystem->frameBuffer().refresh(); myOSystem->frameBuffer().refreshOverlay();
myOSystem->frameBuffer().setCursorState(); myOSystem->frameBuffer().setCursorState();
myEvent->clear(); myEvent->clear();
@ -1337,7 +1338,7 @@ void EventHandler::leaveDebugMode()
{ {
myState = S_EMULATE; myState = S_EMULATE;
myOSystem->createFrameBuffer(); myOSystem->createFrameBuffer();
myOSystem->frameBuffer().refresh(); myOSystem->frameBuffer().refreshTIA();
myOSystem->frameBuffer().setCursorState(); myOSystem->frameBuffer().setCursorState();
myEvent->clear(); myEvent->clear();

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 <sstream> #include <sstream>
@ -37,17 +37,17 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FrameBuffer::FrameBuffer(OSystem* osystem) FrameBuffer::FrameBuffer(OSystem* osystem)
: myOSystem(osystem), : myOSystem(osystem),
theRedrawEntireFrameIndicator(true), theRedrawTIAIndicator(true),
theFrameAdvanceIndicator(false),
theZoomLevel(2), theZoomLevel(2),
theMaxZoomLevel(2), theMaxZoomLevel(2),
theAspectRatio(1.0), theAspectRatio(1.0),
myFrameRate(0), myFrameRate(0),
myPauseStatus(false), myPauseStatus(false),
theOverlayChangedIndicator(false), theRedrawOverlayIndicator(false),
myOverlayRedraws(2),
theFrameAdvanceIndicator(0),
myMessageTime(0), myMessageTime(0),
myMessageText(""), myMessageText(""),
myOverlayRedraws(2),
myNumRedraws(0) myNumRedraws(0)
{ {
// Fill the GUI colors array // 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 // Erase any messages from a previous run
myMessageTime = 0; myMessageTime = 0;
theRedrawEntireFrameIndicator = true; theRedrawTIAIndicator = true; //FIX
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -191,7 +191,7 @@ void FrameBuffer::update()
// Erase this message on next update // Erase this message on next update
if(myMessageTime == 0) if(myMessageTime == 0)
theRedrawEntireFrameIndicator = true; theRedrawTIAIndicator = true; // FIX
} }
} }
break; // S_EMULATE break; // S_EMULATE
@ -200,11 +200,11 @@ void FrameBuffer::update()
case EventHandler::S_MENU: case EventHandler::S_MENU:
{ {
// Only update the screen if it's been invalidated // Only update the screen if it's been invalidated
if(theRedrawEntireFrameIndicator) if(theRedrawTIAIndicator)
drawMediaSource(); drawMediaSource();
// Only update the overlay if it's changed // Only update the overlay if it's changed
if(theOverlayChangedIndicator) if(theRedrawOverlayIndicator)
{ {
// Then overlay any menu items // Then overlay any menu items
myOSystem->menu().draw(); myOSystem->menu().draw();
@ -215,7 +215,7 @@ void FrameBuffer::update()
// menus at least twice (so they'll be in both buffers) // menus at least twice (so they'll be in both buffers)
// Otherwise, we get horrible flickering // Otherwise, we get horrible flickering
myOverlayRedraws--; myOverlayRedraws--;
theOverlayChangedIndicator = (myOverlayRedraws != 0); theRedrawOverlayIndicator = (myOverlayRedraws != 0);
} }
break; break;
} }
@ -223,41 +223,40 @@ void FrameBuffer::update()
case EventHandler::S_LAUNCHER: case EventHandler::S_LAUNCHER:
{ {
// Only update the screen if it's been invalidated or the overlay have changed // Only update the screen if it's been invalidated or the overlay have changed
if(theRedrawEntireFrameIndicator || theOverlayChangedIndicator) if(theRedrawOverlayIndicator)
{ {
// Overlay the ROM launcher // Overlay the ROM launcher
myOSystem->launcher().draw(); myOSystem->launcher().draw();
// Now the screen is up to date
theRedrawEntireFrameIndicator = false;
// This is a performance hack to only draw the overlay when necessary // This is a performance hack to only draw the overlay when necessary
// Software mode is single-buffered, so we don't have to worry // Software mode is single-buffered, so we don't have to worry
// However, OpenGL mode is double-buffered, so we need to draw the // However, OpenGL mode is double-buffered, so we need to draw the
// menus at least twice (so they'll be in both buffers) // menus at least twice (so they'll be in both buffers)
// Otherwise, we get horrible flickering // Otherwise, we get horrible flickering
myOverlayRedraws--; myOverlayRedraws--;
theOverlayChangedIndicator = (myOverlayRedraws != 0); theRedrawOverlayIndicator = (myOverlayRedraws != 0);
} }
break; break;
} }
case EventHandler::S_DEBUGGER: case EventHandler::S_DEBUGGER:
{
// Get one frames' worth of data // Get one frames' worth of data
if(theFrameAdvanceIndicator) bool advance = false;
if(theFrameAdvanceIndicator > 0)
{ {
myOSystem->console().mediaSource().update(); myOSystem->console().mediaSource().update();
theRedrawEntireFrameIndicator = true; // do the next section of code advance = true;
theOverlayChangedIndicator = true; // do this just to be sure --theFrameAdvanceIndicator;
theFrameAdvanceIndicator = false;
} }
// Only update the screen if it's been invalidated // Only update the screen if it's been invalidated or we're in
if(theRedrawEntireFrameIndicator) // frame advance mode
if(advance || theRedrawTIAIndicator)
drawMediaSource(); drawMediaSource();
// Only update the overlay if it's changed // Only update the overlay if it's changed
if(theOverlayChangedIndicator) if(theRedrawOverlayIndicator)
{ {
// Overlay the ROM launcher // Overlay the ROM launcher
myOSystem->debugger().draw(); myOSystem->debugger().draw();
@ -268,9 +267,10 @@ void FrameBuffer::update()
// menus at least twice (so they'll be in both buffers) // menus at least twice (so they'll be in both buffers)
// Otherwise, we get horrible flickering // Otherwise, we get horrible flickering
myOverlayRedraws--; myOverlayRedraws--;
theOverlayChangedIndicator = (myOverlayRedraws != 0); theRedrawOverlayIndicator = (myOverlayRedraws != 0);
} }
break; // S_DEBUGGER break; // S_DEBUGGER
}
case EventHandler::S_NONE: case EventHandler::S_NONE:
return; return;
@ -281,12 +281,36 @@ void FrameBuffer::update()
postFrameUpdate(); 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) void FrameBuffer::showMessage(const string& message)
{ {
myMessageText = message; myMessageText = message;
myMessageTime = myFrameRate << 1; // Show message for 2 seconds 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); myPalette[i] = mapRGB(r, g, b);
} }
theRedrawEntireFrameIndicator = true; theRedrawTIAIndicator = true;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 #ifndef FRAMEBUFFER_HXX
@ -28,8 +28,8 @@
#include "Font.hxx" #include "Font.hxx"
#include "GuiUtils.hxx" #include "GuiUtils.hxx"
class Console;
class OSystem; class OSystem;
class Console;
// Text alignment modes for drawString() // Text alignment modes for drawString()
enum TextAlignment { enum TextAlignment {
@ -46,7 +46,7 @@ enum TextAlignment {
All GUI elements (ala ScummVM) are drawn here as well. All GUI elements (ala ScummVM) are drawn here as well.
@author Stephen Anthony @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 class FrameBuffer
{ {
@ -125,25 +125,24 @@ class FrameBuffer
void pause(bool status); 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. to be redrawn.
@param now Determine if the refresh should be done right away or in @param now Determine if the refresh should be done right away or in
the next frame the next frame
*/ */
void refresh(bool now = false) void refreshTIA(bool now = false);
{
// cerr << "refresh() " << myNumRedraws++ << endl; /**
theRedrawEntireFrameIndicator = true; Indicates that the overlay area is dirty, and certain areas need
theOverlayChangedIndicator = true; to be redrawn.
myOverlayRedraws = 2; */
if(now) { myMessageTime = 0; update(); } void refreshOverlay(bool now = false);
}
/** /**
Indicates that the emulation should advance one frame. Indicates that the emulation should advance one frame.
*/ */
void advance() { theFrameAdvanceIndicator = true; } void advance(int frames) { theFrameAdvanceIndicator = frames; }
/** /**
Toggles between fullscreen and window mode. Toggles between fullscreen and window mode.
@ -411,11 +410,8 @@ class FrameBuffer
// Dimensions of the desktop area // Dimensions of the desktop area
SDL_Rect myDesktopDim; SDL_Rect myDesktopDim;
// Indicates if the entire frame should be redrawn // Indicates if the TIA area should be redrawn
bool theRedrawEntireFrameIndicator; bool theRedrawTIAIndicator;
// Indicates if the emulation should advance by one frame
bool theFrameAdvanceIndicator;
// The SDL video buffer // The SDL video buffer
SDL_Surface* myScreen; SDL_Surface* myScreen;
@ -451,8 +447,14 @@ class FrameBuffer
// Indicates the current pause status // Indicates the current pause status
bool myPauseStatus; bool myPauseStatus;
// Indicates if the menus should be redrawn // Indicates if the overlay area should be redrawn
bool theOverlayChangedIndicator; bool theRedrawOverlayIndicator;
// Number of times menu have been drawn
int myOverlayRedraws;
// Indicates how many frames the emulation should advance
int theFrameAdvanceIndicator;
// Message timer // Message timer
Int32 myMessageTime; Int32 myMessageTime;
@ -460,9 +462,6 @@ class FrameBuffer
// Message text // Message text
string myMessageText; string myMessageText;
// Number of times menu have been drawn
uInt32 myOverlayRedraws;
// Indicates how many times the framebuffer has been redrawn // Indicates how many times the framebuffer has been redrawn
// Used only for debugging purposes // Used only for debugging purposes
uInt32 myNumRedraws; uInt32 myNumRedraws;

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 <cassert> #include <cassert>
@ -339,7 +339,7 @@ void OSystem::createLauncher()
// And start the base dialog // And start the base dialog
myLauncher->initialize(); myLauncher->initialize();
myLauncher->reStack(); myLauncher->reStack();
myFrameBuffer->refresh(); myFrameBuffer->refreshOverlay();
myFrameBuffer->setCursorState(); myFrameBuffer->setCursorState();
mySound->mute(true); mySound->mute(true);
} }

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -226,7 +226,7 @@ void AboutDialog::displayInfo()
delete[] dscStr; delete[] dscStr;
instance()->frameBuffer().refresh(); instance()->frameBuffer().refreshOverlay();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -143,7 +143,9 @@ void AddrValueWidget::handleMouseDown(int x, int y, int button, int clickCount)
abortEditMode(); abortEditMode();
_selectedItem = newSelectedItem; _selectedItem = newSelectedItem;
sendCommand(kAVSelectionChangedCmd, _selectedItem); sendCommand(kAVSelectionChangedCmd, _selectedItem);
instance()->frameBuffer().refresh();
// TODO - dirty rectangle
instance()->frameBuffer().refreshOverlay();
} }
// TODO: Determine where inside the string the user clicked and place the // 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 // also draw scrollbar
_scrollBar->draw(); _scrollBar->draw();
instance()->frameBuffer().refresh(); // TODO - dirty rectangle
instance()->frameBuffer().refreshOverlay();
} }
_currentKeyDown = keycode; _currentKeyDown = keycode;

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // 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 // Make sure that mutually-exclusive items are not enabled at the same time
handleSoundEnableChange(true); handleSoundEnableChange(true);
instance()->frameBuffer().refresh(); instance()->frameBuffer().refreshOverlay();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // 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();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // 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); _currentCol = _selectedItem - (_currentRow * _cols);
sendCommand(kDGSelectionChangedCmd, _selectedItem); sendCommand(kDGSelectionChangedCmd, _selectedItem);
instance()->frameBuffer().refresh();
// TODO - dirty rectangle
instance()->frameBuffer().refreshOverlay();
} }
// TODO: Determine where inside the string the user clicked and place the // 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; _selectedItem = _currentRow*_cols + _currentCol;
draw(); draw();
sendCommand(kDGSelectionChangedCmd, _selectedItem); sendCommand(kDGSelectionChangedCmd, _selectedItem);
instance()->frameBuffer().refresh();
// TODO - dirty rectangle
instance()->frameBuffer().refreshOverlay();
} }
_currentKeyDown = keycode; _currentKeyDown = keycode;

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -127,7 +127,7 @@ void DebuggerDialog::handleCommand(CommandSender* sender, int cmd, int data)
break; break;
case kDDAdvCmd: case kDDAdvCmd:
instance()->debugger().nextFrame(); instance()->debugger().nextFrame(1);
myTab->loadConfig(); myTab->loadConfig();
break; break;

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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" #include "OSystem.hxx"
@ -86,7 +86,7 @@ void DialogContainer::draw()
void DialogContainer::addDialog(Dialog* d) void DialogContainer::addDialog(Dialog* d)
{ {
myDialogStack.push(d); myDialogStack.push(d);
myOSystem->frameBuffer().refresh(); myOSystem->frameBuffer().refreshOverlay();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -95,7 +95,7 @@ void DialogContainer::removeDialog()
if(!myDialogStack.empty()) if(!myDialogStack.empty())
{ {
myDialogStack.pop(); myDialogStack.pop();
myOSystem->frameBuffer().refresh(); myOSystem->frameBuffer().refreshOverlay();
} }
} }

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // 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)) if (setCaretPos(i))
{ {
draw(); draw();
_boss->instance()->frameBuffer().refresh(); // TODO - dirty rectangle
_boss->instance()->frameBuffer().refreshOverlay();
} }
} }

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // 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)) if (setCaretPos(i))
{ {
draw(); draw();
_boss->instance()->frameBuffer().refresh(); // TODO - dirty rectangle
_boss->instance()->frameBuffer().refreshOverlay();
} }
} }

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -54,7 +54,8 @@ void EditableWidget::setEditString(const string& str)
_editScrollOffset = 0; _editScrollOffset = 0;
// Make sure the new string is seen onscreen // 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) if (dirty)
{ {
draw(); draw();
_boss->instance()->frameBuffer().refresh(); // TODO - dirty rectangle
_boss->instance()->frameBuffer().refreshOverlay();
} }
return handled; return handled;

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -118,7 +118,7 @@ void GameInfoDialog::displayInfo()
delete[] keyStr; delete[] keyStr;
delete[] dscStr; delete[] dscStr;
instance()->frameBuffer().refresh(); instance()->frameBuffer().refreshOverlay();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -173,7 +173,7 @@ void HelpDialog::displayInfo()
delete[] keyStr; delete[] keyStr;
delete[] dscStr; delete[] dscStr;
instance()->frameBuffer().refresh(); instance()->frameBuffer().refreshOverlay();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -77,7 +77,9 @@ void ListWidget::setSelected(int item)
_currentPos = _selectedItem - _entriesPerPage / 2; _currentPos = _selectedItem - _entriesPerPage / 2;
scrollToCurrent(); scrollToCurrent();
draw(); 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(); abortEditMode();
_selectedItem = newSelectedItem; _selectedItem = newSelectedItem;
sendCommand(kListSelectionChangedCmd, _selectedItem); sendCommand(kListSelectionChangedCmd, _selectedItem);
instance()->frameBuffer().refresh();
// TODO - dirty rectangle
instance()->frameBuffer().refreshOverlay();
} }
// TODO: Determine where inside the string the user clicked and place the // 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 // also draw scrollbar
_scrollBar->draw(); _scrollBar->draw();
instance()->frameBuffer().refresh(); // TODO - dirty rectangle
instance()->frameBuffer().refreshOverlay();
} }
_currentKeyDown = keycode; _currentKeyDown = keycode;

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -177,7 +177,8 @@ void PopUpDialog::setSelection(int item)
if(item >= 0) if(item >= 0)
drawMenuEntry(item, true); drawMenuEntry(item, true);
_popUpBoss->instance()->frameBuffer().refresh(); // TODO - dirty rectangle
_popUpBoss->instance()->frameBuffer().refreshOverlay();
} }
} }

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // 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 // across the entire screen for a split-second
parent->addDialog(this); parent->addDialog(this);
instance()->frameBuffer().refresh(true); instance()->frameBuffer().refreshOverlay(true);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -59,7 +59,7 @@ ProgressDialog::~ProgressDialog()
void ProgressDialog::done() void ProgressDialog::done()
{ {
parent()->removeDialog(); parent()->removeDialog();
instance()->frameBuffer().refresh(true); instance()->frameBuffer().refreshOverlay(true);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -87,6 +87,6 @@ void ProgressDialog::setProgress(int progress)
{ {
myCurrentStep += myStep; myCurrentStep += myStep;
mySlider->setValue(p); mySlider->setValue(p);
instance()->frameBuffer().refresh(true); instance()->frameBuffer().refreshOverlay(true);
} }
} }

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -152,6 +152,7 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers)
{ {
int i; int i;
bool handled = true; bool handled = true;
bool dirty = false;
switch (keycode) switch (keycode)
{ {
@ -186,8 +187,7 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers)
printPrompt(); printPrompt();
draw(); dirty = true;
instance()->frameBuffer().refresh();
break; break;
} }
@ -196,14 +196,12 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers)
killChar(-1); killChar(-1);
scrollToCurrent(); scrollToCurrent();
draw(); // FIXME - not nice to redraw the full console just for one char! dirty = true;
instance()->frameBuffer().refresh();
break; break;
case 127: case 127:
killChar(+1); killChar(+1);
draw(); dirty = true;
instance()->frameBuffer().refresh();
break; break;
case 256 + 24: // pageup case 256 + 24: // pageup
@ -217,8 +215,8 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers)
if (_scrollLine < _firstLineInBuffer + _linesPerPage - 1) if (_scrollLine < _firstLineInBuffer + _linesPerPage - 1)
_scrollLine = _firstLineInBuffer + _linesPerPage - 1; _scrollLine = _firstLineInBuffer + _linesPerPage - 1;
updateScrollBuffer(); updateScrollBuffer();
draw();
instance()->frameBuffer().refresh(); dirty = true;
} }
break; break;
@ -233,8 +231,8 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers)
if (_scrollLine > _promptEndPos / _lineWidth) if (_scrollLine > _promptEndPos / _lineWidth)
_scrollLine = _promptEndPos / _lineWidth; _scrollLine = _promptEndPos / _lineWidth;
updateScrollBuffer(); updateScrollBuffer();
draw();
instance()->frameBuffer().refresh(); dirty = true;
} }
break; break;
@ -247,8 +245,7 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers)
else else
_currentPos = _promptStartPos; _currentPos = _promptStartPos;
draw(); dirty = true;
instance()->frameBuffer().refresh();
break; break;
case 256 + 23: // end case 256 + 23: // end
@ -262,8 +259,7 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers)
else else
_currentPos = _promptEndPos; _currentPos = _promptEndPos;
draw(); dirty = true;
instance()->frameBuffer().refresh();
break; break;
case 273: // cursor up case 273: // cursor up
@ -274,8 +270,8 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers)
_scrollLine -= 1; _scrollLine -= 1;
updateScrollBuffer(); updateScrollBuffer();
draw();
instance()->frameBuffer().refresh(); dirty = true;
} }
else else
historyScroll(+1); historyScroll(+1);
@ -290,8 +286,8 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers)
_scrollLine += 1; _scrollLine += 1;
updateScrollBuffer(); updateScrollBuffer();
draw();
instance()->frameBuffer().refresh(); dirty = true;
} }
else else
historyScroll(-1); historyScroll(-1);
@ -300,15 +296,15 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers)
case 275: // cursor right case 275: // cursor right
if (_currentPos < _promptEndPos) if (_currentPos < _promptEndPos)
_currentPos++; _currentPos++;
draw();
instance()->frameBuffer().refresh(); dirty = true;
break; break;
case 276: // cursor left case 276: // cursor left
if (_currentPos > _promptStartPos) if (_currentPos > _promptStartPos)
_currentPos--; _currentPos--;
draw();
instance()->frameBuffer().refresh(); dirty = true;
break; break;
default: default:
@ -332,6 +328,13 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers)
break; break;
} }
if(dirty)
{
draw();
// TODO - dirty rectangle
instance()->frameBuffer().refreshOverlay();
}
return handled; return handled;
} }
@ -361,7 +364,7 @@ void PromptWidget::handleCommand(CommandSender* sender, int cmd, int data)
{ {
_scrollLine = newPos; _scrollLine = newPos;
draw(); draw();
instance()->frameBuffer().refresh(); instance()->frameBuffer().refreshOverlay();
} }
break; break;
} }
@ -408,7 +411,7 @@ void PromptWidget::specialKeys(int keycode)
if(handled) if(handled)
{ {
draw(); draw();
instance()->frameBuffer().refresh(); instance()->frameBuffer().refreshOverlay();
} }
} }
@ -544,7 +547,8 @@ void PromptWidget::historyScroll(int direction)
scrollToCurrent(); scrollToCurrent();
draw(); draw();
instance()->frameBuffer().refresh(); // TODO - dirty rectangle
instance()->frameBuffer().refreshOverlay();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -615,7 +619,8 @@ void PromptWidget::putchar(int c)
putcharIntern(c); putcharIntern(c);
draw(); // FIXME - not nice to redraw the full console just for one char! 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++); putcharIntern(*str++);
draw(); draw();
instance()->frameBuffer().refresh(); // TODO - dirty rectangle
instance()->frameBuffer().refreshOverlay();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -216,7 +216,8 @@ void RamWidget::handleCommand(CommandSender* sender, int cmd, int data)
break; break;
} }
instance()->frameBuffer().refresh(); // TODO - dirty rect, or is it necessary here?
instance()->frameBuffer().refreshOverlay();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -187,7 +187,8 @@ void ScrollBarWidget::handleMouseMoved(int x, int y, int button)
draw(); draw();
// Refresh the FB, since the selected part has changed // 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; _sliderPos = UP_DOWN_BOX_HEIGHT;
} }
_boss->instance()->frameBuffer().refresh(); // TODO - dirty rectangle
_boss->instance()->frameBuffer().refreshOverlay();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -125,7 +125,9 @@ void TabWidget::setActiveTab(int tabID)
_activeWidget->receivedFocus(); _activeWidget->receivedFocus();
_boss->draw(); _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); Widget::setFocusForChain(_firstWidget, _activeWidget);
// Make sure the changes are shown onscreen // Make sure the changes are shown onscreen
_boss->instance()->frameBuffer().refresh(); // TODO - dirty rectangle
_boss->instance()->frameBuffer().refreshOverlay();
} }
break; break;
@ -263,7 +266,8 @@ void TabWidget::loadConfig()
} }
// Make sure changes are seen onscreen // Make sure changes are seen onscreen
instance()->frameBuffer().refresh(); // TODO - dirty rectangle
instance()->frameBuffer().refreshOverlay();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // 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 // Make sure that mutually-exclusive items are not enabled at the same time
handleRendererChange(0); // 0 indicates software mode handleRendererChange(0); // 0 indicates software mode
instance()->frameBuffer().refresh(); instance()->frameBuffer().refreshOverlay();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -339,8 +339,8 @@ void StaticTextWidget::setValue(int value)
_label = buf; _label = buf;
// Refresh the screen when the text has changed // Refresh the screen when the text has changed
// TODO - eventually, this should be a dirty rectangle // TODO - create dirty rectangle
_boss->instance()->frameBuffer().refresh(); _boss->instance()->frameBuffer().refreshOverlay();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -421,8 +421,8 @@ void CheckboxWidget::setState(bool state)
sendCommand(_cmd, _state); sendCommand(_cmd, _state);
// Refresh the screen after the checkbox is drawn // Refresh the screen after the checkbox is drawn
// TODO - eventually, this should be a dirty rectangle // TODO - create dirty rectangle
_boss->instance()->frameBuffer().refresh(); _boss->instance()->frameBuffer().refreshOverlay();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -480,8 +480,8 @@ void SliderWidget::handleMouseMoved(int x, int y, int button)
sendCommand(_cmd, _value); sendCommand(_cmd, _value);
} }
// Refresh the screen while the slider is being redrawn // Refresh the screen while the slider is being redrawn
// TODO - eventually, this should be a dirty rectangle // TODO - create dirty rectangle
_boss->instance()->frameBuffer().refresh(); _boss->instance()->frameBuffer().refreshOverlay();
} }
} }

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -67,7 +67,7 @@ enum {
This is the base class for all widgets. This is the base class for all widgets.
@author Stephen Anthony @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 class Widget : public GuiObject
{ {
@ -98,10 +98,10 @@ class Widget : public GuiObject
virtual bool wantsFocus() { return false; }; virtual bool wantsFocus() { return false; };
void setFlags(int flags) { _flags |= flags; void setFlags(int flags) { _flags |= flags;
_boss->instance()->frameBuffer().refresh(); _boss->instance()->frameBuffer().refreshOverlay();
} }
void clearFlags(int flags) { _flags &= ~flags; void clearFlags(int flags) { _flags &= ~flags;
_boss->instance()->frameBuffer().refresh(); _boss->instance()->frameBuffer().refreshOverlay();
} }
int getFlags() const { return _flags; } int getFlags() const { return _flags; }
@ -168,7 +168,7 @@ class StaticTextWidget : public Widget
void setValue(int value); void setValue(int value);
void setAlign(TextAlignment align) { _align = align; } void setAlign(TextAlignment align) { _align = align; }
void setLabel(const string& label) { _label = label; void setLabel(const string& label) { _label = label;
_boss->instance()->frameBuffer().refresh(); _boss->instance()->frameBuffer().refreshOverlay();
} }
const string& getLabel() const { return _label; } const string& getLabel() const { return _label; }