Update of /cvsroot/vba/VisualBoyAdvance/src/win32
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv29156/src/win32
Modified Files:
MainWnd.cpp
Log Message:
screenshots do no longer get overwritten
Index: MainWnd.cpp
===================================================================
RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/MainWnd.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** MainWnd.cpp 21 Jun 2006 16:58:15 -0000 1.21
--- MainWnd.cpp 18 Jul 2006 14:13:42 -0000 1.22
***************
*** 1107,1110 ****
--- 1107,1119 ----
ext);
+ // check if file exists
+ DWORD dwAttr = GetFileAttributes( buffer );
+ if( dwAttr != INVALID_FILE_ATTRIBUTES ) {
+ // screenshot file already exists
+ screenCapture(++captureNumber);
+ // this will recursively use the first non-existent scrrenshot number
+ return;
+ }
+
if(theApp.captureFormat == 0)
theApp.emulator.emuWritePNG(buffer);
|