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.

Graphics > Getting grit to share a palette across multiple files

#178427 - chickendude - Sat Jun 20, 2015 12:01 pm

I'm working on a game for the DS but ran into a problem early on where i couldn't (figure out how to) get grit to share a palette across multiple files. Or some other way to do that. I kinda evaded the problem by placing all tiles/sprites that need to share a palette in one big .png file, the problem with that is that they all have to be the same dimensions and accessing certain parts of it is a bit of a pain since you have to calculate the offset first.

The Grit manual mentions something about putting the -pS flag in the .grit configuration file, i've tried a few different things but can't figure it out. I tried asking at the devkit forums, but that was a few weeks ago and the message hasn't been approved yet (or was rejected). I currently have a separate .grit file for each image and they're all placed in the graphics directory.

And while we're at it, what is a good way to keep track of your palettes? Currently i'm just drawing everything in Gimp without paying much attention to what's in the palette/how full it is.

Thanks for the help :)

#178428 - pitcrawler - Mon Jun 22, 2015 9:15 pm

For me, I use Usenti for graphics. It's designed specifically for making GBA/NDS graphics.

You can make one image with Usenti and set up the palette how you want. Then for further images, you can open the first image then save a copy of it so you have 2 images with the same palette. Then you can either draw in Usenti itself or copy and paste graphics into it and adjust the colors accordingly.

Then with Grit. You just save the palette from one of the images with the -p flag and ignore the palette from the rest of the images that share the palette by using the -p! flag. Then you just load the single palette in your program and let all your separate graphics use it.

Hope this helps.

#178429 - sverx - Tue Jun 23, 2015 12:48 pm

I use Paint Shop Pro. It can save the palette from an image and 'apply' it to the other images so that they're all using the very same palette (those which need to!).
_________________
libXM7|NDS programming tutorial (Italiano)|Waimanu DS / GBA|A DS Homebrewer's Diary

#178433 - gauauu - Thu Jun 25, 2015 4:09 pm

Just chiming in that I use picrawler's method as well :)

#178434 - chickendude - Sat Jun 27, 2015 5:15 pm

Thanks, i've used a tool called "Chili" which seems to work alright, it's what i used in some asm projects on the GBA. I just tried Usenti with Wine and it seems to work all right, a little buggy but useable.

I suppose GIMP should have something similar to that, i've just got to figure out how to get it working.

Thanks for the suggestions, i guess i assumed everyone used grit for everything.