Skip to content

Commit

Permalink
Merge pull request #3 from HarpyWar/patch-1
Browse files Browse the repository at this point in the history
use a minimal hashtable size for 1 file inside mpq
  • Loading branch information
xboi209 committed Sep 6, 2014
2 parents fafa1c0 + 54801e6 commit 4b96b90
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions MPQSigner/src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ int main(int argc, char* args[])
//filename with mpq extension
snprintf(newMPQname, 256, "%s.mpq", shortfilename);

if (SFileCreateArchive(newMPQname, MPQ_CREATE_ARCHIVE_V1 | MPQ_CREATE_ATTRIBUTES | MPQ_CREATE_SIGNATURE, HASH_TABLE_SIZE_DEFAULT, &tempMPQ) == true)
if (SFileCreateArchive(newMPQname, MPQ_CREATE_ARCHIVE_V1 | MPQ_CREATE_ATTRIBUTES | MPQ_CREATE_SIGNATURE, HASH_TABLE_SIZE_MIN, &tempMPQ) == true)
{
cout << "Created archive " << newMPQname << endl;
if (SFileAddFileEx(tempMPQ, args[1], args[1], MPQ_FILE_COMPRESS | MPQ_FILE_SECTOR_CRC, MPQ_COMPRESSION_ZLIB, MPQ_COMPRESSION_NEXT_SAME) == true)
Expand All @@ -117,7 +117,7 @@ int main(int argc, char* args[])
snprintf(newMPQname, 256, "%s.mpq", args[1]);

//copy and pasted because i'm too lazy
if (SFileCreateArchive(newMPQname, MPQ_CREATE_ARCHIVE_V1 | MPQ_CREATE_ATTRIBUTES | MPQ_CREATE_SIGNATURE, HASH_TABLE_SIZE_DEFAULT, &tempMPQ) == true)
if (SFileCreateArchive(newMPQname, MPQ_CREATE_ARCHIVE_V1 | MPQ_CREATE_ATTRIBUTES | MPQ_CREATE_SIGNATURE, HASH_TABLE_SIZE_MIN, &tempMPQ) == true)
{
cout << "Created archive " << newMPQname << endl;
if (SFileAddFileEx(tempMPQ, args[1], args[1], MPQ_FILE_COMPRESS | MPQ_FILE_SECTOR_CRC, MPQ_COMPRESSION_ZLIB, MPQ_COMPRESSION_NEXT_SAME) == true)
Expand Down Expand Up @@ -242,4 +242,4 @@ int verifyArchive(HANDLE MPQ, char* args[])
}

return 0;
}
}

0 comments on commit 4b96b90

Please sign in to comment.