mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
Use stat() instead of fopen() to detect existing files when saving screenshots
git-svn-id: https://svn.eduke32.com/eduke32@8246 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
72b87e5bd7
commit
b2421887a1
1 changed files with 6 additions and 3 deletions
|
@ -13,8 +13,6 @@
|
|||
|
||||
buildvfs_FILE OutputFileCounter::opennextfile(char *fn, char *zeros)
|
||||
{
|
||||
buildvfs_FILE file;
|
||||
|
||||
do // JBF 2004022: So we don't overwrite existing screenshots
|
||||
{
|
||||
if (count > 9999) return nullptr;
|
||||
|
@ -23,9 +21,14 @@ buildvfs_FILE OutputFileCounter::opennextfile(char *fn, char *zeros)
|
|||
zeros[1] = ((count/100)%10)+'0';
|
||||
zeros[2] = ((count/10)%10)+'0';
|
||||
zeros[3] = (count%10)+'0';
|
||||
|
||||
#ifdef USE_PHYSFS
|
||||
buildvfs_FILE file;
|
||||
if ((file = buildvfs_fopen_read(fn)) == nullptr) break;
|
||||
buildvfs_fclose(file);
|
||||
#else
|
||||
struct Bstat st;
|
||||
if (Bstat(fn, &st) == -1) break;
|
||||
#endif
|
||||
count++;
|
||||
} while (1);
|
||||
|
||||
|
|
Loading…
Reference in a new issue