arx-convert
Version:
Converts various Arx Fatalis formats to JSON or YAML and back
25 lines • 822 B
JavaScript
import { BinaryIO } from '../common/BinaryIO.js';
export class LightingHeader {
static readFrom(binary) {
const numberOfColors = binary.readInt32();
binary.readInt32(); // view mode - unused
binary.readInt32(); // mode light - unused
binary.readInt32(); // lpad - ?
return {
numberOfColors,
};
}
static accumulateFrom(colors) {
const buffer = new ArrayBuffer(LightingHeader.sizeOf());
const binary = new BinaryIO(buffer);
binary.writeInt32(colors.length);
binary.writeInt32(0); // view mode
binary.writeInt32(63); // mode light
binary.writeInt32(0); // lpad
return buffer;
}
static sizeOf() {
return BinaryIO.sizeOfInt32() * 4;
}
}
//# sourceMappingURL=LightingHeader.js.map