mirror of https://github.com/stella-emu/stella.git
Modified the FrameBuffer::refresh method to take a boolean value
representing whether a refresh should be done immediately or in the next frame. Do an immediate refresh just before taking a snapshot, to make sure any onscreen messages aren't taken as part of the snapshot. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@362 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
a626c5bfbb
commit
47f8619ec5
|
@ -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.29 2004-07-28 23:54:39 stephena Exp $
|
// $Id: EventHandler.cxx,v 1.30 2005-02-18 21:26:31 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -427,6 +427,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
|
||||||
|
myConsole->frameBuffer().refresh(true);
|
||||||
Snapshot snapshot(myConsole->frameBuffer());
|
Snapshot snapshot(myConsole->frameBuffer());
|
||||||
string result = snapshot.savePNG(filename);
|
string result = snapshot.savePNG(filename);
|
||||||
myConsole->frameBuffer().showMessage(result);
|
myConsole->frameBuffer().showMessage(result);
|
||||||
|
|
|
@ -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.12 2004-07-28 23:54:39 stephena Exp $
|
// $Id: FrameBuffer.hxx,v 1.13 2005-02-18 21:26:31 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#ifndef FRAMEBUFFER_HXX
|
#ifndef FRAMEBUFFER_HXX
|
||||||
|
@ -35,7 +35,7 @@ class Console;
|
||||||
can be changed.
|
can be changed.
|
||||||
|
|
||||||
@author Stephen Anthony
|
@author Stephen Anthony
|
||||||
@version $Id: FrameBuffer.hxx,v 1.12 2004-07-28 23:54:39 stephena Exp $
|
@version $Id: FrameBuffer.hxx,v 1.13 2005-02-18 21:26:31 stephena Exp $
|
||||||
*/
|
*/
|
||||||
class FrameBuffer
|
class FrameBuffer
|
||||||
{
|
{
|
||||||
|
@ -124,8 +124,16 @@ class FrameBuffer
|
||||||
/**
|
/**
|
||||||
Indicates that a redraw should be done, since the window contents
|
Indicates that a redraw should be done, since the window contents
|
||||||
are dirty.
|
are dirty.
|
||||||
|
|
||||||
|
@param now Determine if the refresh should be done right away or in
|
||||||
|
the next frame
|
||||||
*/
|
*/
|
||||||
void refresh() { theRedrawEntireFrameIndicator = true; }
|
void refresh(bool now = false)
|
||||||
|
{
|
||||||
|
theRedrawEntireFrameIndicator = true;
|
||||||
|
if(now)
|
||||||
|
drawMediaSource();
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Reference in New Issue