原文
9 E8 T2 Q6 P+ M7 ]. [6 J) Ahttp://forum.xentax.com/viewtopi ... &p=29933#p29933
! B/ N" S" p. J1 E1 g* O
$ S" T. }2 F" I0 r7 i8 o# l在老外的论坛上发现的这个小工具,以后也许会派上用处。
0 Z5 G* @0 c: f F& ~, w* O3 x3 R6 U; I" K
0 L) X f5 R4 B" M) d) eI had to get some time, but here's the low down.
8 C ]* N! W: H6 P$ N. d: b* W
& B( A) J" s1 A* R) L" aI took a look at the assembly code and found the decompress routine. I then realized that it was standard LZSS compression. 3 r3 H9 \! J# X, y) Q, t: a1 x6 E& D
* }) n( b: p2 M) F
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).
3 y. |& {8 @! ^3 g' i, e3 J! [9 \7 X' {6 N# g3 |7 b) F& [" j2 A
- o2 p6 w: T- @+ M, L) BCode:
! j- L3 y* ~% o1 ?7 d- [Byte[4] "TGZ\0"
4 q! U. i1 S: {/ P% t9 e% Guint32 Original size of bitmap data7 L- \2 W, c( b& u
uint32 Width of image
% \1 d: }+ D I) ^ E" ?uint32 Heigth of image- i6 Z0 i! s5 j9 u& A+ r0 ?$ W' O( n
Byte[n] Bitmap data (LZSS compressed)0 V8 d, L) f) Z
& {% o9 r( r5 M' k8 f& OIf I take the bitmap data and show it this is what you get for the first screen of the game (near the Temple):2 e( B9 M4 C/ F6 A( Y
0 M O9 T8 ?7 v1 _! a% _- N
Attachment:# r2 p, w% J9 Y5 A" u8 \! j( v& }
% [) K: x4 H& ~' t1 R3.tga.jpg [ 464.92 KB | Viewed 251 times ]
( ]! K' m! Z: x* `; o3 p- U/ O; M- z% h7 W6 }
+ z( j: V5 x% D+ z
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!)
|0 D, s. q0 P9 ?2 s+ L& ?# e( ^% T+ s, d, n
So, I recreated the header and inserted that before my uncompressed bitmap data:
8 j: F! s) z" T8 j3 d4 G1 _% c" z& j& ]
. O$ m5 y1 W. R' `7 ?Attachment:# @* Q( n. C9 s# q" a
3 i! S7 y' e% o' e5 ~0 p) K3.tga_final.jpg [ 604.76 KB | Viewed 248 times ] : G, `. R; E. y6 U" O$ ^$ [' h
) U: t7 p& N0 [; DBINGO!
7 \% X5 u9 Z, s- B4 T' M) I2 n
& I* @4 K$ @9 L4 z( U5 H- V% `( _- KNow for coolness, let's rotate it and make it smaller to fit here: |