gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > bmp to bin file question

#90024 - xtoc - Tue Jun 27, 2006 10:54 pm

i've seen many source examples that are using bin files (for there pictures)

i've working with gfx2gba to convert a bmp file to a raw.c / pal.c file. ,
even with gfx2ds i created a .h file.
i've seen there is a file that's named bmp2bin.exe, but no go.


My question of all is : can someone could give me a short example how i can convert a bmp(background) to bin, so i can load this bin file as background on my ds?


thx, greetz

#90031 - ikaris - Wed Jun 28, 2006 12:09 am

To use bmp2bin for DS:

bmp2bin -d inputfile.bmp outputfile.bin

This will create the Bin.

You'd also be good to put it into a folder like "data".

Then, the Makefile has to be modified to transform the Bin into a .h...

Then in your code, you'd have something like:

#include "outputfile_bin.h"

(Note that the .bin was replaced with _bin and a .h was added)

This is how all of the other examples do it. Check out Textured_Quad, it's a good example.

Simply do a compare of your make file (use WinMerge or UltraEdit or something) to compare the files and add what is necessary.

HTH !

#90084 - xtoc - Wed Jun 28, 2006 7:54 am

thx!