Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » [Help] How to incorporate the sprites inside the .exe.

This thread is locked; no one can reply to it. rss feed Print
[Help] How to incorporate the sprites inside the .exe.
Igorrr
Member #14,885
January 2013

How can I put all the sprites inside the .exe file so that the game is only the .exe insted of the .exe and the folder with all the sprites and sfx?

beoran
Member #12,636
March 2011

http://code.google.com/p/bin2h/

Basically you convert the data to an array in C. You'll need to provide your own custom loading routines, but that's not too hard to do.

SiegeLord
Member #7,827
October 2006
avatar

beoran said:

You'll need to provide your own custom loading routines, but that's not too hard to do.

You use the memfile addon for this (al_open_memfile).

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Igorrr
Member #14,885
January 2013

Sorry but I don't really get, what am I supose to do with the array I get from bin2h?

SiegeLord
Member #7,827
October 2006
avatar

Pass it as the first argument of al_open_memfile.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Igorrr
Member #14,885
January 2013

I'm currently using Allegro 4 and that function doesn't exist. Is there any other function for this?

torhu
Member #2,727
September 2002
avatar

Allegro 4 has its own data file format that you can use. And there'a a tool called exedat that adds the data file to the executable.

EDIT: Look at the examples, etc.

Audric
Member #907
January 2001

With Allegro 4, the simplest is to store all the resources in a datafile, and then for release you use the exedat utility to append the datafile at the end of the executable. See example "exexedat.c"

Go to: