Skip to content

Commit

Permalink
修改stormlib
Browse files Browse the repository at this point in the history
  • Loading branch information
actboy168 committed Sep 1, 2013
1 parent 812b33b commit 2038af7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Development/Editor/Core/Script/Python/util/mpqutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ def create(stormlib_path, from_path, to_path):
if mpq is None:
raise Exception('Can\'t open mpq ' + str(to_path))
add_directory(mpq, from_path)
mpq.Compact()
if not mpq.Compact():
raise Exception('Mpq compact failed.')

del mpq
3 changes: 1 addition & 2 deletions Development/Editor/Core/Script/Python/util/stormlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
MPQ_CREATE_ARCHIVE_V1 = 0x00000000
MPQ_FILE_COMPRESS = 0x00000200
MPQ_FILE_ENCRYPTED = 0x00010000
MPQ_FILE_SINGLE_UNIT = 0x01000000
MPQ_FILE_REPLACEEXISTING = 0x80000000
MPQ_COMPRESSION_HUFFMANN = 0x01
MPQ_COMPRESSION_ZLIB = 0x02
Expand Down Expand Up @@ -59,7 +58,7 @@ def __del__(self):
def AddFile(self, path, name, flags = MPQ_FILE_REPLACEEXISTING):
return self.__module.AddFile(self.__mpq, path, name, flags)

def AddFileEx(self, path, name, flags = MPQ_FILE_REPLACEEXISTING | MPQ_FILE_SINGLE_UNIT | MPQ_FILE_COMPRESS):
def AddFileEx(self, path, name, flags = MPQ_FILE_REPLACEEXISTING | MPQ_FILE_COMPRESS):
return self.__module.AddFileEx(self.__mpq, path, name, flags, MPQ_COMPRESSION_ZLIB, MPQ_COMPRESSION_ZLIB)

def Compact(self):
Expand Down

0 comments on commit 2038af7

Please sign in to comment.