Packing up ressources

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Iyad
Posts: 140
Joined: Sat Mar 07, 2009 1:18 am
Location: Montreal, Canada

Packing up ressources

Post by Iyad »

Hi everyone,
I tried to search on the forum but I didnt find a good solution (using code::blocks) about how to integrate my media files in my exe and load them using irrlicht.
Does anyone have a working code for this?
Thanks for your suggestions.
#include <Iyad.h>
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Post by Radikalizm »

Instead of bloating your executable file you should maybe use an external file containing your assets (using a file archive supported by irrlicht, or by designing your own format)

Unless you have a very minimalistic game I wouldn't integrate any assets in an executable
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

For other purposes we have the binary to header converter somewhere in the Irrlicht repository. bitplane added it some month ago. Probably under tools/
Iyad
Posts: 140
Joined: Sat Mar 07, 2009 1:18 am
Location: Montreal, Canada

Post by Iyad »

Unless you have a very minimalistic game I wouldn't integrate any assets in an executable
Irrlicht is not only for games you know, I need my project in only 1 exe, ready to be distributed.
For other purposes we have the binary to header converter somewhere in the Irrlicht repository. bitplane added it some month ago. Probably under tools/
Thx hybrid, i may use this, and if I have some questions ill post them there.

Thanks for your answers.
#include <Iyad.h>
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Post by Radikalizm »

Iyad wrote:
Unless you have a very minimalistic game I wouldn't integrate any assets in an executable
Irrlicht is not only for games you know, I need my project in only 1 exe, ready to be distributed.
I am fully aware of that, since I use irrlicht mostly for prototyping these days
I'm just of the opinion that packing everything in a monolithic file is rarely a good approach
Iyad
Posts: 140
Joined: Sat Mar 07, 2009 1:18 am
Location: Montreal, Canada

Post by Iyad »

I tried the file to header converter, and its seems ok. I got my archive file in a header, but I have a problem when I try to load it :

Code: Select all

    IReadFile *f = createEmbeddedFile(Device->getFileSystem(), "test.zip");
    Device->getFileSystem()->addFileArchive(f);
Errors (in irrstring.h) :

Code: Select all

..\include\irrlicht/irrString.h:282: error: could not convert '*(p ++)' to 'bool'
..\include\irrlicht/irrString.h:297: error: invalid cast from type 'const irr::io::IReadFile' to type 'char'
I really dont know why im getting this error, i compiled about 20 times irrlicht in a static lib, and I even added cheshirekow patch (http://irrlicht.sourceforge.net/phpBB2/ ... =ireadfile).
Does anyone know how to solve this and why it is appearing?
Thanks for your patience
#include <Iyad.h>
Iyad
Posts: 140
Joined: Sat Mar 07, 2009 1:18 am
Location: Montreal, Canada

Post by Iyad »

Its ok, I fixed this up... I recompiled irrlicht and added cheshirekow code in filesystem, the problem was that I was calling

Code: Select all

Device->getFileSystem()->addFileArchive(f);
Instead of

Code: Select all

Device->getFileSystem()->addFileArchive(f, true, true, true, "");
It was an overloaded function and without arguments it was calling the bad one...

Thanks for the help
#include <Iyad.h>
Post Reply