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 > jpeg sprites

#51430 - SilverCoder - Fri Aug 19, 2005 3:08 pm

hi,

i am new to ds development. i read this http://www.double.co.nz/nintendo_ds/index.html tutorials.
i displayed a jpeg with the gba-jpeg-decode (i found it somewhere here in the forum). so far so good.
but now i want to get sprites working.
i want gfx in jpeg format. after hours of trying the only thing i see, is a white background, with a black square (but my sprite isn't just black :)).
has someone a tutorial or sample code for me?

greets silver

#51432 - tepples - Fri Aug 19, 2005 3:16 pm

I don't know if anything new in this area was added to the Nintendo DS, but on the GBA, sprite cels had to be in indexed color format, not the RGB format that JPEG coders emit. You would have to do your own color quantization at runtime (slow!) in order to convert a decoded JPEG to an indexed color image.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#51502 - dovoto - Sat Aug 20, 2005 7:52 pm

DS has a true color - true bitmap sprite mode. THere is an example in the libnds distrabution (www.devkitpro.org -- sourceforge packages -- examples)

This mode requires the alpha bit set. This mode might also be considered a waste of valuable ds vram but it is there if you choose to use itl.
_________________
www.drunkencoders.com

#51506 - tepples - Sat Aug 20, 2005 8:33 pm

So then how do you encode which pixels have the alpha bit set and which have them clear? You'd have to use something like JNG, and that can get a lot more complicated in general.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#51536 - SilverCoder - Sun Aug 21, 2005 1:43 pm

thx for replay.
i started to use pcx as sprite data. and then convert them with pcx2sprite.
that works fine.