DIABLO II DC6 Image File Format
After N-day care research, and reference some E-article data and source procedures. Finally ... (^ _ ^ Hahahahahahaha, I am a genius! Next is a chicken flying egg! Miserable!). Forget it, still open the door!
Simply, DC6 files are mainly divided into 3 parts:
1. File head (24 bytes);
2. Image frames in the DC6 file pointer index (the size has to be determined by some data from the file header);
3. Image frame data (including frame head (32 bytes), and encoded image frame data (size determined by a data decision by the frame header);
Below we will simply understand the three parts of the DC6 file:
One. File header
C language prototype:
Typedef struct
{
Long Version; // 06 00 00 00
Long unknown1; // 01 00 00 00
Long unknown2; // 00 00 00 00
Ubyte Termination [4]; // EE EE EE OR CD CD CD CD
Long Directions; // xx 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Long Frames_Per_Dir; // xx 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
} DC6_HEADER_S;
Here is the file header (24 bytes) of MPTRLITGHHTH.DC6:
00000000h: 06 00 00 00 00 00 00 00 00 EE EE EE; .......... 铑 铑
1. 2. 3. 4.
00000010h: 08 00 00 00 00 00 00; ........
5.6.
Here:
1. Version This is the version number of DC6, generally 06 00 00 00;
2. Unknown1 is unknown, generally 01 00 00 00;
3. Unknown2 is unknown, generally 00 00 00 00 00;
4. Termination [4] is generally EE EE EE EE or CD CD CD;
5. Direction This is the number of frames;
6. Frames_Per_Dir number of frames included in each frame
two. Frame pointer index
With the data of the file header, we can calculate the size of the image frame pointer index, and how many frame images in this DC6 file are. There are 8 Direction in MPTRLITGHHTH.DC6, and there are 6 image frames in each Direction. Then there is a Direction * frames_per_frm = 48 frame image throughout MPTRLITGHHHTH.DC6. The size of the image frame pointer index is 48 * sizeof (long).
Next is the MPTRLITGHHTH.DC6 image frame pointer index table:
00000010H: 08 00 00 00 00 00 00 00 00 EC 0F 00 00; ........? ..? ..
00000020H: F3 1e 00 00 0A 4E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 005179 00 00 B2 86 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .. 秌 ..qy .. 矄 ..
00000040H: 79 94 00 00 DF A2 00 00 C6 B1 00 00 BE C0 00 00; Y?. Pick .. Ticket ..
00000050H: 49 d0 00 00 8A DF 00 00 EE 00 00 Fe FD 00 00; I ?. 娺 .. Di ..
00000060H: F7 0C 01 00 8E 1B 01 00 A7 27 01 00 4B 34 01 00;? ..? ..? .. k4 ..
00000070H: 1B 42 01 00 9A 50 01 00 17 5F 01 00 aa 6f 01 00; .b .. 歅 ..._ .. 猳 ..
00000080H: C4 7F 01 00 86 90 01 00 F7 A1 01 00 44 B3 01 00;? .. 啇 .. ..d ?.
00000090H: B7 C3 01 00 54 CF 01 00 4A DA 01 00 3E E6 01 00; Interview ..t? .J?.>?
000000A0H: 2B F2 01 00 56 FD 01 00 F0 08 02 00 22 19 02 00; ?. v?.? .. "...
000000B0H: BE 28 02 00 2D 38 02 00 DC 47 02 00 C2 57 02 00;?. ..- 8 .. 蹽 .. 耊 ..
000000C0H: 25 68 02 00 CE 73 02 00 4E 80 02 00 27 8D 02 00;% h .. 蝧.. N € .. '?
000000D0H: 54 99 02 00 FD A3 02 00; T? Qi ..
The first pointer D8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00000000, is where the first frame image of the first frame set is started; the second pointer EC 0F 00 00 is pointed to the file mptrliTGHTH.DC6 Where the 00000fech is the place where the first frame set is started; the first frame of the first frame set is the first frame set, the sixth frame image of the eighth frame collection The pointer ends.
three. Frame data
Data of a frame of images, including two parts:
1) Frame head (32 bytes);
C language prototype:
Typedef struct
{
Long flip;
Long width;
Long Height;
Long offset_x;
Long offset_y; // from bottom border, not up
Long unknown;
Long next_block;
Long Length;
} DC6_Frame_Header_s;
Below is a frame header of the first frame image of the first frame collection:
000000d0h: 54 99 02 00 FD A3 02 00 00 00 00 00 31 00 00 00; T . ...... 1 ...?
1. 2.
000000E0H: A9 00 00 EF FF FF 03 00 00 00 00 00 00;? ..? ........
3. 4. 5. 6.
000000f0h: EC 0F 00 00 F1 0E 00 00; .. ..??
7. 8.
Here:
1. A flag of FLIP is displayed by 00 00 00 00 00 00 00 00 00 00 00 001;
2. Width of the rectangular area where the useful data is located in this frame of Width;
3. HEIGHT is the same;
4.
What is offset_x? First we put all the images frames of a frame at a certain position, and put together in a certain order, and finally we use a nail in the appropriate location, so The animation that can be placed in order to play these image frames will not be deviated. So, we set the position of the staples as the origin, set to the positive direction of x, and set it to the positive direction of Y Y, then the coordinates of the left corner of this frame is in this coordinate original (OFFSET_X) , OFFSET_Y). Why do you do this because the image size size of each frame of DC6 is different!
The original image
"Nail" ok
5. OFFSET_Y.
6. Unknown is unknown;
7. Next_block points to the pointer of the next image frame;
8. Useful data of this frame image after the encoding;
2) The encoded image data;
First, you must understand a very important byte, that is, 0x80. This character is used as a resort in image data, that is, the logo of the wrap. Next, we get a byte byte from the first byte of the image data:
If byte = 0x80, the Bank ends, move the cursor to the next line
Else
If Byte & 0x80 (determined if the 7th bit of the byte is 1) Then is written to the memory byte & 0x7f (就 是 低 低 低 低 7)) (This transparent pixel still doesn't know where to get it? !).
Else reads the BYTE data from the file and writes memory.
This is repeated until the Length's Length by this frame is read. It should be noted that if 0x80 is encountered, the pixel is not filled, it will be filled with transparent color. The two-frame data is separated by three characters (EE EE EE). The maximum high and width of one frame of DC6 is 256 * 256.
Finally, explain the Diabloii's palette, according to I saw different palettes under different scenes! Some of the original text is this:
ACT1: ACT 1 Stuffs & Inventory GFX
ACT2: ACT 2 Stuffs & Inventory GFX
ACT3: ACT 3 Stuffs & Inventory GFX
ACT4: ACT 4 Stuffs & Inventory GFX
ACT5: ACT 5 Stuffs & Inventory GFX
Endgame: Ending Screen (Talrasha Giving You Honorific Title)
Endgame2: Ending Screen (Cain Giving You Honorific Title)
Fechar: Character Creation Screen
Loading: Loading Screen (The Wanderer In Front of the Monastery DOORS)
Menu0: beta screenshot # 1MENU1: Beta screenshot # 2
Menu2: Beta Screenshot # 3
Menu3: Beta screenshot # 4
Menu4: Beta Screenshot # 5
Sky: Game Selection Screen
Static: All Gui (GRAPHIC User Interface) stuff (Get Some Random Results)
Trademark: Trademark Screen
Units: all the gui icons (But in Has Been succefully sale
Trademark Screen, Game Select & Gui Stuff, Without Distorsion
And what palette is used in the DC6 file, then take a look at some information in the Diabloii's resource MPQ file! In addition, DiabloIi's palette file is stored in BGR format, not RGB format.
^ _ ^ ^ ^ ^, Please contact me if there is any error. E-mail: a-rice@21cn.com QQ: 23271576