Grit shared palettes
Grit shared palettes
I've been having trouble getting the shared palette option in grit to work properly. I have several 8 bit indexed images with different palettes (each palette only has 7 or 8 colors) and I'm trying to create a shared tileset, shared palette and a separate map for each image. Here's the command I'm using:
grit ./*.png -ftc -gS -m -pS -OBG_OL_MINE
This generates a file containing the shared tileset/palette and a separate file for each map. However, the palette does not contain the colors from all of the images. It seems to only be outputting the colors from one image. The weird part is that it only outputs 12 short values instead of 256 and half of those values are 0x0000. If I remove the -pS option, I get 256 values but still only the colors from one image are filled in and the rest are 0x0000.
I've also tried using bmp instead of png, but I get the same result.
grit ./*.png -ftc -gS -m -pS -OBG_OL_MINE
This generates a file containing the shared tileset/palette and a separate file for each map. However, the palette does not contain the colors from all of the images. It seems to only be outputting the colors from one image. The weird part is that it only outputs 12 short values instead of 256 and half of those values are 0x0000. If I remove the -pS option, I get 256 values but still only the colors from one image are filled in and the rest are 0x0000.
I've also tried using bmp instead of png, but I get the same result.
Re: Grit shared palettes
I downloaded the grit source code and hacked shared palettes in myself.
Re: Grit shared palettes
Great!
Now, why don't you, instead of keeping it to yourself, post a patch to sf.net regarding this issue? I'm sure it would be beneficial to us all if you did...
Now, why don't you, instead of keeping it to yourself, post a patch to sf.net regarding this issue? I'm sure it would be beneficial to us all if you did...
Re: Grit shared palettes
If anyone figures out shared palettes with grit, I'd love to know. I tried the -pS option, rewrote my Makefile, added an output file name, etc. It didn't really work out. Individual separate palettes work fine.
-
- Posts: 29
- Joined: Sun Mar 29, 2009 9:23 pm
Re: Grit shared palettes
My current approach is to merge all images which i want to share the same palette into one image and convert it into a BG
structure (Tiles+Map+Palette). At runtime I extract the areas I need from the Tiles and Map Data.
structure (Tiles+Map+Palette). At runtime I extract the areas I need from the Tiles and Map Data.
Re: Grit shared palettes
I've got several sprite images. I'd like to make one palette for all of them... can that be done? Currently I've got grit making separate palettes for each sprite. I tried making a image for grit with every color from every sprite I wanted to use. That image was called 'a.png' or something similar, and I used the palette from that for the sprites. Still, though, things came out wrong.RyouArashi wrote:My current approach is to merge all images which i want to share the same palette into one image and convert it into a BG
structure (Tiles+Map+Palette). At runtime I extract the areas I need from the Tiles and Map Data.
Re: Grit shared palettes
Wow, I haven't checked this thread in a while. I'll be submitting a patch shortly.
EDIT: Patch is up:
https://sourceforge.net/tracker/?func=d ... tid=668553
EDIT: Patch is up:
https://sourceforge.net/tracker/?func=d ... tid=668553
Re: Grit shared palettes
Hi,
Thanks for the patch.
I tried the following without success. I got the grit source from the svn repository on sourceforge, and downloaded the patch. I moved the patch to the grit directory and tried this (with the included results):
Then I compiled grit with 'make'. Then I copied the resulting executable to the devkitpro folder on my computer. For me this was '/opt/devkitpro/devkitARM/bin/grit'. The results for me are not really good. I find that the grit program isn't putting all my colors in the palette. Also my sprites don't seem to reference the right color. I'm guessing this is part of the same problem. Large parts of my sprites come out black. Am I making a simple error? This is my typical grit file:
I'd really like this to work. Do I need to execute the new grit from the command line? Will it work using a Makefile? Thanks.
EDIT: Hi, I did get this to work. Thanks so much for your patch. In the end I modified the Makefile to execute grit on all the image files in one run, as if I had supplied a list of files to the grit program on the command line. I'm not really good at editing Makefiles, so I won't post my results here unless someone really wants to see it, but it does work. Thanks much.
Thanks for the patch.
I tried the following without success. I got the grit source from the svn repository on sourceforge, and downloaded the patch. I moved the patch to the grit directory and tried this (with the included results):
Code: Select all
me@me:~/workspace/SVN/grit$ patch -p0 < sharedpalettes.patch
(Stripping trailing CRs from patch.)
patching file libgrit/grit_prep.cpp
Hunk #1 succeeded at 35 (offset 1 line).
Hunk #2 succeeded at 598 (offset 1 line).
(Stripping trailing CRs from patch.)
patching file libgrit/grit_shared.cpp
Code: Select all
# Set the warning/log level to 3
-W3
# Tell grit to include a palette (the first index in it will be transparent)
-pS
# Tile the image
-gt
# Set the bit depth to 4 (16 colors)
-gB4
EDIT: Hi, I did get this to work. Thanks so much for your patch. In the end I modified the Makefile to execute grit on all the image files in one run, as if I had supplied a list of files to the grit program on the command line. I'm not really good at editing Makefiles, so I won't post my results here unless someone really wants to see it, but it does work. Thanks much.
Who is online
Users browsing this forum: No registered users and 0 guests