From b96848d6811492fd47344a7a6e3b11e87a2c44dd Mon Sep 17 00:00:00 2001 From: Garux Date: Wed, 30 Dec 2020 12:30:35 +0300 Subject: [PATCH] split repacker's outgoing pk3s to ~2Gb chunks (more results in bugs) (windows only) --- tools/quake3/common/vfs.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/quake3/common/vfs.c b/tools/quake3/common/vfs.c index ca69c924..82501b33 100644 --- a/tools/quake3/common/vfs.c +++ b/tools/quake3/common/vfs.c @@ -396,7 +396,16 @@ int vfsLoadFile( const char *filename, void **bufferptr, int index ){ return -1; } - +__int64 FileSize(const wchar_t* name) +{ + WIN32_FILE_ATTRIBUTE_DATA fad; + if (!GetFileAttributesEx(name, GetFileExInfoStandard, &fad)) + return -1; // error condition, could call GetLastError to find out more + LARGE_INTEGER size; + size.HighPart = fad.nFileSizeHigh; + size.LowPart = fad.nFileSizeLow; + return size.QuadPart; +} bool vfsPackFile( const char *filename, const char *packname, const int compLevel ){ @@ -409,6 +418,9 @@ bool vfsPackFile( const char *filename, const char *packname, const int compLeve FixDOSName( fixed ); g_strdown( fixed ); + if( FileSize( packname ) > 2100000000 ) + strcat( (char*)packname, "+" ); + for ( i = 0; i < g_numDirs; i++ ) { strcpy( tmp, g_strDirs[i] );