UNPKG

arx-convert

Version:

Converts various Arx Fatalis formats to JSON or YAML and back

28 lines 1.12 kB
import { BinaryIO } from '../common/BinaryIO.js'; import { KEEP_ZERO_BYTES } from '../common/constants.js'; import { OldKeyFrame } from './OldKeyFrame.js'; export class NewKeyFrame { static readFrom(binary) { return { num_frame: binary.readInt32(), flag_frame: binary.readInt32(), info_frame: binary.readString(256, KEEP_ZERO_BYTES), master_key_frame: binary.readInt32() !== 0, key_frame: binary.readInt32() !== 0, key_move: binary.readInt32() !== 0, // is there a global translation? key_orient: binary.readInt32() !== 0, // is there a global rotation? key_morph: binary.readInt32() !== 0, // is there a global morph? (ignored) time_frame: binary.readInt32(), }; } static accumulateFrom(json) { const buffer = new ArrayBuffer(NewKeyFrame.sizeOf()); const binary = new BinaryIO(buffer); // TODO return buffer; } static sizeOf() { return OldKeyFrame.sizeOf() + BinaryIO.sizeOfString(256); } } //# sourceMappingURL=NewKeyFrame.js.map