deskjet / chiptune2.js

much like chiptune.js - but newer and neater
382 stars 50 forks source link

Zip support for mods ? #26

Closed bigrck64 closed 6 years ago

bigrck64 commented 7 years ago

Now that iOS player is working, I have one more question :) Do you know if libopenmpt support zipped mod file ? It's not a needed feature, but could be a nice option :)

photonstorm commented 7 years ago

You could always use this? https://stuk.github.io/jszip/documentation/howto/read_zip.html

Then pass the unzipped data in.

deskjet commented 7 years ago

I don't think libopenmpt does zipped modules. However it comes with a zip decompressor (miniz) builtin. Maybe you could use that (it's not exported to JS though).

sagamusix commented 6 years ago

There is an undocumented make parameter HACK_ARCHIVE_SUPPORT=1 that can be used to enable zip support in libopenmpt, but it's only a workaround that should only be used if you really have no other alternative (e.g. in a web context it can be sensible). If you can avoid it, use a libraries that is supposed to do the job, like the one photonstorm referenced.

bigrck64 commented 6 years ago

Hey, that's a nice parameter ! Thanks for sharing, I will test it :)

bigrck64 commented 6 years ago

Hey sagamusix, I just try to build 0.3.6 today with the HACK_ARCHIVE_SUPPORT=1 parameter but the build failed with :

[CXX] soundlib/Snd_fx.cpp [CXX] soundlib/Sndfile.cpp soundlib/Sndfile.cpp:40:10: fatal error: '../unarchiver/unarchiver.h' file not found

include "../unarchiver/unarchiver.h"

^~~~~~~~ 1 error generated. Makefile:596: recipe for target 'soundlib/Sndfile.o' failed make: *** [soundlib/Sndfile.o] Error 1

Any idea where I should download the "unarchiver" sources ?

sagamusix commented 6 years ago

As I have mentioned this is a hack and the required source is not found in official libopenmpt packages - just in our source tree, so you have to build from git or SVN. Please use a proper solution like the one photonstorm suggested instead of relying on an undocumented hack that might be removed at any point in time.

bigrck64 commented 6 years ago

Understood sagamusix, I will not rely on it. Anyway, it's working perfectly with latest https://github.com/OpenMPT/openmpt/releases :+1: A big thanks for all the incredible work around OpenMPT, you are awesome !