原文' F- S2 `- ?( t6 h: Y
http://forum.xentax.com/viewtopi ... &p=29933#p29933
6 {2 A$ e2 H( O: M S4 `2 u" z( T; [ u2 e3 I' w! K; U9 F
在老外的论坛上发现的这个小工具,以后也许会派上用处。) N8 P/ U4 I0 c! T
4 v6 E% ?* h4 R
# v8 ]8 X0 P. C8 S' L: @2 E5 ^/ s
I had to get some time, but here's the low down. ! J' a( K, _1 g% m+ y
7 l- s4 \7 r3 QI took a look at the assembly code and found the decompress routine. I then realized that it was standard LZSS compression.
- K+ e/ G+ p6 U. F3 C- n$ T) S! a8 `) z( E- W) o* n8 _( s
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).
2 {; D4 z% @' z8 d O) ]5 u
. S1 O$ C' a( A3 E. a
/ V9 }0 n# f, C- Q( k8 x' {Code:
6 T: i1 C* I6 vByte[4] "TGZ\0"
3 r1 g/ Z. y& q9 ~! juint32 Original size of bitmap data `( J: i7 Q' |8 I0 S7 P
uint32 Width of image
" r2 P2 x$ z2 [uint32 Heigth of image( [& `% n* s2 e6 K
Byte[n] Bitmap data (LZSS compressed)
+ e" z2 ? f5 Z9 _. N3 ?( K8 G0 n0 y7 ~
If I take the bitmap data and show it this is what you get for the first screen of the game (near the Temple):3 R; R, f" _) r: ~
! P; [ Q2 W' p
Attachment:
/ _0 M( l% Y# ~/ G k% u8 y
$ N4 G' d5 Y# Z( q# i8 X' x U3.tga.jpg [ 464.92 KB | Viewed 251 times ] 7 {' Y# G6 W6 [: r3 J
* A+ y, d8 N0 u7 p: X) o) T$ g$ B, j, ]
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!)1 y1 t% R. i4 f: B' n
# f3 N; x- p4 |3 d) o3 }So, I recreated the header and inserted that before my uncompressed bitmap data:% q4 `$ V+ O9 `% J u: Y
% C( ?( @- M0 d3 i' X
% w& `, N+ @2 C. V2 X: v4 S% X' d1 S
Attachment:3 Q# s* A% Y. e& U+ e' u0 D
- l$ ^8 y% }: R+ D x5 R3.tga_final.jpg [ 604.76 KB | Viewed 248 times ] + V4 R3 m& Y4 r" |3 t4 U
1 F$ @, R0 f9 i2 b
BINGO! # f( H2 i7 k& A. l0 {: a
# f, z% G% I" N9 w8 LNow for coolness, let's rotate it and make it smaller to fit here: |