From 9b6ed83d7e0836aae68bb90e03cd074397995f9a Mon Sep 17 00:00:00 2001 From: stephena Date: Wed, 16 Jun 2010 13:45:32 +0000 Subject: [PATCH] Snapshots in continuous snapshot mode are now tagged with a timestamp, so they don't overwrite previously created files. This timestamp is related to the millisecond that the snapshot was taken, so there's no chance of overlap (snapshots can only be taken every 1 second / 1000 milliseconds at most). The appended value is an 8-character hex representation of this 32-bit value. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2055 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- src/emucore/EventHandler.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index 38493844c..c3543b13e 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -766,14 +766,14 @@ void EventHandler::poll(uInt64 time) { #ifdef CHEATCODE_SUPPORT const CheatList& cheats = myOSystem->cheat().perFrame(); - for(unsigned int i = 0; i < cheats.size(); i++) + for(uInt32 i = 0; i < cheats.size(); i++) cheats[i]->evaluate(); #endif // Handle continuous snapshots if(myContSnapshotInterval > 0 && (++myContSnapshotCounter % myContSnapshotInterval == 0)) - takeSnapshot(myContSnapshotCounter / myContSnapshotInterval); + takeSnapshot(time >> 10); // not quite milliseconds, but close enough } } else if(myOverlay) @@ -1838,7 +1838,7 @@ void EventHandler::takeSnapshot(uInt32 number) if(number > 0) { ostringstream buf; - buf << sspath << "_" << number << ".png"; + buf << sspath << "_" << hex << setw(8) << setfill('0') << number << ".png"; filename = buf.str(); } else if(!myOSystem->settings().getBool("sssingle"))