Page 1 of 1
Packing up ressources
Posted: Mon Mar 28, 2011 3:00 pm
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.
Posted: Mon Mar 28, 2011 3:10 pm
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
Posted: Mon Mar 28, 2011 3:12 pm
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/
Posted: Mon Mar 28, 2011 3:35 pm
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.
Posted: Mon Mar 28, 2011 3:38 pm
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
Posted: Sat Apr 02, 2011 8:29 pm
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
Posted: Sun Apr 03, 2011 8:32 pm
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