split repacker's outgoing pk3s to ~2Gb chunks (more results in bugs) (windows only)

This commit is contained in:
Garux
2020-12-30 12:30:35 +03:00
parent 2f2140efa4
commit b96848d681
+13 -1
View File
@@ -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] );