mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-01 23:20:44 +00:00
Set timestamp for savegames on POSIX
So they can be sorted correctly etc
This commit is contained in:
parent
1e3bc3429b
commit
edb4856abd
1 changed files with 4 additions and 36 deletions
|
@ -478,42 +478,10 @@ int idSaveGameThread::Enumerate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// RB: FIXME ?
|
// DG: just use the idFile object's timestamp - the windows code gets file attributes and
|
||||||
|
// other complicated stuff like that.. I'm wonderin what that was good for.. this seems to work.
|
||||||
// use current time
|
details->date = file->Timestamp();
|
||||||
time_t aclock;
|
// DG end
|
||||||
time( &aclock );
|
|
||||||
|
|
||||||
/*
|
|
||||||
// Use the date from the directory
|
|
||||||
WIN32_FILE_ATTRIBUTE_DATA attrData;
|
|
||||||
BOOL attrRet = GetFileAttributesEx( file->GetFullPath(), GetFileExInfoStandard, &attrData );
|
|
||||||
delete file;
|
|
||||||
if( attrRet == TRUE )
|
|
||||||
{
|
|
||||||
FILETIME lastWriteTime = attrData.ftLastWriteTime;
|
|
||||||
const ULONGLONG second = 10000000L; // One second = 10,000,000 * 100 nsec
|
|
||||||
SYSTEMTIME base_st = { 1970, 1, 0, 1, 0, 0, 0, 0 };
|
|
||||||
ULARGE_INTEGER itime;
|
|
||||||
FILETIME base_ft;
|
|
||||||
BOOL success = SystemTimeToFileTime( &base_st, &base_ft );
|
|
||||||
|
|
||||||
itime.QuadPart = ( ( ULARGE_INTEGER* )&lastWriteTime )->QuadPart;
|
|
||||||
if( success )
|
|
||||||
{
|
|
||||||
itime.QuadPart -= ( ( ULARGE_INTEGER* )&base_ft )->QuadPart;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Hard coded number of 100-nanosecond units from 1/1/1601 to 1/1/1970
|
|
||||||
itime.QuadPart -= 116444736000000000LL;
|
|
||||||
}
|
|
||||||
itime.QuadPart /= second;
|
|
||||||
details->date = itime.QuadPart;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// RB end
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue