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 > Help: Grit and tiled backgrounds [solved]

#166599 - Emmanuel - Wed Feb 11, 2009 12:54 pm

When I used PAlib, I had my images, and then PAlib tiled them and outputted image.pal.bin image.map.bin image.tiles.bin image.info.bin (I don't care about info)

What I need is either someone to tell me how to convert a normal image with grit into tiled, with grit recognizing repeated tiles, PAGfx style, and outputting the files in that way, one per variable...

Or someone to tell me how to.... I need to convert normal images into tiled, and load them from FAT/EFS... they will have 512x512 to 1024x1024 sizes... so, I don't think a bmp style would fit...

All I get is grit to output me a single image.img.bin, which I don't know how to use in tiled mode... probably I even have the grit commands wrong...
Code:
grit title_up.png -w3 -gTFF00FF -gB16 -ftb
grit title_back.png -w3 -gTFF00FF -gB16 -ftb
pause

Those are my grit.bat commands...

BG will be 256 colors, perhaps multilayers, with FF00FF transparent (Magenta)... but what I need is just the map, the pal, and the tile files... or how to get them from FAT/EFS

Does Grit detects repeated tiles without repeating them unnecesarily?


Last edited by Emmanuel on Wed Feb 11, 2009 3:53 pm; edited 1 time in total

#166601 - dovoto - Wed Feb 11, 2009 1:52 pm

There are examples in the the example folder which use grit to convert graphics. The background all in one does for instance. Look at the .grit file to see the commands used.
_________________
www.drunkencoders.com

#166604 - Emmanuel - Wed Feb 11, 2009 3:03 pm

dovoto wrote:
There are examples in the the example folder which use grit to convert graphics. The background all in one does for instance. Look at the .grit file to see the commands used.

yeah, already got those, thanks, but, now I'm having issues mixing this with the fade to black you told me before... If I only fade, using the bmp bg, it works. If I set the tiled bg to a certain number, it looks good, but doesn't fade... if I set it to 0, it looks weird at the start, and the end, but the start fades...
For example
Code:
int bg1 = bgInit(number, BgType_Text8bpp, BgSize_T_256x256, number,number);

When number is:
0: it looks similar, but, the first and last rows look weird, and the first does fade in and out, as supposed...
1: it looks perfectly OK, but doesn't fade...
2 and 3: Just a whole screen the color of the first pixel...

i'm using mode 5 2d.... anyone got any idea of the cause? so I don't post all the code...

nvm, fixed... my code was a little messy at first...