mirror of https://github.com/stella-emu/stella.git
Removed the last remains of dirty-rect updating from the FrameBuffer.
This code was originally there for software mode, where it was very expensive to update pixels, so it was done as little as possible. However, it was also a bit of a hack, and sometimes interfered with double-buffered hardware rendering. So now showing the various UI's will burn slightly more CPU, but will be guaranteed to work under all conditions. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2934 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
23a2e2d7ee
commit
da86a3b175
|
@ -463,12 +463,11 @@ bool PromptWidget::handleKeyDown(StellaKey key, StellaMod mod)
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void PromptWidget::insertIntoPrompt(const char* str)
|
||||
{
|
||||
uInt32 l = (uInt32)strlen(str);
|
||||
|
||||
for (uInt32 i = _promptEndPos - 1; i >= _currentPos; i--)
|
||||
Int32 l = (Int32)strlen(str);
|
||||
for(Int32 i = _promptEndPos - 1; i >= _currentPos; i--)
|
||||
buffer(i + l) = buffer(i);
|
||||
|
||||
for (uInt32 j = 0; j < l; ++j)
|
||||
for(Int32 j = 0; j < l; ++j)
|
||||
{
|
||||
_promptEndPos++;
|
||||
putcharIntern(str[j]);
|
||||
|
|
|
@ -48,7 +48,6 @@
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
FrameBuffer::FrameBuffer(OSystem& osystem)
|
||||
: myOSystem(osystem),
|
||||
myRedrawEntireFrame(true),
|
||||
myInitializedCount(0),
|
||||
myPausedCount(0),
|
||||
myTIASurface(NULL)
|
||||
|
@ -313,9 +312,7 @@ void FrameBuffer::update()
|
|||
|
||||
case EventHandler::S_PAUSE:
|
||||
{
|
||||
// Only update the screen if it's been invalidated
|
||||
if(myRedrawEntireFrame)
|
||||
drawTIA();
|
||||
drawTIA();
|
||||
|
||||
// Show a pause message every 5 seconds
|
||||
if(myPausedCount++ >= 7*myOSystem.frameRate())
|
||||
|
@ -328,34 +325,28 @@ void FrameBuffer::update()
|
|||
|
||||
case EventHandler::S_MENU:
|
||||
{
|
||||
// When onscreen messages are enabled in double-buffer mode,
|
||||
// a full redraw is required
|
||||
myOSystem.menu().draw(myMsg.enabled && isDoubleBuffered());
|
||||
drawTIA();
|
||||
myOSystem.menu().draw(isDoubleBuffered());
|
||||
break; // S_MENU
|
||||
}
|
||||
|
||||
case EventHandler::S_CMDMENU:
|
||||
{
|
||||
// When onscreen messages are enabled in double-buffer mode,
|
||||
// a full redraw is required
|
||||
myOSystem.commandMenu().draw(myMsg.enabled && isDoubleBuffered());
|
||||
drawTIA();
|
||||
myOSystem.commandMenu().draw(isDoubleBuffered());
|
||||
break; // S_CMDMENU
|
||||
}
|
||||
|
||||
case EventHandler::S_LAUNCHER:
|
||||
{
|
||||
// When onscreen messages are enabled in double-buffer mode,
|
||||
// a full redraw is required
|
||||
myOSystem.launcher().draw(myMsg.enabled && isDoubleBuffered());
|
||||
myOSystem.launcher().draw(isDoubleBuffered());
|
||||
break; // S_LAUNCHER
|
||||
}
|
||||
|
||||
#ifdef DEBUGGER_SUPPORT
|
||||
case EventHandler::S_DEBUGGER:
|
||||
{
|
||||
// When onscreen messages are enabled in double-buffer mode,
|
||||
// a full redraw is required
|
||||
myOSystem.debugger().draw(myMsg.enabled && isDoubleBuffered());
|
||||
myOSystem.debugger().draw(isDoubleBuffered());
|
||||
break; // S_DEBUGGER
|
||||
}
|
||||
#endif
|
||||
|
@ -370,9 +361,6 @@ void FrameBuffer::update()
|
|||
|
||||
// Do any post-frame stuff
|
||||
postFrameUpdate();
|
||||
|
||||
// The frame doesn't need to be completely redrawn anymore
|
||||
myRedrawEntireFrame = false;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -385,10 +373,7 @@ void FrameBuffer::showMessage(const string& message, MessagePosition position,
|
|||
|
||||
// Erase old messages on the screen
|
||||
if(myMsg.counter > 0)
|
||||
{
|
||||
myRedrawEntireFrame = true;
|
||||
refresh();
|
||||
}
|
||||
|
||||
// Precompute the message coordinates
|
||||
myMsg.text = message;
|
||||
|
@ -643,8 +628,6 @@ void FrameBuffer::setPalette(const uInt32* raw_palette)
|
|||
|
||||
// Let the TIA surface know about the new palette
|
||||
myTIASurface->setPalette(myPalette, raw_palette);
|
||||
|
||||
myRedrawEntireFrame = true;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -653,8 +636,6 @@ void FrameBuffer::stateChanged(EventHandler::State state)
|
|||
// Make sure any onscreen messages are removed
|
||||
myMsg.enabled = false;
|
||||
myMsg.counter = 0;
|
||||
|
||||
myRedrawEntireFrame = true;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -426,9 +426,6 @@ class FrameBuffer
|
|||
// The parent system for the framebuffer
|
||||
OSystem& myOSystem;
|
||||
|
||||
// Indicates if the entire frame need to redrawn
|
||||
bool myRedrawEntireFrame;
|
||||
|
||||
// Color palette for TIA and UI modes
|
||||
Uint32 myPalette[256+kNumColors];
|
||||
|
||||
|
|
Loading…
Reference in New Issue