mirror of https://github.com/stella-emu/stella.git
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:
parent
419a255cfb
commit
e327a773c4
|
@ -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: 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
|
||||
|
@ -30,6 +30,8 @@
|
|||
Snapshot::Snapshot(FrameBuffer& 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 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);
|
||||
if(!out)
|
||||
return "Couldn't create snapshot file";
|
||||
|
|
|
@ -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.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>
|
||||
|
@ -2108,10 +2108,6 @@ void EventHandler::loadState(int state)
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void EventHandler::takeSnapshot()
|
||||
{
|
||||
#ifdef PSP_DEBUG
|
||||
fprintf(stdout,"EventHandler::takeSnapshot\n");
|
||||
#endif
|
||||
|
||||
#ifdef SNAPSHOT_SUPPORT
|
||||
// Figure out the correct snapshot name
|
||||
string filename;
|
||||
|
@ -2140,9 +2136,6 @@ void EventHandler::takeSnapshot()
|
|||
{
|
||||
buf.str("");
|
||||
buf << sspath << "_" << i << ".png";
|
||||
#ifdef PSP_DEBUG
|
||||
fprintf(stdout,"EventHandler::takeSnapshot '%s'\n",buf.str().c_str());
|
||||
#endif
|
||||
if(!FilesystemNode::fileExists(buf.str()))
|
||||
break;
|
||||
}
|
||||
|
@ -2153,7 +2146,6 @@ void EventHandler::takeSnapshot()
|
|||
filename = sspath + ".png";
|
||||
|
||||
// Now create a Snapshot object and save the PNG
|
||||
refreshDisplay(true); // force an immediate update
|
||||
Snapshot snapshot(myOSystem->frameBuffer());
|
||||
string result = snapshot.savePNG(filename);
|
||||
myOSystem->frameBuffer().showMessage(result);
|
||||
|
|
|
@ -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.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>
|
||||
|
@ -287,7 +287,10 @@ void FrameBuffer::hideMessage()
|
|||
{
|
||||
// Erase old messages on the screen
|
||||
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()
|
||||
{
|
||||
theRedrawTIAIndicator = true;
|
||||
myMessage.counter = 0;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
Loading…
Reference in New Issue