Fixed issue with hiding messages, taking snapshots, and switching

rendering modes.  At times messages were shown when they weren't supposed
to be, and vice versa.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1105 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2006-05-24 17:37:33 +00:00
parent 419a255cfb
commit e327a773c4
3 changed files with 9 additions and 19 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: Snapshot.cxx,v 1.9 2005-09-06 22:25:40 stephena Exp $ // $Id: Snapshot.cxx,v 1.10 2006-05-24 17:37:32 stephena Exp $
//============================================================================ //============================================================================
#ifdef SNAPSHOT_SUPPORT #ifdef SNAPSHOT_SUPPORT
@ -30,6 +30,8 @@
Snapshot::Snapshot(FrameBuffer& framebuffer) Snapshot::Snapshot(FrameBuffer& framebuffer)
: myFrameBuffer(framebuffer) : myFrameBuffer(framebuffer)
{ {
// Make sure we have a 'clean' image, with no onscreen messages
myFrameBuffer.hideMessage();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -74,12 +76,6 @@ string Snapshot::savePNG(string filename)
uInt32 width = myFrameBuffer.imageWidth(); uInt32 width = myFrameBuffer.imageWidth();
uInt32 height = myFrameBuffer.imageHeight(); uInt32 height = myFrameBuffer.imageHeight();
// TODO - this should really call something like OSystem::message()
// so we can get rid of annoying ifdefs everywhere
#ifdef PSP
fprintf(stdout,"ok w=%i h=%i\n",width,height);
#endif
ofstream* out = new ofstream(filename.c_str(), ios_base::binary); ofstream* out = new ofstream(filename.c_str(), ios_base::binary);
if(!out) if(!out)
return "Couldn't create snapshot file"; return "Couldn't create snapshot file";

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.163 2006-05-15 12:24:09 stephena Exp $ // $Id: EventHandler.cxx,v 1.164 2006-05-24 17:37:33 stephena Exp $
//============================================================================ //============================================================================
#include <sstream> #include <sstream>
@ -2108,10 +2108,6 @@ void EventHandler::loadState(int state)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EventHandler::takeSnapshot() void EventHandler::takeSnapshot()
{ {
#ifdef PSP_DEBUG
fprintf(stdout,"EventHandler::takeSnapshot\n");
#endif
#ifdef SNAPSHOT_SUPPORT #ifdef SNAPSHOT_SUPPORT
// Figure out the correct snapshot name // Figure out the correct snapshot name
string filename; string filename;
@ -2140,9 +2136,6 @@ void EventHandler::takeSnapshot()
{ {
buf.str(""); buf.str("");
buf << sspath << "_" << i << ".png"; buf << sspath << "_" << i << ".png";
#ifdef PSP_DEBUG
fprintf(stdout,"EventHandler::takeSnapshot '%s'\n",buf.str().c_str());
#endif
if(!FilesystemNode::fileExists(buf.str())) if(!FilesystemNode::fileExists(buf.str()))
break; break;
} }
@ -2153,7 +2146,6 @@ 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
refreshDisplay(true); // force an immediate update
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);

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.88 2006-05-15 16:21:27 stephena Exp $ // $Id: FrameBuffer.cxx,v 1.89 2006-05-24 17:37:33 stephena Exp $
//============================================================================ //============================================================================
#include <sstream> #include <sstream>
@ -287,7 +287,10 @@ void FrameBuffer::hideMessage()
{ {
// Erase old messages on the screen // Erase old messages on the screen
if(myMessage.counter > 0) if(myMessage.counter > 0)
myOSystem->eventHandler().refreshDisplay(); {
myMessage.counter = 0;
myOSystem->eventHandler().refreshDisplay(true);
}
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -325,7 +328,6 @@ void FrameBuffer::pause(bool status)
void FrameBuffer::refresh() void FrameBuffer::refresh()
{ {
theRedrawTIAIndicator = true; theRedrawTIAIndicator = true;
myMessage.counter = 0;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -