Examples of Irrlicht with libarchive?

Discussion about everything. New games, 3d math, development tips...
Post Reply
carlwryker
Posts: 22
Joined: Sun Jun 12, 2016 8:03 am

Examples of Irrlicht with libarchive?

Post 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.
Code::Blocks
mingw
Windows 10 64-bit
Cube_
Posts: 1010
Joined: Mon Oct 24, 2011 10:03 pm
Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d

Re: Examples of Irrlicht with libarchive?

Post 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)
"this is not the bottleneck you are looking for"
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Examples of Irrlicht with libarchive?

Post 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).
Cube_
Posts: 1010
Joined: Mon Oct 24, 2011 10:03 pm
Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d

Re: Examples of Irrlicht with libarchive?

Post 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.
"this is not the bottleneck you are looking for"
carlwryker
Posts: 22
Joined: Sun Jun 12, 2016 8:03 am

Re: Examples of Irrlicht with libarchive?

Post by carlwryker »

Thank you!
Code::Blocks
mingw
Windows 10 64-bit
Post Reply