mirror of
https://github.com/elliotnunn/macresources.git
synced 2024-06-07 05:29:30 +00:00
Ditch FakeResDecompress in preparation for Max's
This commit is contained in:
parent
29982335a6
commit
fbdb8eb61a
|
@ -1,26 +0,0 @@
|
|||
def GetEncoding(inf):
|
||||
try:
|
||||
if inf[6] == 8:
|
||||
encoding = 'DonnBits'
|
||||
elif inf[6] == 9:
|
||||
defprocID = int.from_bytes(inf[8:10], byteorder='big', signed=True)
|
||||
encoding = 'GreggyBits%d' % defprocID
|
||||
else:
|
||||
raise ValueError
|
||||
# print('GetEncoding', encoding)
|
||||
return encoding
|
||||
except:
|
||||
return 'UnknownCompression'
|
||||
|
||||
|
||||
def DecompressResource(inf):
|
||||
# print('DecompressResource', GetEncoding(inf))
|
||||
if GetEncoding(inf) == 'UnknownCompression': return inf
|
||||
return b'decompressed ' + inf
|
||||
|
||||
|
||||
def CompressResource(inf, encoding):
|
||||
# print('CompressResource', encoding)
|
||||
if encoding == 'UnknownCompression': return inf
|
||||
if inf.startswith(b'decompressed '): inf = inf[16:]
|
||||
return inf
|
|
@ -1,7 +1,7 @@
|
|||
import collections
|
||||
import struct
|
||||
import enum
|
||||
from .FakeResDecompress import DecompressResource, CompressResource, GetEncoding
|
||||
from ResDecompress import DecompressResource, CompressResource, GetEncoding
|
||||
|
||||
|
||||
FAKE_HEADER_RSRC_TYPE = b'header' # obviously invalid
|
||||
|
|
Loading…
Reference in New Issue
Block a user