-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathR16.bt
66 lines (57 loc) · 1.48 KB
/
R16.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
//------------------------------------------------
//--- 010 Editor v7.0 Binary Template
//
// File:
// Authors:
// Version:
// Purpose:
// Category:
// File Mask:
// ID Bytes:
// History:
//------------------------------------------------
local float height, width;
struct {
UINT16 Height <name="Height">;
UINT16 Width <name="Width">;
UBYTE MM;
UBYTE MN;
UBYTE MN;
UBYTE MN;
UINT16 Depth;
UBYTE UI;
UINT16 UI;
UINT16 TilesCount <name="Tiles">;
UINT16 UI;
UINT16 TilesCount <name="Tiles">;
UINT16 UI;
UINT16 H <name="Tile height">;
UINT16 W <name="Tile width">;
UINT DataSize <name="Data size">;
} HEADER;
BitfieldDisablePadding();
typedef struct {
ubyte Blue : 5 <name="Blue">;
ubyte Green : 5 <name="Green">;
ubyte Red : 5 <name="Red">;
ubyte Alpha : 1 <name="Blue">;
} PIXEL <name="Pixel">;
struct {
height = HEADER.Height;
width = HEADER.Width;
Printf("%d", height * width);
PIXEL PixelArray[height * width] <optimize=false>;
} PIXEL_DATA <name="Pixel data">;
struct {
local int height = HEADER.Height, width = HEADER.Width, i;
} variables <hidden=true>;
if (HEADER.MM > 0) {
while (variables.height >= 1 || variables.width >= 1)
{
variables.height = variables.height/2;
variables.width = variables.width/2;
struct {
PIXEL MipMapArray[variables.height*variables.width] <optimize=false>;
} MM <name="Mip Map">;
};
};