UNPKG

mdx-m3-viewer

Version:

A browser WebGL model viewer. Mainly focused on models of the games Warcraft 3 and Starcraft 2.

33 lines (30 loc) 629 B
/** * An unknown chunk. */ export default class UnknownChunk { /** * @param {BinaryStream} stream * @param {number} size * @param {string} tag */ constructor(stream, size, tag) { /** @member {string} */ this.tag = tag; /** @member {Uint8Array} */ this.chunk = stream.readUint8Array(new Uint8Array(size)); } /** * @param {BinaryStream} stream */ writeMdx(stream) { stream.write(this.tag); stream.writeUint32(this.chunk.byteLength); stream.writeUint8Array(this.chunk); } /** * @return {number} */ getByteLength() { return 8 + this.chunk.byteLength; } }