原文' J! {7 ?6 J( P
http://forum.xentax.com/viewtopi ... &p=29933#p29933$ c$ i2 n( d" k) c8 n
4 k; j$ I; j9 g f% L
在老外的论坛上发现的这个小工具,以后也许会派上用处。9 q+ A, w( d! M
0 Z* F0 M5 c& j' k2 s
' B; K: I" H; y7 T5 eI had to get some time, but here's the low down. " a, r2 E' W1 x- ?! p
8 Z( g- t; v* g
I took a look at the assembly code and found the decompress routine. I then realized that it was standard LZSS compression.
6 y" l/ ?% r7 m! m9 c1 ~& ~+ t T+ I! \* H
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).
/ x9 k: `6 S4 J% A
1 A, D& W" [! [. e/ ^
8 o" W$ q! K* U; X3 g; \+ jCode:
1 q: o0 k, x6 {- ~6 nByte[4] "TGZ\0"
z- P/ l. T2 {7 a% O1 g. ~* huint32 Original size of bitmap data" q6 Q+ c+ u8 P7 I: }
uint32 Width of image9 u$ E1 d: U( N: { d# |; u& s
uint32 Heigth of image
2 L: ]% Y" s4 yByte[n] Bitmap data (LZSS compressed). ~" J# R- H. v1 ]9 b
) D* v' @' e9 S
If I take the bitmap data and show it this is what you get for the first screen of the game (near the Temple):) O3 g Y+ _* {9 [+ z- |
, z4 \! R7 ^0 M# B, }; Y* B
Attachment:
) S+ z2 N, C1 i2 ^9 w7 G. x4 E& D+ ~/ ~6 e
3.tga.jpg [ 464.92 KB | Viewed 251 times ] - d1 [1 z s& S- [& y, O Y4 ^! T
$ J D) y1 J2 G; |$ \2 A
3 w4 x5 D6 s, j7 FMissing 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!)
9 e1 D7 g1 s6 P! j. m5 \" w8 D" b
So, I recreated the header and inserted that before my uncompressed bitmap data:8 u" s0 I9 r4 b3 d
* s! o/ a9 y: w! n# O
% z+ x; @/ ~) e: K* f+ x* y
Attachment:+ R w; l: s0 f
+ L0 R) e# v1 E8 Y) o) v
3.tga_final.jpg [ 604.76 KB | Viewed 248 times ] ?: ~2 K. A' V) P
7 e- A( s: T0 ]8 a( \; a( Y) H4 k8 B. H
BINGO!
6 |+ S, G, ]' M. x0 W1 T+ ~7 ^9 L6 V3 V' Q
Now for coolness, let's rotate it and make it smaller to fit here: |