Mail Archives: djgpp/1998/10/02/21:58:10
jud wrote:
>
> what is the best way to compile grahpics into a program? would i just have
> to make a huge array? or is there a better way?
If using Allegro, you can use a datafile. Otherwise, it might be best
to make it into an assembly file, because GCC can take absurd amounts of
memory when compiling large initialized arrays. Basically, it would
look something like this:
--- file pic.s ---
.data
.global _pic_array
_pic_array:
# Here follows all the bytes of your image.
.byte 42
.byte 17
--- file pic.h ---
extern unsigned char pic_array[];
--- end ---
Then #include "pic.h" into your files, and access the array as usual.
You can probably write a simple program to automate this, or hack
Allegro's DAT2S.
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -