feat: switch to array buffer

This commit is contained in:
TrèsAbhi committed 2024-02-07 10:34:13 -06:00
1 parent 9cfa2357b0
commit cb2846a256
7 files changed
+45 -53

No files matched your search

+2 -6
View File
@@ -89,9 +89,9 @@ export class ScgReadStream extends ScpgReadStream {
);
const strideBasedSize = stride * polygonGroupRaw.vertexCount;
if (verticesStream.buffer.length !== strideBasedSize) {
if (verticesStream.buffer.byteLength !== strideBasedSize) {
console.warn(
`Vertex stride mismatch; expected ${strideBasedSize}, got ${verticesStream.buffer.length}; skipping...`,
`Vertex stride mismatch; expected ${strideBasedSize}, got ${verticesStream.buffer.byteLength}; skipping...`,
);
return;
@@ -104,10 +104,6 @@ export class ScgReadStream extends ScpgReadStream {
}));
}
if (verticesStream.readRemainingLength() !== 0) {
throw new RangeError('Vertices stream was not fully consumed');
}
polygonGroups.set(polygonGroupRaw['#id'].readBigUInt64LE(), {
vertices,
indices,