inwc3 / JMPQ3

Native Java mpq archive library
Apache License 2.0
38 stars 17 forks source link

Cannot handle file attributes #11

Open Frotty opened 7 years ago

Frotty commented 7 years ago

E.g. load, then close war3.mpq The attributes file and section are gone and wc3 will not load.

Frotty commented 7 years ago

leaving out attributes completely doesn't produce an error. So this is default for now.

DrSuperGood commented 7 years ago

As part of my changes to remove archive file duplication on load I have added support for opening a MPQ archive in read only mode. This prevents the archive file from being modified at all on closure. Useful for opening the Warcraft III main data MPQ archive files (eg war3.mpq) as one generally does not want to modify them and often cannot modify them without administrator permission.

I will see to adding a modification check so that archives opened for writing will only be modified if at least 1 change is made to them. This will prevent existing code that operates in a read only style from modifying archive files.

I will look into better attribute file handling later on. Until then this issue probably should stay open.

Frotty commented 7 years ago

I commented out the current attributes generation. It is pretty much working, but the crc32 for some wav files differed from the ladik one. Hence me mentioning that wav export might not be 100% working yet.

DrSuperGood commented 7 years ago

I commented out the current attributes generation. It is pretty much working, but the crc32 for some wav files differed from the ladik one. Hence me mentioning that wav export might not be 100% working yet.

Might be a good idea to add a test case for this, as well as other compression formats.

Frotty commented 7 years ago

Ideally yes

DrSuperGood commented 7 years ago

Wav files might be compressed by multiple compression schemes. The first sector cannot be compressed with ADPCM as it contains the wav header and so has to be compressed by something else (if at all).