原文. p) C, S' x6 p( I, G6 v. S
http://forum.xentax.com/viewtopi ... &p=29933#p29933+ N4 X( ~8 V% \: g7 U4 L
% |2 L1 V/ b+ b- g% t E3 b% c9 x8 E1 t在老外的论坛上发现的这个小工具,以后也许会派上用处。
+ U. ~% r9 n7 K/ F' p
; F9 V" `4 ]& C8 ]: L2 T! N, i9 c% N- w+ x) B& B) \+ G4 g7 g' d
I had to get some time, but here's the low down.
$ ~* ]+ | P; ~; o
' |, P& i- C. q+ |; aI took a look at the assembly code and found the decompress routine. I then realized that it was standard LZSS compression.
2 F! {" e1 Y+ A/ T
$ M5 S0 [, I9 `8 x$ R6 M9 KThe 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). 9 u2 n, R8 {3 Y
4 M5 ]: l1 ?7 R. z, P8 v @! v
- T! h# z: J5 R" d. `6 ]3 B% @
Code:2 g! w8 B4 K9 D! f4 M4 c) C
Byte[4] "TGZ\0"
3 V5 L* T) f4 i7 \2 r) t* j1 Huint32 Original size of bitmap data7 `: ]! c+ g1 K5 W
uint32 Width of image$ |# K0 `* }3 W" k/ z( I* N& |" G
uint32 Heigth of image
! Y) e0 d+ A& f0 f+ a3 w( i' iByte[n] Bitmap data (LZSS compressed)/ y: ^8 E% c% o1 d: b$ _ `" P; U
8 }, Y; |1 ~' t8 y- xIf I take the bitmap data and show it this is what you get for the first screen of the game (near the Temple):% R& U2 V& w8 t, u1 v0 I
$ p9 f) i# d5 ^1 B2 N5 H3 TAttachment:: i3 @$ R2 a1 p4 w
6 ]4 L( u6 ^2 r+ n/ T3.tga.jpg [ 464.92 KB | Viewed 251 times ]
]" \6 Y8 D4 Z% r# A
8 |1 c1 r" _0 Y; J) W6 A" \ g% F" g9 d2 J( J6 L0 }; z/ n
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!), ?) S I6 d1 C. u% F
" n" D$ Z! Z; ^7 b" {* I& {So, I recreated the header and inserted that before my uncompressed bitmap data:* M$ Z6 K9 G+ @6 r% {
' S0 H6 V+ ?- T0 w5 X) V5 ]0 G# w0 P' j$ w
Attachment:
8 W, q$ W. A; ^2 \* z
5 j# y# h" ^& M3.tga_final.jpg [ 604.76 KB | Viewed 248 times ]
: x- i$ s0 b. w! u( u, k. v+ G' Q1 K6 Z# x
BINGO! 9 V2 k* [; p ^& y9 Q& z: v
! Z i& X; ~* d' j* E, P% TNow for coolness, let's rotate it and make it smaller to fit here: |