原文. D. V7 ?6 M! I
http://forum.xentax.com/viewtopi ... &p=29933#p29933
- G; _4 V8 ^- B9 M9 z8 O8 `, s! [. A" j j2 z! `1 [7 x
在老外的论坛上发现的这个小工具,以后也许会派上用处。
# p$ J! X- U; o4 N8 H % r) f6 C1 r& U% D
[$ X, H. v, }3 a) H. a, I+ a; aI had to get some time, but here's the low down.
5 j. F# d3 H4 w$ {* l
1 e( j6 ~; ^/ M6 m1 NI took a look at the assembly code and found the decompress routine. I then realized that it was standard LZSS compression. * [* _: o1 |' g% X( l) b- R+ W
) Y7 a4 M- G# e; T9 B- S0 h& n
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).
% d* z; S% B* u: Q
& f! D0 g' R$ n* J8 i
% I# ]/ t# ]- ^ f" ^7 PCode:. L8 C& b9 c4 a9 D; L: U2 Z
Byte[4] "TGZ\0"
( J6 B3 K; C. l9 fuint32 Original size of bitmap data; g2 e% |7 {0 x. k: S6 {+ q& i0 |
uint32 Width of image' R) y6 ~9 s* v- C! L, m( ?! j0 O" o
uint32 Heigth of image
, m3 Z" L1 A1 s/ g2 S: nByte[n] Bitmap data (LZSS compressed)
; E5 t k% D' A/ g# t" \! ?$ g! [& F1 z' N% T* } W% h) r" c
If I take the bitmap data and show it this is what you get for the first screen of the game (near the Temple):) o9 i6 U. n1 T; H1 A$ _) ?3 |' j
5 V+ ]: R% W6 A& G% S& pAttachment:0 t7 @0 g R6 D& a' O
3 X" p5 K$ X% E/ u6 L6 j3.tga.jpg [ 464.92 KB | Viewed 251 times ] ! @1 i, J9 c4 j0 a( p0 [ |
|: j! f f4 E1 G+ C4 m
: q% c7 f4 s2 E/ O) o2 X/ R! ]& X: RMissing 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!)) Q+ j) W; S& @& `
, ?# N' _5 D N0 c9 P# N* ESo, I recreated the header and inserted that before my uncompressed bitmap data:6 \7 i2 u# _8 l, b1 Z3 ?; p( V* C3 Q
4 b9 ^0 s8 z3 T3 Q# k: R4 j" {
! e5 d p/ E' p4 D" R7 nAttachment:5 t4 |$ k E+ B8 v3 |. Q$ |9 D
4 P6 N* x( M7 u; U- K9 U3.tga_final.jpg [ 604.76 KB | Viewed 248 times ]
1 L9 B2 W( u% C* s
, A2 k, B- d& VBINGO!
% A3 V1 j9 _- G. G
+ Y% G! G. E1 e; y6 A2 `% NNow for coolness, let's rotate it and make it smaller to fit here: |