This repository has been archived by the owner on May 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
MSK.bt
92 lines (86 loc) · 1.58 KB
/
MSK.bt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//------------------------------------------------
//--- 010 Editor v8.0.1 Binary Template
//
// File: MSK.bt
// Authors: AlexKimov
// Version: 0.1
// Purpose: Hard Truck King Of the Road 1.3 mask texture file
//
// History:
//
//------------------------------------------------
local uint i, count, size, number = 0;
char Magic[4]; // signature
UINT16 Width;
UINT16 Height;
struct {
BYTE R;
BYTE G;
BYTE B;
} PALETTE[256];
typedef struct {
UBYTE Size;
if (Size == 0) Printf("123 ");
if (Magic != "MS16")
{
if (Size <= 127)
{
UBYTE Block[Size];
number += Size;
}
else
{
number += Size - 128;
};
}
else
{
if (Size == 80)
{
FSkip(-1);
char PFRM[4];
if (PFRM == "PFRM")
{
UINT Size;
UINT RedMask;
UINT GreenMask;
UINT BlueMask;
UINT AlphaMask;
BYTE Unknown[20];
break;
};
};
if (Size <= 127)
{
UINT16 Block[Size];
number += Size;
}
else
{
number += Size - 128;
};
};
} BLOCK <name=getBlockName>;
struct {
while (!FEof())
BLOCK DataBlock;
} DATA;
string getBlockName(BLOCK &block)
{
if (Magic != "MS16")
{
if (block.Size <= 127)
return "raw data";
else
return "black pixels" ;
}
else
{
if (exists(block.PFRM))
return "end";
if (block.Size <= 127)
return "raw data";
else
return "black pixels" ;
}
}