-
Notifications
You must be signed in to change notification settings - Fork 1
/
VST-header.js
76 lines (67 loc) · 2.4 KB
/
VST-header.js
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
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(['kaitai-struct/KaitaiStream'], factory);
} else if (typeof module === 'object' && module.exports) {
module.exports = factory(require('kaitai-struct/KaitaiStream'));
} else {
root.Vsth = factory(root.KaitaiStream);
}
}(this, function (KaitaiStream) {
var Vsth = (function() {
function Vsth(_io, _parent, _root) {
this._io = _io;
this._parent = _parent;
this._root = _root || this;
this._read();
}
Vsth.prototype._read = function() {
this.vistaHeader = new VstHeader(this._io, this, this._root);
this.boundingBox = new BoundingBox(this._io, this, this._root);
this.textureRef = this._io.readBytes(2048);
}
var VstHeader = Vsth.VstHeader = (function() {
function VstHeader(_io, _parent, _root) {
this._io = _io;
this._parent = _parent;
this._root = _root || this;
this._read();
}
VstHeader.prototype._read = function() {
this.magic = this._io.readBytes(3);
if (!((KaitaiStream.byteArrayCompare(this.magic, [86, 83, 84]) == 0))) {
throw new KaitaiStream.ValidationNotEqualError([86, 83, 84], this.magic, this._io, "/types/vst_header/seq/0");
}
this.end = KaitaiStream.bytesToStr(this._io.readBytes(1), "ASCII");
this.endianness = this._io.readU4le();
this.major = this._io.readU4le();
this.minor = this._io.readU4le();
this.implId = this._io.readU4le();
this.res = this._io.readU8le();
this.texturesCount = this._io.readU4le();
this.vertexCount = this._io.readU4le();
this.lodsCount = this._io.readU4le();
}
return VstHeader;
})();
var BoundingBox = Vsth.BoundingBox = (function() {
function BoundingBox(_io, _parent, _root) {
this._io = _io;
this._parent = _parent;
this._root = _root || this;
this._read();
}
BoundingBox.prototype._read = function() {
this.xmin = this._io.readF4le();
this.ymin = this._io.readF4le();
this.zmin = this._io.readF4le();
this.xmax = this._io.readF4le();
this.ymax = this._io.readF4le();
this.zmax = this._io.readF4le();
}
return BoundingBox;
})();
return Vsth;
})();
return Vsth;
}));