It does indeed have multiple palettes, one for each icon in fact. Rainbow (a rather good TIM2 viewer) reads in the number of palettes but doesn't seem to store it or allow you to switch them.
I made a GFXtract script to handle these particular files:
This doesn't handle all TIM2 files, but I'm going off of the assumption that all of the files from this game are similar (in terms of their format and version). Unfortunately there's no way to tell how to separate the icons (and besides GFXtract doesn't have that functionality yet) so what it'll do is output the same image multiple times but with different palettes. You'll have to cut out the individual icons manually, I'm afraid.
By the way, just out of curiosity may I ask how the TXD files were handled?
I made a GFXtract script to handle these particular files:
Code:
idstring TIM2
get VERSION short
get TNUM short
goto 8 cur
for i = 0 < TNUM
get SEGSIZE long
get PALLEN long
get LENGTH long
get HEADLEN short
get PALNUM short
math PALNUM /= 0x10
get FORMAT byte
get MIPNUM byte
get CLUT byte
get BPP byte
if BPP == 1
set BPP 16
elif BPP == 2
set BPP 24
elif BPP == 3
set BPP 32
elif BPP == 4
set BPP 4
elif BPP == 5
set BPP 8
else
print "Invalid bit depth!"
exit
endif
get WIDTH short
get HEIGHT short
goto 0x18 cur
savepos OFFSET
set PALOFF OFFSET
math PALOFF += LENGTH
for j = 0 < PALNUM
get NAME basename
string NAME += _pal
string NAME += j
goto OFFSET
setformat BPP RGBA 1 32 PALOFF
read IMG WIDTH HEIGHT
savepng IMG NAME
math PALOFF += 0x40
next j
next i
This doesn't handle all TIM2 files, but I'm going off of the assumption that all of the files from this game are similar (in terms of their format and version). Unfortunately there's no way to tell how to separate the icons (and besides GFXtract doesn't have that functionality yet) so what it'll do is output the same image multiple times but with different palettes. You'll have to cut out the individual icons manually, I'm afraid.
By the way, just out of curiosity may I ask how the TXD files were handled?