原文, H- k4 U! \2 D1 A
http://forum.xentax.com/viewtopi ... &p=29933#p29933
. T1 B d+ y$ K" E
( p% v( _% a1 i* ?在老外的论坛上发现的这个小工具,以后也许会派上用处。
. |6 [3 e- O6 T
7 }( M7 L& ]4 |0 j+ E A+ x4 k0 ~! O) b. F J! f9 I" C* I }
I had to get some time, but here's the low down. 7 ]- Y" m K6 Q. \3 @
{ Q0 `) N5 e/ o+ A$ H, vI took a look at the assembly code and found the decompress routine. I then realized that it was standard LZSS compression. 1 D$ j, p2 D# [$ K; j
4 R0 A7 Y$ k$ @The executable uncompresses the bitmap data and fills in a BITMAPHEADER to show the actual .BMP file (not TGA). So basically, the .TGA files are Art files, with the magic word TGZ (Texture Graphics Zipped or something). 4 W2 ?0 u2 F. l2 D! d
3 t+ J' ~, {1 V& I1 J1 `1 h3 l8 a# `
( n) q* s! v6 eCode:) J6 ]0 A) w1 N+ w4 s
Byte[4] "TGZ\0"
+ C% }" l$ R" N2 f" r" h& F( \% t) Ruint32 Original size of bitmap data, i# {: ?- f X- V
uint32 Width of image4 n3 y" Z2 P/ ]% ^- ~+ D" e! v
uint32 Heigth of image, n* Z3 R" |$ x' ?1 P3 A: K1 l8 p ^
Byte[n] Bitmap data (LZSS compressed)" O* N( w/ ^% T* i9 g. L+ m
/ K9 ~, q! W& G% T7 {) `2 U. TIf I take the bitmap data and show it this is what you get for the first screen of the game (near the Temple):1 R9 `3 B, }& G! G/ n9 c$ W" ?* C
: s4 ?' b4 H$ R1 V' YAttachment: v! w/ i, b+ O# E8 n4 Y
0 d, g* _8 h9 @$ C# u% b+ O8 e, q3.tga.jpg [ 464.92 KB | Viewed 251 times ] . e! D/ [! L( G" d1 \' [9 V( |
) x' X& e9 c$ P+ I3 ]3 K8 q& y, N: C. {: A# g$ l. o5 W
Missing colours, but it show how the executable rotates the image when needed to give the 360 degrees impression in the game. Okay, so I took another look at the executable and noticed that it filled in a .BMP header with standard values for each image, and filling up the colour table in the .BMP with 0 (the bitmap values are also the RGB values! 16 bitcounts!)+ j, T. ?* Z; S( ~: f
8 T. w( ~5 W- G! ]; ^So, I recreated the header and inserted that before my uncompressed bitmap data:
+ e5 M/ V/ }0 ]# Y6 v; I& N3 m, a# t# p% N
. U' P; y2 x7 zAttachment:9 ]5 ^; ]8 s% ?8 |6 V3 \
& X& D0 L5 }, f9 k. a- q' [
3.tga_final.jpg [ 604.76 KB | Viewed 248 times ] ' b, e1 \0 U1 ~* f
8 U3 U) Y y+ m( J( ^, ~
BINGO! 7 E& ]! Q( @" M1 o' W' o' Y: j6 E
" O+ s! u0 |+ C u/ C% oNow for coolness, let's rotate it and make it smaller to fit here: |