From 9c1b9ae00e0aa9a1904bad20be6ba701433ddd13 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Wed, 19 Dec 2018 14:26:15 -0330 Subject: [PATCH] Fix bug when taking snapshots in 1x mode; once started, it never stopped. --- src/emucore/TIASurface.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/emucore/TIASurface.cxx b/src/emucore/TIASurface.cxx index 88c90edad..cf5584b62 100644 --- a/src/emucore/TIASurface.cxx +++ b/src/emucore/TIASurface.cxx @@ -418,7 +418,10 @@ void TIASurface::render() mySLineSurface->render(); if(mySaveSnapFlag) + { myOSystem.png().takeSnapshot(); + mySaveSnapFlag = false; + } } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -427,6 +430,8 @@ void TIASurface::renderForSnapshot() // TODO: This is currently called from PNGLibrary::takeSnapshot() only // Therefore the code could be simplified. // At some point, we will probably merge some of the functionality. + // Furthermore, toggling the variable 'mySaveSnapFlag' in different places + // is brittle, especially since rendering can happen in a different thread. uInt32 width = myTIA->width(); uInt32 height = myTIA->height();