#2239 - TurboHz - Fri Jan 31, 2003 3:05 pm
I've been using gif2spr to convert graphics to GBA format.
It seems to work ok; my sprites and tiles are displayed correctly.
BUT, using VisualBoyAdvance, I noticed that the palette (and also the tile data, accordingly), is being rearranged? (I'm using 16 colour palettes, BTW)
I wanted to do some FX changing palette values dinamically, so I arranged my palette to make it easy to shift the values to next palette slot... (did I make that clear enough???)
Anyone has noticed that as well?
#2259 - loopy - Fri Jan 31, 2003 10:09 pm
Yeah, I get fed up with that too. Doesn't seem too many people are using 16 color sprites and all the utilities are for 256. Anyway, I use pcx2sprite and then convert the 256-color output to 16 with my own VB utility, code below:
Code: |
Attribute VB_Name = "colorConvert"
Option Explicit
Sub Main()
Dim i As Integer
Dim s As String
Dim s2 As String
Dim endOfFile As Boolean
Dim endOfString As Boolean
Open Command() For Binary As #1
Open App.Path & "\output.h" For Output As #2
For i = 1 To 9
Line Input #1, s
Next i
Print #2, s
endOfFile = False
While endOfFile = False
Line Input #1, s
If Right$(s, 2) = "};" Then endOfFile = True
endOfString = False
i = 24
s2 = " "
While endOfString = False
s2 = s2 & "0x" & Mid$(s, i + 8, 1) & Mid$(s, i + 10, 1) & Mid$(s, i, 1) & Mid$(s, i + 2, 1) & ", "
i = i + 16
If i >= Len(s) Then endOfString = True
Wend
If endOfFile = True Then s2 = Left$(s2, Len(s2) - 2)
Print #2, s2
Wend
Print #2, "};"
Close #2
Close #1
End Sub
|
You can just drag-and-drop your 256-color .h file and this will spit out output.h. It cuts out the palette, but you just cut that out of the original file if you want it.
#2309 - Maddox - Sat Feb 01, 2003 10:05 pm
Keep trying because professionals MOSTLY use 16-color sprites. Oops, $0.02.
_________________
You probably suck. I hope you're is not a game programmer.
#2411 - Quirky - Mon Feb 03, 2003 8:41 am
FFS Maddox. If you have such a problem helping people out, just stop posting.
As for using gif2spr - I think like most conversion tools it arranges the palette in the order it finds the colours in the first image file. A way round that might be to create an (unused) image that has the colours in the order you want them. Then these'll be added to the internal palette first and used as references when optimising the other images.
#2412 - TurboHz - Mon Feb 03, 2003 9:20 am
I found another workaround.
I convert the images to 4bit BMPs, and the use bmp2raw to export raw binary data for both palette and image. With this utility, the palette order is preserved-
#2432 - tepples - Mon Feb 03, 2003 9:41 pm
There's a converter called "bmp2bg" in the tools folder of the source code for TOD. It converts .bmp and .pcx bitmaps to 4-bit tile data, preserving maps and even correcting for the difference between sRGB (CRT gamma) and GBA gamma.
Despite the name, it also works for 16-color sprites. For 2D mode, place all your cels side-by-side in a 256-pixel-wide bitmap; for 1D mode, line up your cells vertically in a bitmap that's as wide as one sprite.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#2435 - lordmetroid - Mon Feb 03, 2003 10:41 pm
Yes I have noticed that professionals use 16 colors tiles...
However we are amateurs and I personally choosed to use 256 colors because it gives me less trouble to code for it.
However there are alot of advantages with haveing 16 color tiles.
Not only does it take less space to store and is fatser to upload to VRAM it also quite impossible that one would need to use so many colors as 256 on a signle tile!
_________________
*Spam*
Open Solutions for an open mind, www.areta.org
Areta is an organization of coders codeing mostly open source project, but there is alot of sections like GBA dev, Language learning communities, RPG communities, etc...
#2453 - loopy - Tue Feb 04, 2003 8:58 am
Is that all you had to say, Maddox? Assuming you are a professional and use 16-color sprites, you mean to tell me that you didn't have any profound advice? Perhaps that's why you'd rather post snide comments than contributing knowledge and insight.
By the way, your grammar sucks. I hope your [sic] not a native English speaker.
#2497 - JonH - Wed Feb 05, 2003 12:13 am
loopy wrote: |
By the way, your grammar sucks. I hope your [sic] not a native English speaker. |
heh i done that one already on a different thread ;)