Page 1 of 1

Examples of Irrlicht with libarchive?

Posted: Fri Sep 16, 2016 4:13 am
by carlwryker
I want to make a game editor that saves and loads media data (textures, meshes, scenes/maps) into and from a single file, such that I only have to distribute a single file instead of many media files. I have read that libarchive might be a suitable choice for zip, but I don't know of any examples that show how to use libarchive with Irrlicht.

Re: Examples of Irrlicht with libarchive?

Posted: Fri Sep 16, 2016 6:04 am
by Cube_
if you only need read capabilities irrlicht has built-in capabilities already, I just load everything from a data directory that I merge with a zip file as a virtual filesystem, that way I can load from data and in the final product I just mount [name].zip over /data and I can access both just fine, it's very effective (in that I can easily edit the files when testing and I can easily add files)

Re: Examples of Irrlicht with libarchive?

Posted: Fri Sep 16, 2016 7:08 am
by hendu
I don't think any library supports reading and writing an archive at the same time, and re-opening it in different modes for every file would slow things down due to lack of caching, etc. I would use two files, one read-only for what you supply, and one for the user data (ro at load time, rw when saving).

Re: Examples of Irrlicht with libarchive?

Posted: Sat Sep 17, 2016 5:05 am
by Cube_
hendu wrote:I don't think any library supports reading and writing an archive at the same time, and re-opening it in different modes for every file would slow things down due to lack of caching, etc. I would use two files, one read-only for what you supply, and one for the user data (ro at load time, rw when saving).
imo this, if you then really want to just overwrite the RO library at exit or at some other predictable point.

even if you did open the library rw it'd be orders of magnitude slower because now you'd have to have all sorts of safeguards to make sure you're not reading mid-write because you'd likely crash.

Re: Examples of Irrlicht with libarchive?

Posted: Sat Sep 17, 2016 9:59 pm
by carlwryker
Thank you!