Skip to content

Commit 2ce396d

Browse files
committed
array struct syntax
1 parent 2a79bb2 commit 2ce396d

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

src/header.js

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
1-
const Struct = require('awestruct')
2-
3-
const t = Struct.types
1+
const struct = require('awestruct')
2+
const t = struct.types
43

54
// SLP Header
6-
module.exports = Struct({
7-
version: t.string(4),
8-
numFrames: t.int32,
9-
comment: t.string(24),
5+
module.exports = struct([
6+
['version', t.string(4)],
7+
['numFrames', t.int32],
8+
['comment', t.string(24)],
109

11-
frames: t.array('numFrames', Struct({
12-
cmdTableOffset: t.uint32,
13-
outlineTableOffset: t.uint32,
14-
paletteOffset: t.uint32,
15-
properties: t.uint32,
10+
['frames', t.array('numFrames', struct([
11+
['cmdTableOffset', t.uint32],
12+
['outlineTableOffset', t.uint32],
13+
['paletteOffset', t.uint32],
14+
['properties', t.uint32],
1615

17-
width: t.int32,
18-
height: t.int32,
19-
hotspot: Struct({
20-
x: t.int32,
21-
y: t.int32
22-
})
23-
}))
24-
})
16+
['width', t.int32],
17+
['height', t.int32],
18+
['hotspot', struct([
19+
['x', t.int32],
20+
['y', t.int32]
21+
])]
22+
]))]
23+
])

0 commit comments

Comments
 (0)